wysiwyg

Changes to selection and range functionality in IE8

时光总嘲笑我的痴心妄想 提交于 2019-12-11 12:27:06
问题 I'm having to debug a WYSIWYG javascript based HTML editor that is failing in IE8. It's only designed for use in IE so that should simplify the solution. Here's the existing code that is failing: function isAllowed() { var sel var obj sel = foo.document.selection if (sel.type != "Control") { obj = sel.createRange().parentElement() } else { obj = sel.createRange()(0) } if (obj.isContentEditable) { foo.focus() return true } else { return false } } Essentially what is happening is that if you

May posting of images through a rich text editor be vulnerable to XSS attacks?

情到浓时终转凉″ 提交于 2019-12-11 07:59:43
问题 I'm using a rich text editor - CKEditor to allow users to input formatted text that renders HTML/CSS. To prevent XSS attacks by untrusted users, I'm using the Jsoup Java library which filters/whiltelists necessary tags and/or attributes of the user input something like, for example, an anchor tag like, <a href='http://example.com/' onclick='executeMaliciousTask();'>Click Here</a> is turned into <a href="http://example.com/" rel="nofollow">Click Here</a> The link generated by Jsoup seems to be

Remove empty tags in Imperavi Redactor

血红的双手。 提交于 2019-12-11 07:39:34
问题 Using Imperavi Redactor with Yii 2 framework. When no text is entered, Imperavi Redactor produces this markup: <p><br></p> . For each line break this markup is appended too. I want to remove this because there is no way to normally validate such content with RequiredValidator . I want to do deletion in beforeValidate() event and check if any text is entered. If there is no text except empty tags, spaces and line breaks the saving is not allowed. Otherwise the content should be saved in

RichTextEditor for PHP CMS

痞子三分冷 提交于 2019-12-11 05:37:28
问题 What RTE / WYSIWYG are you using for your CMS please? I am trying to decide on one to use. I am working with PHP and MySQL. 回答1: I'm using: http://ckeditor.com/ From the page What is CKEditor?: CKEditor is a text editor to be used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word

How to create an RSS feed and display it?

安稳与你 提交于 2019-12-11 04:26:53
问题 On a website I am maintaining for a radio station they have a page that displays news articles. Right now the news is posted in an html page which is then read by a php page which includes all the navigation. I have been asked to make this into and RSS feed. How do I do this? I know how to make the XML file but the person who edits the news file is not technical and needs a WYSIWYG editor. Is there a WYSIWYG editor for XML? Once I have the feed how do I display it on my site? Im working with

Replacing Heading (<h1>, <h2> …) Tags with <p> Tags and Classes

假如想象 提交于 2019-12-11 02:39:01
问题 I wish to replace tags from a WYSIWYG editor to . At the moment I am using the following code to achieve this. $content = preg_replace('/<h1(.*?)<\/h1>/si', '<p class="heading-1"$1</p>', $content); $content = preg_replace('/<h2(.*?)<\/h2>/si', '<p class="heading-2"$1</p>', $content); $content = preg_replace('/<h3(.*?)<\/h3>/si', '<p class="heading-3"$1</p>', $content); $content = preg_replace('/<h4(.*?)<\/h4>/si', '<p class="heading-4"$1</p>', $content); $content = preg_replace('/<h5(.*?)<\

CKEditor on font-size change event

非 Y 不嫁゛ 提交于 2019-12-11 02:28:38
问题 Is there any way to capture an event when user has changed font-size? I'm looking for something similar to this: CKEDITOR.editor.getCommand('xxx').on('xxx', function(){ }); 回答1: You need to use: CKEDITOR.instances.your_instance_name.on( 'change', function() { // Code goes here } ); Replace your_instance_name with your instance name. 来源: https://stackoverflow.com/questions/19490380/ckeditor-on-font-size-change-event

PHP XSS Prevention WhiteListing

天大地大妈咪最大 提交于 2019-12-11 02:08:53
问题 My site utilizes a WYSIWYG editor for users to update their accounts,enter comments, and send private messages. The editor (CKEditor) is great for only allowing users to enter valid input, but I worry about injection through TamperData or other means. How can I control this on the server side? I need to whitelist specific tags: <b><ul><ol><a><img><br> , will this be a SAFE approach to preventing XSS? 回答1: Use HTML Purifier : HTML Purifier is a standards-compliant HTML filter library written

Free XML based java gui language with builder

旧城冷巷雨未停 提交于 2019-12-11 00:00:50
问题 Is there a free decent java GUI descriptor language (probably XML based), which has a Glade-like (WYSIWYG) GUI builder? 回答1: Netbeans IDE. Whenever you use its GUI editor, it stores the GUI in XML, in a *.form file. For example if your create a class com.some.package.MyForm which extends some Swing component or window, look for this file $SRCDIR/com/some/package/MyForm.java and $SRCDIR/com/some/package/MyForm.form . The former is the actual Java class that gets compiled. The latter is a file

WYSIWYG html editor query

ぃ、小莉子 提交于 2019-12-10 23:14:22
问题 I am in the process of creating a simple WYSIWYG HTML editor to enable the users of my application to design simple HTML emails. At the moment I have decided to use the web browser control with MSHTML to enable me to edit what is displayed. I have a tool bar which holds all of the relevant buttons, bold, underline, etc. I need a way to check if the current block has any formatting so the correct state can be displayed on the buttons in the tool bar. I tried to add an event handler to the