greenlock.html/js/app.js

29 lines
873 B
JavaScript
Raw Normal View History

2018-05-01 00:03:12 +00:00
(function () {
'use strict';
2018-05-01 08:15:41 +00:00
var $qs = function (s) { return window.document.querySelector(s); };
var $qsa = function (s) { return window.document.querySelectorAll(s); };
2018-05-04 20:26:06 +00:00
var apiUrl = 'https://acme-{{env}}.api.letsencrypt.org/directory';
function updateApiType() {
var formData = new FormData($qs("#js-acme-form"));
2018-05-01 08:15:41 +00:00
console.log('ACME api type radio:');
2018-05-01 08:15:41 +00:00
var value = formData.get("acme-api-type");
$qs('#js-acme-api-url').value = apiUrl.replace(/{{env}}/g, value);
2018-05-04 23:59:05 +00:00
}
$qs('#js-acme-form').addEventListener('change', updateApiType);
2018-05-04 23:59:05 +00:00
updateApiType();
try {
document.fonts.load().then(function() {
$qs('body').classList.add("js-app-ready");
}).catch(function(error) {
$qs('body').classList.add("js-app-ready");
});
} catch(e) {
setTimeout(function() {$qs('body').classList.add("js-app-ready");}, 200);
2018-05-01 08:15:41 +00:00
}
2018-05-01 00:03:12 +00:00
}());