1 //<script type="text/javascript">
4 // could probably do this with anon-functions..
8 // -----------------------------------
9 // this stuff doesnt work!!!
11 // -----------------------------------
13 function RooDebugLoader(fn)
16 // these fire off too fast for the thing to work correctly...
17 window.setTimeout(function() {
18 //console.log("load" + fn);
19 if (typeof(fn) == 'string') {
20 RooDebugLoader.realLoad(fn);
25 }, RooDebugLoader.timer);
26 RooDebugLoader.timer += 200;
29 RooDebugLoader.realLoad = function (fn)
32 if (typeof(RooDebugLoader.path) != 'undefined'){
33 return RooDebugLoader.path;
35 var sts = document.getElementsByTagName('script');
36 for (var i =0;i<sts.length;i++) {
37 if (/\/roojs-debug.js$/.test(sts[i].getAttribute('src'))) {
38 RooDebugLoader.path = sts[i].getAttribute('src').replace(/\/roojs-debug.js$/,'')
39 return RooDebugLoader.path;
42 alert("can not find path to roojs-debug.js");
48 var html_doc = document.getElementsByTagName('head')[0];
50 if (/\.js$/.test(fn)) {
53 var js = document.createElement('script');
54 js.setAttribute('language', 'javascript');
55 js.setAttribute('type', 'text/javascript');
56 //js.setAttribute('src', getpath() + '/' + fn +'?_ts='+Math.random());
57 js.setAttribute('src', getpath() + '/' + fn);
58 html_doc.appendChild(js);
61 if (/\.css$/.test(fn)) {
63 //<link rel="stylesheet" type="text/css" href="App_Themes/HCCCommonStyle.css" />
64 var js = document.createElement('link');
65 js.setAttribute('rel', 'stylesheet');
66 js.setAttribute('type', 'text/css');
68 js.setAttribute('href', getpath() + '/' + fn);
69 html_doc.appendChild(js);
72 RooDebugLoader.timer = 200;
73 RooDebugLoader.loaded = false;
74 RooDebugLoader.onload = function()
76 if (RooDebugLoader.loaded) {
79 if (!document || !document.getElementsByTagName('script').length) {
80 window.setTimeout(RooDebugLoader.onload, 100);
82 RooDebugLoader.loaded = true;
83 RooDebugLoader.loader();
85 //RooDebugLoader.onload();
86 window.setTimeout(RooDebugLoader.onload, 100);
88 RooDebugLoader.loader = function () {
90 RooDebugLoader('css/reset-min.css');
91 RooDebugLoader('css/core.css');
92 RooDebugLoader('css/basic-dialog.css');
93 RooDebugLoader('css/button.css');
94 RooDebugLoader('css/inline-editor.css');
95 RooDebugLoader('css/layout.css');
96 RooDebugLoader('css/qtips.css');
97 RooDebugLoader('css/resizable.css')
98 RooDebugLoader('css/tabs.css');
99 RooDebugLoader('css/toolbar.css');
100 RooDebugLoader('css/tree.css');
101 RooDebugLoader('css/ytheme-gray.css');