Autor | Zpráva | ||
---|---|---|---|
radas Profil * |
#1 · Zasláno: 22. 3. 2011, 12:32:21
Zdravím,
mám formulář, ke kterému jsem implementoval Tiny MCE a pak jsem tam vložil ještě jeden JS skritp, který by mi tam vkládal obrázky přimo do textu...Jenže se to hada s Tiny MCE a nevím proč... můj JS <script type="text/javascript"> function insertSmiley (SelectedSmiley) { var preval=document.formatovani.elm1.value; switch (SelectedSmiley) { case 0: document.formatovani.elm1.value=preval+"<img src="../clanky/2/vzor.jpg" />"; break; } document.formatovani.elm1.focus(); return false; } </script> formulař <form name="formatovani" method="post" action="edit_clanek_uvod.php" enctype="multipart/form-data"> Název<br /> <input name="jmeno" value="Reference" /> <br /><br /> Text článku<br /> <textarea id="elm1" name="elm1" rows="15" cols="60" >text....</textarea><br /><br /> Obrázek<br /> <a href="#" onClick="return insertSmiley(0);"><img src="../clanky/2/vzor2.jpg" title="vzor2.jpg" alt="vzor2.jpg" /></a> <input type="submit" name="save" value="Odeslat" /> </form> a když ve stránce neni tento kod <script type="text/javascript"> tinyMCE.init({ // General options language : "cs", mode : "textareas", theme : "advanced", plugins : "safari,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 : "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", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,|,forecolor,backcolor,|,fullscreen", theme_advanced_toolbar_location : "bottom", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, entity_encoding : "raw", // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "User", staffid : "1", forced_root_block : false, force_br_newlines : true, force_p_newlines : false } }); </script> tak JS s funkcí insertSmiley nepracuje a netuším proč ...jiny JS tam neni :( |
||
Joker Profil |
#2 · Zasláno: 22. 3. 2011, 12:48:26
radas:
Nejspíš to bude tím, že TinyMCE editor ve skutečnosti není ta textarea, ale jiný prvek (tuším iframe), který ji nahradí. Čili funkce asi pracuje, ale mění obsah neviditelného prvku. |
||
radas Profil * |
#3 · Zasláno: 22. 3. 2011, 12:57:41
aha tak to mě nenapadlo..takže se ta moje myšlenka neda realizoavt?
|
||
Chamurappi Profil |
#4 · Zasláno: 22. 3. 2011, 12:59:09
Reaguji na radase:
Projdi si dokumentaci k TinMCE a najdi si v ní, jak se u něj vkládají smajlíky — určitě už v něm bude něco hotového. |
||
radas Profil * |
#5 · Zasláno: 22. 3. 2011, 13:42:42
Chamurappi:
máte pravdu, řešení tam jsou... jenže u mě je problém že soubory nejdříve nahrávam na web a pak u jednotlivých článku se zobrazuji soubory, které lze vložit k článku, čili bych to nemohl řešit tak jako zde ( http://tinymce.moxiecode.com/forum/viewtopic.php?pid=60929#p60929 ) proto jsem si napsal ten první JS skript... |
||
Časová prodleva: 13 let
|
0