Jump to content
  • 0

Rozszerzenie edytora - nie obsługuje skryptów JS i innych znaczników HTMl


RSI-SHOP

Question

Witam.

Rozszerzyłem sobie edytor tinyMCE do wersji extended : ( http://mypresta.eu/en/art/know-how/tinymce-editor-full-options-all-html-tags.html )

$(document).ready(function(){
        {block name="autoload_tinyMCE"}
            tinySetup({
                editor_selector :"autoload_rte",
                                  theme_advanced_buttons1 : "save,newdocument,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect, fontselect,fontsizeselect",
                                  theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,search,replace,bullist,numlist,outdent,indent,blockquote,undo,redo,link,unlink,anchor,image,cleanup,help,codemagic,insertdate,inserttime,preview,forecolor,backcolor",
                                  theme_advanced_buttons3 : "code,tablecontrols,hr,removeformat,visualaid,sub,sup,charmap,emotions,iespell,media,advhr,print,ltr,rtl,fullscreen",
                                  theme_advanced_buttons4 : "styleprops,cite,abbr,acronym,del,ins,attribs,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
                                  theme_advanced_toolbar_location : "top",
                                  theme_advanced_toolbar_align : "left",
                                  theme_advanced_statusbar_location : "bottom",
                                  theme_advanced_resizing : false,
                                                    extended_valid_elements: 'pre[*],script[*],style[*]',
                                                    valid_children: "+body[style|script],pre[script|div|p|br|span|img|style|h1|h2|h3|h4|h5],*[*]",
                                                    valid_elements : '*[*]',
                                                    force_p_newlines : false,
                                                    cleanup: false,
                                                    forced_root_block : false,
                                                    force_br_newlines : true
            });
        {/block}
    });

Problem mam w tym że jak dodam jakiś mały skrypt do edytora sypie mi błędem. Co może być przyczyną ??? Przecież są skrypty które umieszcza się "logicznie" w sekcji <body></body>

 

Pozdrawiam

post-735577-0-85379700-1395830903_thumb.jpg

Edited by mroczus87 (see edit history)
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

pominąłeś ten krok:
 

 

Attention!

Prestashop in version 1.5+ has got new validation function, in this case it is also necessary to change Validate.php class, you can read about it here: validation class change

 

Lookig for tutorial about extending tinymce featured on product edit page? check this tutorial: full featured editor on product edit page

Link to comment
Share on other sites

  • 0

najprościej rzecz ujmując w validate.php całą funkcję isCleanHtml

 

zmieniamy na:

public static function isCleanHtml($html, $allow_iframe = false){
    return true;
}

(zwróć uwagę na parametry funkcji, muszą być takie same jak w oryginale - sądrobne rozbieżności między wersjami)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...