tinymce

paste_preprocess tinymce issue

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 06:08:49
问题 i want to strip all the html tags when pasting in tinymce editor. following is the code which is not functional... following is the tinymce settings... the paste_preprocess callback is not trigering... am i missing some option..? tinyMCESettings = [ { mode : "none,textareas", height:heightEditor, width:'100%', plugins: "paste", theme : "advanced", //skin : "wp_theme", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter", relative_urls : "true", paste_use

paste_preprocess tinymce issue

久未见 提交于 2020-01-13 06:07:05
问题 i want to strip all the html tags when pasting in tinymce editor. following is the code which is not functional... following is the tinymce settings... the paste_preprocess callback is not trigering... am i missing some option..? tinyMCESettings = [ { mode : "none,textareas", height:heightEditor, width:'100%', plugins: "paste", theme : "advanced", //skin : "wp_theme", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter", relative_urls : "true", paste_use

Decrease the line spacing in TinyMCE textarea

本秂侑毒 提交于 2020-01-12 04:53:45
问题 I am using TinyMCE to provide a rich text editing text editor. But the line spacing between the lines is too much. I have added a screenshot that shows the line spacing I get on pressing an enter. What can be done about it 回答1: There is a css class that is applied to the TinyMCE html content. It looks like you have <p> tags causing the spacing. Honestly, it looks pretty good to me. But you can override in the css class: .tinymce-content p { padding: 0; margin: 2px 0; } See the tinymce docs

How best to sanitize fields in ruby on rails

北城余情 提交于 2020-01-10 19:30:07
问题 I currently have a controller capturing some html from TinyMCE on the front end. If I tinker with firebug it is possible to submit script tags and inject alert messages etc on to the screen. edit: Currently I am fixing this in the model by using the sanitize helper: require 'action_view' class NotesController < AuthApplicationController include ActionView::Helpers::SanitizeHelper ... def update params[:note][:content] = sanitize(params[:note][:content], :tags => %w(a object p param h1 h2 h3

TinyMCE- Get plain text

久未见 提交于 2020-01-10 18:44:13
问题 In tinyMCE, Is there any way to get the plain text instead of HTML text? 回答1: Try this: var myText = tinyMCE.activeEditor.selection.getContent({ format: 'text' }); 回答2: var rawtext = tinyMCE.activeEditor.getBody().textContent; 回答3: I just tried this approach: editor.getContent() .replace(/<[^>]*>/ig, ' ') .replace(/<\/[^>]*>/ig, ' ') .replace(/ | /gi, ' ') .replace(/\s+/ig, ' ') .trim(); Replaces both opening and closing html tags with space Replaces various known special characters with

TinyMCE- Get plain text

风格不统一 提交于 2020-01-10 18:43:12
问题 In tinyMCE, Is there any way to get the plain text instead of HTML text? 回答1: Try this: var myText = tinyMCE.activeEditor.selection.getContent({ format: 'text' }); 回答2: var rawtext = tinyMCE.activeEditor.getBody().textContent; 回答3: I just tried this approach: editor.getContent() .replace(/<[^>]*>/ig, ' ') .replace(/<\/[^>]*>/ig, ' ') .replace(/ | /gi, ' ') .replace(/\s+/ig, ' ') .trim(); Replaces both opening and closing html tags with space Replaces various known special characters with

Change default font type/size in TinyMCE

一世执手 提交于 2020-01-10 17:33:47
问题 How do you change the default font type and font size in TinyMCE? I'm using the advanced skin and I've changed the body, td, pre style in default/content.css but it still doesn't change. 回答1: Well, there are several content.css and only one is used to style your editor depending on your configuration settings . You should use the content_css configuration option and name an own css file where you can overwrite the editors defaults (the content.css you were recently looking for). In your init

cant preview image with ajax in MVC project

拈花ヽ惹草 提交于 2020-01-07 09:24:50
问题 i am making a blogsite, and i can upload images to it using tinymce's richtext-editor, but the preview of the image doesnt show up in the textarea. (although if i upload the image anyway, i can perfectly see it in the blogfeed). i suspect there is a problem with how i implemented tinymce into the MVC framework (brad traversy's framework on udemy). because when i look at the filepaths to the image they are different. "<img src="http//localhost/mywebsite/content/images/image.jpg>" . (image from

How to get the html code from tinyMCE editor using Php,Javascript

谁都会走 提交于 2020-01-07 08:34:33
问题 I am the tinyMCE beginer... i display the tinyMCE editot in browser and make able to add the style to the textarea content How to get the html code from tinyMCE editor using Php,Javascript... 回答1: You may use tinymce.activeEditor.getContent() or if you know your editor id tinymce.get('my_editor_id').getContent(); 来源: https://stackoverflow.com/questions/11503320/how-to-get-the-html-code-from-tinymce-editor-using-php-javascript

Debugging Responsive File Manager Plugin (TinyMCE)

南笙酒味 提交于 2020-01-07 05:06:11
问题 Yesterday I found this great looking plugin for file and image management for tinymce however I cannot get the files to actually save to the drive. I have tried every commbination I can think of. responsivefilemanager.com - This plugin. Anyone used it before and know of the settings I might need? The plugin sits here: /public_html/cms/app/webroot/js/tinymce/plugins/filemanager I'm trying to set it up so the uploads go here: /public_html/cms/app/webroot/files/cms The config file for the plugin