tinymce-4

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

不问归期 提交于 2019-12-21 12:10:45
问题 Does anyone see a way to make the TinyMCE 4 Font Sizes drop down offer font sizes in px instead of pt? Thanks 回答1: 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

Is there open “Insert/Edit image” dialog event in Tinymce?

大城市里の小女人 提交于 2019-12-20 05:42:21
问题 I need to get to know when the dialog has already been opened. But I didn't find any decent way for this. The only thing I found in the documentation is editor.on() but it doesn't work with the mceImagecommand and nothing is said about mceImage in the docs. And it supposed to fire before the dialog is shown. All that comes to my mind is to attach the 'click' event on the "Image" button and wait for the dialog through the timer but it wouldn't be a very decent solution. Any better ideas? 回答1:

Radio buttons acts as Check-box in TinyMce 4

﹥>﹥吖頭↗ 提交于 2019-12-20 05:04:58
问题 Here's the fiddle, the type is radio but acts like check-box {type: 'radio', name: 'letter', label: 'Letter'}, {type: 'radio', name: 'custom', label: 'Custom'}, I tried using them under one name that didn't work out, and my 2nd question: how to make one of them as default(as selected). Keep Smiling :) 回答1: It seems like the tinymce/ui/Radio class is not implemented yet. It act like a tinymce/ui/Checkbox . You can use the tinymce/ui/ListBox class as a workaround. 回答2: for the 2nd question:

Radio buttons acts as Check-box in TinyMce 4

怎甘沉沦 提交于 2019-12-20 05:03:03
问题 Here's the fiddle, the type is radio but acts like check-box {type: 'radio', name: 'letter', label: 'Letter'}, {type: 'radio', name: 'custom', label: 'Custom'}, I tried using them under one name that didn't work out, and my 2nd question: how to make one of them as default(as selected). Keep Smiling :) 回答1: It seems like the tinymce/ui/Radio class is not implemented yet. It act like a tinymce/ui/Checkbox . You can use the tinymce/ui/ListBox class as a workaround. 回答2: for the 2nd question:

How do I initialize TinyMCE on a ajax loaded textarea in 4.x?

折月煮酒 提交于 2019-12-18 03:57:27
问题 I am upgrading to tinyMCE 4.x and I am attempting to initialize tinyMCE on a textarea loaded via AJAX. In 3.x I did something of the sort: TinyMCE - attach to divs loaded via AJAX calls but this does not seem to work in 4.x. 回答1: tinymce.remove(); tinymce.init(); This works well! 回答2: In TinyMCE 4.x mceRemoveControl and mceAddControl have been removed. You have to use mceRemoveEditor and mceAddEditor instead. Got it from: [Resolved] mceRemoveControl and mceAddControl in tinymce 4 Otherwise,

How do I initialize TinyMCE on a ajax loaded textarea in 4.x?

不想你离开。 提交于 2019-12-18 03:57:02
问题 I am upgrading to tinyMCE 4.x and I am attempting to initialize tinyMCE on a textarea loaded via AJAX. In 3.x I did something of the sort: TinyMCE - attach to divs loaded via AJAX calls but this does not seem to work in 4.x. 回答1: tinymce.remove(); tinymce.init(); This works well! 回答2: In TinyMCE 4.x mceRemoveControl and mceAddControl have been removed. You have to use mceRemoveEditor and mceAddEditor instead. Got it from: [Resolved] mceRemoveControl and mceAddControl in tinymce 4 Otherwise,

TinyMCE 4 links plugin modal in not editable

风格不统一 提交于 2019-12-17 17:54:46
问题 I am using tinyMCE4 editor inside a Boostrap modal dialog. when I clicked on link icon it opens a new modal dialog box, It displayed fine but the input areas are not editable. <div id="editing" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <form> <label> <span>Description</span> <div id="description"></div> </label> <form> </div> <script> tinymce.init({ selector: 'div#description', inline: false, theme : "modern", schema: "html5", add

Stop x-tags from capturing focus/blur events

烈酒焚心 提交于 2019-12-14 03:19:11
问题 I am trying to create a custom element which wraps tinyMCE functionality. I have the following:- (function(xtag) { xtag.register('x-tinymce', { lifecycle:{ created: tinymceCreate, removed: tinymceDestroy }, accessors: { disabled: { attribute: { boolean: true }, get: getDisabledAttribute, set: setDisabledAttribute } } }); function tinymceCreate(){ var textarea = document.createElement('textarea'); var currentElement = this; currentElement.textAreaId = xtag.uid(); textarea.id = currentElement

Changing background toolbar colour and text colour in tinymce editor

痴心易碎 提交于 2019-12-14 02:55:38
问题 I have used this code in my init call for tinymce to point at my main css file: <script> tinymce.init({ selector: 'textarea', content_css:'default.css' }); This works well and within that CSS i use this to alter the background colour of the body of my editor : .mce-content-body { background: #474F52; } I now want to add to this the appropriate CSS overrides for the toolbar colour - the button colour and the text colour as per: Please help! I have searched far and wide to no avail. 回答1: /*

How do I implement tinymce.Shortcuts in TinyMCE v4

旧城冷巷雨未停 提交于 2019-12-14 02:02:22
问题 I want to add keyboard shortcuts to my TinyMCE editor. Here is my init code: tinymce.init({ selector: 'textarea', menubar: false, mode : "exact", plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table contextmenu paste code', 'print' ], toolbar: 'print | styleselect | bullist numlist', }); I know that I need something along the lines of: editor.shortcuts.add('ctrl+a', function() {}); But I don't