[open-ils-commits] r14290 - in trunk/Open-ILS/xul/staff_client/chrome/content: OpenILS util (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 7 11:34:43 EDT 2009
Author: phasefx
Date: 2009-10-07 11:34:41 -0400 (Wed, 07 Oct 2009)
New Revision: 14290
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js
trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js
Log:
remnants of some troubleshooting; useful to keep these in here
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-10-07 15:32:54 UTC (rev 14289)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-10-07 15:34:41 UTC (rev 14290)
@@ -3,8 +3,13 @@
if (typeof OpenILS == 'undefined') OpenILS = {};
OpenILS.data = function () {
- JSAN.use('util.error'); this.error = new util.error();
- JSAN.use('util.network'); this.network = new util.network();
+ try {
+ JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('util.network'); this.network = new util.network();
+ } catch(E) {
+ alert(location.href + '\nError in OpenILS.data constructor: ' + E);
+ throw(E);
+ }
return this;
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2009-10-07 15:32:54 UTC (rev 14289)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2009-10-07 15:34:41 UTC (rev 14290)
@@ -1,21 +1,34 @@
function $(id) { return document.getElementById(id); }
- function ses(a) {
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
- switch(a) {
- case 'staff_id' : return data.list.au[0].id(); break;
- case 'staff_usrname' : return data.list.au[0].usrname(); break;
- case 'ws_ou' :
- return data.list.au[0].ws_ou();
- break;
- case 'authtime' :
- return data.session.authtime;
- break;
- case 'key':
- default:
- return data.session.key;
- break;
- }
+ function ses(a,params) {
+ try {
+ if (!params) params = {};
+ var data;
+ if (params.data) {
+ data = params.data; data.stash_retrieve();
+ } else {
+ // This has been breaking in certain contexts, with an internal instantiation of util.error failing because of util.error being an object instead of the constructor function it should be
+ JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.stash_retrieve();
+ }
+
+ switch(a) {
+ case 'staff_id' : return data.list.au[0].id(); break;
+ case 'staff_usrname' : return data.list.au[0].usrname(); break;
+ case 'ws_ou' :
+ return data.list.au[0].ws_ou();
+ break;
+ case 'authtime' :
+ return data.session.authtime;
+ break;
+ case 'key':
+ default:
+ return data.session.key;
+ break;
+ }
+ } catch(E) {
+ alert(location.href + '\nError in global_utils.js, ses(): ' + E);
+ throw(E);
+ }
}
function font_helper() {
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js 2009-10-07 15:32:54 UTC (rev 14289)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/error.js 2009-10-07 15:34:41 UTC (rev 14290)
@@ -3,21 +3,27 @@
if (typeof util == 'undefined') util = {};
util.error = function () {
- try {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
- .getService(Components.interfaces.nsIConsoleService);
- } catch(E) {
- this.consoleDump = false;
- dump('util.error constructor: ' + E + '\n');
- }
+ try {
- this.sdump_last_time = new Date();
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
+ .getService(Components.interfaces.nsIConsoleService);
+ } catch(E) {
+ this.consoleDump = false;
+ dump('util.error constructor: ' + E + '\n');
+ }
- this.OpenILS = {};
+ this.sdump_last_time = new Date();
- JSAN.use('util.sound'); this.sound = new util.sound();
+ this.OpenILS = {};
+ JSAN.use('util.sound'); this.sound = new util.sound();
+
+ } catch(E) {
+ alert('Error in util.error constructor: ' + E);
+ }
+
return this;
};
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-10-07 15:32:54 UTC (rev 14289)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-10-07 15:34:41 UTC (rev 14290)
@@ -6,11 +6,18 @@
if (typeof util == 'undefined') util = {};
util.network = function () {
- JSAN.use('util.error'); this.error = new util.error();
- JSAN.use('util.sound'); this.sound = new util.sound();
+ try {
- offlineStrings = document.getElementById('offlineStrings');
+ JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('util.sound'); this.sound = new util.sound();
+ offlineStrings = document.getElementById('offlineStrings');
+
+ } catch(E) {
+ alert('error in util.network constructor: ' + E);
+ throw(E);
+ }
+
return this;
};
More information about the open-ils-commits
mailing list