Pull in custom.js with offline/chrome overlays
authorJason Etheridge <jason@esilibrary.com>
Tue, 6 Sep 2011 19:14:20 +0000 (15:14 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 6 Sep 2011 20:12:45 +0000 (16:12 -0400)
Or at least try to.  Main goal here is for browser.xul to see url constant
changes from custom.js and feed them to embedded Acquisition interfaces via
xulG.urls

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul

index 413a18a..c635ab3 100644 (file)
         ]]>
         </script>
         <script type="text/javascript" src="../main/constants.js" />
+        <script>
+        <![CDATA[
+            try {
+                if (typeof xulG.url_prefix != 'undefined') {
+                    dump('pulling in custom.js in util_overlay_chrome.xul\n');
+                    // Pull in local customizations
+                    var r = new XMLHttpRequest();
+                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    r.send(null);
+                    if (r.status == 200) {
+                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        eval( r.responseText );
+                    }
+                } else {
+                    dump('cannot pull in custom.js in util_overlay_chrome.xul\n');
+                }
+            } catch(E) {
+                dump('cannot pull in custom.js in util_overlay_chrome.xul: ' + E + '\n');
+            }
+        ]]>
+        </script>
         <script type="text/javascript" src="util/utils.js" />
         <script type="text/javascript" src="util/CGI.js" />
         <script type="text/javascript" src="util/md5.js" />
index e9d2539..6990dae 100644 (file)
     </script>
     <scripts id="openils_util_scripts">
         <script type="text/javascript" src="../main/constants.js" />
+        <script>
+        <![CDATA[
+            try {
+                if (typeof xulG.url_prefix != 'undefined') {
+                    dump('pulling in custom.js in util_overlay_offline.xul\n');
+                    // Pull in local customizations
+                    var r = new XMLHttpRequest();
+                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    r.send(null);
+                    if (r.status == 200) {
+                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        eval( r.responseText );
+                    }
+                } else {
+                    dump('cannot pull in custom.js in util_overlay_offline.xul\n');
+                }
+            } catch(E) {
+                dump('cannot pull in custom.js in util_overlay_offline.xul: ' + E + '\n');
+            }
+        ]]>
+        </script>
         <script type="text/javascript" src="util/utils.js" />
         <script type="text/javascript" src="util/CGI.js" />
         <script type="text/javascript" src="util/md5.js" />