moved google frame script into main script block; only loading now if we're in IE
authorBill Erickson <erickson@esilibrary.com>
Mon, 13 Dec 2010 21:40:47 +0000 (16:40 -0500)
committerBill Erickson <erickson@esilibrary.com>
Mon, 13 Dec 2010 21:40:47 +0000 (16:40 -0500)
Open-ILS/web/opac/skin/default/xml/body.xml
Open-ILS/web/opac/skin/default/xml/common/js_common_postbody.xml

index 0f44a62..818bac9 100644 (file)
             <button onclick='dojo.cookie("noGCF", "true", {path:"/", expires: 365}); hideMe($("gcfPrompt"));'>&common.googlechromeframe.dontask;</button>
         </div>
     </center>
-    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
-    <script><![CDATA[ 
-        dojo.addOnLoad(
-            function() {
-                CFInstall.check({
-                    preventPrompt: true,
-                    onmissing: function() {
-                        if (dojo.cookie("noGCF") != "true")
-                            unHideMe($('gcfPrompt'));
-                    }
-                });
-            }
-        );
-        ]]>
-    </script>
 
     <!--#include virtual='common/js_common_postbody.xml'-->
 
index 9c9ff32..f7c9b68 100644 (file)
 
         console.log('middle of main script');
 
+        if(dojo.isIE) {
+            setTimeout(
+                function() {
+                    openils.Util.requireLegacy('http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js');
+                    CFInstall.check({
+                        preventPrompt: true,
+                        onmissing: function() {
+                            if (dojo.cookie("noGCF") != "true")
+                                unHideMe($('gcfPrompt'));
+                        }
+                    });
+            }, 0);
+        }
+
 
         config.css.color_1 = "color_1";
         config.css.color_2 = "color_2";