Rip modal_xulG_stack out, replace with openDialog
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 11 Apr 2012 23:53:48 +0000 (19:53 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 1 Aug 2012 20:14:41 +0000 (16:14 -0400)
This converts the util/window.js open function to a wrapper around the
openDialog function and passes xulG in that way, as well as teaches
global_util.js to look for it having been passed in via the arguments
parameter on window.

The non-modal "push it into place" is still done as well, in case some
window isn't using global_util.js and needs xulG.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

28 files changed:
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul
Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/chrome/content/util/timestamp.js
Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js
Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.xul
Open-ILS/xul/staff_client/chrome/content/util/window.js
Open-ILS/xul/staff_client/server/cat/bib_brief.js
Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/cat/copy_notes.xul
Open-ILS/xul/staff_client/server/cat/marc_view.xul
Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul
Open-ILS/xul/staff_client/server/cat/volume_editor.js
Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js
Open-ILS/xul/staff_client/server/circ/circ_summary.xul
Open-ILS/xul/staff_client/server/circ/copy_details.xul
Open-ILS/xul/staff_client/server/main/simple_auth.xul
Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul
Open-ILS/xul/staff_client/server/patron/bill_wizard.js
Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js
Open-ILS/xul/staff_client/server/patron/hold_cancel.js
Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js
Open-ILS/xul/staff_client/server/serial/editor_base.js
Open-ILS/xul/staff_client/server/serial/notes.xul
Open-ILS/xul/staff_client/server/serial/select_aou.xul
Open-ILS/xul/staff_client/server/serial/select_unit.xul

index 38e62ae..af52251 100644 (file)
@@ -1,3 +1,7 @@
+    if(window.arguments && typeof window.arguments[0] == 'object' && typeof xulG == 'undefined') {
+        xulG = window.arguments[0];
+    }
+
     function $(id) { return document.getElementById(id); }
 
     function oils_unsaved_data_V() {
         }
     }
 
-    function update_modal_xulG(v) {
-        try {
-            if (typeof xulG != "undefined" && xulG.not_modal) {
-                xulG = v;
-                xulG.not_modal = true;
-                return;
-            }
-
-            JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
-            var key = location.pathname + location.search + location.hash;
-            if (typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
-                data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = v;
-                data.stash('modal_xulG_stack');
-            }
-        } catch(E) {
-            alert('FIXME: update_modal_xulG => ' + E);
-        }
-    }
-
     function xul_param(param_name,_params) {
         /* By default, this function looks for a CGI-style query param identified by param_name.  If one isn't found, it then looks in xulG.  If one still isn't found, and _params.stash_name is true, it looks in the global xpcom stash for the field identified by stash_name.  If _params.concat is true, then it looks in all these places and concatenates the results.  There are also options for converting JSON to javascript objects, and clearing the xpcom stash_name field after retrieval.  Also added, ability to search a specific spot in the xpcom stash that implements a stack to hold xulG's for modal windows */
         try {
                 }
             }
             if (typeof _params.no_xulG == 'undefined') {
-                if (typeof _params.modal_xulG != 'undefined') {
-                    if (typeof xulG != 'undefined' && xulG.not_modal) {
-                        // for interfaces that used to be modal but aren't now, do nothing
-                    } else {
-                        JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
-                        var key = location.pathname + location.search + location.hash;
-                        //dump('xul_param, considering modal key = ' + key + '\n');
-                        if (typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
-                            xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
-                        }
-                    }
-                }
                 if (typeof xulG == 'object' && typeof xulG[ param_name ] != 'undefined') {
                     var x = xulG[ param_name ];
                     //dump('\tfound via xulG = ' + x + '\n');
index d7fb3b4..8d130f4 100644 (file)
@@ -1278,11 +1278,9 @@ main.menu.prototype = {
                                 var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService);
 
                                 cookieSvc.setCookieString(cookieUriSSL, null, "ses="+obj.data.session.key + "; secure;", null);
-
-                        } catch(E) {
-                            alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
-                        }
-
+                            } catch(E) {
+                                alert(offlineStrings.getFormattedString(main.session_cookie.error, [E]));
+                            }
                         } else {
                             if (network.get_new_session(offlineStrings.getString('menu.cmd_chg_session.label'),{'url_prefix':obj.url_prefix})) {
                                 obj.data.stash_retrieve();
index 89b5440..30c507d 100644 (file)
 
                 $('server').value = g.data.server_unadorned;
 
-                addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true}))
+                addCSSClass(document.documentElement,xul_param('login_type'))
 
-                if (xul_param('desc_brief',{'modal_xulG':true})) {
+                if (xul_param('desc_brief')) {
                     $('desc').hidden = false;
-                    $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) );
+                    $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief') ) );
                 }
-                if (xul_param('desc_full',{'modal_xulG':true})) {
+                if (xul_param('desc_full')) {
                     $('desc').hidden = false;
-                    $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) );
+                    $('desc_full').appendChild( document.createTextNode( xul_param('desc_full') ) );
                 }
 
                 $('username').focus();
@@ -90,7 +90,7 @@
                         'password_prompt' : $('password'),
                         'server_prompt' : $('server'),
                     },
