Sha256: 08a6eec0d7ae43390da67f174832623ed679e738867f693a2898bd3a62a32c80

Contents?: true

Size: 1.15 KB

Versions: 43

Compression:

Stored size: 1.15 KB

Contents

(function (global) {
  "use strict"
  var loadedScripts = 0,
      totalScripts,
      merge,
      loadScript,
      runJasmine,
      manifestScript;

  merge = function (arrays) {
    var resultingArray = [],
        workingArray,
        a, b, x, y;

    for (a = 0, b = arrays.length; a < b; a++) {
      workingArray = arrays[a];
      for (x = 0, y = workingArray.length; x < y; x++) {
        resultingArray.push(workingArray[x]);
      }
    }
    return resultingArray;
  };
  loadScript = function (src, nextIdx) {
    var script = document.createElement('script'),
        nextScript;

    script.type = 'text/javascript';
    script.src = src;

    document.getElementsByTagName('head')[0].appendChild(script);
    if (nextIdx === undefined) { return script; }
    script.onload = function () {
      if (nextIdx < totalScripts.length) {
        loadScript(totalScripts[nextIdx], nextIdx + 1);
      }
    };
    return script;
  };
  manifestScript = loadScript('../manifest.js');

  manifestScript.onload = function () {
    var idx = 0;

    totalScripts = merge([manifest.support, manifest.test]);
    loadScript(totalScripts[idx], idx + 1);
  };
})(window);

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
govuk_frontend_toolkit-9.0.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-9.0.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-8.2.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-8.1.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-8.0.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.6.0 app/assets/spec/support/load.js
idsk_frontend_toolkit-8.4.4 app/assets/spec/support/load.js
idsk_frontend_toolkit-7.4.3 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.5.0 app/assets/spec/support/load.js
idsk_frontend_toolkit-7.4.2 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.4.2 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.4.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.4.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.3.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.2.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.1.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.0.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-7.0.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-6.0.4 app/assets/spec/support/load.js
govuk_frontend_toolkit-6.0.3 app/assets/spec/support/load.js