insertion une image avec TinyMCE

Par marwen9250, il y a 12 ans


Salut,
Mon problém s'est l'orsque le clik sur le botton browser aucun affichage de mon page d'edition d'image méme si je mes dans le file lien de google
voici mon script

<script type="text/javascript" src="<?php echo Router::webroot('js/tinymce/tiny_mce.js') ?>"></script>
<script type="text/javascript">
tinyMCE.init({
        // General options
        mode : "specific_textareas",
        editor_selector :"wysiwyg",
        theme : "advanced",
        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
        // Theme options
        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,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        // Skin options
        skin : "o2k7",
        skin_variant : "silver",
        file_browser_callback:'fileBrowser'
});
function fileBrowser(field_name, url, type, win){
  tinyMCE.activeEditor.windowManeger.open({
    file:'<?php echo Router::url('admin/medias/index/'.$id); ?>',
    title: 'Gallerie',
    width:420,
    height:400,
    resizable:'yes',
    inline: 'yes',
    close_previous: 'no'
  },{
    window :win,
    input:field_name
  });
  return false;

}
</script>

2 réponses

marwen9250, il y a 12 ans

Salut,
voici mon error:
Uncaught ReferenceError: ttinyMCE is not defined 6:117
fileBrowser 6:117
m.create.execCallback tiny_mce.js:1
tinyMCEPopup.openBrowser tiny_mce_popup.js:5
openBrowser form_utils.js:67
(anonymous function)

Benjamin Derepas, il y a 12 ans

Peut être que tu n'a pas mis l'intégralité de ton code, mais dans ce que je vois, jQuery n'est pas importé. A moins que tu travailles avec la version js pure, c'est normal que ça ne fonctionne pas =D
Ou bien l'adresse reliant tinymce à ta page est mauvaise