|
|
@ -312,29 +312,15 @@ button.primary:hover{
|
|
|
|
return bar;
|
|
|
|
return bar;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var hideSpinner = function () {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
document.querySelector('.cp-loading-spinner-container').style.display = 'none';
|
|
|
|
|
|
|
|
} catch (err) { return; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var getList = function () {
|
|
|
|
|
|
|
|
return document.querySelector('.cp-loading-progress-list') || {};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var getProgressBar = function () {
|
|
|
|
|
|
|
|
return document.querySelector('.cp-loading-progress-container') || {};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var hasErrored = false;
|
|
|
|
var hasErrored = false;
|
|
|
|
var updateLoadingProgress = function (data) {
|
|
|
|
var updateLoadingProgress = function (data) {
|
|
|
|
if (!built || !data) { return; }
|
|
|
|
if (!built || !data) { return; }
|
|
|
|
var c = types.indexOf(data.type);
|
|
|
|
var c = types.indexOf(data.type);
|
|
|
|
if (c < current) { return console.error(data); }
|
|
|
|
if (c < current) { return console.error(data); }
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
hideSpinner();
|
|
|
|
document.querySelector('.cp-loading-spinner-container').style.display = 'none';
|
|
|
|
getList().innerHTML = makeList(data);
|
|
|
|
document.querySelector('.cp-loading-progress-list').innerHTML = makeList(data);
|
|
|
|
getProgressBar().innerHTML = makeBar(data);
|
|
|
|
document.querySelector('.cp-loading-progress-container').innerHTML = makeBar(data);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
if (!hasErrored) { console.error(e); }
|
|
|
|
if (!hasErrored) { console.error(e); }
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -343,7 +329,6 @@ button.primary:hover{
|
|
|
|
|
|
|
|
|
|
|
|
window.CryptPad_loadingError = function (err) {
|
|
|
|
window.CryptPad_loadingError = function (err) {
|
|
|
|
if (!built) { return; }
|
|
|
|
if (!built) { return; }
|
|
|
|
console.error(err);
|
|
|
|
|
|
|
|
hasErrored = true;
|
|
|
|
hasErrored = true;
|
|
|
|
var err2;
|
|
|
|
var err2;
|
|
|
|
if (err === 'Script error.') {
|
|
|
|
if (err === 'Script error.') {
|
|
|
@ -354,12 +339,10 @@ button.primary:hover{
|
|
|
|
var node = document.querySelector('.cp-loading-progress');
|
|
|
|
var node = document.querySelector('.cp-loading-progress');
|
|
|
|
if (!node) { return; }
|
|
|
|
if (!node) { return; }
|
|
|
|
if (node.parentNode) { node.parentNode.removeChild(node); }
|
|
|
|
if (node.parentNode) { node.parentNode.removeChild(node); }
|
|
|
|
hideSpinner();
|
|
|
|
document.querySelector('.cp-loading-spinner-container').setAttribute('style', 'display:none;');
|
|
|
|
document.querySelector('#cp-loading-message').setAttribute('style', 'display:block;');
|
|
|
|
document.querySelector('#cp-loading-message').setAttribute('style', 'display:block;');
|
|
|
|
document.querySelector('#cp-loading-message').innerText = err2 || err;
|
|
|
|
document.querySelector('#cp-loading-message').innerText = err2 || err;
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) { console.error(e); }
|
|
|
|
console.error(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return function () {
|
|
|
|
return function () {
|
|
|
|
built = true;
|
|
|
|
built = true;
|
|
|
|