Owen Leonard
6381d1853d
The staff client CSS is not language-specific, so it can be moved out of the en/ directory and thus not be duplicated for every translation. In order to be able to have a generic path to the YUI CSS files, the YUI directory is moved by this patch to the staff client's lib/ directory. To test, apply the patch and visit various pages in the staff client. Look in particular at pages which include more than the standard CSS. For example: - The staff client login page. - The staff client home page. - Patron -> Set permissions. - The advanced cataloging editor. - Acquisitions -> Vendor -> Basket groups. - Tools -> News -> Edit news. - Administration -> System preferences. Revised: I intended for this to be built on top of Bug 15883. Now it is. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> On top of 15883 Works as described, all pages on test plan No Errors Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
61 lines
2.6 KiB
C++
61 lines
2.6 KiB
C++
[% #Enable tinymce for system preferences %]
|
|
<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
|
|
<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({
|
|
setup : function(ed) {
|
|
ed.onInit.add(function(editor){
|
|
[%-
|
|
#Ideally, it would be nice just to use the "oninput" event, which captures keyboard input, dragging, pasting, etc.
|
|
#However, it doesn't work in IE when the event listener is for an element which is "contenteditable". Since TinyMCE
|
|
#uses a "contenteditable" body element in an iframe element, it's never going to fire in IE.
|
|
|
|
#We can get around this a bit by using "onkeyup" and "ondragend".
|
|
|
|
#"ondragend" occurs after you drag content within the editor. "ondrop" is for when you drag content from outside the
|
|
#editor but it doesn't "dirty" the editor, which makes it useless, as the editor won't save unless it's dirty.
|
|
#"onpaste" is useless in this same way.
|
|
|
|
#Reference:
|
|
#https://developer.mozilla.org/en-US/docs/Web/Events/input
|
|
#https://connect.microsoft.com/IE/feedbackdetail/view/794285
|
|
-%]
|
|
|
|
tinyMCE.dom.Event.bind(editor.getBody(), 'input keyup dragend', function(e){
|
|
if (ed.isDirty()){
|
|
wysiwyg_change(ed);
|
|
}
|
|
});
|
|
});
|
|
|
|
// Register change when TinyMCE command returns isDirty()
|
|
ed.onExecCommand.add(function(ed, cmd, ui, val) {
|
|
if (ed.isDirty()){
|
|
wysiwyg_change(ed);
|
|
}
|
|
});
|
|
|
|
},
|
|
mode : "specific_textareas",
|
|
editor_selector : "mce",
|
|
theme : "advanced",
|
|
content_css : "[% interface %]/[% theme %]/css/tinymce.css",
|
|
plugins : "table,save,advhr,advlink,contextmenu,advimage",
|
|
theme_advanced_buttons1 : "bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,image,link,unlink,anchor,cleanup,help,code,advhr,",
|
|
theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap|,forecolor,backcolor",
|
|
theme_advanced_buttons3 : "",
|
|
theme_advanced_toolbar_location : "top",
|
|
theme_advanced_toolbar_align : "left",
|
|
theme_advanced_path_location : "bottom",
|
|
theme_advanced_resizing : true,
|
|
apply_source_formatting : true
|
|
});
|
|
//]]>
|
|
</script>
|