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

dependencies.js rewrite #9488

Merged
merged 1 commit into from
Oct 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);