[open-ils-commits] r18327 - in branches/rel_2_0/Open-ILS: web/opac/locale/en-US xul/staff_client/server/cat (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 14 11:31:39 EDT 2010


Author: phasefx
Date: 2010-10-14 11:31:37 -0400 (Thu, 14 Oct 2010)
New Revision: 18327

Modified:
   branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.xul
Log:
change the Swap Editor button to a persisted checkbox

Modified: branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-10-14 15:29:29 UTC (rev 18326)
+++ branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-10-14 15:31:37 UTC (rev 18327)
@@ -2569,7 +2569,8 @@
 <!ENTITY staff.cat.marcedit.validate.accesskey "V">
 <!ENTITY staff.cat.marcedit.save-button.accesskey "d">
 <!ENTITY staff.cat.marcedit.help.label "Help">
-<!ENTITY staff.cat.marcedit.swapEditor.label "Swap Editor Type">
+<!ENTITY staff.cat.marcedit.flatTextEditor.label "Flat-Text Editor">
+<!ENTITY staff.cat.marcedit.flatTextEditor.accesskey "">
 <!ENTITY staff.cat.marcedit.help.accesskey "H">
 <!ENTITY staff.cat.marcedit.caption.label "MARC Record">
 <!ENTITY staff.cat.marcedit.toggleFFE.label "Fixed Fields -- Record type: ">

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-10-14 15:29:29 UTC (rev 18326)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.js	2010-10-14 15:31:37 UTC (rev 18327)
@@ -91,15 +91,22 @@
     }
 }
 
-function swap_editors () {
+function set_flat_editor (useFlatText) {
 
     dojo.require('MARC.Record');
 
     var xe = $('xul-editor');
     var te = $('text-editor');
 
-    te.hidden = te.hidden ? false : true;
-    xe.hidden = xe.hidden ? false : true;
+    if (useFlatText) {
+        if (xe.hidden) { return; }
+        te.hidden = false;
+        xe.hidden = true;
+    } else {
+        if (te.hidden) { return; }
+        te.hidden = true;
+        xe.hidden = false;
+    }
 
     if (te.hidden) {
         // get the marcxml from the text box
@@ -168,7 +175,7 @@
 
         document.getElementById('save-button').setAttribute('label', window.xulG.save.label);
         document.getElementById('save-button').setAttribute('oncommand',
-            'if ($("xul-editor").hidden) swap_editors(); ' +
+            'if ($("xul-editor").hidden) set_flat_editor(false); ' +
             'mangle_005(); ' + 
             'var xml_string = xml_escape_unicode( xml_record.toXMLString() ); ' + 
             'save_attempt( xml_string ); ' +

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.xul	2010-10-14 15:29:29 UTC (rev 18326)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/cat/marcedit.xul	2010-10-14 15:31:37 UTC (rev 18327)
@@ -24,6 +24,7 @@
     <caption label="&staff.cat.marcedit.options.label;"/>
     <hbox flex="1">
         <checkbox oils_persist="checked" accesskey="&staff.cat.marcedit.stackSubfields.accesskey;" label="&staff.cat.marcedit.stackSubfields.label;" oncommand="stackSubfields(this);" checked="false" id="stackSubfields"/>
+        <checkbox oils_persist="checked" accesskey="&staff.cat.marcedit.flatTextEditor.accesskey;" label="&staff.cat.marcedit.flatTextEditor.label;" oncommand="set_flat_editor(this.checked);" checked="false" id="swapEditor_checkbox"/>
         <checkbox oils_persist="checked" accesskey="&staff.cat.marcedit.fastItemAdd.accesskey;" label="&staff.cat.marcedit.fastItemAdd.label;" oncommand="fastItemAdd_toggle(this);" checked="false" id="fastItemAdd_checkbox"/>
         <hbox id="fastItemAdd_textboxes">
             <label control="fastItemAdd_callnumber" accesskey="&staff.cat.marcedit.fastItemAdd_callnumber.accesskey;" value="&staff.cat.marcedit.fastItemAdd_callnumber.label;" />
@@ -33,7 +34,6 @@
         </hbox>
         <button label="&staff.cat.marcedit.validate.label;" accesskey="&staff.cat.marcedit.validate.accesskey;" oncommand="validateAuthority(this);"/>
         <button id="save-button" accesskey="&staff.cat.marcedit.save-button.accesskey;"/>
-        <button label="&staff.cat.marcedit.swapEditor.label;" oncommand="swap_editors()"/>
         <button label="&staff.cat.marcedit.help.label;" accesskey="&staff.cat.marcedit.help.accesskey;"
             oncommand="alert(
                 $('catStrings').getString('staff.cat.marcedit.help.add_row') + '\n' +



More information about the open-ils-commits mailing list