src/js/utils.js
branchnew-model
changeset 887 6a04bd37da0a
parent 882 61c384dda19e
child 906 4b6e154ae8de
--- a/src/js/utils.js	Mon May 07 15:25:52 2012 +0200
+++ b/src/js/utils.js	Thu May 10 18:48:09 2012 +0200
@@ -16,10 +16,21 @@
     }
 }
 
+IriSP._cssCache = [];
+
 IriSP.loadCss = function(_cssFile) {
-    IriSP.jQuery("<link>", {
-        rel : "stylesheet",
-        type : "text/css",
-        href : _cssFile
-    }).appendTo('head');
-}
\ No newline at end of file
+    if (IriSP._(IriSP._cssCache).indexOf(_cssFile) === -1) {
+        IriSP.jQuery("<link>", {
+            rel : "stylesheet",
+            type : "text/css",
+            href : _cssFile
+        }).appendTo('head');
+        IriSP._cssCache.push(_cssFile);
+    }
+}
+
+IriSP.log = function() {
+    if (typeof console !== "undefined" && typeof IriSP.logging !== "undefined" && IriSP.logging) {
+        console.log.apply(console, arguments);
+    }
+}