util.window was relying on xulG, but when called from the main.menu framework, there...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Jan 2008 19:14:46 +0000 (19:14 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Jan 2008 19:14:46 +0000 (19:14 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_1@8465 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/util/window.js

index 987c2b7..e55d4a2 100644 (file)
                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;
+       }
 
index d8c17d0..60c7090 100644 (file)
@@ -83,9 +83,13 @@ util.window.prototype = {
                        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');