From 367a36e4f33fb64c9115bb014530474ee1454c22 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 29 Mar 2019 19:01:19 +0000 Subject: [PATCH] Bug 21582: Use CodeMirror for *UserJS & *UserCSS This patch adds CodeMirror syntax highlighting by default to JS and CSS system preferences. HTML preferences will use CodeMirror editors if UseWYSIWYGinSystemPreferences is disabled. Three new CodeMirror files are added to support three new syntax highlighting modes: XML (for HTML), CSS, and JS. A new option is added to *.pref file configurations for textareas which are intended for HTML, JS, or CSS: syntax. This option is passed to the CodeMirror configuration to control syntax highlighting mode. Textareas without a syntax option specified will not have CodeMirror enabled. To test, apply the patch and go to Administration -> System preferences. Test the behavior of several preferences which use + [% ELSIF ( CHUNK.type_textarea )%] + [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] + [% ELSE %] - - - + Click to edit + + [% END %] [% ELSIF ( CHUNK.type_languages ) %]