[open-ils-commits] r8463 - in branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content: OpenILS util

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jan 22 14:37:43 EST 2008


Author: phasefx
Date: 2008-01-22 14:11:14 -0500 (Tue, 22 Jan 2008)
New Revision: 8463

Modified:
   branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
   branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/window.js
Log:
util.window was relying on xulG, but when called from the main.menu framework, there is no xulG.  This fixes the Operator Change regression, and the chrome Perm Denied/Re-Auth regression

Modified: branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js	2008-01-22 17:59:24 UTC (rev 8462)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js	2008-01-22 19:11:14 UTC (rev 8463)
@@ -213,4 +213,10 @@
 		window.open(uri, "_blank", winopts);
 	}
 
+	function url_prefix(url) {
+		if (url.match(/^\//)) url = urls.remote + url;
+		if (! url.match(/^(http|chrome):\/\//) && ! url.match(/^data:/) ) url = 'http://' + url;
+		dump('url_prefix = ' + url + '\n');
+		return url;
+	}
 

Modified: branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/window.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/window.js	2008-01-22 17:59:24 UTC (rev 8462)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/window.js	2008-01-22 19:11:14 UTC (rev 8463)
@@ -83,9 +83,13 @@
 			if (typeof data.modal_xulG_stack == 'undefined') data.modal_xulG_stack = {}; 
 			/* FIXME - not a perfect key.. could imagine two top-level windows both opening modal windows */
 			key = url; 
-			if (typeof xulG == 'object') if (typeof xulG.url_prefix == 'function') {
-				key = key.replace( xulG.url_prefix('/'), '/' );	
-			}
+			if (typeof xulG == 'object') {
+                if (typeof xulG.url_prefix == 'function') {
+				    key = key.replace( xulG.url_prefix('/'), '/' );	
+    			}
+            } else if (typeof url_prefix == 'function') {
+				    key = key.replace( url_prefix('/'), '/' );	
+            }
 			if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = [];
 			data.modal_xulG_stack[key].push( my_xulG );
 			data.stash('modal_xulG_stack');



More information about the open-ils-commits mailing list