[open-ils-commits] r9358 -
trunk/Open-ILS/xul/staff_client/server/cat
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 14 23:20:24 EDT 2008
Author: dbs
Date: 2008-04-14 22:42:21 -0400 (Mon, 14 Apr 2008)
New Revision: 9358
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
Log:
Move inline calls into my_init(); messagecatalog isn't visible until after onload event
Thanks to phasefx and miker for the assist!
Modified: trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js 2008-04-15 01:37:00 UTC (rev 9357)
+++ trunk/Open-ILS/xul/staff_client/server/cat/marcedit.js 2008-04-15 02:42:21 UTC (rev 9358)
@@ -14,6 +14,10 @@
var xml_record;
+var context_menus;
+var tag_menu;
+var p;
+
function $(id) { return document.getElementById(id); }
function mangle_005() {
@@ -134,6 +138,74 @@
// then fall back to the default locale if preferred locale is not necessary
req.open('GET','/xul/server/locale/' + locale + '/marcedit-tooltips.xml',true);
+ context_menus = createComplexXULElement('popupset');
+ document.documentElement.appendChild( context_menus );
+
+ tag_menu = createPopup({position : 'after_start', id : 'tags_popup'});
+ context_menus.appendChild( tag_menu );
+
+ tag_menu.appendChild(
+ createMenuitem(
+ { label : $('catStrings').getString('staff.cat.marcedit.add_row.label'),
+ oncommand :
+ 'var e = document.createEvent("KeyEvents");' +
+ 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,13,0);' +
+ 'current_focus.inputField.dispatchEvent(e);'
+ }
+ )
+ );
+
+ tag_menu.appendChild(
+ createMenuitem(
+ { label : $('catStrings').getString('staff.cat.marcedit.remove_row.label'),
+ oncommand :
+ 'var e = document.createEvent("KeyEvents");' +
+ 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,46,0);' +
+ 'current_focus.inputField.dispatchEvent(e);'
+ }
+ )
+ );
+
+ tag_menu.appendChild( createComplexXULElement( 'separator' ) );
+
+ tag_menu.appendChild(
+ createMenuitem(
+ { label : $('catStrings').getString('staff.cat.marcedit.replace_006.label'),
+ oncommand :
+ 'var e = document.createEvent("KeyEvents");' +
+ 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,64,0);' +
+ 'current_focus.inputField.dispatchEvent(e);'
+ }
+ )
+ );
+
+ tag_menu.appendChild(
+ createMenuitem(
+ { label : $('catStrings').getString('staff.cat.marcedit.replace_007.label'),
+ oncommand :
+ 'var e = document.createEvent("KeyEvents");' +
+ 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,65,0);' +
+ 'current_focus.inputField.dispatchEvent(e);'
+ }
+ )
+ );
+
+ tag_menu.appendChild(
+ createMenuitem(
+ { label : $('catStrings').getString('staff.cat.marcedit.replace_008.label'),
+ oncommand :
+ 'var e = document.createEvent("KeyEvents");' +
+ 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,66,0);' +
+ 'current_focus.inputField.dispatchEvent(e);'
+ }
+ )
+ );
+
+ tag_menu.appendChild( createComplexXULElement( 'separator' ) );
+
+ p = createComplexXULElement('popupset');
+ document.documentElement.appendChild( p );
+
req.onreadystatechange = function () {
if (req.readyState == 4) {
bib_data = new XML( req.responseText.replace(xmlDeclaration, '') );
@@ -143,6 +215,8 @@
req.send(null);
loadRecord(xml_record);
+
+
} catch(E) {
alert('FIXME, MARC Editor, my_init: ' + E);
}
@@ -1261,73 +1335,7 @@
}
}
-var context_menus = createComplexXULElement('popupset');
-document.documentElement.appendChild( context_menus );
-var tag_menu = createPopup({position : 'after_start', id : 'tags_popup'});
-context_menus.appendChild( tag_menu );
-
-tag_menu.appendChild(
- createMenuitem(
- { label : $('catStrings').getString('staff.cat.marcedit.add_row.label'),
- oncommand :
- 'var e = document.createEvent("KeyEvents");' +
- 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,13,0);' +
- 'current_focus.inputField.dispatchEvent(e);'
- }
- )
-);
-
-tag_menu.appendChild(
- createMenuitem(
- { label : $('catStrings').getString('staff.cat.marcedit.remove_row.label'),
- oncommand :
- 'var e = document.createEvent("KeyEvents");' +
- 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,46,0);' +
- 'current_focus.inputField.dispatchEvent(e);'
- }
- )
-);
-
-tag_menu.appendChild( createComplexXULElement( 'separator' ) );
-
-tag_menu.appendChild(
- createMenuitem(
- { label : $('catStrings').getString('staff.cat.marcedit.replace_006.label'),
- oncommand :
- 'var e = document.createEvent("KeyEvents");' +
- 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,64,0);' +
- 'current_focus.inputField.dispatchEvent(e);'
- }
- )
-);
-
-tag_menu.appendChild(
- createMenuitem(
- { label : $('catStrings').getString('staff.cat.marcedit.replace_007.label'),
- oncommand :
- 'var e = document.createEvent("KeyEvents");' +
- 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,65,0);' +
- 'current_focus.inputField.dispatchEvent(e);'
- }
- )
-);
-
-tag_menu.appendChild(
- createMenuitem(
- { label : $('catStrings').getString('staff.cat.marcedit.replace_008.label'),
- oncommand :
- 'var e = document.createEvent("KeyEvents");' +
- 'e.initKeyEvent("keypress",1,1,null,1,0,0,0,66,0);' +
- 'current_focus.inputField.dispatchEvent(e);'
- }
- )
-);
-
-tag_menu.appendChild( createComplexXULElement( 'separator' ) );
-
-
-
function genToolTips () {
for (var i in bib_data.field) {
var f = bib_data.field[i];
@@ -1408,9 +1416,6 @@
}
}
-var p = createComplexXULElement('popupset');
-document.documentElement.appendChild( p );
-
function getTooltip (target, type) {
var tt = '';
More information about the open-ils-commits
mailing list