tinymce-4

Keep correct size of embed video in TinyMce

戏子无情 提交于 2019-12-13 03:42:32
问题 I want to add embed media in TinyMce with media plugin. When I add an embed video for example with specific size value, when I save the post, the width is not correct. The following HTML is created: <iframe src="//www.youtube.com/embed/XlpTLDulFe8" width="100" height="100" allowfullscreen="allowfullscreen"></iframe> But infortunatly, i've the folowing CSS (mdl CSS) that overload my width-size: iframe { display: block; width: 100%; border: none; } I want to use instead a max-width:100%; for

Customize tinymce 4.0.5 styleselect toolbar menu

蓝咒 提交于 2019-12-12 08:34:43
问题 I'm trying to customize the default styleselect toolbar menu so I can add to it a custom menu element. The idea is to place font size as a styleselect submenu: I initialized a TinyMCE 4.0.5 in the following way: tinymce.init( { language_url : '/webobbywebapp/js/tiny_mce/language/es.js', selector:'textarea', plugins: "image, link, print", toolbar: "styleselect | undo redo | removeformat | bold italic underline | aligncenter alignjustify | bullist numlist outdent indent | link | print |

Insert an image into a tinymce editor

心不动则不痛 提交于 2019-12-12 08:27:55
问题 I have a tinymce text box on my html page. Under this text box I have a table with my file system in which I can navigate to locate my images. I would like to be able to click on an image in this table and have it inserted in the timymce text box. How might I go about doing this? 回答1: I've used the command tinyMCE.execCommand('mceInsertContent', false, '<img alt="Smiley face" height="42" width="42" src="' + sr + '"/>'); to insert the image in tinyMCE after extracting the URL from the image's

How to Make TinyMCE's modal dialogs Responsive?

和自甴很熟 提交于 2019-12-12 07:45:54
问题 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,

TinyMCE: when selecting Bold, how to use different font instead of applying normal bold style?

社会主义新天地 提交于 2019-12-12 00:38:02
问题 When I select Bold in TinyMCE I want to make it use a different font instead of just using the bold variant of current font - how can I do that? 回答1: // get the current editor var editor = tinyMce.activeEditor; // get the editor formatter var f = editor.formatter; f.register('customBold', { inline: 'span', selector: 'span,p', styles: { fontWeight: 'bold',fontFamily: 'arial'.....your custom style }, }); editor.addCommand('customBold',function(){ editor.applyFormat(name) }); // add a button in

listbox return wrong value in wordpress3.9

一个人想着一个人 提交于 2019-12-11 19:06:12
问题 I used the listbox UI element in Wordpress 3.8, but it does not work in its newer version (3.9). I wrote this JS code to test it: (function() { var ICONS; var icon = function(id) { return '<i class="fa fa-' + id + '"></i>'; } ICONS = ["rub", "ruble", "rouble", "pagelines", "stack-exchange", "arrow-circle-o-right", "arrow-circle-o-left", "caret-square-o-left", "toggle-left", "dot-circle-o", "wheelchair", "vimeo-square", "try", "adjust", "anchor", "archive", "arrows", "arrows-h", "arrows-v",

Custom TinyMCE 4.x button to increase letter spacing not working

泪湿孤枕 提交于 2019-12-11 15:57:33
问题 I implemented a TinyMCE button to increase the letter spacing at http://fiddle.tinymce.com/Z9eaab/31. If you enter the words "some text" in the text area at the bottom and then select "some" and hit the "Increase letter spacing" button multiple times, the letter spacing only increases the first time. If you select the second word, "text," the spacing increases each time you hit "Increase letter spacing." as it should. I can see from the console.log on line 9 that when it doesn't work it's

TinyMce disappears in SPA - Knockout binding evaluated twice causing editor to fail

女生的网名这么多〃 提交于 2019-12-11 12:36:19
问题 I’m trying to implement TinyMCE into John Papa’s HotSpa template . I’m currently using Knockout 3.1.0 , and Durandal 2.0 . For some unknown reason, my custom knockout binding init method is triggered only once on first load, but twice when view is refreshed. By refresh, I mean using durandal router, I navigated to the same view again (but with different parameters). It still went through the whole durandal life cycle, hooks of deattached and attached are called again. I had some debug code in

How to apply CSS on custom buttons in tinyMCE active editor popup

懵懂的女人 提交于 2019-12-11 11:07:15
问题 I want to add custom CSS in my tinyMCE active editor popup, attaching the screenshot for your reference. below is the reference code: tinymce.activeEditor.windowManager.open({ title: 'Browse Image Gallery', file: "data/get_images_tiny.php", width: 500, height: 305, resizable: "no", inline: "yes", close_previous: "no", buttons: [{ text: 'Upload Image from your PC', onclick: function () { //do something } }, { text: 'Close', onclick: 'close' }] } }); 回答1: The best way to do is to override style

tinymce - adding a custom code / change value of a html element, when any of buttons is clicked

馋奶兔 提交于 2019-12-11 09:26:59
问题 I am using inline tinymce for editing the current content. I would like to check if the user really editing some thing before I ajax save it. I kept a hidden input and changed its value on keypress when the user updated the content. And on blur the ajax works fine. But if the user selects a line and bolds it then I need to update the same hidden input such that I pull the ajax save again on blur, which is currently not happening, I tried tinymce onclick event but it reacts when I focus on