Note that there are some explanatory texts on larger screens.

plurals
  1. POIs this possible to set the language in tinymce editor in javascript?
    primarykey
    data
    text
    <p>I have using tinymce text edit for my asp.net applications.Now i have added language pack.now i want to set the language pack for the text editor programatically.And also hide the language pack bar from the visible state.</p> <p><img src="https://i.stack.imgur.com/dBb6E.png" alt="enter image description here"></p> <p>for example : i want to programatically set the language of the text editior is hindi.Pleasr guide me to get out of this...</p> <p>whenever user clicks translation Button in my web form , i have initialized this string variable.then i want to set the tinymce editor language programatically.</p> <p>string lang="Hindi";</p> <p><strong>ptp.js</strong><br></p> <pre><code>function LoadTypePad() { // Initialize pad tinyMCE.init({ // General options mode : "textareas", theme : "advanced", skin : "o2k7", skin_variant : "silver", plugins : "safari,style,table,advhr,advimage,advlink,inlinepopups,insertdatetime,preview,media,searchreplace,print,paste,fullscreen,indicime,aksharspellchecker", // Theme options theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect,fontselect,aksharspellchecker,indicime, indicimehelp", theme_advanced_buttons2 : "selectall,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,media,advhr,|,print", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, spellchecker_rpc_url:"http://service.vishalon.net/spellchecker.aspx", // 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", width : "100%", init_instance_callback : "afterInit" }); } function showPleaseWait() { var mainMessage = document.getElementById("message").innerHTML; document.getElementById("message").innerHTML = pleaseWait; pleaseWait = mainMessage; } // This function finds absolute position of the element in screen and returns array. function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); return [curleft,curtop]; } } // id= outer most id for show/hide. baseid = reference id for pointer function showPopup(id, baseid) { toggle_menu(id); var base = document.getElementById(baseid); var l = findPos(base); var obj = document.getElementById(id + 'content'); var im = document.getElementById(id + 'img'); var left = im.src.indexOf('left.gif') &gt; 0; obj.style.top = (l[1] - obj.offsetHeight - 20) + "px"; obj.style.left = (l[0] + (base.offsetWidth/2) - (left?obj.offsetWidth:0)) + "px"; l = findPos(obj); im.style.top = (l[1] + obj.offsetHeight - 1) + "px"; im.style.left = (l[0] + (left?obj.offsetWidth - 26:0)) + "px"; } function closePopup() { // hide popup var elem = document.getElementById("step1"); elem.style.display = "none"; elem = document.getElementById("step2"); elem.style.display = "none"; elem = document.getElementById("step3"); elem.style.display = "none"; } // Once tinymce is fully loaded function afterInit() { // Find search string from referral var term = document.referrer; var re = /bengali|gujarati|gujrati|hindi|marathi|devnagari|devanagari|punjabi|gurmukhi|kannada|malayalam|tamil|telugu|thelugu|thamil/gi ; var m = re.exec(term); var result =''; if (m != null &amp;&amp; m.length &gt; 0) result = "&lt;strong&gt;" + m[0] + "&lt;/strong&gt;"; else result = "your favourite Indic Script"; // Create popup CreatePopup("step1", "Step 1", "Click here to erase existing contents", "right"); CreatePopup("step2", "Step 2", "Select " + result + " from this dropdown list and start typing.", "left"); CreatePopup("step3", "Step 3", "Click here to get a help for typing once you selected script in Step 2", "right"); // Restore the message from please wait to spell checker document.getElementById("message").innerHTML = "Now Akshar Spell Checker for Gujarati is available!!! Click on &lt;img src=\"tiny_mce/plugins/aksharspellchecker/img/aksharspellchecker.gif\"&gt; to check Gujarati spelling"; // Initialize for google search pph = new PramukhPhoneticHandler(); pph.convertToIndicIME("q"); pph.onScriptChange("q", indicChange); // Open up popups showPopup("step1","elm1_newdocument"); showPopup("step2","elm1_indicime"); showPopup("step3","elm1_indicimehelp"); // Close popup after xx seconds. setTimeout("closePopup();",15000); } function toggle_menu(id) { var elem = document.getElementById(id); elem.style.display = elem.style.display=="none"? "":"none"; } function CheckNewVersion() { var JSONRequest = tinymce.util.JSONRequest; try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) { // do nothing } JSONRequest.sendRPC({ url : "http://service.vishalon.net/pramukhtypepadmessage.aspx?v=2.5.00", method : "", params : "", type: "GET", success : function(r){ var message = r.substring(r.indexOf(",")+1); if (message != "") document.getElementById("message").innerHTML = "&lt;img src='img/info.jpg' &gt;" + message + "&lt;br&gt;&lt;br&gt;"; }, error : function(e, x) { // do nothing } }); } function indicChange(id, lang) { var s = document.getElementById('language'); s.value = lang; if (lang == null || lang == "") lang = 'english'; pph.setScript(id, lang); } function CreatePopup(id, title,content, dir) { var holder = document.getElementById("plholder"); holder.innerHTML += "&lt;div id='" +id + "' style='display:none;'&gt;"+ "&lt;div class='popupbody' id='" +id + "content'&gt;" + "&lt;div style='float:right;'&gt;&lt;img src='img/close.gif' style='cursor:pointer;cursor:hand;' onclick='toggle_menu(\"" + id + "\");'/&gt;&lt;/div&gt;"+ "&lt;div&gt;&lt;strong&gt;" + title + "&lt;/strong&gt;&lt;/div&gt;"+ "&lt;div style='clear:both'&gt;&lt;/div&gt;"+ "&lt;div&gt;" + content + "&lt;/div&gt;"+ "&lt;/div&gt;"+ "&lt;img src='img/" + dir + ".gif' id='" + id + "img' style='position:absolute;'/&gt;"+ "&lt;/div&gt;"; } var pph, pleaseWait = "Please wait while Pramukh Type Pad is loading... &lt;img src='img/progress.gif' /&gt; &amp;nbsp;&amp;nbsp;(Loading problem??? Get &lt;a href=\"pramukhlibex.htm\"&gt;Simple Pramukh Type Pad&lt;/a&gt; )"; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload