Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / coffee-script / lib / coffee-script / browser.js
1 // Generated by CoffeeScript 1.8.0
2 (function() {
3   var CoffeeScript, compile, runScripts,
4     __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
5
6   CoffeeScript = require('./coffee-script');
7
8   CoffeeScript.require = require;
9
10   compile = CoffeeScript.compile;
11
12   CoffeeScript["eval"] = function(code, options) {
13     if (options == null) {
14       options = {};
15     }
16     if (options.bare == null) {
17       options.bare = true;
18     }
19     return eval(compile(code, options));
20   };
21
22   CoffeeScript.run = function(code, options) {
23     if (options == null) {
24       options = {};
25     }
26     options.bare = true;
27     options.shiftLine = true;
28     return Function(compile(code, options))();
29   };
30
31   if (typeof window === "undefined" || window === null) {
32     return;
33   }
34
35   if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
36     compile = function(code, options) {
37       var js, v3SourceMap, _ref;
38       if (options == null) {
39         options = {};
40       }
41       options.sourceMap = true;
42       options.inline = true;
43       _ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
44       return "" + js + "\n//# sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//# sourceURL=coffeescript";
45     };
46   }
47
48   CoffeeScript.load = function(url, callback, options, hold) {
49     var xhr;
50     if (options == null) {
51       options = {};
52     }
53     if (hold == null) {
54       hold = false;
55     }
56     options.sourceFiles = [url];
57     xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
58     xhr.open('GET', url, true);
59     if ('overrideMimeType' in xhr) {
60       xhr.overrideMimeType('text/plain');
61     }
62     xhr.onreadystatechange = function() {
63       var param, _ref;
64       if (xhr.readyState === 4) {
65         if ((_ref = xhr.status) === 0 || _ref === 200) {
66           param = [xhr.responseText, options];
67           if (!hold) {
68             CoffeeScript.run.apply(CoffeeScript, param);
69           }
70         } else {
71           throw new Error("Could not load " + url);
72         }
73         if (callback) {
74           return callback(param);
75         }
76       }
77     };
78     return xhr.send(null);
79   };
80
81   runScripts = function() {
82     var coffees, coffeetypes, execute, i, index, s, script, scripts, _fn, _i, _len;
83     scripts = window.document.getElementsByTagName('script');
84     coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
85     coffees = (function() {
86       var _i, _len, _ref, _results;
87       _results = [];
88       for (_i = 0, _len = scripts.length; _i < _len; _i++) {
89         s = scripts[_i];
90         if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
91           _results.push(s);
92         }
93       }
94       return _results;
95     })();
96     index = 0;
97     execute = function() {
98       var param;
99       param = coffees[index];
100       if (param instanceof Array) {
101         CoffeeScript.run.apply(CoffeeScript, param);
102         index++;
103         return execute();
104       }
105     };
106     _fn = function(script, i) {
107       var options;
108       options = {
109         literate: script.type === coffeetypes[1]
110       };
111       if (script.src) {
112         return CoffeeScript.load(script.src, function(param) {
113           coffees[i] = param;
114           return execute();
115         }, options, true);
116       } else {
117         options.sourceFiles = ['embedded'];
118         return coffees[i] = [script.innerHTML, options];
119       }
120     };
121     for (i = _i = 0, _len = coffees.length; _i < _len; i = ++_i) {
122       script = coffees[i];
123       _fn(script, i);
124     }
125     return execute();
126   };
127
128   if (window.addEventListener) {
129     window.addEventListener('DOMContentLoaded', runScripts, false);
130   } else {
131     window.attachEvent('onload', runScripts);
132   }
133
134 }).call(this);