tinymce

TinyMCE Hide the bar

馋奶兔 提交于 2019-12-22 03:19:36
问题 I use tinymce and i want to hide the button toolbar. Is there a way to do that? 回答1: Using tinyMCE 4 you can set the following in the tinymce init: toolbar: false Here is a full blown example of the init if you want a clean editor with no options: <script type="text/javascript"> tinymce.init({ menubar: false, statusbar: false, toolbar: false }); </script> 回答2: There is a plugin that will do this either from a link outside of the editor or from the toolbar itself. http://www.neele.name/pdw

Set data URI in TinyMCE

狂风中的少年 提交于 2019-12-22 02:32:09
问题 TinyMCE init options $scope.tinymceOptions = { plugins: 'base64img image imagetools paste ...', relative_urls: false, paste_data_images: true, ... }; paste_data_images: true option means that data:url images (inline images) should NOT be removed from the pasted contents (see docs). I use TinyMCE 4.2.8. Inside base64img plugin I've written the following code var editor; // TinyMCE editor var imgData; // base64 image data string, like "data:image/png;base64,...=" editor.setContent("<img src='"

How to prevent the <p> tag from wrapping around my input with tinymce in Rails?

和自甴很熟 提交于 2019-12-21 23:30:04
问题 By default, the tinymce input gets passed to the DOM as a paragraph tag: I would like to remove that element wrapper so that tinymce passes exactly what I entered in the text editor. How do I do that ? Please if you provide a code, can you also let me know where that code gets added ? Regards !!! 回答1: Actually I solved my problem. All I had to do was change the styling for paragraph tag : p {margin: 0; padding: 0;} 回答2: You need to specify the forced_root_block to false. However the

TinyMCE UTF-8 saving to MySQL Database

拟墨画扇 提交于 2019-12-21 20:45:45
问题 I send TinyMCE input to POST (a php file), then save it in MySQL Database. The input has UTF-8 (Turkish characters). So when I type Türkçe inside the TinyMCE input and send it to post, PHP backend receives this string : <p>Türkçe</p> How can I convert it back to Türkçe so I can save it correctly in MySQL ? P.S.: MySQL is set to utf8_unicode_ci collation, so it can save UTF-8 characters correctly. I need to convert them in PHP, I guess. Or a way for TinyMCE to send them correctly? Thanks for

TinyMCE file_picker_callback select image from default browser file selection

大兔子大兔子 提交于 2019-12-21 17:34:29
问题 Im using TinyMCE in a project and want the user to select and upload images to the server using its default insert image window. I want to click the following button: Open the browsers default file select window and add the selected image to the editor: My code so far is as follows.. JS: tinymce.init({ selector: '#html-editor', language: 'pt_PT', plugins: [ "bdesk_photo advlist autolink link image lists charmap preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars

Google Spell API and TinyMCE

血红的双手。 提交于 2019-12-21 16:19:10
问题 I just successfully implemented the spell checking plugin for TinyMCE using the instructions here. I got a bit scared, though, by this ending paragraph. I've had some trouble finding good documentation of the Google Spell Service and it seems as if it is no longer updated but still available to developers already using it (which should include the TinyMCE .Net package even though you haven't used it before). However, use at your own risk should Google decide to delete it. This is the only

ASP.Net 4.0 with TinyMCE and XML Encoding re-encodes Content on Postback

◇◆丶佛笑我妖孽 提交于 2019-12-21 12:38:08
问题 i have a ASP.NET 4.0 based CMS, where i use the TinyMCE (3.4) via jQuery to edit one Textbox. In addition to this i have several other textboxes. There is also another DropDown List on the Page, which controls the Contenttype. This Control has AutoPostback enabled and sets the visibility on the textboxes regarding the selectes item. As i want to keep the Postback Validation on i have configured the TinyXML to use xml for the content serialisation (encoding: "xml"). Now i have the problem,

Insert Text at current position TINYMCE IE9

a 夏天 提交于 2019-12-21 05:24:23
问题 How to insert text into a tinyMce edtitor at the current position. It works perfect in Chrome, FF, Safari, but in IE it always starts at the top of the textarea. I currently do the following: tinyMCE.execCommand('mceInsertContent',false, 'blabla this is tekst'); I tried with focus, other commands, nothing works :(. 回答1: Thanks for the help, but nothing worked. I found my own solution, and I felt like sharing this was needed, because I only found outdated solutions, that did not work :(. The

Remove styles when pasting from Word or other source

两盒软妹~` 提交于 2019-12-21 05:22:12
问题 I'm trying to set it up so that when I paste text, specifically from Word or another source, all the styling will be stripped. I'm happy to let bold and italic styles stay as well as lists and so forth, but the rest should go. How can I do this? I know there is a plugin that will allow me to do this if I paste via clicking a button but I'm looking for if someone presses CTRL+V or command+V. Any help? 回答1: I am using TinyMCE with the paste plugin an the following setup: paste_create_paragraphs

TinyMCE security question: How do you prevent malicious input?

元气小坏坏 提交于 2019-12-21 04:33:10
问题 How do you prevent malicious input in WYSIWYG editors like TinyMCE? I have a system with users who are not "tech savvy" (so no WMD) and need a rich text editor that posts its content into a database. I'm worried about scripting attacks and malicious input code. 回答1: If you only want safe html then you should use the HTML Purifier. If you want to protect against XSS and block all html then you should use $var=htmlspcialchars($var,ENT_QUOTES); 回答2: You can't prevent that input from the client