<!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: ">
}
}
-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
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 ); ' +
<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;" />
</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' +