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

Commit

Permalink
Merge pull request #9488 from TuurDutoit/deps-rewrite
Browse files Browse the repository at this point in the history
dependencies.js rewrite
  • Loading branch information
ingorichter committed Oct 14, 2014
2 parents 1296a4e + c255c8f commit 49d118f
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,25 @@
*/
window.setTimeout(function () {
"use strict";

var key, missingDeps = "";
var deps = { "Mustache": window.Mustache, "jQuery": window.$, "RequireJS": window.require };
var key, missingDeps = [];

for (key in deps) {
if (deps.hasOwnProperty(key) && !deps[key]) {
missingDeps.push(key);
missingDeps += "<li>" + key + "</li>";
}
}
if (missingDeps.length === 0) {
return;

if (missingDeps.length > 0) {
var str = "<h1>Missing libraries</h1>" +
"<p>Oops! One or more required libraries could not be found.</p>" +
"<ul>" + missingDeps + "</ul>" +
"<p>If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:</p>" +
"<pre>git submodule update --init</pre>" +
"<p>If you're still having problems, please contact us via one of the channels mentioned at the bottom of the <a target=\"blank\" href=\"../README.md\">README</a>.</p>" +
"<p><a href=\"#\" onclick=\"window.location.reload()\">Reload Brackets</a></p>";

document.write(str);
}
document.write("<h1>Missing libraries</h1>");
document.write("<p>Oops! One or more required libraries could not be found.</p>");
document.write("<ul>");
missingDeps.forEach(function (key) {
document.write("<li>" + key + "</li>");
});

document.write("</ul>");
document.write("<p>If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:</p>");
document.write("<pre>git submodule update --init</pre>");
document.write("<p>If you're still having problems, please contact us via one of the channels mentioned at the bottom of the <a target=\"blank\" href=\"../README.md\">README</a>.</p>");
document.write("<p><a href=\"#\" onclick=\"window.location.reload()\">Reload Brackets</a></p>");
}, 1000);
}, 1000);

0 comments on commit 49d118f

Please sign in to comment.