tinymce

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: /*

TinyMce editor not returning tags

浪尽此生 提交于 2019-12-14 02:33:52
问题 H7i guys, I am having a weird problem with the TinyMce editor. What I am trying to do is to select some text, click a button and append a tag at the start and at the end. For example, if the original text is <p>hello</p> , the end text would be <myTag><p>hello</p></myTag> . It works fine but when selecting a single line of text the existing tags are not returned. So in the previous example I would get hello only and not <p>hello</p> . When I select multiple lines it returns the tags. Here is

TinyMCE: How to prepend 'http://' to URL if it's not there

喜夏-厌秋 提交于 2019-12-14 02:06:08
问题 Is there way to prepend 'http://' to URL if it's not there while adding URL with Insert Link in TinyMCE? 回答1: For that you would need to copy the tinymce Insert Link plugin, rename it, add the necessary code to it (the "http"-Adding) and use it as your own plugin. EDIT: Ok, here is an example (using jQuery): // You might need to change the event and/or tha handling // but this should give you a guess at what needs to be done setup : function(ed) { ed.onClick.add(function(ed, evt) { $(ed

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

Alternative to Tiny MCE

不羁的心 提交于 2019-12-14 00:39:29
问题 Was wondering if anyone knows a good alternative to tinymce? I find that it sometimes has problems with AJAX infused content. And I've noticed that it seems a little slow when loading - I first see the textarea with the HTML-Markup and then it flashes and then I see the tiny interface. wmd and markitup are not exactly what I am looking for - they are too rudimentary. Is there any other good lightweight Javascript WYSIWYG Editor out there? Thanks Casper 回答1: What about FCKeditor? 回答2: CKEditor

Add a button after loading TinyMCE via JQuery and it's not working

一曲冷凌霜 提交于 2019-12-13 20:14:31
问题 I'm loading TinyMCE via JQuery and after it's loaded, I'd like to add a save button to it. The save button is calling a function but Firebug says the function is not defined, in this case destroyTinyMCE() is not defined. What's wrong? $('div#introText').click(function() { loadTinyMCE(); $('div#introText').after('<input value="Save" onclick="destroyTinyMCE();" type="button">'); }); function loadTinyMCE() { //some variable } function destroyTinyMCE() { $('div#introText').tinymce().destroy(); $(

Move iFrame in the DOM using jQuery

时间秒杀一切 提交于 2019-12-13 20:04:59
问题 My overall aim is to create an editor which I can skin using jQuery UI (by creating a custom toolbar which uses integration calls), using TinyMCE. Lets say I have a TinyMCE editor on a page. The actual editor is an iFrame contained inside a lot of horrible table code, which is also where the current (to be scrapped) toolbar is. I want just the iframe inside a div - ideally get rid of the table code. So...I want to transform: <table> <tr> <td><iframe id="xyz"></iframe></td> </tr> </table> into

Add a tinymce editor dynamically

南楼画角 提交于 2019-12-13 19:15:15
问题 I have a page with 2 working tinymce editor when i display it. Textarea is dynamicaly added to the page with a user control (page already loaded). The following js/coffescript aim to add a tinymce editor to the new textarea: $(document).on 'nested:fieldAdded', (event) -> tinyMCE.execCommand("mceAddControl", false, event.field.find('textarea').attr("id")) If i do an alert event.field.find('textarea').attr("id") , it returns the correct ID of the textfield where the editor should be added.

Two divs (one with tinymce) to share a scrollbar

纵然是瞬间 提交于 2019-12-13 18:25:36
问题 I have these two divs: <div id="ing" style="position:relative;"> <div id="comm" style="position: absolute; width: 27% !important; height: 141px; right: 18px; top: 1px; "> </div> </div> And then in JS I set tinymce to the "ingredients" div. How to make these two divs share a scrollbar like this: http://jsfiddle.net/userdude/hThsx/ 回答1: Problem her is that your editor uses a contenteditable iframe with an own document. So this iframe has an own scrollbar and you cannot do anything about it

Remove background color and font color in HTML with Javascript

≡放荡痞女 提交于 2019-12-13 18:09:30
问题 I am improving TinyMCE editor and want to add buttons Default color in forecolor and backcolor. This is how I get selected text with random style of background colors: outer = tinyMCE.activeEditor.selection.getNode().outerHTML; For example, there could be something like this: <p style="font-size: 18px;"> sadasdasdsasdasda <span style="background-color: rgb(0, 255, 0);" data-mce-style="background-color: #00ff00;">sdasdasda</span> <span style="background-color: rgb(255, 0, 0);" data-mce-style=