Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Inform the user about missing libraries #2440

Merged
merged 15 commits into from
Jan 2, 2013
Merged
29 changes: 29 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,34 @@
<!-- All other scripts are loaded through require. -->
<script src="thirdparty/require.js" data-main="brackets"></script>

<!-- Verify that all dependencies are loaded. -->
<script>
window.setTimeout(function () {
var deps = { "Mustache": window.Mustache, "jQuery": window.$, "CodeMirror": window.CodeMirror, "RequireJS": window.require };
var key, allOK = true;
for (key in deps) {
if (!deps[key]) {
allOK = false;
break;
}
}
if (allOK) {
return;
}
document.write("<h1>Missing libraries</h1>");
document.write("<p>The following required libraries were not found:</p>");
document.write("<ul>");
for (key in deps) {
if (!deps[key]) {
document.write("<li>" + key + "</li>");
}
}
document.write("</ul>");
document.write("<p>If you have checked up Brackets from github, please update the submodules by running the following command:</p>");
document.write("<pre>git submodule update --init</pre>");
document.write("<p><a href=\"#\" onclick=\"window.location.reload()\">Reload Brackets</a></p>");
}, 1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably bump this up to 2 seconds in case the user is running on a really slow (or bogged down) machine.

</script>

</body>
</html>