tinymce

How to highlight a given text in TinyMCE?

只愿长相守 提交于 2019-12-10 11:35:28
问题 I have the following phrase: The birds fly in the sky near planes. 0123456789012345678901234567890123456 1 2 3 How can I highlight in the sky with TinyMce if I know the start(14) and end(23) of the phrase ? I would like to use the setRng method but I didn't find any sample code. 回答1: Here is the solution I came up with : var ed = tinyMCE.activeEditor; var range = ed.selection.getRng(); range.setStart(textNode, start); range.setEnd(textNode, end); ed.selection.setRng(range); Where : textNode

how to set tinymce default content

心不动则不痛 提交于 2019-12-10 11:29:11
问题 My tinymce version is 3.5.8. I want to set the default content, and try the way on official website and other ways by google, but all error. Some of error as below: TypeError: tinyMCE.activeEditor is null [Break On This Error] tinyMCE.activeEditor.selection.setContent('<strong>Some contents</strong>'); TypeError: tinyMCE.get(...) is undefined [Break On This Error] tinyMCE.get('content').setContent('<strong>Some contents</strong>'); Thanks a lot. 回答1: This is likely because the tinyMCE editor

textarea, tinyMCE and insert an image in textarea

别说谁变了你拦得住时间么 提交于 2019-12-10 11:27:51
问题 I want to insert an image in textarea with jquery. (I know that img tag could not to inserted in textarea). Im using tinymce <img src="image.jpg" class="po"/> <form> <input type="text" name="yassi" class="infobox"/> <br /> <textarea class="me"></textarea> <input type="submit" value="click" class="submit"/> </form> jquery: <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "simple" }); </script> <script type="text/javascript" scr="config.js"> </script> and in config.js

multiple TinyMCE

元气小坏坏 提交于 2019-12-10 10:48:25
问题 I have recently encountered a problem while developing a page with multiple TinyMCEs. <textarea style='width:90%;height:500px;' class='tinymce' name='message' id="mce_editor_0" placeholder='Long Message'>{if isset($message)}{$message}{/if}</textarea> <textarea style='width:90%;height:200px;' class='tinymce' name='signature' id="mce_editor_1" placeholder='Long Message'></textarea> $.ajax({ url: "../action/getEmailTemplate?id="+id+'&type='+type }).done(function ( data ) { console.log("../action

TinyMCE: Using CSS class attributes with the formatselect-dropdown formats

拟墨画扇 提交于 2019-12-10 10:08:07
问题 I would like to customize the formats in the TinyMCE formatselect dropdown to support css class attributes. Example: If would like to be able to select <h2 class='foo'> instead of just <h2> as format in the formatselect dropdown. Does anyone here have an idea how I could do this? 回答1: There is no smart way to do this in the current TinyMCE version according to its main developer: We have plans for a advanced style format plugin. So that you can specify formats, styles, containers, wrappers

To access tinymce iframe elements through jquery

坚强是说给别人听的谎言 提交于 2019-12-10 10:05:27
问题 I an using Tinymce Editor. In need to access tinymce iframe with jquery I had tried... var iframe = $('#comment_ifr')[0];//document.getElementById('comment_ifr');// or $('#comment_ifr')[0]; the other is just faster. alert(iframe); var doc = iframe.document || iframe.contentDocument || iframe.contentWindow && iframe.contentWindow.document || null; //if( !doc ) return; //and now jquery $( "img", doc ).click(function() { alert('image clicked'); }); ---------- In my above code once an image

How do I wrap tinyMCE inside a polymer element?

℡╲_俬逩灬. 提交于 2019-12-10 09:53:39
问题 So I'd like to create a polymer-element that usually just displays content, but when the edit-attribute is present then tinymce should appear inline. This is what I have so far: <polymer-element name="article-widget" attributes="edit"> <template> <div id="content"><content></content></div> </template> <script> Polymer('article-widget', { edit: false, ready: function() { tinymce.init({ selector: "div#content", theme: "modern", plugins: [ ["advlist autolink link image lists charmap print

TINYMCE V3 or V4 Show/Hide ToolBar on focus/blur

*爱你&永不变心* 提交于 2019-12-10 07:34:04
问题 I'm working with , the version V3 or v4 of Tinymce, I want to do the next actions: 1- On focus Show the toolbar. 2- On blur Hide the toolbar. I was watching this example: http://sourceforge.net/p/tinymce/plugins/185/, is not bad, but I'm trying to do with events, but did't work. Somebody knows a good example? <!-- TinyMCE --> <script type="text/javascript" src="tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="Scripts/jquery-1.10.2.min.js"></script> <script type="text

How can I set up TinyMCE so that it won't allow inline data images?

点点圈 提交于 2019-12-10 04:22:47
问题 I have a TinyMCE installation on a CMS and the users have been pasting in images which are of the inline data type. This kind of thing: <img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/ /ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcpp V0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7" width="16" height="14" alt="embedded folder icon"> They are pasting in some pretty large

JavaScript TinyMCE/jQuery race condition on firefox

瘦欲@ 提交于 2019-12-10 04:03:24
问题 I have a website with a form that uses TinyMCE; independently, I use jQuery. When I load the form from staging server on Firefox 3 (MacOS X, Linux), TinyMCE doesn't finish loading. There is an error in Firefox console, saying that t.getBody() returned null . t.getBody() , as far as I understand from TinyMCE docs, is a function that returns document's body element to be inspected for some features. Problem doesn't occur when I use Safari, nor when I use Firefox with the same site running from