backporting "insert before" marc editor fix
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Jan 2007 18:00:33 +0000 (18:00 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Jan 2007 18:00:33 +0000 (18:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6784 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/cat/marcedit.xul

index 518b93e..83c4fda 100644 (file)
@@ -285,14 +285,22 @@ function createMARCTextbox (element,attrs) {
 
                                        var df = <datafield tag="" ind1="" ind2="" xmlns="http://www.loc.gov/MARC21/slim"><subfield code="" /></datafield>;
 
-                                       index.parent().insertChildAfter( index, df );
+                                       if (event.shiftKey) { // ctrl+shift+enter
+                                               index.parent().insertChildBefore( index, df );
+                                       } else {
+                                               index.parent().insertChildAfter( index, df );
+                                       }
 
                                        var new_df = marcDatafield(df);
 
                                        if (row.parentNode.lastChild === row) {
                                                row.parentNode.appendChild( new_df );
                                        } else {
-                                               row.parentNode.insertBefore( new_df, row.nextSibling );
+                                               if (event.shiftKey) { // ctrl+shift+enter
+                                                       row.parentNode.insertBefore( new_df, row );
+                                               } else {
+                                                       row.parentNode.insertBefore( new_df, row.nextSibling );
+                                               }
                                        }
 
                                        new_df.firstChild.focus();
index 7846cb4..923ec60 100644 (file)
@@ -4,6 +4,7 @@
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xhtml="http://www.w3.org/1999/xhtml" onload="my_init()">
 
+<script src="/xul/server/util/sprintf.js" type="application/x-javascript; e4x=1"/>
 <script src="marcedit.js" type="application/x-javascript; e4x=1"/>
 <script src="/opac/common/js/CGI.js" type="application/x-javascript; e4x=1"/>
 
@@ -13,7 +14,7 @@
                <checkbox persist="checked" accesskey='s' label="Stack subfields" onclick="stackSubfields(this);" checked="false" id="stackSubfields"/>
                <button label="Validate" oncommand="validateAuthority(this);"/>
                <button id="save-button"/>
-               <button label="Help" oncommand="alert('Add Row: CTRL+Enter\nAdd Subfield: CTRL+D\nRemove Row: CTRL+Del\nRemove Subfield: SHIFT+Del\nCreate/Replace 006: CTRL+F6\nCreate/Replace 007: CTRL+F7\nCreate/Replace 008: CTRL+F8\n');"/>
+               <button label="Help" oncommand="alert('Add Row: CTRL+Enter\nInsert Row: CTRL+Shift+Enter\nAdd Subfield: CTRL+D\nRemove Row: CTRL+Del\nRemove Subfield: SHIFT+Del\nCreate/Replace 006: CTRL+F6\nCreate/Replace 007: CTRL+F7\nCreate/Replace 008: CTRL+F8\n');"/>
        </hbox>
 </groupbox>