BVB Source Codes

reactide Show browser.js Source code

Return Download reactide: download browser.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. exports.__esModule = true;
  4. exports.transformFileSync = exports.transformFile = exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.Plugin = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined;
  5.  
  6. var _node = require("./node");
  7.  
  8. Object.defineProperty(exports, "File", {
  9.   enumerable: true,
  10.   get: function get() {
  11.     return _node.File;
  12.   }
  13. });
  14. Object.defineProperty(exports, "options", {
  15.   enumerable: true,
  16.   get: function get() {
  17.     return _node.options;
  18.   }
  19. });
  20. Object.defineProperty(exports, "buildExternalHelpers", {
  21.   enumerable: true,
  22.   get: function get() {
  23.     return _node.buildExternalHelpers;
  24.   }
  25. });
  26. Object.defineProperty(exports, "template", {
  27.   enumerable: true,
  28.   get: function get() {
  29.     return _node.template;
  30.   }
  31. });
  32. Object.defineProperty(exports, "version", {
  33.   enumerable: true,
  34.   get: function get() {
  35.     return _node.version;
  36.   }
  37. });
  38. Object.defineProperty(exports, "util", {
  39.   enumerable: true,
  40.   get: function get() {
  41.     return _node.util;
  42.   }
  43. });
  44. Object.defineProperty(exports, "messages", {
  45.   enumerable: true,
  46.   get: function get() {
  47.     return _node.messages;
  48.   }
  49. });
  50. Object.defineProperty(exports, "types", {
  51.   enumerable: true,
  52.   get: function get() {
  53.     return _node.types;
  54.   }
  55. });
  56. Object.defineProperty(exports, "traverse", {
  57.   enumerable: true,
  58.   get: function get() {
  59.     return _node.traverse;
  60.   }
  61. });
  62. Object.defineProperty(exports, "OptionManager", {
  63.   enumerable: true,
  64.   get: function get() {
  65.     return _node.OptionManager;
  66.   }
  67. });
  68. Object.defineProperty(exports, "Plugin", {
  69.   enumerable: true,
  70.   get: function get() {
  71.     return _node.Plugin;
  72.   }
  73. });
  74. Object.defineProperty(exports, "Pipeline", {
  75.   enumerable: true,
  76.   get: function get() {
  77.     return _node.Pipeline;
  78.   }
  79. });
  80. Object.defineProperty(exports, "analyse", {
  81.   enumerable: true,
  82.   get: function get() {
  83.     return _node.analyse;
  84.   }
  85. });
  86. Object.defineProperty(exports, "transform", {
  87.   enumerable: true,
  88.   get: function get() {
  89.     return _node.transform;
  90.   }
  91. });
  92. Object.defineProperty(exports, "transformFromAst", {
  93.   enumerable: true,
  94.   get: function get() {
  95.     return _node.transformFromAst;
  96.   }
  97. });
  98. Object.defineProperty(exports, "transformFile", {
  99.   enumerable: true,
  100.   get: function get() {
  101.     return _node.transformFile;
  102.   }
  103. });
  104. Object.defineProperty(exports, "transformFileSync", {
  105.   enumerable: true,
  106.   get: function get() {
  107.     return _node.transformFileSync;
  108.   }
  109. });
  110. exports.run = run;
  111. exports.load = load;
  112. function run(code) {
  113.   var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  114.  
  115.   return new Function((0, _node.transform)(code, opts).code)();
  116. }
  117.  
  118. function load(url, callback) {
  119.   var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  120.   var hold = arguments[3];
  121.  
  122.   opts.filename = opts.filename || url;
  123.  
  124.   var xhr = global.ActiveXObject ? new global.ActiveXObject("Microsoft.XMLHTTP") : new global.XMLHttpRequest();
  125.   xhr.open("GET", url, true);
  126.   if ("overrideMimeType" in xhr) xhr.overrideMimeType("text/plain");
  127.  
  128.   xhr.onreadystatechange = function () {
  129.     if (xhr.readyState !== 4) return;
  130.  
  131.     var status = xhr.status;
  132.     if (status === 0 || status === 200) {
  133.       var param = [xhr.responseText, opts];
  134.       if (!hold) run(param);
  135.       if (callback) callback(param);
  136.     } else {
  137.       throw new Error("Could not load " + url);
  138.     }
  139.   };
  140.  
  141.   xhr.send(null);
  142. }
  143.  
  144. function runScripts() {
  145.   var scripts = [];
  146.   var types = ["text/ecmascript-6", "text/6to5", "text/babel", "module"];
  147.   var index = 0;
  148.  
  149.   function exec() {
  150.     var param = scripts[index];
  151.     if (param instanceof Array) {
  152.       run(param, index);
  153.       index++;
  154.       exec();
  155.     }
  156.   }
  157.  
  158.   function run(script, i) {
  159.     var opts = {};
  160.  
  161.     if (script.src) {
  162.       load(script.src, function (param) {
  163.         scripts[i] = param;
  164.         exec();
  165.       }, opts, true);
  166.     } else {
  167.       opts.filename = "embedded";
  168.       scripts[i] = [script.innerHTML, opts];
  169.     }
  170.   }
  171.  
  172.   var _scripts = global.document.getElementsByTagName("script");
  173.  
  174.   for (var i = 0; i < _scripts.length; ++i) {
  175.     var _script = _scripts[i];
  176.     if (types.indexOf(_script.type) >= 0) scripts.push(_script);
  177.   }
  178.  
  179.   for (var _i = 0; _i < scripts.length; _i++) {
  180.     run(scripts[_i], _i);
  181.   }
  182.  
  183.   exec();
  184. }
  185.  
  186. if (global.addEventListener) {
  187.   global.addEventListener("DOMContentLoaded", runScripts, false);
  188. } else if (global.attachEvent) {
  189.   global.attachEvent("onload", runScripts);
  190. }
downloadbrowser.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top