mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-30 04:50:28 +00:00
the flag must be in all src and test files so that we get the benefit of running in the strict mode even in jstd the following script was used to modify all files: for file in `find src test -name "*.js"`; do echo -e "'use strict';\n" > temp.txt cat $file >> temp.txt mv temp.txt $file done
61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
'use strict';
|
|
|
|
(function(previousOnLoad){
|
|
var prefix = (function(){
|
|
var filename = /(.*\/)angular-bootstrap.js(#(.*))?/;
|
|
var scripts = document.getElementsByTagName("script");
|
|
for(var j = 0; j < scripts.length; j++) {
|
|
var src = scripts[j].src;
|
|
if (src && src.match(filename)) {
|
|
var parts = src.match(filename);
|
|
return parts[1];
|
|
}
|
|
}
|
|
})();
|
|
|
|
function addScript(path) {
|
|
document.write('<script type="text/javascript" src="' + prefix + path + '"></script>');
|
|
}
|
|
|
|
function addCSS(path) {
|
|
document.write('<link rel="stylesheet" type="text/css" href="' + prefix + path + '"/>');
|
|
}
|
|
|
|
window.onload = function(){
|
|
try {
|
|
if (previousOnLoad) previousOnLoad();
|
|
} catch(e) {}
|
|
var config = angularJsConfig(document);
|
|
if (config.autotest) angular.scenario.setUpAndRun(config);
|
|
};
|
|
|
|
addCSS("../../css/angular-scenario.css");
|
|
addScript("../../lib/jquery/jquery-1.4.2.js");
|
|
document.write(
|
|
'<script type="text/javascript">' +
|
|
'var _jQuery = jQuery.noConflict(true);' +
|
|
'</script>'
|
|
);
|
|
addScript("../angular-bootstrap.js");
|
|
|
|
addScript("Scenario.js");
|
|
addScript("Application.js");
|
|
addScript("Describe.js");
|
|
addScript("Future.js");
|
|
addScript("Runner.js");
|
|
addScript("SpecRunner.js");
|
|
addScript("dsl.js");
|
|
addScript("matchers.js");
|
|
addScript("ObjectModel.js");
|
|
addScript("output/Html.js");
|
|
addScript("output/Json.js");
|
|
addScript("output/Object.js");
|
|
addScript("output/Xml.js");
|
|
|
|
// Create the runner (which also sets up the global API)
|
|
document.write(
|
|
'<script type="text/javascript">' +
|
|
' var $runner = new angular.scenario.Runner(window);' +
|
|
'</script>');
|
|
|
|
})(window.onload);
|