-                    xul_param('login_type',{'modal_xulG':true}) || 'temp'
+                    xul_param('login_type') || 'temp'
                 );
                 g.session.on_init = function() { 
                     try {
                             'usr' : js2JSON(staff)
                         }
                         g.data.stash('temporary_session');
-                        var my_xulG = { // new way, to minimize the use of global spaces
-                            'temporary_session' : g.data.temporary_session
-                        };
-                        update_modal_xulG(my_xulG);
+                        xulG.temporary_session = g.data.temporary_session;
                         window.close();
                     } catch(E) {
                         g.error.standard_unexpected_error_alert('simple_auth.session.on_init',E);
index 281ee63..0d42345 100644 (file)
@@ -19,7 +19,7 @@
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
 
 <window id="fancy_prompt_win" 
-    onload="try { my_init(); font_helper(); persist_helper( xul_param('title',{'modal_xulG':true}) ); } catch(E) { alert(E); }"
+    onload="try { my_init(); font_helper(); persist_helper( xul_param('title') ); } catch(E) { alert(E); }"
     oils_persist="width height"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
@@ -34,8 +34,6 @@
     <script>
     <![CDATA[
 
-        var xulG = {};
-
         function my_init() {
             try {
                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.use('util.error'); g.error = new util.error();
                 g.error.sdump('D_TRACE','my_init() for fancy_prompt.xul');
 
-                //JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
-                //g.data.fancy_prompt_data = ''; g.data.stash('fancy_prompt_data');
-                //g.data.fancy_prompt_data = {};
-
-                //var key = location.pathname + location.search + location.hash;
-                //if (typeof g.data.modal_xulG_stack != 'undefined' && typeof g.data.modal_xulG_stack[key] != 'undefined') {
-                //    xulG = g.data.modal_xulG_stack[key][ g.data.modal_xulG_stack[key].length - 1 ];
-                //}
-
-                var top_xml = xul_param('top_xml',{'stash_name':xul_param('top_xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});
+                var top_xml = xul_param('top_xml',{'stash_name':xul_param('top_xml_in_stash')});
                 if (top_xml) {
                     var parser = new DOMParser();
                     var doc = parser.parseFromString( top_xml, 'text/xml' );
@@ -61,7 +50,7 @@
                     if (node) document.getElementById('fancy_prompt_topbar').appendChild(node);
                 }
 
-                var my_xml = xul_param('xml',{'stash_name':xul_param('xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});
+                var my_xml = xul_param('xml',{'stash_name':xul_param('xml_in_stash')});
                 if (my_xml) {
                     var parser = new DOMParser();
                     var doc = parser.parseFromString( my_xml, 'text/xml' );
@@ -69,7 +58,7 @@
                     if (node) document.getElementById('fancy_prompt_main').appendChild(node);
                 }
 
-                var bot_xml = xul_param('bottom_xml',{'stash_name':xul_param('bottom_xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});;
+                var bot_xml = xul_param('bottom_xml',{'stash_name':xul_param('bottom_xml_in_stash')});;
                 if (bot_xml) {
                     var parser = new DOMParser();
                     var doc = parser.parseFromString( bot_xml, 'text/xml' );
                     nl[i].addEventListener('command',function(ev) { window.close(); },false);
                 }
 
-                if (xul_param('title',{'modal_xulG':true})) {
-                    try { window.title = xul_param('title',{'modal_xulG':true}); } catch(E) {}
-                    try { document.title = xul_param('title',{'modal_xulG':true}); } catch(E) {}
+                if (xul_param('title')) {
+                    try { window.title = xul_param('title'); } catch(E) {}
+                    try { document.title = xul_param('title'); } catch(E) {}
                 }
 
-                if (xul_param('focus',{'modal_xulG':true})) {
-                    var focus_element = document.getElementById(xul_param('focus',{'modal_xulG':true}));
+                if (xul_param('focus')) {
+                    var focus_element = document.getElementById(xul_param('focus'));
                     if (focus_element) focus_element.focus();
                 }
 
-                var snd = xul_param('sound',{'modal_xulG':true});
-                var snd_obj = xul_param('sound_object',{'modal_xulG':true});
+                var snd = xul_param('sound');
+                var snd_obj = xul_param('sound_object');
                 if (snd) {
                     try {
                         var params = { 'sig' : 'fancy_prompt_my_init' };
                     }
                 }
 
-                JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
                 xulG.fancy_status = 'incomplete';
-                var key = location.pathname + location.search + location.hash;
-                data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = xulG;
-                data.stash('modal_xulG_stack');
 
             } catch(E) {
                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
                     xulG[ nl[i].id ] = nl[i].nodeName == 'checkbox' ? nl[i].checked : nl[i].value;
                 }
                 xulG.fancy_status = 'complete';
-                var key = location.pathname + location.search + location.hash;
-                data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = xulG;
-                data.stash('modal_xulG_stack');
     
                 window.close();
             } catch(E) {
index c84833a..45cd623 100644 (file)
@@ -182,7 +182,7 @@ util.print.prototype = {
                         print_url += '<script src="' + this.data.hash.aous['print.custom_js_file'] + '"></script>';
                     }
                     print_url += '</head><body onload="try{print_init(\'' + params.type + '\');}catch(E){alert(E);}">' + window.escape(msg.replace(/<script[^>]*>.*?<\/script>/gi,'')) + '</body></html>';
-                    obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,modal', null, { "data" : params.data, "list" : params.list}, function(w) { 
+                    obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,modal', { "data" : params.data, "list" : params.list}, function(w) { 
                         try {
                             obj.NSPrint(w, silent, params);
                         } catch(E) {
index 141551c..aac7d70 100644 (file)
@@ -22,31 +22,31 @@ function timestamp_init() {
         JSAN.use('util.sound'); sound = new util.sound();
         JSAN.use('util.date'); 
 
-        $('datepicker').value = xul_param('default_date',{'modal_xulG':true}) || util.date.formatted_date(new Date(),'%F');
-        if (xul_param('default_time',{'modal_xulG':true})) {
-            $('timepicker').value = xul_param('default_time',{'modal_xulG':true});
+        $('datepicker').value = xul_param('default_date') || util.date.formatted_date(new Date(),'%F');
+        if (xul_param('default_time')) {
+            $('timepicker').value = xul_param('default_time');
         }
-        if (xul_param('time_readonly',{'modal_xulG':true})) {
+        if (xul_param('time_readonly')) {
             $('timepicker').readonly = true; // This isn't working correctly with xulrunner 1.9.2
             $('timepicker').disabled = true; // So, poor man's kludge
         }
-        if (xul_param('date_readonly',{'modal_xulG':true})) {
+        if (xul_param('date_readonly')) {
             $('datepicker').readonly = true; // This isn't working correctly with xulrunner 1.9.2
             $('datepicker').disabled = true; // So, poor man's kludge
         }
 
-        if (xul_param('title',{'modal_xulG':true})) { $('dialogheader').setAttribute('title',xul_param('title',{'modal_xulG':true})); }
-        if (xul_param('description',{'modal_xulG':true})) { $('dialogheader').setAttribute('description',xul_param('description',{'modal_xulG':true})); }
+        if (xul_param('title')) { $('dialogheader').setAttribute('title',xul_param('title')); }
+        if (xul_param('description')) { $('dialogheader').setAttribute('description',xul_param('description')); }
 
         var x = $('msg_area');
-        if (x && xul_param('msg',{'modal_xulG':true})) {
+        if (x && xul_param('msg')) {
             var d = document.createElement('description');
-            var t = document.createTextNode( xul_param('msg',{'modal_xulG':true}) );
+            var t = document.createTextNode( xul_param('msg') );
             x.appendChild( d );
             d.appendChild( t );
         }
 
-        if (xul_param('allow_unset',{'modal_xulG':true})) { $('remove_btn').hidden = false; }
+        if (xul_param('allow_unset')) { $('remove_btn').hidden = false; }
 
         /* set widget behavior */
         $('cancel_btn').addEventListener(
@@ -92,13 +92,13 @@ function timestamp_init() {
 }
 
 function check_date(value) {
-    if (xul_param('disallow_future_dates',{'modal_xulG':true})) {
+    if (xul_param('disallow_future_dates')) {
         if ( value > new Date() ) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.future_date_disallowed') }; }
     }
-    if (xul_param('disallow_past_dates',{'modal_xulG':true})) {
+    if (xul_param('disallow_past_dates')) {
         if ( util.date.check_past('YYYY-MM-DD', value) ) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.past_date_disallowed') }; }
     }
-    if (xul_param('disallow_today',{'modal_xulG':true})) {
+    if (xul_param('disallow_today')) {
         if ( util.date.formatted_date(new Date(),'%F') == value) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.today_disallowed') }; }
     }
     return { 'allowed' : true };
@@ -110,12 +110,8 @@ function gen_handle_apply(params) {
 
             if (!params) { params = {}; }
             if (params.remove) {
-                update_modal_xulG(
-                    {
-                        'timestamp' : null,
-                        'complete' : 1
-                    }
-                )
+                xulG.timestamp = null;
+                xulG.complete = 1;
                 window.close();
             } else {
 
@@ -130,12 +126,8 @@ function gen_handle_apply(params) {
                 dp_date.setHours( tp_date.getHours() );
                 dp_date.setMinutes( tp_date.getMinutes() );
 
-                update_modal_xulG(
-                    {
-                        'timestamp' : util.date.formatted_date(dp_date,'%{iso8601}'),
-                        'complete' : 1
-                    }
-                )
+                xulG.timestampe = util.date.formatted_date(dp_date,'%{iso8601}');
+                xulG.complete = 1;
                 window.close();
             }
 
index 35e5319..0bc238f 100644 (file)
@@ -9,24 +9,24 @@ function my_init() {
         JSAN.use('util.error'); g.error = new util.error();
         g.error.sdump('D_TRACE','my_init() for widget_prompt.xul');
 
-        widget = xul_param('widget',{'modal_xulG':true});
+        widget = xul_param('widget');
         if (widget) {
             $('widget_prompt_main').appendChild(widget);
         }
 
-        var ok_label = xul_param('ok_label',{'modal_xulG':true}) || offlineStrings.getString('common.ok.label');
+        var ok_label = xul_param('ok_label') || offlineStrings.getString('common.ok.label');
         $('ok_btn').setAttribute('label',ok_label);
 
-        var ok_accesskey = xul_param('ok_accesskey',{'modal_xulG':true}) || offlineStrings.getString('common.ok.accesskey');
+        var ok_accesskey = xul_param('ok_accesskey') || offlineStrings.getString('common.ok.accesskey');
         $('ok_btn').setAttribute('accesskey',ok_accesskey);
 
-        var cancel_label = xul_param('cancel_label',{'modal_xulG':true}) || offlineStrings.getString('common.cancel.label');
+        var cancel_label = xul_param('cancel_label') || offlineStrings.getString('common.cancel.label');
         $('cancel_btn').setAttribute('label',cancel_label);
 
-        var cancel_accesskey = xul_param('cancel_accesskey',{'modal_xulG':true}) || offlineStrings.getString('common.cancel.accesskey');
+        var cancel_accesskey = xul_param('cancel_accesskey') || offlineStrings.getString('common.cancel.accesskey');
         $('cancel_btn').setAttribute('accesskey',cancel_accesskey);
 
-        var desc = xul_param('desc',{'modal_xulG':true});
+        var desc = xul_param('desc');
         if (desc) {
             $('desc').appendChild( document.createTextNode( desc ) );
         }
@@ -34,13 +34,12 @@ function my_init() {
         $('ok_btn').addEventListener('command',widget_save,false);
         $('cancel_btn').addEventListener('command',function(ev) { window.close(); },false);
 
-        if (xul_param('title',{'modal_xulG':true})) {
-            try { window.title = xul_param('title',{'modal_xulG':true}); } catch(E) {}
-            try { document.title = xul_param('title',{'modal_xulG':true}); } catch(E) {}
+        if (xul_param('title')) {
+            try { window.title = xul_param('title'); } catch(E) {}
+            try { document.title = xul_param('title'); } catch(E) {}
         }
 
         xulG[ 'status' ] = 'incomplete';
-        update_modal_xulG(xulG);
 
         try { widget.focus(); } catch(E) {}
 
@@ -52,7 +51,7 @@ function my_init() {
 function widget_save(ev) {
     try {
         if (widget) {
-            switch( xul_param('access',{'modal_xulG':true}) ) {
+            switch( xul_param('access') ) {
                 case 'method' :
                     xulG[ 'value' ] = xulG[ 'method' ]();
                 break;
@@ -67,8 +66,6 @@ function widget_save(ev) {
         }
         xulG[ 'status' ] = 'complete';
 
-        update_modal_xulG(xulG);
-
         window.close();
     } catch(E) {
         alert('Error in widget_prompt.js, widget_save(): ' + E);
index 303a4c3..dbe504d 100644 (file)
@@ -19,7 +19,7 @@
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
 
 <window id="widget_prompt_win" 
-    onload="try { my_init(); font_helper(); persist_helper( xul_param('title',{'modal_xulG':true}) ); } catch(E) { alert(E); }"
+    onload="try { my_init(); font_helper(); persist_helper( xul_param('title') ); } catch(E) { alert(E); }"
     oils_persist="width height"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index ddb8cbc..38c3836 100644 (file)
@@ -32,27 +32,6 @@ util.window.prototype = {
     // From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
     // Message-ID: <ckjh7a$18q1@ripley.netscape.com>
     // Modified by Jason for Evergreen
-    'SafeWindowOpen' : function (url,title,features) {
-        var w;
-
-        const CI = Components.interfaces;
-        const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
-
-        var blocked = false;
-        try {
-            // pref 'dom.disable_open_during_load' is the main popup blocker preference
-            blocked = PB.getBoolPref("dom.disable_open_during_load");
-            if(blocked) PB.setBoolPref("dom.disable_open_during_load",false);
-            w = this.win.open(url,title,features);
-        } catch(E) {
-            this.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n');
-            throw(E);
-        }
-        if(blocked) PB.setBoolPref("dom.disable_open_during_load",true);
-
-        return w;
-    },
-
     'SafeWindowOpenDialog' : function (url,title,features) {
         var w;
 
@@ -66,7 +45,7 @@ util.window.prototype = {
             if(blocked) PB.setBoolPref("dom.disable_open_during_load",false);
             w = this.win.openDialog.apply(this.win,arguments);
         } catch(E) {
-            this.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n');
+            this.error.sdump('D_ERROR','window.SafeWindowOpenDialog: ' + E + '\n');
             throw(E);
         }
         if(blocked) PB.setBoolPref("dom.disable_open_during_load",true);
@@ -74,57 +53,16 @@ util.window.prototype = {
         return w;
     },
 
+    // This has basically become a compatibility wrapper for openDialog.
     'open' : function(url,title,features,my_xulG) {
         var key;
-        if (!title) title = '_blank';
-        if (!features) features = 'chrome';
-        this.error.sdump('D_WIN', 'opening ' + url + ', ' + title + ', ' + features + ' from ' + this.win + '\n');
-        var data;
-        if (features.match(/modal/) && my_xulG) {
-            JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.init({'via':'stash'});
-            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('/'), '/' );    
-                }
-            } else if (typeof url_prefix == 'function') {
-                    key = key.replace( url_prefix('/'), '/' );    
-            }
-            // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it.
-            // So remove it here, like we remove url_prefix.
-            key = key.replace('oils://remote/', '/');
-            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');
-            this.error.sdump('D_WIN','modal key = ' + key);
-        }
-        var w = this.SafeWindowOpen(url,title,features);
-        if (features.match(/modal/) && my_xulG) { 
-            data.init({'via':'stash'});
-            var x = data.modal_xulG_stack[key].pop();
-            data.stash('modal_xulG_stack');
-            w.focus();
-            return x;
-        } else {
-            if (my_xulG) {
-                if (get_contentWindow(w)) {
-                    get_contentWindow(w).xulG = my_xulG;
-                } else {
-                    w.xulG = my_xulG;
-                }
-            }
-        }
-        /*
-        setTimeout( 
-            function() { 
-                try { w.title = title; } catch(E) { dump('**'+E+'\n'); }
-                try { w.document.title = title; } catch(E) { dump('**'+E+'\n'); }
-            }, 0 
-        );
-        */
-        return w;
+        if (!features) features = 'chrome,dialog=no';
+        if (!features.match(/dialog/)) features = 'dialog=no,' + features; // window.open doesn't do dialog by default
+        if (!features.match(/chrome/)) features = 'chrome=no,' + features; // And window.open doesn't assume chrome by default
+        var outArgs = Array.prototype.slice.call(arguments);
+        outArgs[1] = title;
+        outArgs[2] = features;
+        return this.openDialog.apply(this, outArgs); // Pass to openDialog
     },
 
     'openDialog' : function(url,title,features,my_xulG) {
@@ -132,36 +70,13 @@ util.window.prototype = {
         if (!title) title = '_blank';
         if (!features) features = 'chrome'; // Note that this is a default for openDialog anyway
         var outArgs = Array.prototype.slice.call(arguments);
-        outArgs.splice(3,1); // Remove my_xulG
+        outArgs[1] = title;
+        outArgs[2] = features;
         this.error.sdump('D_WIN', 'opening ' + url + ', ' + title + ', ' + features + ' from ' + this.win + '\n');
         var data;
-        if (features.match(/modal/) && my_xulG) {
-            JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.init({'via':'stash'});
-            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('/'), '/' );    
-                }
-            } else if (typeof url_prefix == 'function') {
-                    key = key.replace( url_prefix('/'), '/' );    
-            }
-            // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it.
-            // So remove it here, like we remove url_prefix.
-            key = key.replace('oils://remote/', '/');
-            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');
-            this.error.sdump('D_WIN','modal key = ' + key);
-        }
         var w = this.SafeWindowOpenDialog.apply(this, outArgs);
         if (features.match(/modal/) && my_xulG) { 
-            data.init({'via':'stash'});
-            var x = data.modal_xulG_stack[key].pop();
-            data.stash('modal_xulG_stack');
-            w.focus();
-            return x;
+            return my_xulG;
         } else {
             if (my_xulG) {
                 if (get_contentWindow(w)) {
index 13c57d8..0f527d6 100644 (file)
@@ -13,19 +13,6 @@ function bib_brief_init(mode) {
 
         docid = xul_param('docid');
 
-        // hackery if modal and invoked with util.window
-        var key = location.pathname + location.search + location.hash;
-        if (!docid
-            && typeof g.data.modal_xulG_stack != 'undefined'
-            && typeof g.data.modal_xulG_stack[key] != 'undefined'
-        ) {
-            var xulG = g.data.modal_xulG_stack[key][
-                g.data.modal_xulG_stack[key].length - 1 ];
-            if (typeof xulG == 'object') {
-                docid = xulG.docid;
-            }
-        }
-
         JSAN.use('util.network'); g.network = new util.network();
         JSAN.use('util.date');
 
index 48aeb39..d289be8 100644 (file)
@@ -25,13 +25,13 @@ function my_init() {
             $('non_unified_buttons').hidden = true;
         }
 
-        g.docid = xul_param('docid',{'modal_xulG':true});
-        g.handle_update = xul_param('handle_update',{'modal_xulG':true});
+        g.docid = xul_param('docid');
+        g.handle_update = xul_param('handle_update');
 
         /******************************************************************************************************/
         /* Get the copy ids from various sources and flesh them */
 
-        var copy_ids = xul_param('copy_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copy_ids','clear_xpcom':true,'modal_xulG':true});
+        var copy_ids = xul_param('copy_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copy_ids','clear_xpcom':true});
         if (!copy_ids) copy_ids = [];
 
         if (copy_ids.length > 0) g.copies = g.network.simple_request(
@@ -43,13 +43,13 @@ function my_init() {
         /* And other fleshed copies if any */
 
         if (!g.copies) g.copies = [];
-        var c = xul_param('copies',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copies','clear_xpcom':true,'modal_xulG':true})
+        var c = xul_param('copies',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copies','clear_xpcom':true})
         if (c) g.copies = g.copies.concat(c);
 
         /******************************************************************************************************/
         /* We try to retrieve callnumbers for existing copies, but for new copies, we rely on this */
 
-        g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true,'modal_xulG':true});
+        g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true});
 
         /******************************************************************************************************/
         /* Get preference (if it exists) for copy location label order */
@@ -71,7 +71,7 @@ function my_init() {
         /******************************************************************************************************/
         /* Is the interface an editor or a viewer, single or multi copy, existing copies or new copies? */
 
-        if (xul_param('edit',{'modal_xulG':true}) == '1') { 
+        if (xul_param('edit') == '1') { 
 
             g.edit = false;
 
@@ -1465,7 +1465,6 @@ g.stash_and_close = function() {
         //g.data.temp_copies = js2JSON( g.copies );
         //g.data.stash('temp_copies');
         xulG.copies = g.copies;
-        update_modal_xulG(xulG);
         JSAN.use('util.widgets');
         util.widgets.dispatch('close',window);
     } catch(E) {
index fb633a7..a71f436 100644 (file)
@@ -53,7 +53,7 @@
 
                 g.error.sdump('D_TRACE','my_init() for copy_notes.xul');
 
-                g.copy_id = xul_param('copy_id',{'modal_xulG':true});
+                g.copy_id = xul_param('copy_id');
 
                 refresh();
 
index 7ad8343..90b42e8 100644 (file)
@@ -47,16 +47,6 @@ vim:noet:sw=4:ts=4:
                 var docid = xul_param('docid');
                 var noprint = xul_param('noprint');
 
-                JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
-                var key = location.pathname + location.search + location.hash;
-                if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
-                    var modal_xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
-                    if (typeof modal_xulG == 'object') {
-                        docid = modal_xulG.docid;
-                        if (modal_xulG.noprint) noprint = modal_xulG.noprint;
-                    }
-                }
-
                 JSAN.use('util.network'); g.network = new util.network();
 
                 if (docid > -1) {
index d2160db..72264b7 100644 (file)
@@ -46,7 +46,6 @@
                 g.record_ids = xul_param(
                     'record_ids',{
                         'concat' : true,
-                        'modal_xulG' : true,
                         'JSON2js_if_cgi' : true,
                         'JSON2js_if_xpcom' : true,
                         'stash_name':'rb_temp_record_ids',
index d520479..48d8d55 100644 (file)
@@ -20,7 +20,7 @@ function my_init() {
 
         JSAN.use('cat.util');
 
-        g.volumes = xul_param('volumes',{'stash_name':'volumes_temp','clear_xpcom':true,'modal_xulG':true}); //JSON2js( g.data.volumes_temp );
+        g.volumes = xul_param('volumes',{'stash_name':'volumes_temp','clear_xpcom':true}); //JSON2js( g.data.volumes_temp );
         //g.data.volumes_temp = ''; g.data.stash('volumes_temp');
 
         var rows = document.getElementById('rows');
@@ -123,7 +123,6 @@ g.stash_and_close = function() {
         xulG.volumes = g.volumes;
         xulG.update_these_volumes = 1;
         xulG.auto_merge = document.getElementById('auto_merge').checked;
-        update_modal_xulG(xulG);
         window.close();
     } catch(E) {
         alert('FIXME: volume editor -> ' + E);
index 46d306b..a139a99 100644 (file)
@@ -34,7 +34,7 @@ function backdate_post_checkin_init() {
         $('checkin_effective_datepicker').value = util.date.formatted_date(new Date(),'%F');
 
         var x = $('circ_brief_area');
-        var circ_ids = xul_param('circ_ids',{'modal_xulG':true});
+        var circ_ids = xul_param('circ_ids');
         if (x) {
             var d = document.createElement('description');
             var t = document.createTextNode( $('circStrings').getFormattedString('staff.circ.backdate.circ_ids.prompt',[circ_ids.length,circ_ids.join(',')]) ); 
@@ -111,13 +111,9 @@ function gen_handle_apply(circ_ids) {
                             sound.circ_good();
                         }
 
-                        update_modal_xulG(
-                            {
-                                'backdate' : backdate,
-                                'bad_circs' : bad_circs,
-                                'complete' : 1
-                            }
-                        )
+                        xulG['backdate'] = backdate;
+                        xulG['bad_circs'] = bad_circs;
+                        xulG['complete'] = 1;
                         window.close();
                     }
                 }
index e39bfde..9a98fb8 100644 (file)
@@ -48,7 +48,7 @@
                 JSAN.use('util.error'); g.error = new util.error();
                 g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
 
-                g.copy_id = xul_param('copy_id',{'modal_xulG':true});
+                g.copy_id = xul_param('copy_id');
 
                 JSAN.use('util.network'); g.network = new util.network();
                 JSAN.use('util.date');
                 //g.data.fancy_prompt_data = js2JSON( [ g.circs[0].usr() ] );
                 //g.data.stash('fancy_prompt_data');
                 xulG.retrieve_these_patrons = [ g.circs[0].usr() ];
-                update_modal_xulG(xulG);
                 window.close();
             } catch(E) {
                 g.error.standard_unexpected_error_alert('retrieve_last',E);
                 //g.data.fancy_prompt_data = js2JSON(patrons);
                 //g.data.stash('fancy_prompt_data');
                 xulG.retrieve_these_patrons = patrons;
-                update_modal_xulG(xulG);
                 window.close();
             } catch(E) {
                 g.error.standard_unexpected_error_alert('retrieve_all',E);
index 5462794..aefcac9 100644 (file)
@@ -48,7 +48,7 @@
                 JSAN.use('util.error'); g.error = new util.error();
                 g.error.sdump('D_TRACE','my_init() for circ_copy_details.xul');
 
-                g.copy_id = xul_param('copy_id',{'modal_xulG':true});
+                g.copy_id = xul_param('copy_id');
 
                 JSAN.use('util.network'); g.network = new util.network();
                 JSAN.use('util.date');
                 //g.data.fancy_prompt_data = js2JSON( [ g.circ.usr() ] );
                 //g.data.stash('fancy_prompt_data');
                 xulG.retrieve_these_patrons = [ g.circ.usr() ];
-                update_modal_xulG(xulG);
                 window.close();
             } catch(E) {
                 alert(E);
                 //g.data.fancy_prompt_data = js2JSON( [ g.hold.usr() ] );
                 //g.data.stash('fancy_prompt_data');
                 xulG.retrieve_these_patrons = [ g.hold.usr() ];
-                update_modal_xulG(xulG);
                 window.close();
             } catch(E) {
                 alert(E);
index 5dae0ac..e311333 100644 (file)
 
                 $('server').value = g.data.server_unadorned;
 
-                addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true}))
+                addCSSClass(document.documentElement,xul_param('login_type'))
 
-                if (xul_param('desc_brief',{'modal_xulG':true})) {
+                if (xul_param('desc_brief')) {
                     $('desc').hidden = false;
-                    $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) );
+                    $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief') ) );
                 }
-                if (xul_param('desc_full',{'modal_xulG':true})) {
+                if (xul_param('desc_full')) {
                     $('desc').hidden = false;
-                    $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) );
+                    $('desc_full').appendChild( document.createTextNode( xul_param('desc_full') ) );
                 }
 
                 $('username').focus();
@@ -96,7 +96,7 @@
                         'password_prompt' : $('password'),
                         'server_prompt' : $('server'),
                     },
-                    xul_param('login_type',{'modal_xulG':true}) || 'temp'
+                    xul_param('login_type') || 'temp'
                 );
                 g.session.on_init = function() { 
                     try {
                             'usr' : js2JSON(staff)
                         }
                         g.data.stash('temporary_session');
-                        var my_xulG = { // new way, to minimize the use of global spaces
-                            'temporary_session' : g.data.temporary_session
-                        };
-                        update_modal_xulG(my_xulG);
+                        xulG.temporary_session = g.data.temporary_session;
                         window.close();
                     } catch(E) {
                         g.error.standard_unexpected_error_alert('simple_auth.session.on_init',E);
index 11297bb..3633745 100644 (file)
             try {
                 patron = g.network.simple_request(
                     'FM_AU_FLESHED_RETRIEVE_VIA_ID',
-                    [ses(), xul_param('patron_id', {'modal_xulG': true})]
+                    [ses(), xul_param('patron_id')]
                 );
             } catch (e) {
                 alert ("Patron retrieval failed");
index b355845..1dc3147 100644 (file)
@@ -76,8 +76,8 @@ function retrieve_circ() {
 function retrieve_patron() {
     JSAN.use('patron.util'); 
 
-    g.patron_id = xul_param('patron_id',{'modal_xulG':true});
-    g.au_obj = xul_param('patron',{'modal_xulG':true});
+    g.patron_id = xul_param('patron_id');
+    g.au_obj = xul_param('patron');
 
     if (! g.au_obj) {
         g.au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.patron_id );
@@ -105,7 +105,7 @@ function patron_bill_init() {
         JSAN.use('util.money');
         JSAN.use('util.widgets');
         JSAN.use('util.functional');
-        var override_default_billing_type = xul_param('override_default_billing_type',{'modal_xulG':true});
+        var override_default_billing_type = xul_param('override_default_billing_type');
         var billing_list = util.functional.filter_list( g.OpenILS.data.list.cbt, function (x) { return x.id() >= 100 || x.id() == override_default_billing_type } );
         var ml = util.widgets.make_menulist(
             util.functional.map_list(
@@ -133,15 +133,15 @@ function patron_bill_init() {
         if ( g.OpenILS.data.hash.cbt[ ml.value ] ) {
             $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price();
         }
-        var override_default_price = xul_param('override_default_price',{'modal_xulG':true});
+        var override_default_price = xul_param('override_default_price');
         if (override_default_price) {
             $('bill_amount').value = override_default_price;
         }
         $('bill_amount').select(); $('bill_amount').focus();
 
-        g.circ = xul_param('circ',{'modal_xulG':true});
-        if (xul_param('xact_id',{'modal_xulG':true})) { 
-            g.mbts_id = xul_param('xact_id',{'modal_xulG':true});
+        g.circ = xul_param('circ');
+        if (xul_param('xact_id')) { 
+            g.mbts_id = xul_param('xact_id');
             $('summary').hidden = false; 
             retrieve_mbts();
             retrieve_circ();
@@ -157,19 +157,15 @@ function patron_bill_init() {
 
 function patron_bill_finish() {
     try {
-        var do_not_process_bill = xul_param('do_not_process_bill',{'modal_xulG':true});
-        var xact_id = xul_param('xact_id',{'modal_xulG':true});
+        var do_not_process_bill = xul_param('do_not_process_bill');
+        var xact_id = xul_param('xact_id');
 
         if (do_not_process_bill) {
 
-            update_modal_xulG(
-                {
-                    'proceed' : true,
-                    'cbt_id' : $('billing_type').value,
-                    'amount' : $('bill_amount').value,
-                    'note' : $('bill_note').value
-                }
-            );
+            xulG.proceed = true;
+            xulG.cbt_id = $('billing_type').value;
+            xulG.amount = $('bill_amount').value;
+            xulG.note = $('bill_note').value;
 
         } else {
 
@@ -202,12 +198,8 @@ function patron_bill_finish() {
                 if (typeof mb_id.ilsevent != 'undefined') throw(mb_id);
                 //alert($('patronStrings').getString('staff.patron.bill_wizard.patron_bill_finish.billing_added'));
 
-                update_modal_xulG(
-                    {
-                        mb_id : mb_id,
-                        xact_id : xact_id
-                    }
-                );
+                xulG.mb_id = mb_id;
+                xulG.xact_id = xact_id;
 
             } else {
                 throw(xact_id);
index 8aad033..b2d60fd 100644 (file)
@@ -30,16 +30,16 @@ function edit_penalty_init() {
         }
 
         /* set widget values */
-        document.getElementById('note_tb').value = xul_param('note',{'modal_xulG':true});
-        document.getElementById('csp_menupopup').setAttribute('value',xul_param('id',{'modal_xulG':true}));
-        if (xul_param('id',{'modal_xulG':true})==21) { // SILENT_NOTE
+        document.getElementById('note_tb').value = xul_param('note');
+        document.getElementById('csp_menupopup').setAttribute('value',xul_param('id'));
+        if (xul_param('id')==21) { // SILENT_NOTE
             document.getElementById('note_btn').checked = true;
-        } else if (xul_param('id',{'modal_xulG':true})==20) { // ALERT_NOTE
+        } else if (xul_param('id')==20) { // ALERT_NOTE
             document.getElementById('alert_btn').checked = true;
-        } else if (xul_param('id',{'modal_xulG':true})==25) { // STAFF_CHR
+        } else if (xul_param('id')==25) { // STAFF_CHR
             document.getElementById('block_btn').checked = true;
         } else {
-            var nl = document.getElementById('csp_menupopup').getElementsByAttribute('value',xul_param('id',{'modal_xulG':true}));
+            var nl = document.getElementById('csp_menupopup').getElementsByAttribute('value',xul_param('id'));
             if (nl.length > 0) {
                 document.getElementById('csp_menulist').setAttribute('label', nl[0].getAttribute('label'));
             } else {
@@ -97,13 +97,9 @@ function edit_penalty_init() {
                         note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F'), ses('ws_ou_shortname')]);
                     }
                 }
-                update_modal_xulG(
-                    {
-                        'id' : document.getElementById('csp_menupopup').getAttribute('value'),
-                        'note' : note,
-                        'modify' : 1
-                    }
-                )
+                xulG.id = document.getElementById('csp_menupopup').getAttribute('value');
+                xulG.note = note;
+                xulG.modify = 1;
                 window.close();
             }, 
             false
index 9bef546..4adbcc1 100644 (file)
@@ -32,13 +32,9 @@ function hold_cancel_init() {
             'command', 
             function() {
                 var note = document.getElementById('note_tb').value;
-                update_modal_xulG(
-                    {
-                        'cancel_reason' : document.getElementById('ahrcc_menupopup').getAttribute('value'),
-                        'note' : note,
-                        'proceed' : 1
-                    }
-                )
+                xulG.cancel_reason = document.getElementById('ahrcc_menupopup').getAttribute('value');
+                xulG.note = note;
+                xulG.proceed = 1;
                 window.close();
             }, 
             false
index fd9d064..ddfd645 100644 (file)
@@ -79,13 +79,9 @@ function new_penalty_init() {
                         note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F'), ses('ws_ou_shortname')]);
                     }
                 }
-                update_modal_xulG(
-                    {
-                        'id' : document.getElementById('csp_menupopup').getAttribute('value'),
-                        'note' : note,
-                        'modify' : 1
-                    }
-                )
+                xulG.id = document.getElementById('csp_menupopup').getAttribute('value');
+                xulG.note = note;
+                xulG.modify = 1;
                 window.close();
             }, 
             false
index 91f84ae..6da04b0 100644 (file)
@@ -27,10 +27,10 @@ serial.editor_base = {
             /******************************************************************************************************/
             /* base vars */
 
-            obj.docid = xul_param('docid',{'modal_xulG':true});
+            obj.docid = xul_param('docid');
             
             if (typeof params.handle_update == 'undefined') {
-                obj.handle_update = xul_param('handle_update',{'modal_xulG':true});
+                obj.handle_update = xul_param('handle_update');
             } else {
                 obj.handle_update = params.handle_update;
             }
@@ -54,7 +54,7 @@ serial.editor_base = {
             /* Get the fm_type ids from various sources and flesh them */
 
             var fm_type_ids = params[fm_type + '_ids'];
-            if (!fm_type_ids) fm_type_ids = xul_param(fm_type + '_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type + '_ids','clear_xpcom':true,'modal_xulG':true});
+            if (!fm_type_ids) fm_type_ids = xul_param(fm_type + '_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type + '_ids','clear_xpcom':true});
             if (!fm_type_ids) fm_type_ids = [];
 
             obj[fm_type_plural] = [];
@@ -70,7 +70,7 @@ serial.editor_base = {
 
             if (!obj[fm_type_plural]) obj[fm_type_plural] = [];
             var fms = params[fm_type_plural];
-            if (!fms) fms = xul_param(fm_type_plural,{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type_plural,'clear_xpcom':true,'modal_xulG':true})
+            if (!fms) fms = xul_param(fm_type_plural,{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type_plural,'clear_xpcom':true})
             if (fms) obj[fm_type_plural] = obj[fm_type_plural].concat(fms);
 
 
@@ -90,7 +90,7 @@ serial.editor_base = {
 
             var do_edit;
             if (typeof params.do_edit == 'undefined') {
-                do_edit = xul_param('do_edit',{'modal_xulG':true});
+                do_edit = xul_param('do_edit');
             } else {
                 do_edit = params.do_edit;
             }
@@ -185,7 +185,7 @@ serial.editor_base = {
             /* Show the Record Details? (only for 'in_modal' mode)*/
 
             var bdb;
-            if (xul_param('in_modal',{'modal_xulG':true}) && obj.docid) {
+            if (xul_param('in_modal') && obj.docid) {
                 bdb = document.getElementById('brief_display_box'); while(bdb.firstChild) bdb.removeChild(bdb.lastChild);
                 var brief_display = document.createElement('iframe'); bdb.appendChild(brief_display); 
                 brief_display.setAttribute( 'src', urls.XUL_BIB_BRIEF + '?docid=' + obj.docid); // this is a modal window, so can't push in xulG
@@ -580,18 +580,17 @@ serial.editor_base = {
                 } catch(E) {
                     alert($('serialStrings').getString('staff.serial.editor_base.handle_update.error') + ' ' + js2JSON(E));
                 }
-            } else if (xul_param('in_modal',{'modal_xulG':true})) {
+            } else if (xul_param('in_modal')) {
                 // TODO: this is to perhaps allow this editor to be called
                 // in a modal window, but is unfinished functionality
                 var xulG = {};
                 xulG[fm_type_plural] = obj[fm_type_plural];
-                update_modal_xulG(xulG);
             } else {
                 obj.data['temp_' + fm_type_plural] = js2JSON( obj[fm_type_plural] );
                 obj.data.stash('temp_' + fm_type_plural);
             }
 
-            if (xul_param('in_modal',{'modal_xulG':true})) {
+            if (xul_param('in_modal')) {
                 window.close();
             }
         } catch(E) {
index ede54b9..4e2d960 100644 (file)
 
                                g.error.sdump('D_TRACE','my_init() for notes.xul');
 
-                               g.object_type = xul_param('object_type',{'modal_xulG':true});
-                               g.object_id = xul_param('object_id',{'modal_xulG':true});
-                               g.function_type = xul_param('function_type',{'modal_xulG':true});
-                               g.constructor = xul_param('constructor',{'modal_xulG':true});
+                               g.object_type = xul_param('object_type');
+                               g.object_id = xul_param('object_id');
+                               g.function_type = xul_param('function_type');
+                               g.constructor = xul_param('constructor');
 
                                var window_title = xul_param('title',{'modal_xulG':true});
                                if (window_title) {
index c6f24f3..4026ae5 100644 (file)
@@ -47,7 +47,7 @@
                 var file; var list_data; var ml;
 
                 file = new util.file('offline_ou_list');
-                var server_unadorned = xul_param('server_unadorned',{'modal_xulG':true});
+                var server_unadorned = xul_param('server_unadorned');
                 if (file._file.exists()) {
                     list_data = file.get_object(); file.close();
                     ml = util.widgets.make_menulist( list_data[0], list_data[1] );
@@ -76,7 +76,7 @@
         }
 
         g.select_aou = function() {
-            update_modal_xulG({'create_mfhd_aou' : $('lib_menu').value});
+            xulG.create_mfhd_aou = $('lib_menu').value;
             window.close();
         }
 
index ad513c9..3d0cbdc 100644 (file)
@@ -45,7 +45,7 @@
 
                 var ml;
                                JSAN.use('util.network'); g.network = new util.network();
-                var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true});
+                var sdist_ids = xul_param('sdist_ids');
                 //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only)
                 var robj = g.network.request(
                     'open-ils.serial',
@@ -65,7 +65,7 @@
         g.select_unit = function() {
             var selection = JSON2js($('unit_menu').value);
             selection.label = $('unit_menu').selectedItem.label;
-            update_modal_xulG({'sunit_selection' : selection});
+            xulG.sunit_selection = selection;
             window.close();
         }