Bugzilla – Attachment 96465 Details for
Bug 21665
Advanced editor - Double clicking on value brings subfield code as well
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21665: Advanced editor - double clicking on value brings subfield code as well
Bug-21665-Advanced-editor---double-clicking-on-val.patch (text/plain), 2.55 KB, created by
Cori Lynn Arnold
on 2019-12-18 21:30:35 UTC
(
hide
)
Description:
Bug 21665: Advanced editor - double clicking on value brings subfield code as well
Filename:
MIME Type:
Creator:
Cori Lynn Arnold
Created:
2019-12-18 21:30:35 UTC
Size:
2.55 KB
patch
obsolete
>From d1f7a30aa1d02a3274793937203924e9d98a0c1d Mon Sep 17 00:00:00 2001 >From: Cori Lynn Arnold <carnold@dgiinc.com> >Date: Wed, 18 Dec 2019 21:19:10 +0000 >Subject: [PATCH] Bug 21665: Advanced editor - double clicking on value brings > subfield code as well > >To test, apply patch: >0/Verify that the advanced editor is enabled by going to >"Administration" and searching for "EnableAdvancedCatalogingEditor" >1/Set it to "Enable" if it isn't already. >2/Go to "Cataloging", click on "Advanced editor" >3/Search for a record by entering "specious" in the keyword box and >hitting enter >4/Click "import" on a record >5/For any subfield (maybe specifically the text in an 020 field) double >click on the text >6/Hit CNTRL-V into your favorite text editor, verify that the subfield >code was not pasted with the text from the subfield. >--- > .../intranet-tmpl/lib/koha/cateditor/marc-editor.js | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >index 5e39a43b75..5c190d2907 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >@@ -86,6 +86,22 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], > editor.overwriteMode = newState; > } > >+ function doubleClickSubfield( cm ) { >+ var field = cm.marceditor.getCurrentField(); >+ if ( !field ) return; >+ >+ var curCursor = cm.getCursor(); >+ var subfield = field.getSubfieldAt( curCursor.ch ); >+ var subfieldText = cm.getRange({line:curCursor.line,ch:subfield.contentsStart},{line:curCursor.line,ch:subfield.end}); >+ var textArea = document.createElement("TEXTAREA"); >+ textArea.value = subfieldText; >+ textArea.style.background = 'transparent'; >+ document.body.appendChild(textArea); >+ textArea.select(); >+ document.execCommand("Copy"); >+ document.body.removeChild(textArea); >+ } >+ > // Editor helper functions > function activateTabPosition( cm, pos, idx ) { > // Allow tabbing to as-yet-nonexistent positions >@@ -625,6 +641,7 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], > this.cm.on( 'changes', editorChanges ); > this.cm.on( 'cursorActivity', editorCursorActivity ); > this.cm.on( 'overwriteToggle', editorSetOverwriteMode ); >+ this.cm.on( 'dblclick', doubleClickSubfield ); > > this.onCursorActivity = options.onCursorActivity; > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21665
:
81165
|
95379
|
96465
|
97761