2011-06-20 8 views
1

私は自分のウェブサイトに簡単なTinyMCEエディタをセットアップしました。私はまた、各画像の下にリンクを張ったシンプルな画像ギャラリーを持っています。私は既に、リンクが押されたときに高度な画像ダイアログを開く方法を考え出しましたが、画像のURLとして画像のURLを渡したいと思います。私はそれが可能であることを知っていると私はTinyMCEフォーラムで多くのリンクを見てきましたが、それらはすべてWikiを指し、何らかの理由で壊れています。私はいつもここで終わる:http://tinymce.moxiecode.com/wiki.phptinyMCE AdvImageにパラメータを渡す

これは私がTinyMCEの構成方法である:

tinyMCE.init({ 
    theme : "advanced", 
    skin : "cirkuit", 
    mode : "textareas", 
    language : 'sl', 
    plugins : "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_advanced_buttons1 : "newdocument,|,styleselect,formatselect,fontselect,fontsizeselect", 
    theme_advanced_buttons2 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,cut,copy,paste,pastetext,pasteword,|,search,replace", 
    theme_advanced_buttons3 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,cleanup,code,|,forecolor,backcolor", 
    theme_advanced_buttons4 : "image,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,|,fullscreen", 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_statusbar_location : "bottom", 
    theme_advanced_resizing : true, 
    theme_advanced_resize_horizontal : false, 
    extended_valid_elements : "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]", 
    width : 520, 
    height: 500 
}); 

と私はダイアログを開き、これを使用します。

tinyMCE.activeEditor.execCommand('mceAdvImage'); 

私は、これは愚かな質問である知っているが、私を助けてください。

+0

1明確な質問 – Thariama

答えて

1

カスタム変数をエディタインスタンスに保存することができます。エディタのインスタンスが分かっていれば、どこからでもこの変数にアクセスできます。例:

tinyMCE.activeEditor.my_var = "abc"; 
+0

私は実際に 'tinyMCE.activeEditor.execCommand(「mceAdvImage」)を呼び出す前に画像を追加し、選択することにより、別の解決策を見つけました;'しかし、私はあまりにもあなたをテストし、私が取得管理それは機能する。ありがとう! –

関連する問題