Sha256: 1f887c3165118456f8514bdbd5892a0578dc8cc89c193c6d73f8c64402d370f6

Contents?: true

Size: 1.15 KB

Versions: 22

Compression:

Stored size: 1.15 KB

Contents

(function (root) {
  "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);
  };
}).call(this);

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-4.13.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.12.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.11.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.10.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.9.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.9.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.8.2 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.8.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.8.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.7.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.6.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.6.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.5.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.4.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.3.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.2.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.2.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.1.1 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.1.0 app/assets/spec/support/load.js
govuk_frontend_toolkit-4.0.1 app/assets/spec/support/load.js