move EventListenerList out of global_util.js
authorJason Etheridge <jason@esilibrary.com>
Thu, 24 Jan 2013 22:30:26 +0000 (17:30 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 4 Mar 2013 19:49:33 +0000 (14:49 -0500)
So that we can more easily pull it into main.xul (which we also do here)

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/Makefile.am
Open-ILS/xul/staff_client/chrome/content/OpenILS/event_util.js [new file with mode: 0644]
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul
Open-ILS/xul/staff_client/chrome/content/main/main.xul
Open-ILS/xul/staff_client/chrome/content/util/shell.html
Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
Open-ILS/xul/staff_client/server/admin/printer_settings.xul
Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml
Open-ILS/xul/staff_client/server/index.xhtml

index 2e165a6..a27b5cb 100644 (file)
@@ -102,6 +102,7 @@ build_dir:
        @cp build/chrome/content/main/bindings.xml build/server/main/bindings.xml
        @cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
        @cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
+       @cp build/chrome/content/OpenILS/event_util.js build/server/OpenILS/event_util.js
        @if [ -d branding ]; then cp -fR branding/* build/; fi
        @external/prune_dirs.sh build/
 
diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/event_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/event_util.js
new file mode 100644 (file)
index 0000000..39934b4
--- /dev/null
@@ -0,0 +1,37 @@
+function EventListenerList() {
+    this._listeners = [];
+    return this;
+}
+
+EventListenerList.prototype = {
+    'add' : function(node, type, listener, useCapture) {
+        try {
+            node.addEventListener(type,listener,useCapture);
+            this._listeners.push({
+                'node' : node,
+                'type' : type,
+                'listener' : listener,
+                'useCapture' : useCapture
+            });
+        } catch(E) {
+            alert(location.href + ' Error adding event listener ' + type + ': ' + E);
+        }
+    },
+
+    'removeAll' : function() {
+        try {
+            if (typeof this._listeners != 'undefined') {
+                for (var i = 0; i < this._listeners.length; i++) {
+                    this._listeners[i].node.removeEventListener(
+                        this._listeners[i].type,
+                        this._listeners[i].listener,
+                        this._listeners[i].useCapture
+                    );
+                }
+            }
+        } catch(E) {
+            alert(location.href + ' Error in unloadEventListeners(): ' + E);
+        }
+    }
+}
+
index f7abba4..fabe682 100644 (file)
@@ -2,43 +2,6 @@
         xulG = window.arguments[0];
     }
 
-    function EventListenerList() {
-        this._listeners = [];
-        return this;
-    }
-
-    EventListenerList.prototype = {
-        'add' : function(node, type, listener, useCapture) {
-            try {
-                node.addEventListener(type,listener,useCapture);
-                this._listeners.push({
-                    'node' : node,
-                    'type' : type,
-                    'listener' : listener,
-                    'useCapture' : useCapture
-                });
-            } catch(E) {
-                alert(location.href + ' Error adding event listener ' + type + ': ' + E);
-            }
-        },
-
-        'removeAll' : function() {
-            try {
-                if (typeof this._listeners != 'undefined') {
-                    for (var i = 0; i < this._listeners.length; i++) {
-                        this._listeners[i].node.removeEventListener(
-                            this._listeners[i].type,
-                            this._listeners[i].listener,
-                            this._listeners[i].useCapture
-                        );
-                    }
-                }
-            } catch(E) {
-                alert(location.href + ' Error in unloadEventListeners(): ' + E);
-            }
-        }
-    }
-
     function $(id) { return document.getElementById(id); }
 
     function oils_unsaved_data_V() {
index c3b9e47..0860a6d 100644 (file)
@@ -63,6 +63,7 @@
         <script type='text/javascript' src='util/en-US/OrgTree.js' />
         <script type="text/javascript" src="util/org_utils.js" />   
         <script type="text/javascript" src="global_util.js" />   
+        <script type="text/javascript" src="event_util.js" />   
         <messagecatalog id="offlineStrings" src='chrome://open_ils_staff_client/locale/offline.properties'/>
         <messagecatalog id="authStrings" src='chrome://open_ils_staff_client/locale/auth.properties'/>
         <hbox id="debug_box" hidden="true" flex="1" style="border: red thin dashed">
index 2b834db..a9dc1d8 100644 (file)
@@ -60,6 +60,7 @@
         <script type="text/javascript" src="util/md5.js" />
         <script type="text/javascript" src="util/JSON_v1.js" />
         <script type="text/javascript" src="global_util.js" />   
+        <script type="text/javascript" src="event_util.js" />   
         <hbox id="debug_box" hidden="true" flex="1" style="border: red thin dashed">
             <label value="Debug:" />
             <textbox id="debug_tb" flex="1"/>
index 1ba8226..3884d9c 100644 (file)
@@ -45,6 +45,7 @@
         <script type="text/javascript" src="../OpenILS/util/OrgTree.js" />
         -->
         <script type="text/javascript" src="../OpenILS/util/org_utils.js" />   
+        <script type="text/javascript" src="../OpenILS/event_util.js" />   
     </scripts>
     <script>dump('Loaded main/main.xul\n');</script>
 
index 32a7cc2..884c48e 100644 (file)
@@ -8,6 +8,7 @@
 <script type="text/javascript" src="/xul/server/main/JSAN.js" />
 <script type="text/javascript" src="/xul/server/main/constants.js" />
 <script type="text/javascript" src="/xul/server/OpenILS/global_util.js" />
+<script type="text/javascript" src="/xul/server/OpenILS/event_util.js" />
 <script type="text/javascript" src="/xul/server/OpenILS/data.js" />
 <script type="text/javascript" src="/xul/server/util/network.js" />
 <script type="text/javascript" src="/xul/server/util/error.js" />
index b4b81ac..dec055d 100644 (file)
@@ -73,6 +73,7 @@
         <script type='text/javascript' src='/opac/common/js/<!--#echo var="locale"-->/OrgTree.js' />
         <script type="text/javascript" src="/opac/common/js/org_utils.js" />   
         <script type="text/javascript" src="global_util.js" />   
+        <script type="text/javascript" src="event_util.js" />   
         <menupopup id="clipboard">
             <menuitem label="&common.textbox.cut;" oncommand="util.clipboard.cut()" />
             <menuitem label="&common.textbox.copy;" oncommand="util.clipboard.copy()" />
index e8f61ae..6df759b 100644 (file)
@@ -23,6 +23,7 @@
     <script type="text/javascript" src="/opac/common/js/org_utils.js"></script>
 
     <script type="text/javascript" src="/xul/server/OpenILS/global_util.js"></script>
+    <script type="text/javascript" src="/xul/server/OpenILS/event_util.js"></script>
     <script type="text/javascript" src="/xul/server/main/constants.js"></script>
     <script type="text/javascript" src="/xul/server/main/JSAN.js"></script>
     <script type="text/javascript" src="printer_settings.js"></script>
index eae0bbe..5f851c6 100644 (file)
@@ -15,6 +15,7 @@
     <script type="text/javascript" src="/xul/server/main/JSAN.js"></script>
     <script type="text/javascript" src="/xul/server/main/constants.js" />
     <script type="text/javascript" src="/xul/server/OpenILS/global_util.js" />
+    <script type="text/javascript" src="/xul/server/OpenILS/event_util.js" />
 
     <script type="text/javascript" src="/opac/common/js/utils.js" />
     <script type="text/javascript" src="/opac/common/js/CGI.js" />
index 324c017..1b36f3a 100644 (file)
@@ -74,6 +74,8 @@
 </script>
   <script type="text/javascript" src="OpenILS/global_util.js">
 </script>
+  <script type="text/javascript" src="OpenILS/event_util.js">
+</script>
   <script type="text/javascript" src="main/JSAN.js">
 </script>
   <script type="text/javascript">