tinymce

Customizing the WP image editing widget

馋奶兔 提交于 2019-12-22 09:15:39
问题 While editing a post that contains an image, WP attaches a properties inspector icon over the image to allow editing basic properties such as size, alignment, link etc. I'd like to know how difficult it would be to hack into this dialog screen and add some custom programming to the link area. I'd like to add a popup menu there that I can access with the click of a button (next to the existing "Link to Image" button. I'd prefer to hook into this dialog via a file in my theme's folder or via a

Tinymce not working in angularjs mdDialog

人走茶凉 提交于 2019-12-22 09:14:17
问题 I'm trying to use TinyMCE editor in angularjs mdDialog. Worling Plukr: http://embed.plnkr.co/s3NsemdcDAtG7AoQRvLh/ Plunkr with issues: http://embed.plnkr.co/fL8kGLl3b4TNdxW1AtKG/ All features are working normally instead of drop down: http://prntscr.com/fop9u0 It works fine if I increase the top position of drop down around 100px. http://prntscr.com/fope8o I noticed that this problem appearing due to page scroll.. Can someone help me out to get these drop downs in right position. 回答1: There

Allow only certain formats in tinymce 4 Modern theme?

有些话、适合烂在心里 提交于 2019-12-22 08:49:31
问题 Is there a 'modern theme' (in other words, tinymce 4) equivalent of the theme_advanced_blockformats option? theme_advanced_blockformats allows you to limit the set of available formats by adding the following to tinymce.init() : tinyMCE.init({ ... theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,code,samp" }); (TinyMCE theme advanced block formats) I know that it's possible to explicitly specify which formats are available by passing an option to tinymce.init() , like

Underline format problem

时光总嘲笑我的痴心妄想 提交于 2019-12-22 08:05:48
问题 According to the documentation i would like to overwrite predefined formats using this settings: formats: { bold : {inline : 'b' }, italic : {inline : 'i' }, underline: { inline: 'u' } }, I insert "this is a text" into the editor and press the underline-button. This is the result (this gets saved to database too): <p>thi<span style="text-decoration: underline;">s is a t</span>ext</p> Why do i get no u-tags, but the predefined span with underlined style? How do i get my lovely u-tags here?

TinyMCE Enable button while in read only mode

这一生的挚爱 提交于 2019-12-22 06:35:41
问题 I have a TinyMCE 4.x instance where the text should be in read only mode. But I still have some buttons that I want to have enabled. For example, one button could provide a character count for the part of the text I've selected. But when I turn on read only mode for TinyMCE all buttons are disabled. Can I enable just my buttons while still retaining read only mode? 回答1: It's probably too late for you but other people may pass by here. I came up by writing this function function

Can't sendKeys() to TinyMCE with Selenium WebDriver

99封情书 提交于 2019-12-22 05:23:31
问题 I am using Selenium WebDriver in Eclipse and I am trying to insert text into a tinymce box on a web page. This is the code I am using. //find tinymce iframe editorFrame = driver.findElement(By.cssSelector(".col_right iframe")); //switch to iframe driver.switchTo().frame(editorFrame); driver.findElement(By.className("mceContentBody")).sendKeys("YOOOO"); driver.switchTo().defaultContent(); The cursor is blinking inside of the editor, however no text is sent. I have also tried this slight

How to refresh tinymce iframe?

家住魔仙堡 提交于 2019-12-22 04:36:09
问题 How can I refresh the tinymce content or refresh the tinymce iframe using jquery? 回答1: This code is used to refresh tinymce: tinyMCE.execCommand("mceRepaint"); 回答2: You can use this statement to refresh (replace) the content: editor.execCommand('mceSetContent', false, html); Or if you want to make sure the dirty flag is cleared: editor.execCommand('mceSetContent', false, html); editor.startContent = tinymce.trim(editor.getContent({ format: 'raw' })); editor.isNotDirty = true; editor

How to refresh tinymce iframe?

爷,独闯天下 提交于 2019-12-22 04:36:07
问题 How can I refresh the tinymce content or refresh the tinymce iframe using jquery? 回答1: This code is used to refresh tinymce: tinyMCE.execCommand("mceRepaint"); 回答2: You can use this statement to refresh (replace) the content: editor.execCommand('mceSetContent', false, html); Or if you want to make sure the dirty flag is cleared: editor.execCommand('mceSetContent', false, html); editor.startContent = tinymce.trim(editor.getContent({ format: 'raw' })); editor.isNotDirty = true; editor

TinyMCE render listbox items as html

↘锁芯ラ 提交于 2019-12-22 04:01:07
问题 I created a TinyMCE plugin and need the listbox items to display html. This is my plugin: editor.addButton('icons', { title: 'Foo', text: 'Foo', type: 'button', onclick: function() { editor.windowManager.open({ title: 'Foo', width: 300, height: 200, body: [{ type: 'listbox', label: 'Foo', name: 'foo', values: [{ title: '<em>Foo</em>', // <-- Mark save. Render as html. value: 1 }], }], }); } }); See also the fiddle: http://jsfiddle.net/allcaps/vqctac3d/ But the output looks like: Expected: How

tinyMCE - source code editing in a textarea

淺唱寂寞╮ 提交于 2019-12-22 03:36:03
问题 I'm playing around with MCE, I was wondering if there was the possibility of letting the user enter source code into a post, much like the 101010 button in this form. 回答1: You'll need to add plugins: "code" to the initialization code as follows: tinymce.init({ plugins: "code" }); https://www.tinymce.com/docs/plugins/code/ 回答2: The option exists. One of the optional buttons has 'html' written on it and can be used to go into HTML editing mode. You can see it in this full featured example - 6