tinymce-4

Can't catch the ForeColor command anymore, tinymce 4.1.4

徘徊边缘 提交于 2019-12-04 16:33:43
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. The TextColor plugin no longer fires the execCommand event because since this commit it directly uses the Formatter infrastructure . So you cannot get your old event. However you can use the formatChanged on the formatter to provide a callback:

How do I add placeholder text to TinyMCE?

不羁的心 提交于 2019-12-04 16:05:36
问题 For standard textareas, I use placeholder="" . How can I extend tinymce so that it also works in this way. Similar to this for CKEditor: http://alfonsoml.blogspot.com.es/2012/04/placeholder-text-in-ckeditor.html 回答1: The placeholder plugin worked great for me. This plugin brings HTML5 placeholder attribute functionality for the TinyMCE editor. 回答2: <html> <head> <title>Bhanu Pratap, Tinymce with placeholder... </title> <script src="http://cdn.tinymce.com/4/tinymce.min.js"></script> <script

TinyMCE4 equivalent of toolbar location external?

我们两清 提交于 2019-12-04 15:46:33
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? 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 themes in folder tiny_mce\themes) But in TinyMCE 4, there's no "advanced" theme, but a "modern" theme as the

Command identifiers for tinymce 4.x (mceAddControl)

不羁的心 提交于 2019-12-04 10:45:23
I am migrating from tinyMCE 3.x to the latest version of tinyMCE 4.x. My problem is that I have dynamic generation of tinyMCE instances so in 3.x I was using: tinymce.EditorManager.execCommand('mceAddControl', true, "content_txt"); but in version 4.x this doesn't work. I started to check the documentation but I can't find the identifiers for version 4.x Migration is very simple, replace tinymce.EditorManager.execCommand('mceAddControl', true, "content_txt"); by tinymce.EditorManager.execCommand('mceAddEditor', true, "content_txt"); When you want to turn it of, you can use tinymce.EditorManager

Tinymce 4.x extend plugin

时间秒杀一切 提交于 2019-12-04 09:42:58
I'm looking for some examples on how to extend a existing tinymce (4.x) plugin, e.g. the "link" plugin. The link plugin opens a dialog window... what I'd like to do is add an event when the dialog is opened and modify the body (insert some extra HTML with click events). It seems to be problematic to do it nicely... I want to avoid some "on top" code like $('#mce_13').click(...); and rather use something like editor.on('DialogOpen', function(e) { // if link dialog then $(e.body).append('<div>My HTML</div>'); }); However there are no such events like onDialogOpen ... is there a best practice to

TinyMCE file_picker_callback select image from default browser file selection

拥有回忆 提交于 2019-12-04 08:38:51
Im using TinyMCE in a project and want the user to select and upload images to the server using its default insert image window. I want to click the following button: Open the browsers default file select window and add the selected image to the editor: My code so far is as follows.. JS: tinymce.init({ selector: '#html-editor', language: 'pt_PT', plugins: [ "bdesk_photo advlist autolink link image lists charmap preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code media nonbreaking", "table contextmenu directionality paste textcolor colorpicker imagetools" ], add

Getting the TinyMCE 4 Font Sizes drop down to set the font size in px instead of pt

∥☆過路亽.° 提交于 2019-12-04 04:37:01
Does anyone see a way to make the TinyMCE 4 Font Sizes drop down offer font sizes in px instead of pt? Thanks You need to use the fontsize_formats option where you can also change the unit of the values of the font sizes dropdown: tinymce.init({ selector: 'textarea', toolbar: 'fontsizeselect', fontsize_formats: "8px 10px 12px 14px 18px 24px 36px" }); Demo JSFiddle . 来源: https://stackoverflow.com/questions/28132337/getting-the-tinymce-4-font-sizes-drop-down-to-set-the-font-size-in-px-instead-of

TinyMCE Advanced theme - Where is it?

非 Y 不嫁゛ 提交于 2019-12-04 01:39:55
I am in the process of creating a drop down list with contains a list of classes so my users can apply them to link, paragraphs etc. I have read in a lot of places now that the advanced theme supports this out of the box but I can't find out where to download this theme. I suspect the advanced theme is Wordpress only at this point as I found it included in the wordpress download but not in a format that would allow me to use it. Am I missing something? OK, I found out where the confusion lies. TinyMCE versions 3.x contain the advanced theme but it is not shipped with 4.0 which I am using. I

initialize tinymce with content

心不动则不痛 提交于 2019-12-03 18:08:04
问题 I have a page containing one tinymce4 editor instance. I want to initialize this editor with some content, programmatically. I know that I have to call: tinymce.get('editor').setContent('my content'); However I have trouble to do this when tinymce is getting initialized. This question has already been asked: initialize tinyMCE with default content but the answer that was given at that time is not working, at least for tinymce4. Here is what I have tried: 1st attempt: tinymce.init({ mode:

How to Make TinyMCE's modal dialogs Responsive?

亡梦爱人 提交于 2019-12-03 10:21:53
I'm working with TinyMCE4 on a responsive CMS using Bootstrap 3. I've noticed that the dialog/modals aren't responsive in TinyMCE4 which is a bit of a bummer. I started writing some simple CSS classes to override the fixed widths, but there appears to be tons which makes this an task that seems rather daunting. So, I thought that surely someone else has done this by now. Here is what I have so far, but there is are many many more selectors that have to be done for this to work. So, question, has anyone else come up with a complete, fail safe way to make TinyMCE's dialog/modals responsive? /*