From c255c8f5303f2cf1a13058cec344dc00c4c6aef9 Mon Sep 17 00:00:00 2001 From: Tuur Dutoit Date: Wed, 8 Oct 2014 16:58:42 +0200 Subject: [PATCH] dependencies.js rewrite --- src/dependencies.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/dependencies.js b/src/dependencies.js index e0a9a432204..a6d4565667b 100644 --- a/src/dependencies.js +++ b/src/dependencies.js @@ -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 += "
  • " + key + "
  • "; } } - if (missingDeps.length === 0) { - return; + + if (missingDeps.length > 0) { + var str = "

    Missing libraries

    " + + "

    Oops! One or more required libraries could not be found.

    " + + "" + + "

    If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:

    " + + "
    git submodule update --init
    " + + "

    If you're still having problems, please contact us via one of the channels mentioned at the bottom of the README.

    " + + "

    Reload Brackets

    "; + + document.write(str); } - document.write("

    Missing libraries

    "); - document.write("

    Oops! One or more required libraries could not be found.

    "); - document.write(""); - document.write("

    If you're running from a local copy of the Brackets source, please make sure submodules are updated by running:

    "); - document.write("
    git submodule update --init
    "); - document.write("

    If you're still having problems, please contact us via one of the channels mentioned at the bottom of the README.

    "); - document.write("

    Reload Brackets

    "); -}, 1000); +}, 1000); \ No newline at end of file