tinymce

TinyMCE width and height disobedient!

痴心易碎 提交于 2019-12-17 22:45:19
问题 According to the (conflicting) documentation of TinyMCE, the editor takes on the size of the textarea (or other) element that it replaces. It also says that you can set the size of the editor by specifying { height: '123', width: '123' } in the init method. I have tried BOTH and still get only one result - the editor resizes itself to (how it remembers is beyond me) what it was the last time a user resized it. 回答1: I know all about this, it is very annoying. Adding this to any loaded CSS file

%22 (double quotes) added to url out of nowhere

£可爱£侵袭症+ 提交于 2019-12-17 20:37:56
问题 I'm making a mail programm that wil be used to mail newsletters to customers, in the newsletters will be images and links. When I tested it on localhost everything worked fine and the links worked. However when I uploaded it to my website the links and image paths won't work anymore. For some reason it adds %22 (which I found out are double quotes ") to the links and paths so the link I mailed looks like this: /%22http//www.mywebsite.com/%22 And the image path looks like this: %22http//www

Tiny MCE popups blank in Django admin

怎甘沉沦 提交于 2019-12-17 16:21:07
问题 I have got tinyMCE working in the django admin, but all the popups are blank (eg. edit HTML, add image) The paths to the popup html pages all exist in the right places http://thatch.media/js/tiny_mce/themes/advanced/source_editor.htm?mce_rdomain=thatch The permissions are set to 777 on the whole js folder This is my Model class Page(models.Model): title = models.CharField(max_length=200) ... class Admin: js = ('js/tiny_mce/tiny_mce.js', 'js/textareas.js') Any Ideas? 回答1: I ran into this

XML parser error: entity not defined

浪子不回头ぞ 提交于 2019-12-17 10:49:43
问题 I have searched stackoverflow on this problem and did find a few topics, but I feel like there isn't really a solid answer for me on this. I have a form that users submit and the field's value is stored in a XML file. The XML is set to be encoded with UTF-8. Every now and then a user will copy/paste text from somewhere and that's when I get the "entity not defined error". I realize XML only supports a select few entities and anything beyond that is not recognized - hence the parser error.

What's the best way to set cursor/caret position?

眉间皱痕 提交于 2019-12-17 10:17:23
问题 If I'm inserting content into a textarea that TinyMCE has co-opted, what's the best way to set the position of the cursor/caret? I'm using tinyMCE.execCommand("mceInsertRawHTML", false, content); to insert the content, and I'd like set the cursor position to the end of the content. Both document.selection and myField.selectionStart won't work for this, and I feel as though this is going to be supported by TinyMCE (through something I can't find on their forum) or it's going to be a really

make readonly/disable tinymce textarea

大憨熊 提交于 2019-12-17 09:37:20
问题 I need to disable or make readonly a tinymce textarea at runtime. 回答1: Use the configuration parameter readonly tinyMCE.init({ ... theme : "advanced", readonly : 1 }); Here is a link to a demo. Update : What you can do to prevent users from editing content in your editor is to set the contenteditable attribute of the editors iframe body to false: tinymce.activeEditor.getBody().setAttribute('contenteditable', false); 回答2: From version 4.3.x on you can use code below for readonly mode tinymce

How do i remove tinyMCE and then re-add it?

孤者浪人 提交于 2019-12-17 03:09:23
问题 I'm trying to add the tinyMCE editor to my page, remove it, then add it again but am getting errors. When I run Part A, then Part B, Than Part A again I get the error: Error: g.win.document is null Source File: tiny_mce/tiny_mce.js Line: 1 Part A js += " tinyMCE.init({ "; js += " 'mode' : 'exact', \n"; js += " 'elements' : '" + ctrl.ID + "Editor', \n"; js += " 'plugins' : 'insertdatetime,TVCMSLink,TVCMSImage',\n"; js += " 'theme' : 'advanced',\n"; js += " 'theme_advanced_layout_manager' :

TinyMCE Paste As Plain Text

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 03:08:06
问题 This is one of the common issue with RTEs on web. Could you please guide me through how to: Paste as the PLAIN TEXT Retain the HTML but remove the WORD/HTML styling I want to do it directly on paste (paste_preprocess callback), without opening the dialogs provided by Paste plugins. Any thoughts/experiences ? Thanks, Imran 回答1: This is what i do to get paste plain text. 1. paste_preprocess setting (in tinymce init) paste_preprocess : function(pl, o) { //example: keep bold,italic,underline and

Django-tinymce in Django Admin - “can't find variable: tinyMCE”

旧时模样 提交于 2019-12-14 03:59:40
问题 I'm trying to use django-tinymce to edit fields in django admin. I've the app installed in my virtualenv ( django-tinymce==1.5.1b4 ). It's listed in my installed apps - INSTALLED_APPS = ( #... 'tinymce', #... ) My settings includes the following TINYMCE_DEFAULT_CONFIG = { 'theme': "advanced", 'theme_advanced_toolbar_location': "top", 'theme_advanced_buttons1': "bold,italic,underline,separator," "bullist,separator,outdent,indent,separator,undo,redo", 'theme_advanced_buttons2': "", 'theme

J is null in TinyMce.js

混江龙づ霸主 提交于 2019-12-14 03:16:02
问题 I use tinymce on my website and I always run into this annoying j is null. In my template file I originally had the init method out in the open like in the example... <script type="text/javascript" > tinyMCE.init({ mode : "textareas", theme : "simple" }); </script> But in the error console of Firefox I see something that says "j is null" and the reference is somewhere within the tiny_mce.js file. Any help is appreciated. Thanks so much. 回答1: It's a tinymce bug. Internally, the tinymce code