mirror of https://github.com/xwiki-labs/cryptpad
display a notice if bower dependencies fail to load for the checkup page
This commit is contained in:
parent
404b89eb28
commit
e5df9cb730
|
@ -0,0 +1,17 @@
|
|||
(function () {
|
||||
var first = true;
|
||||
window.addEventListener('error', function (ev) {
|
||||
if (!ev) { return; }
|
||||
var srcElement = ev.srcElement;
|
||||
if (!srcElement) { return; }
|
||||
var nodeName = srcElement.nodeName;
|
||||
if (nodeName !== 'SCRIPT') { return; }
|
||||
var src = srcElement.src;
|
||||
if (!/\/bower_components\/.*/.test(src)) { return; }
|
||||
if (first) {
|
||||
document.write(`<p>It's possible that this server's administrators forgot to install its client-side dependencies with 'bower update'.</p>`);
|
||||
first = false;
|
||||
}
|
||||
document.write(`<p>Failed to load <code>${src}</code>.</p>`);
|
||||
}, true);
|
||||
}());
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<script type="text/javascript" src="/checkup/dependency-warning.js?ver=1.0.0"></script>
|
||||
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue