iframe tweaks for xulrunner 1.9. hold_notices.xul is all kinds of broken, though
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Nov 2008 02:53:11 +0000 (02:53 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Nov 2008 02:53:11 +0000 (02:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11233 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/cat/copy_editor.xul
Open-ILS/xul/staff_client/server/cat/copy_summary.xul
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
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/patron/bill_details.xul
Open-ILS/xul/staff_client/server/patron/hold_notices.xul
Open-ILS/xul/staff_client/server/patron/info.xul

index c9b38d4..8b1bbcf 100644 (file)
@@ -139,13 +139,11 @@ function my_init() {
                /******************************************************************************************************/
                /* Show the Record Details? */
 
+        var bdb = document.getElementById('brief_display_box'); while(bdb.firstChild) bdb.removeChild(bdb.lastChild);
                if (g.docid) {
-                       document.getElementById('brief_display').setAttribute(
-                               'src',
-                               urls.XUL_BIB_BRIEF + '?docid=' + g.docid
-                       );
-               } else {
-                       document.getElementById('brief_display').setAttribute('hidden','true');
+            var brief_display = document.createElement('iframe'); bdb.appendChild(brief_display); 
+                       brief_display.setAttribute( 'src', urls.XUL_BIB_BRIEF + '?docid=' + g.docid); // this is a modal window, so can't push in xulG
+                       brief_display.setAttribute( 'flex','1' );
                }
 
                /******************************************************************************************************/
index 367117a..097182f 100644 (file)
@@ -37,9 +37,9 @@
        <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
        <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
 
-       <iframe id="brief_display"/>
+    <vbox id="brief_display_box"/>
 
-       <groupbox flex="1" style="overflow: auto">
+       <groupbox flex="1" class="my_overflow">
                <caption id="caption" label="&staff.cat.copy_editor.groupbox1.label;"/>
 
                <hbox id="top_nav">
index 344e4aa..e734d8a 100644 (file)
@@ -50,7 +50,7 @@
                                JSAN.use('util.error'); g.error = new util.error();
                                g.error.sdump('D_TRACE','my_init() for cat_copy_summary.xul');
 
-                               var copy_id = xul_param('copy_id');
+                               var copy_id = xul_param('copy_id'); 
 
                                JSAN.use('util.network'); g.network = new util.network();
                                JSAN.use('util.date'); JSAN.use('util.widgets');
index 52d8810..c7b2496 100644 (file)
@@ -23,8 +23,11 @@ function my_init() {
                /* What record am I dealing with?  Am I adding just copies or copies and volumes? */
 
                g.doc_id = xul_param('doc_id');
-               document.getElementById('summary').setAttribute('src',urls.XUL_BIB_BRIEF); // + '?docid=' + window.escape(g.doc_id));
-               get_contentWindow(document.getElementById('summary')).xulG = { 'docid' : g.doc_id };
+        var sb = document.getElementById('summary_box'); while(sb.firstChild) sb.removeChild(sb.lastChild);
+        var summary = document.createElement('iframe'); sb.appendChild(summary);
+               summary.setAttribute('src',urls.XUL_BIB_BRIEF);
+               summary.setAttribute('flex','1');
+               get_contentWindow(summary).xulG = { 'docid' : g.doc_id };
 
                g.copy_shortcut = xul_param('copy_shortcut',{'JSON2js_if_cgi':true});
                g.error.sdump('D_ERROR','location.href = ' + location.href + '\n\ncopy_short cut = ' + g.copy_shortcut + '\n\nou_ids = ' + xul_param('ou_ids'));
index 8d267e9..1773c9a 100644 (file)
@@ -38,8 +38,8 @@
        <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
        <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
 
-       <iframe id="summary" />
-       <groupbox flex="1" style="overflow: auto">
+    <vbox id="summary_box"/>
+       <groupbox flex="1" class="my_overflow">
                <caption id="caption" label="&staff.cat.volume_copy_creator.label;"/>
                <hbox style="border-bottom: solid black thin">
                        <hbox id="marc_cn"/>
index 0838dbf..05b525a 100644 (file)
                                g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ g.copy.call_number() ]);
                                if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
 
-                               $('top').setAttribute('src',urls.XUL_BIB_BRIEF);// + '?docid=' + g.callnumber.record());
-                               get_contentWindow($('top')).xulG = { 'docid' : g.callnumber.record() };
-                               $('mid').setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + g.copy.id());
-                               get_contentWindow($('mid')).xulG = { 'copy_id' : g.copy.id() };
+                var tv = $('top_vbox'); while(tv.firstChild) tv.removeChild(tv.lastChild);
+                var top = document.createElement('iframe'); tv.appendChild(top);
+                               top.setAttribute('src',urls.XUL_BIB_BRIEF);
+                top.setAttribute('flex','1');
+                               get_contentWindow(top).xulG = { 'docid' : g.callnumber.record() };
+                var mv = $('mid_vbox'); while(mv.firstChild) mv.removeChild(mv.lastChild);
+                var mid = document.createElement('iframe'); mv.appendChild(mid);
+                               mid.setAttribute('src',urls.XUL_COPY_SUMMARY);
+                mid.setAttribute('flex','1');
+                               get_contentWindow(mid).xulG = { 'copy_id' : g.copy.id() };
 
                                show_circs();
 
        ]]>
        </script>
 
-       <vbox flex="1" style="overflow: auto;">
-               <iframe id="top" style="overflow: auto;"/>
+       <vbox flex="1" class="my_overflow">
+        <vbox id="top_vbox" flex="1" class="my_overflow"/>
                <splitter><grippy/></splitter>
-               <iframe id="mid" style="overflow: auto;"/>
+        <vbox id="mid_vbox" flex="1" class="my_overflow"/>
                <splitter><grippy/></splitter>
-               <groupbox flex="1" id="circs" style="overflow: auto;">
+               <groupbox flex="1" id="circs" class="my_overflow">
                        <caption label="&staff.circ.circ_summary.caption;"/>
                </groupbox>
                <hbox>
index 3122a5c..4788433 100644 (file)
                                //g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ g.copy.call_number() ]);
                                //if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
 
-                               $('top').setAttribute('src',urls.XUL_BIB_BRIEF); // + '?docid=' + g.callnumber.record());
-                               get_contentWindow($('top')).xulG = { 'docid' : g.callnumber.record() };
+                var tb = $('top_box'); while (tb.firstChild) tb.removeChild(tb.lastChild);
+                var top = document.createElement('iframe'); tb.appendChild(top);
+                               top.setAttribute('src',urls.XUL_BIB_BRIEF);
+                               top.setAttribute('flex','1');
+                               get_contentWindow(top).xulG = { 'docid' : g.callnumber.record() };
                                //g.data.temp_copy = g.copy; g.data.stash('temp_copy'); 
                                //g.data.temp_callnumber = g.callnumber; g.data.stash('temp_callnumber'); 
