2010-03-16 00:02:54 +00:00
|
|
|
(function(onLoadDelegate){
|
|
|
|
|
var prefix = (function(){
|
|
|
|
|
var filename = /(.*\/)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];
|
|
|
|
|
}
|
2010-03-23 22:16:44 +00:00
|
|
|
}
|
2010-03-16 00:02:54 +00:00
|
|
|
})();
|
|
|
|
|
function addScript(path) {
|
|
|
|
|
document.write('<script type="text/javascript" src="' + prefix + path + '"></script>');
|
2010-04-19 21:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2010-03-16 00:02:54 +00:00
|
|
|
function addCSS(path) {
|
|
|
|
|
document.write('<link rel="stylesheet" type="text/css" href="' + prefix + path + '"/>');
|
2010-04-19 21:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2010-03-16 00:02:54 +00:00
|
|
|
window.onload = function(){
|
|
|
|
|
_.defer(function(){
|
2010-05-24 20:54:32 +00:00
|
|
|
$scenarioRunner.run(jQuery(window.document.body));
|
2010-03-16 00:02:54 +00:00
|
|
|
});
|
|
|
|
|
(onLoadDelegate||function(){})();
|
|
|
|
|
};
|
|
|
|
|
addCSS("../../css/angular-scenario.css");
|
|
|
|
|
addScript("../../lib/underscore/underscore.js");
|
2010-03-23 22:16:44 +00:00
|
|
|
addScript("../../lib/jquery/jquery-1.4.2.js");
|
2010-03-16 00:02:54 +00:00
|
|
|
addScript("../angular-bootstrap.js");
|
|
|
|
|
addScript("Runner.js");
|
2010-05-24 20:54:32 +00:00
|
|
|
document.write('<script type="text/javascript">' +
|
|
|
|
|
'$scenarioRunner = new angular.scenario.Runner(window, jQuery);' +
|
|
|
|
|
'</script>');
|
2010-03-16 00:02:54 +00:00
|
|
|
})(window.onload);
|
|
|
|
|
|