From 93fa391d6a7f0241f3c5fc43e8e7f045d9e40797 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 1 Dec 2020 15:23:31 +0000 Subject: [PATCH] Bug 24709: Advanced editor - show space after delimiter visually This patch updates the JavaScript and CSS for the advanced MARC editor so that a space immediately following a delimiter will be surrounded by an orange dotted border. To test the EnableAdvancedCatalogingEditor system preference should be enabled. Apply the patch and clear your browser cache if necessary. - Go to Cataloging -> Advanced editor. - On any text entry line (e.g. 245), add a space immediately following the **delimiter the space and delimiter should be surrounded by a red dotted border. - Remove the extra space and confirm that the red dotted border is removed **To create a delimiter in the advanced editor, go to a non-control field (after 010) and hit the control button with the letter "d" then enter any letter or single digit. --- koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-mode.js | 4 ++++ koha-tmpl/intranet-tmpl/prog/css/cateditor.css | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-mode.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-mode.js index 8b67815980..6d3e13a0ec 100644 --- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-mode.js +++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-mode.js @@ -132,6 +132,8 @@ CodeMirror.defineMode( 'marc', function( config, modeConfig ) { return 'end-space'; } else if ( stream.match( /\s{2,}/ ) ) { return 'double-space'; + } else if ( stream.match( /\‡.\s/ ) ) { + return 'space-after-delimiter'; } else if ( stream.match( /[^ \t‡]+/ ) || stream.match( /[ \t]+/ ) ) { return; } @@ -160,6 +162,8 @@ CodeMirror.defineMode( 'marc', function( config, modeConfig ) { return 'end-space'; } else if ( stream.match( /\s{2,}/ ) ) { return 'double-space'; + } else if ( stream.match( /\‡.\s/ ) ) { + return 'space-after-delimiter'; } else { stream.match( /[ \t]+/ ); } diff --git a/koha-tmpl/intranet-tmpl/prog/css/cateditor.css b/koha-tmpl/intranet-tmpl/prog/css/cateditor.css index ba7de2e5b2..08b917bf7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/cateditor.css +++ b/koha-tmpl/intranet-tmpl/prog/css/cateditor.css @@ -110,6 +110,10 @@ body { border-bottom: 2px dotted #CC3333; } +.cm-space-after-delimiter { + border: 2px dotted #FFA500; +} + #editor .modified-line-gutter { width: 10px; } @@ -477,4 +481,4 @@ body { .ui-keyboard-accept { display: none; -} \ No newline at end of file +} -- 2.11.0