-                               $('item_summary').setAttribute('src',urls.XUL_COPY_SUMMARY);
-                               get_contentWindow($('item_summary')).xulG = { 'copy' : g.copy, 'callnumber' : g.callnumber };
+                var ib = $('item_summary_box'); while(ib.firstChild) ib.removeChild(ib.lastChild);
+                var item_summary = document.createElement('iframe'); ib.appendChild(item_summary);
+                               item_summary.setAttribute('src',urls.XUL_COPY_SUMMARY);
+                               item_summary.setAttribute('flex','1');
+                               get_contentWindow(item_summary).xulG = { 'copy' : g.copy, 'callnumber' : g.callnumber };
 
                                $('r_last').disabled = true;
                                if (g.circ) {
                                        $('r_last').disabled = false;
                                        g.data.temp_circ = g.circ; g.data.stash('temp_circ');
-                                       $('circ').setAttribute('src',urls.XUL_CIRC_BRIEF); // + '?no_border=1');
-                                       get_contentWindow($('circ')).xulG = { 'no_border' : 1 };
+                    var cb = $('circ_box'); while(cb.firstChild) cb.removeChild(cb.lastChild);
+                    var circ_frame = document.createElement('iframe'); cb.appendChild(circ_frame);
+                                       circ_frame.setAttribute('src',urls.XUL_CIRC_BRIEF);
+                                   circ_frame.setAttribute('flex','1');
+                                       get_contentWindow(circ_frame).xulG = { 'no_border' : 1 };
                                        if (g.circ.checkin_time()) {
                                                $('circ_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.last_circ'));
                                        } else {
        <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
 
        <vbox flex="1" style="overflow: auto;">
-               <vbox style="border: none; overflow: none; min-height: 80;">
-                       <iframe flex="1" id="top" style="overflow: none; min-height: 80;"/>
-               </vbox>
+               <vbox id="top_box" flex="1" style="border: none; overflow: none; min-height: 80;"/>
                <splitter><grippy/></splitter>
-               <vbox style="border: none; overflow: none; min-height: 80;">
-                       <iframe flex="1" id="item_summary" style="overflow: none; min-height: 80;"/>
-               </vbox>
+               <vbox id="item_summary_box" flex="1" style="border: none; overflow: none; min-height: 80;"/>
                <splitter><grippy/></splitter>
                <groupbox flex="1" id="holds" style="overflow: none; min-height: 80;">
                        <caption id="hold_caption" label="&staff.circ.copy_details.hold_caption;"/>
                <splitter><grippy/></splitter>
                <groupbox flex="1" id="circs" style="overflow: none; min-height: 80;">
                        <caption id="circ_caption" label="&staff.circ.copy_details.circ_caption;" style="font-weight: bold"/>
-                       <iframe id="circ" style="min-height: 80" flex="1"/>
+            <vbox id="circ_box" flex="1" style="min-height: 80"/>
                </groupbox>
        </vbox>
        <hbox>
index 5c75a23..2e98348 100644 (file)
@@ -70,8 +70,8 @@
 
                                                switch(g.mbts.xact_type()) {
                                                        case 'circulation' : retrieve_circ(); break;
-                                                       case 'grocery' : retrieve_grocery(); break;
-                                                       default: break;
+                                                       case 'grocery' : retrieve_grocery(); $('copy_summary_vbox').hidden = true; $('copy_summary_splitter').hidden = true; break;
+                                                       default: $('copy_summary_vbox').hidden = true; $('copy_summary_splitter').hidden = true; break;
                                                }
 
                                        } catch(E) {
                                                $('renewal').value = r || 'No';
 
                                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                                               $('copy_summary').setAttribute('src',urls.XUL_COPY_SUMMARY + '?copy_id=' + r_circ.target_copy());
-                                               //get_contentWindow($('copy_summary')).xulG = { 'copy_id' : r_circ.target_copy() };
-                                               $('copy_summary').hidden=false;
+                        var csb = $('copy_summary_vbox'); while (csb.firstChild) csb.removeChild(csb.lastChild);
+                        var copy_summary = document.createElement('iframe'); csb.appendChild(copy_summary);
+                                               copy_summary.setAttribute('src',urls.XUL_COPY_SUMMARY); // + '?copy_id=' + r_circ.target_copy());
+                                               copy_summary.setAttribute('flex','1');
+                                               get_contentWindow(copy_summary).xulG = { 'copy_id' : r_circ.target_copy() };
 
                                                g.network.simple_request(
                                                        'MODS_SLIM_RECORD_RETRIEVE_VIA_COPY.authoritative',
                                retrieve_patron();
 
                                retrieve_mbts();
-                               //retrieve_circ();
 
                                init_lists();
 
 
                <splitter><grippy/></splitter>
 
-               <iframe id="copy_summary" flex="1" hidden="true"/>
+        <vbox id="copy_summary_vbox" flex="1" />
 
-               <splitter><grippy/></splitter>
+               <splitter id="copy_summary_splitter"><grippy/></splitter>
 
                        <groupbox orient="vertical" flex="2">
                                <caption label="&staff.patron.bill_details.bills.label;" style="color: red"/>
index 6e9f73f..25a6ab9 100644 (file)
 
                                a_list_of_one();
 
-                               document.getElementById('bib_brief').setAttribute('src',urls.XUL_BIB_BRIEF); // + '?docid=' + g.ahr.target());
-                               get_contentWindow(document.getElementById('bib_brief')).xulG = { 'docid' : g.ahr.target() };
+                               var x = document.getElementById('bib_brief_box'); while (x.firstChild) x.removeChild(x.lastChild);
+                var bib_brief = document.createElement('iframe'); x.appendChild(bib_brief);
+                bib_brief.setAttribute('flex',1);
+                bib_brief.setAttribute('src',urls.XUL_BIB_BRIEF); 
+                               get_contentWindow(bib_brief).xulG = { 'docid' : g.ahr.target() };
 
                                refresh();
 
                                /* template */
                                var node = $('notification_template').cloneNode(true); np.appendChild(node); node.hidden = false;
                                util.widgets.apply(node,'name','notify_time',
-                                       function(n){n.setAttribute("tooltiptext", $("patronStrings").getFormattedString('staff.patron.hold_notices.tooltiptext',[g.notifications[i].id(), g.notifications[i].hold(), g.notifications[i].notify_staff()]));
+                                       function(n){
+                        n.setAttribute(
+                            "tooltiptext", 
+                            $("patronStrings").getFormattedString('staff.patron.hold_notices.tooltiptext',[g.notifications[i].id(), g.notifications[i].hold(), g.notifications[i].notify_staff()])
+                        );
+                    }
                                );
                                apply(node,'method',g.notifications[i].method ? g.notifications[i].method() : '');
                                apply(node,'note',g.notifications[i].note() ? g.notifications[i].note() : '');
 
     <vbox id="v1" flex="1" persist="height">
         <label id="patron_name" class="patronNameLarge"/>
-        <iframe id="bib_brief" flex="1"/>
+        <vbox id="bib_brief_box" flex="1"/>
     </vbox>
 
     <splitter><grippy/></splitter>
index 1b74b39..07e2432 100644 (file)
                                g.patron_id = xul_param('patron_id');
 
                                try{
-                                       $('notes_frame').setAttribute('src',urls.XUL_PATRON_INFO_NOTES); 
-                                       get_contentWindow($('notes_frame')).xulG = 
+                    var np = $('notes_panel'); while (np.firstChild) np.deleteChild(np.lastChild);
+                    var notes_frame = document.createElement('iframe'); np.appendChild(notes_frame);
+                                       notes_frame.setAttribute('src',urls.XUL_PATRON_INFO_NOTES); 
+                                       notes_frame.setAttribute('flex','1');
+                                       get_contentWindow(notes_frame).xulG = 
                                                { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
                                }catch(E){alert(E);}
                                try{
-                                       $('stat_cats_frame').setAttribute('src',urls.XUL_PATRON_INFO_STAT_CATS);
-                                       get_contentWindow($('stat_cats_frame')).xulG = 
+                                       var scp = $('stat_cats_panel'); while (scp.firstChild) scp.deleteChild(scp.lastChild);
+                    var stat_cats_frame = document.createElement('iframe'); scp.appendChild(stat_cats_frame);
+                    stat_cats_frame.setAttribute('src',urls.XUL_PATRON_INFO_STAT_CATS);
+                    stat_cats_frame.setAttribute('flex','1');
+                                       get_contentWindow(stat_cats_frame).xulG = 
                                                { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
                                }catch(E){alert(E);}
                                try{
-                                       $('surveys_frame').setAttribute('src',urls.XUL_PATRON_INFO_SURVEYS);
-                                       get_contentWindow($('surveys_frame')).xulG = 
+                    var sp = $('surveys_panel'); while (sp.firstChild) sp.deleteChild(sp.lastChild);
+                    var surveys_frame = document.createElement('iframe'); sp.appendChild(surveys_frame);
+                                       surveys_frame.setAttribute('src',urls.XUL_PATRON_INFO_SURVEYS);
+                                       surveys_frame.setAttribute('flex','1');
+                                       get_contentWindow(surveys_frame).xulG = 
                                                { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
                                }catch(E){alert(E);}
                                try{
-                                       $('group_frame').setAttribute('src',urls.XUL_PATRON_INFO_GROUP);
-                                       get_contentWindow($('group_frame')).xulG = 
+                    var gp = $('group_panel'); while (gp.firstChild) gp.deleteChild(gp.lastChild);
+                    var group_frame = document.createElement('iframe'); gp.appendChild(group_frame);
+                                       group_frame.setAttribute('src',urls.XUL_PATRON_INFO_GROUP);
+                                       group_frame.setAttribute('flex','1');
+                                       get_contentWindow(group_frame).xulG = 
                                                { 'patron_id' : g.patron_id, 'url_prefix' : xulG.url_prefix, 'new_tab' : xulG.new_tab };
                                }catch(E){alert(E);}
 
                                <tab label=" " disabled="true" linkedpanel="notes_panel" flex="1"/>
                        </tabs>
                        <tabpanels flex="1">
-                               <tabpanel id="notes_panel" orient="vertical">
-                                       <iframe id="notes_frame" flex="1"/>
-                               </tabpanel>
-                               <tabpanel id="stat_cats_panel" orient="vertical">
-                                       <iframe id="stat_cats_frame" flex="1"/>
-                               </tabpanel>
-                               <tabpanel id="surveys_panel" orient="vertical">
-                                       <iframe id="surveys_frame" flex="1"/>
-                               </tabpanel>
-                               <tabpanel id="group_panel" orient="vertical">
-                                       <iframe id="group_frame" flex="1"/>
-                               </tabpanel>
+                               <tabpanel id="notes_panel" orient="vertical" />
+                               <tabpanel id="stat_cats_panel" orient="vertical" />
+                               <tabpanel id="surveys_panel" orient="vertical" />
+                               <tabpanel id="group_panel" orient="vertical" />
                        </tabpanels>
                </tabbox>
        </vbox>