From f0f36a7b02e5dece844929aafdb135614732425c Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 24 Jan 2013 17:30:26 -0500 Subject: [PATCH] move EventListenerList out of global_util.js So that we can more easily pull it into main.xul (which we also do here) Signed-off-by: Jason Etheridge Signed-off-by: Ben Shum --- Open-ILS/xul/staff_client/Makefile.am | 1 + .../chrome/content/OpenILS/event_util.js | 37 +++++++++++++++++++ .../chrome/content/OpenILS/global_util.js | 37 ------------------- .../content/OpenILS/util_overlay_chrome.xul | 1 + .../content/OpenILS/util_overlay_offline.xul | 1 + .../staff_client/chrome/content/main/main.xul | 1 + .../chrome/content/util/shell.html | 1 + .../server/OpenILS/util_overlay.xul | 1 + .../server/admin/printer_settings.xul | 1 + .../server/admin/upload_xacts.xhtml | 1 + Open-ILS/xul/staff_client/server/index.xhtml | 2 + 11 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 Open-ILS/xul/staff_client/chrome/content/OpenILS/event_util.js diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am index 2e165a689e..a27b5cb4c4 100644 --- a/Open-ILS/xul/staff_client/Makefile.am +++ b/Open-ILS/xul/staff_client/Makefile.am @@ -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 index 0000000000..39934b4529 --- /dev/null +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/event_util.js @@ -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); + } + } +} + diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index f7abba410d..fabe682c72 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -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() { diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul index c3b9e4772a..0860a6ddec 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul @@ -63,6 +63,7 @@ diff --git a/Open-ILS/xul/staff_client/chrome/content/util/shell.html b/Open-ILS/xul/staff_client/chrome/content/util/shell.html index 32a7cc2baf..884c48e174 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/shell.html +++ b/Open-ILS/xul/staff_client/chrome/content/util/shell.html @@ -8,6 +8,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml b/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml index eae0bbeb90..5f851c6959 100644 --- a/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml @@ -15,6 +15,7 @@ + -- 2.43.2