tinymce-4

How to add tinymce 4.x dynamically to textarea?

旧城冷巷雨未停 提交于 2019-12-10 15:33:19
问题 I have a little problem with adding tinymce dynamically to textarea after init. tinymce.init({ selector: "textarea", theme: "modern", height: 100, plugins: [ "advlist autolink image lists charmap print preview hr anchor pagebreak spellchecker", "link searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste textcolor" ], toolbar: "insertfile undo redo | styleselect | bold italic |

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: How do I prevent `<br data-mce-bogus=“1”>` text in editor?

梦想与她 提交于 2019-12-10 03:05:51
问题 I have a page with several TinyMCE (v4) editors, which all work great ... until I try and add: inline: true to their configuration. When I do that the inline-ing part works great (the toolbar is gone, then appears when I focus the editor), but for some strange reason the editor stops working at that point. Inside the editor I see: <br data-mce-bogus="1"> but I can't edit that text, or add new text, or do anything at all really with the editor. I can make the editor work again if I remove

TinyMCE4 equivalent of toolbar location external?

帅比萌擦擦* 提交于 2019-12-09 22:09:29
问题 In TinyMCE 3 you can use theme_advanced_toolbar_location = 'external' in mce settings, making a class=mceExternalToolbar element. However, there doesn't seem to be an exact equivalent for TinyMCE 4. Am I missing something, or is an external toolbar that sticks to top when scrolling down, not easily doable in TinyMCE 4? 回答1: In TinyMCE 3, "theme_advanced_toolbar_location" is a theme option of the "advanced" theme, which is one of the official themes(the other is simple, you can see these 2

Can't catch the ForeColor command anymore, tinymce 4.1.4

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 21:21:14
问题 Tinymce used to fire an event for the text-color-change, if you ran: tinymce.activeEditor.on('execCommand', function() {console.log(arguments);} ) you would see the execCommand ForeColor, ran whenever the text color is changed. If you look in TinyMCE-Textcolor plugin, it doesn't seem to have any execCommands or any way to detect when text-color changes. 回答1: The TextColor plugin no longer fires the execCommand event because since this commit it directly uses the Formatter infrastructure. So

TinyMCE 4 add drop down menu to menu bar

自作多情 提交于 2019-12-09 11:59:36
问题 I need to add another drop down menu next to "Tools" item in TinyMCE 4: The closest solution I found was this: // Adds a custom menu item to the editor that inserts contents when clicked // The context option allows you to add the menu item to an existing default menu tinymce.init({ ... setup: function(ed) { ed.addMenuItem('example', { text: 'My menu item', context: 'tools', onclick: function() { ed.insertContent('Hello world!!'); } }); } }); But it only adds an item to the already existing

Proper Way Of Modifying Toolbar After Init in TinyMCE

╄→尐↘猪︶ㄣ 提交于 2019-12-08 19:21:04
问题 I am extending a cloud-hosted LMS with javascript. Therefore, we can add javascript to the page, but cannot modify the vendor javascript for different components. The LMS uses tinyMCE frequently. The goal is to add a new button on to the toolbar of each tinyMCE editor. The problem is that since the tinyMCE modules are initialized in the vendor's untouchable code, we cannot modify the init() call. Therefore, we cannot add any text on to the "toolbar" property of the init() object. So I

jQuery: Change keyboard value when input

被刻印的时光 ゝ 提交于 2019-12-08 12:15:35
问题 Example: when I press key "A" on a keyboard, then the value will change to "S" and text box show up "S". How can I do this with jQuery or Tinymce 4? Thank you very much! 回答1: You will need to check the keyCode in every keypress event. If the keyCode is the same with A then you need to change it to whatever string you want, for example: S . <div> <label>Test:</label> <input type="text" id="test"> </div> $("#test").on("keypress", function (e) { if (97 == e.keyCode || 65 == e.keyCode) { e

Is it possible to have custom Functions and commands in the TinyMCE4 Menubar?

﹥>﹥吖頭↗ 提交于 2019-12-08 08:59:50
问题 I have learned how to integrate custom commands in the Tiny Toolbar with the ed.addButton() Function. Is there a similar way to add functionality to the Upper menu, the menubar ? In the Tiny Documentation I just found how to change the order of the menu secton with this code in the init function: menubar: "tools table format view insert edit", 回答1: Examples : // Adds a custom menu item to the editor that inserts contents when clicked // The context option allows you to add the menu item to an

TinyMCE Image Upload API not showing image picker icon

↘锁芯ラ 提交于 2019-12-08 01:57:38
问题 We followed the instructions on this tutorial but for some reason, the upload button (the search folder icon next to the image URL) on the image dialog does not show: http://www.tinymce.com/wiki.php/Handling_Asynchronous_Image_Uploads We've tried with just the images_upload_url option as well as all the options, but the upload icon never shows: tinymce.init({ ... images_upload_url: "postAcceptor.php", images_upload_base_path: "/some/basepath", //optional images_upload_credentials: true /