--- a/src/js/main.js Fri May 11 16:07:52 2012 +0200
+++ b/src/js/main.js Mon May 14 11:57:05 2012 +0200
@@ -35,9 +35,20 @@
)
}
+IriSP._cssCache = [];
+
+IriSP.loadCss = function(_cssFile) {
+ if (typeof _cssFile === "string" && _cssFile && IriSP._(IriSP._cssCache).indexOf(_cssFile) === -1) {
+ IriSP.jQuery("<link>", {
+ rel : "stylesheet",
+ type : "text/css",
+ href : _cssFile
+ }).appendTo('head');
+ IriSP._cssCache.push(_cssFile);
+ }
+}
+
IriSP.loadLibs = function( config, metadata_url, callback ) {
- // Localize jQuery variable
- IriSP.jQuery = null;
var $L = $LAB.script(IriSP.getLib("jQuery")).script(IriSP.getLib("swfObject")).wait()
.script(IriSP.getLib("jQueryUI"));
@@ -63,9 +74,6 @@
config.gui.widgets[idx].type === "SparklineWidget") {
$L.script(IriSP.getLib("raphael"));
}
- if (config.gui.widgets[idx].type === "TraceWidget") {
- $L.script(IriSP.getLib("tracemanager"))
- }
}
// same for modules
@@ -75,25 +83,12 @@
$L.script(IriSP.getLib("raphaelJs"));
}
*/
-
$L.wait(function() {
- IriSP.jQuery = window.jQuery.noConflict( true );
-
- var css_link_jquery = IriSP.jQuery( "<link>", {
- rel: "stylesheet",
- type: "text/css",
- href: IriSP.getLib("cssjQueryUI"),
- 'class': "dynamic_css"
- } );
- var css_link_custom = IriSP.jQuery( "<link>", {
- rel: "stylesheet",
- type: "text/css",
- href: config.gui.css,
- 'class': "dynamic_css"
- } );
-
- css_link_jquery.appendTo('head');
- css_link_custom.appendTo('head');
+ if (typeof IriSP.jQuery === "undefined" && typeof window.jQuery !== "undefined") {
+ IriSP.jQuery = window.jQuery.noConflict();
+ }
+ IriSP.loadCss(IriSP.getLib("cssjQueryUI"));
+ IriSP.loadCss(config.gui.css);
IriSP.setupDataLoader();
IriSP.__dataloader.get(metadata_url,