Bug 18417: Advanced Editor (Rancor) add shortcuts for copyright symbols (C) (P)
authorJesse Weaver <pianohacker@gmail.com>
Tue, 10 Nov 2015 19:02:06 +0000 (12:02 -0700)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 9 Jan 2018 20:24:05 +0000 (17:24 -0300)
To test:
1 - Apply patch
2 - Open advanced cataloging editor
3 - Try using Alt+P and Alt+C and note symbols are added
4 - Save record and ensure symbols are saved

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js

index 3b8622a..d2cc7b5 100644 (file)
@@ -136,6 +136,14 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ],
     }
 
     var _editorKeys = {
+        'Alt-C': function( cm ) {
+            cm.replaceRange( '©', cm.getCursor() );
+        },
+
+        'Alt-P': function( cm ) {
+            cm.replaceRange( '℗', cm.getCursor() );
+        },
+
         Enter: function( cm ) {
             var cursor = cm.getCursor();
             cm.replaceRange( '\n', { line: cursor.line }, null, 'marcAware' );