// update tinyMCE setup on product page
This commit is contained in:
@@ -29,47 +29,40 @@
|
|||||||
{block name="autoload_tinyMCE"}
|
{block name="autoload_tinyMCE"}
|
||||||
// Execute when tab Informations has finished loading
|
// Execute when tab Informations has finished loading
|
||||||
tabs_manager.onLoad('Informations', function(){
|
tabs_manager.onLoad('Informations', function(){
|
||||||
// change each by click to load only on click
|
tinySetup({
|
||||||
$(".autoload_rte").each(function(e){
|
editor_selector :"autoload_rte",
|
||||||
tinySetup({
|
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
||||||
mode :"exact",
|
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,,|,forecolor,backcolor",
|
||||||
editor_selector :"autoload_rte",
|
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,ltr,rtl,|,fullscreen",
|
||||||
elements : $(this).attr("id"),
|
theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,pagebreak",
|
||||||
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
setup : function(ed) {
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,,|,forecolor,backcolor",
|
ed.onInit.add(function(ed)
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,ltr,rtl,|,fullscreen",
|
{
|
||||||
theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,pagebreak",
|
if (typeof ProductMultishop.load_tinymce[ed.id] != 'undefined')
|
||||||
setup : function(ed) {
|
|
||||||
{* Count the total number of the field *}
|
|
||||||
|
|
||||||
ed.onInit.add(function(ed)
|
|
||||||
{
|
{
|
||||||
if (typeof ProductMultishop.load_tinymce[ed.id] != 'undefined')
|
if (typeof ProductMultishop.load_tinymce[ed.id])
|
||||||
{
|
ed.hide();
|
||||||
if (typeof ProductMultishop.load_tinymce[ed.id])
|
else
|
||||||
ed.hide();
|
ed.show();
|
||||||
else
|
}
|
||||||
ed.show();
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.onKeyUp.add(function(ed, e) {
|
ed.onKeyUp.add(function(ed, e) {
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
textarea = $('#'+ed.id);
|
textarea = $('#'+ed.id);
|
||||||
max = textarea.parent('div').find('span.counter').attr('max');
|
max = textarea.parent('div').find('span.counter').attr('max');
|
||||||
if (max != 'none')
|
if (max != 'none')
|
||||||
{
|
{
|
||||||
textarea_value = textarea.val();
|
textarea_value = textarea.val();
|
||||||
count = stripHTML(textarea_value).length;
|
count = stripHTML(textarea_value).length;
|
||||||
rest = max - count;
|
rest = max - count;
|
||||||
if (rest < 0)
|
if (rest < 0)
|
||||||
textarea.parent('div').find('span.counter').html('<span style="color:red;">{l s='Maximum'} '+max+' {l s='characters'} : '+rest+'</span>');
|
textarea.parent('div').find('span.counter').html('<span style="color:red;">{l s='Maximum'} '+max+' {l s='characters'} : '+rest+'</span>');
|
||||||
else
|
else
|
||||||
textarea.parent('div').find('span.counter').html(' ');
|
textarea.parent('div').find('span.counter').html(' ');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
{/block}
|
{/block}
|
||||||
|
|||||||
Reference in New Issue
Block a user