Koha/koha-tmpl/intranet-tmpl/prog/en/includes/wysiwyg-systempreferences.inc
Owen Leonard ba19c4fd9b Bug 26949: Upgrade TinyMCE in the staff interface from 5.0.16 to 5.9.2
This patch upgrades TinyMCE in the staff interface from 5.0.16 to 5.9.2.
Other than the required TinyMCE package files, the only other change is
to the internationalization include file, which is updated to include
the latest set of strings for translation.

To test, apply the patch and clear your browser cache if necessary.

Test that the TinyMCE editor works in the staff interface:

 - In system preferences, with the  UseWYSIWYGinSystemPreferences
   preference enabled: IntranetCirculationHomeHTML,
   IntranetmainUserblock, IntranetReportsHomeHTML, etc.
 - Additional contents, with the AdditionalContentsEditor preference
   set to "WYSIWYG."
 - Administration -> Libraries, in the "OPAC info" field.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-05 10:58:13 +02:00

42 lines
1.7 KiB
PHP

[% USE raw %]
[% USE Asset %]
[% #Enable tinymce for system preferences %]
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
[% INCLUDE 'str/tinymce_i18n.inc' %]
<!-- wysiwyg-systempreferences.inc -->
<script>
// Save TinyMCE content and trigger an event on the original element
function wysiwyg_change (ed){
ed.save();
var original_textarea = ed.getElement();
$(original_textarea).trigger("input");
}
tinyMCE.init({
verify_html: false,
force_br_newlines : false,
force_p_newlines : false,
forced_root_block : '',
extended_valid_elements:"style,link[href|rel]",
custom_elements:"style,link,~link",
branding : false,
relative_urls : false,
content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
editor_selector : "mce",
menubar : "file edit view insert format tools table",
mode : "specific_textareas",
plugins : "autoresize table hr link image charmap lists code emoticons",
toolbar : [
"formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr",
"table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code"
],
init_instance_callback: function (editor) {
editor.on('Dirty', function (e) {
// When a change has been made to the contents of an editor,
// enable the corresponding preference Save button
wysiwyg_change( editor );
});
}
});
</script>
<!-- / wysiwyg-systempreferences.inc -->