1/* 2 javascript functions for wp-monalisa edit form 3*/ 4 5 6/* 7 diese funktion haengt die smilies an den vorhandenen im editor text an 8 9*/ 10function smile2edit(textid,smile,replace) 11{ 12 var itext; 13 var tedit = null; 14 15 // einzufügenden text ermitteln 16 if ( replace == 1) 17 itext = "<img class='wpml_ico' alt='' src='" + smile + "' />"; 18 else 19 itext = " " + smile + " "; // add space to separate smilies 20 21 // editor objekt holen, falls vorhanden 22 if ( typeof tinyMCE != "undefined" ) 23 tedit = tinyMCE.get('content'); 24 25 if ( tedit == null || tedit.isHidden() == true) 26 { 27 // text in html editor einfügen 28 tarea = document.getElementById(textid); 29 insert_text(itext, tarea); 30 } else if ( (tedit.isHidden() == false) && window.tinyMCE) 31 { 32 // füge den text in den tinymce ein 33 window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', 34 false, itext); 35 } 36} 37 38 39/* 40 diese funktion fügt den text stxt an der aktuellen position des cursors 41 der textarea obj ein. obj ist als objekt zu übergeben 42 43*/ 44function smile2comment(textid,smile,replace){ 45 tarea = document.getElementById(textid); 46 if (tarea == null) 47 { 48 alert('wp-monalisa: Textarea not found. Please contact the webmaster of this site.'); 49 return; 50 } 51 if ( replace == 1) 52 insert_text("<img class='wpml_ico' alt='' src='" + smile + "' />", tarea); 53 else 54 insert_text(" " + smile + " ", tarea); // add space to separate smilies 55} 56 57/* 58 diese funktion fügt den text stxt an der aktuellen stelle des cursors 59 der textarea obj ein. obj ist als objekt zu übergeben 60*/ 61function insert_text(stxt,obj) 62{ 63 try { 64 // pruefe of fckeditor aktiv ist entweder 65 // als comment editor oder als text editor 66 if(typeof window.CKEDITOR.instances.comment!='undefined') 67 { 68 // wenn ja, nutzen wir die fckeditor funktion 69 // um den text einzufügen 70 window.CKEDITOR.instances.comment.insertHtml(stxt); 71 return; 72 } 73 74 if(typeof CKEDITOR.instances.content!='undefined') 75 { 76 // wenn ja, nutzen wir die fckeditor funktion 77 // um den text einzufügen 78 CKEDITOR.instances.content.insertHtml(stxt); 79 return; 80 } 81 } 82 catch(e) {} 83 84 if(document.selection) 85 { 86 obj.focus(); 87 document.selection.createRange().text=stxt; 88 document.selection.createRange().select(); 89 } 90 else if (obj.selectionStart || obj.selectionStart == '0') 91 { 92 intStart = obj.selectionStart; 93 intEnd = obj.selectionEnd; 94 obj.value = (obj.value).substring(0, intStart) + stxt + (obj.value).substring(intEnd, obj.value.length); 95 obj.selectionStart = obj.selectionEnd = intStart + stxt.length; 96 obj.focus(); 97 } 98 else 99 { 100 obj.value += stxt; 101 } 102 103 104} 105 106/* 107 diese funktion(en) dient zum auf und zuklappen der gesamten smilies 108 im comment form und zwar ajax-like 109*/ 110jQuery(function() { 111 // show all smilies 112 jQuery("#buttonm").click(function() { 113 jQuery("#smiley1").toggle("slow"); 114 jQuery("#smiley2").toggle("slow"); 115 }); 116 // hide all smilies 117 jQuery("#buttonl").click(function() { 118 jQuery("#smiley2").toggle("slow"); 119 jQuery("#smiley1").toggle("slow"); 120 }); 121 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.