if (xulG.unified_interface) {
$('non_unified_buttons').hidden = true;
+ xulG.reset_batch_menus = function() {
+ $('batch_class_menulist').value = false;
+ util.widgets.dispatch('command',$('batch_class_menulist'));
+ $('batch_prefix_menulist').value = false;
+ util.widgets.dispatch('command',$('batch_prefix_menulist'));
+ $('batch_suffix_menulist').value = false;
+ util.widgets.dispatch('command',$('batch_suffix_menulist'));
+ }
+ xulG.apply_template_to_batch = function(id,value) {
+ if (!isNaN(Number(value))) {
+ $(id).value = value;
+ util.widgets.dispatch('command',$(id));
+ }
+ setTimeout(
+ function() {
+ // TODO: Only apply batch to columns that haven't been adjusted manually?
+ util.widgets.dispatch('command',$('batch_button'));
+ },0
+ );
+ }
} else {
$('Create').hidden = true;
}
)
)
); hbox.appendChild(ml);
+ ml.setAttribute('id','batch_class_menulist');
+ ml.addEventListener(
+ 'command',
+ function() {
+ if (!isNaN(Number(ml.value))) {
+ addCSSClass(hbox,'copy_editor_field_changed');
+ if (xulG.unified_interface) {
+ xulG.notify_of_templatable_field_change('batch_class_menulist',ml.value);
+ }
+ } else {
+ removeCSSClass(hbox,'copy_editor_field_changed');
+ }
+ },
+ false
+ );
}
g.list_prefixes = function() {
for (var i = 0; i < g.common_ancestor_ou_ids.length; i++) {
g.render_prefix_menu_items(ml.firstChild,g.common_ancestor_ou_ids[i]);
}
+ ml.setAttribute('id','batch_prefix_menulist');
+ ml.addEventListener(
+ 'command',
+ function() {
+ if (!isNaN(Number(ml.value))) {
+ addCSSClass(hbox,'copy_editor_field_changed');
+ if (xulG.unified_interface) {
+ xulG.notify_of_templatable_field_change('batch_prefix_menulist',ml.value);
+ }
+ } else {
+ removeCSSClass(hbox,'copy_editor_field_changed');
+ }
+ },
+ false
+ );
}
g.list_suffixes = function() {
for (var i = 0; i < g.common_ancestor_ou_ids.length; i++) {
g.render_suffix_menu_items(ml.firstChild,g.common_ancestor_ou_ids[i]);
}
+ ml.setAttribute('id','batch_suffix_menulist');
+ ml.addEventListener(
+ 'command',
+ function() {
+ if (!isNaN(Number(ml.value))) {
+ addCSSClass(hbox,'copy_editor_field_changed');
+ if (xulG.unified_interface) {
+ xulG.notify_of_templatable_field_change('batch_suffix_menulist',ml.value);
+ }
+ } else {
+ removeCSSClass(hbox,'copy_editor_field_changed');
+ }
+ },
+ false
+ );
}
g.render_batch_button = function() {
- var hbox = $('batch_button');
+ var hbox = $('batch_button_box');
var btn = document.createElement('button');
+ btn.setAttribute('id','batch_button');
btn.setAttribute('label',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.label'));
btn.setAttribute('accesskey',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.accesskey'));
btn.setAttribute('image','/xul/server/skin/media/images/down_arrow.gif');
for (var i = 0; i < nl.length; i++) {
/* classification */
if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_classification && !nl[i].disabled) {
- var value = $('batch_class').firstChild.value;
+ var value = $('batch_class_menulist').value;
if (!isNaN( Number(value) )) {
nl[i].value = value;
util.widgets.dispatch('command',nl[i]);
}
/* prefix */
if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_prefix && !nl[i].disabled) {
- var value = $('batch_prefix').firstChild.value;
+ var value = $('batch_prefix_menulist').value;
if (!isNaN( Number(value) )) {
nl[i].value = value;
util.widgets.dispatch('command',nl[i]);
}
/* suffix */
if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_suffix && !nl[i].disabled) {
- var value = $('batch_suffix').firstChild.value;
+ var value = $('batch_suffix_menulist').value;
if (!isNaN( Number(value) )) {
nl[i].value = value;
util.widgets.dispatch('command',nl[i]);