YUI Editor: How to paste as plain text? - javascript

I implemented the Yahoo Rich Text Editor (YUI Editor) in a Rails application using the YUI_Editor Plugin.
If I copy/paste text out of a PDF into a YUI-Editor-enhanced-TextArea (YEETA :)) it does not only copy the text but also the formatting of it.
How do I configure the YUI Editor to remove all formatting of text pasted into the YEETA before inserting it?
I'm intrested in your answer even if you're not working with Rails and/or using the YUI_Editor plugin. Give me a hint and I'll figure out how to solve this with my setup.
Thanks a lot for your help!

I've written an extension to the YUI editor to handle this, you can download it here:
http://antscode.blogspot.com/2009/05/strip-formatting-on-paste-using-yui.html

As far as I know there is no such function in the YUI editor. Finally I parsed the editor content on submit as described on this question.

Related

Adding input tools to a textarea

Am creating a blog website in Django where bloggers are not familiar with Markdown/Markup. So am planning to add these tools to my textarea.(image below).
Please suggest an easy way to achieve this.
Use WYSIWYG Editor like summernote
https://github.com/summernote/django-summernote

How to add javascript to a joomla 1.5 article using TinyMCE editor?

I'm having trouble trying to get JavaScript to show up on a Joomla! article using the TinyMCE editor. I've set all the settings I should based on Google searches and it's still not showing. The JavaScript code is commented out as shown in screenshots below.
Any help is greatly appreciated. TQ!
Though many WYSIWYG editors claim <script> support, I would suggest using the "None" editor when adding the JavaScript code to your posts. I use Switch Editor to quickly change editors. After installing and activating the package:
Switch to "None" editor
Open the article
Add the embed code
Save the article
Switch back to your favorite WYSIWYG editor to edit other articles
This will give you the least problems. Unfortunately, the package is only available for Joomla! 2.5+. However, there is an alternative here:
http://www.joomler.net/download/81-joomla15-plugin/959-editor-switcher-for-joomla15-released.html
On a side note, you should upgrade your site away from Joomla! 1.5 ASAP!

How to clean up HTML on-paste in my WYSIWYG editor

I have created a WYSIWYG HTML editor and I noticed that when you paste text from Word, it comes in with its source formatting and I don't want it. Is it possible to clean that up when it gets to the editor.
What I need the most is being able to clean-up the text before it get to the editor itself. Something like an "onPaste" thing that can allow me to filter my text when it's pasted (using the command or keyboard shortcut).
HTML Purifier will create standards compliant markup
http://htmlpurifier.org/
Or http://www.w3.org/People/Raggett/tidy/
If those don't help you, I suggest you switch to FCKEditor or tinymce which has this feature built-in.
you could easily set the InsertMode like this
{
InsertMode: "insert_only_text"
}
from the docs

JavaScript WYSIWYG implementation

I want to write a very simple WYSIWYG editor, but i don't understand how do they work :(
I've tried to read sources of tinyMCE but stuck in all those classes and functions.
As I know they're creating iframe then do some black magic there and everything works.
The question is: what do those editors do with iframe so it becomes editable?
Thank you.
The keywords are contentEditable and designMode.
Good sources to get started:
Rich-Text Editing in Mozilla (MDC)
element.contentEditable in Mozilla (MDC)
contentEditable in IE (MSDN)
very simple means you want little extension? In such case, you will like http://code.google.com/p/jwysiwyg/
Its constructor is really simple, but not good for extension works.
You can search JQuery. I think there's huge amount of HTML editor or rich text editor available.
By the way, the HTML editor inside Extjs is the worst thing I have ever seen.
Google released yesterday an open source editor:
http://closuretools.blogspot.com/2010/07/introducing-closure-library-editor.html
A quick look at it shows an IFRAME with the BODY tag with the attribute: contentEditable

How does Google mail achieve rtf in textarea?

I am intended to develop a rich input textarea similar to Google mail. Any ideal or resource to share? Thanks in advance!
My suggestion is to use TinyMCE it is a great Rich Text Box. Yahoo also has a really great Rich Text Editor (which has been deprecated).
These are not textareas, btw - they are IFRAMEs holding full HTML managed by the editor code. I also recommend FCKeditor - very configurable and easily integrated. You can write your code using textareas, make a javascript call and those textareas go hidden and the IFRAME gets injected in place. Upon submit the html gets copied back in the textarea. so really don't need to do much...
I am not sure what google uses, but I've used FCKEditor and it worked out great.
Look at the ContentEditable tag. And also have a look at Squire on gihub which is an open source rich text editor that is very lightweight and flexible (used in opera's mail client)
The editors given in the other answers are very heavy and come with their own (outdated, bloated) UI components.

Categories