-// vim:noet:sw=4:ts=4
+// vim:et:sw=4:ts=4
var g = {};
g.map_acn = {};
try {
g.copies = xulG.copies;
g.original_copies = js2JSON( g.copies );
- if (g.copies.length > 0 && g.copies[0].id() < 0) {
- document.getElementById('copy_notes').setAttribute('hidden','true');
- $('save').setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.create_copies'));
- $('save').setAttribute('accesskey', $('catStrings').getString('staff.cat.copy_editor.create_copies.accesskey'));
- }
- if (g.copies.length != 1) {
- document.getElementById('copy_notes').setAttribute('hidden','true');
- }
+ g.show_copy_notes_button();
for (var i = 0; i < g.applied_templates.length; i++) {
g._apply_template( g.applied_templates[i], false);
}
g.changed[ 'volume_copy_creator.'+id ] = { 'type' : 'volume_copy_creator', 'field' : id, 'value' : v };
}
} else {
- if (g.copies.length > 0 && g.copies[0].id() < 0) {
- document.getElementById('copy_notes').setAttribute('hidden','true');
- $('save').setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.create_copies'));
- $('save').setAttribute('accesskey', $('catStrings').getString('staff.cat.copy_editor.create_copies.accesskey'));
- }
- if (g.copies.length != 1) {
- document.getElementById('copy_notes').setAttribute('hidden','true');
- }
+ g.show_copy_notes_button();
}
} catch(E) {
}
/******************************************************************************************************/
+/* Show copy notes button */
+g.show_copy_notes_button = function() {
+ if (g.copies.length > 0 && g.copies[0].id() < 0) {
+ document.getElementById('copy_notes').setAttribute('hidden','true');
+ $('save').setAttribute('label', $('catStrings').getString('staff.cat.copy_editor.create_copies'));
+ $('save').setAttribute('accesskey', $('catStrings').getString('staff.cat.copy_editor.create_copies.accesskey'));
+ }
+ if (g.copies.length != 1) {
+ document.getElementById('copy_notes').setAttribute('hidden','true');
+ }
+}
+
+/******************************************************************************************************/
/* Retrieve Templates */
g.retrieve_templates = function() {