From 6fa5ba75f08bfde30ae273f23ca0414992eb607e Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 14 Oct 2010 15:29:29 +0000 Subject: [PATCH] change the Swap Editor button to a persisted checkbox git-svn-id: svn://svn.open-ils.org/ILS/trunk@18326 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 3 ++- Open-ILS/xul/staff_client/server/cat/marcedit.js | 15 +++++++++++---- Open-ILS/xul/staff_client/server/cat/marcedit.xul | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index ec54c08b32..9ce45a69d5 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2582,7 +2582,8 @@ - + + diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 58dcb78ad4..d6b4cc68fd 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -91,15 +91,22 @@ function wrap_long_fields (node) { } } -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 @@ function my_init() { 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 ); ' + diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.xul b/Open-ILS/xul/staff_client/server/cat/marcedit.xul index 83d8a5e50d..fed7cffa5e 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.xul +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.xul @@ -24,6 +24,7 @@ +