@@ -, +, @@
- Edit a news item and confirm that the contents of the
editor show HTML syntax highlighting.
- Test HTML linting by adding some malformed HTML (missing closing tag,
for instance). The error should be highlighted.
- Set the NewsToolEditor to "TinyMCE" and confirm that WYSIWYG editing
still works correctly.
---
.../prog/en/modules/tools/koha-news.tt | 87 +++++++++++++---------
1 file changed, 50 insertions(+), 37 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
@@ -1,19 +1,23 @@
[% USE raw %]
[% USE Asset %]
+[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
-[% Asset.css("lib/codemirror/codemirror.css") | $raw %]
-
Koha › Tools › News
[% INCLUDE 'doc-head-close.inc' %]
[% IF ( opac_news_count ) %]
[% END %]
+[% IF Koha.Preference('NewsToolEditor') == 'codemirror' %]
+ [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
+ [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
+
+[% END %]
@@ -208,12 +212,12 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]
[% END %]
+
+
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("js/tools-menu.js") | $raw %]
- [% Asset.js("lib/d3c3/d3.min.js") | $raw %]
- [% Asset.js("lib/d3c3/c3.min.js") | $raw %]
[% IF ( opac_news_count ) %]
[% INCLUDE 'datatables.inc' %]
[% END %]
- [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
- [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
- [% INCLUDE 'str/tinymce_i18n.inc' %]
-
+ [% IF Koha.Preference('NewsToolEditor') == 'codemirror' %]
+ [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
+ [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
+ [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
+ [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
+ [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
+
+ [% ELSE %]
+
+ [% END # /IF NewsToolEditor %]
[% END %]
[% BLOCK lang_locations %]
--