htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
See the ultimate Word cleaner. Amazing!!


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

First page Previous page 1 2 3 4 5 6 7 Next page Last page  View All


Luis
Veteran

Apr 27, 2003, 5:01 AM

Post #1 of 169 (17373 views)
Shortcut
See the ultimate Word cleaner. Amazing!! Can't Post

As a result of a previous post
http://www.interactivetools.com/forum/gforum.cgi?post=4244
it came to my inspiration to redo the Word Cleaner mod from scratch.

Advantadges:
  1. It will clean up the code silently with no need of buttons (onpaste) and while you type, it will not include unnecessary code.
  2. Very easy to decide which tags to strip out commenting or uncommenting out in editor.js to fit everybody's needs.
  3. It will take care of all unnecessary code for example </P>, </LI>, dir=ltr, <B></B> (and other empty tags), &nbsp; etc.
  4. HTML perfectly formatted (I think) on input and output.
  5. It works using the Paste button or CTRL+V
  6. It's smaller than the previous one.
  7. No need of temp textareas or sandboxes.


What I am missing:
  1. Have it working with Shift+Insert and Context Menu's Paste option
  2. Some refining in the tags I want to remove.


I will post my files tomorrow, after I make some refining (too sleepy now).

See it at http://webstationone.com/test/htmlarea

PD. I will erase all my previous postings regarding the other mod to avoid confusion.


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Apr 27, 2003, 5:04 AM)


weston
New User

Apr 27, 2003, 12:31 PM

Post #2 of 169 (17292 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Thanks luis! I'm really looking forward to this!

Wes


Side Note:

I went ahead and tested it a little further and I think that I found a possible problem. I'm almost certain that it has nothing to do with the word mod, becuase it all shows up fine until you go to save it. But I thought that you might be interested in knowing if you didn't already.

Original text previous formated in word was:
Este salmo foi escrito por Davi no período que ele fugia de Absalão. Absalão era um jovem forte, rigoroso carismático e voluntarioso. O seu meio irmão Amnon, atacou e violentou a sua irmã. Absalão esperava que Davi tomasse alguma posição. Esperava que Davi fizesse justiça. Mas, Davi não fez nada. Extremamente fora de controle, Absalão tomou as dores da irmã e matou o seu irmão. Além disso, rebelou-se contra o pai conquistando aliados dentro do reino e destitui o pai do reinado, fazendo com que fugisse de Jerusalém.


It ended up producing the following:
Este salmo foi escrito por Davi no perÃ&shy;odo que ele fugia de Absalão. Absalão era um jovem forte, rigoroso carismático e voluntarioso. O seu meio irmão Amnon, atacou e violentou a sua irmã. Absalão esperava que Davi tomasse alguma posição. Esperava que Davi fizesse justiça. Mas, Davi não fez nada. Extremamente fora de controle, Absalão tomou as dores da irmã e matou o seu irmão. Além disso, rebelou-se contra o pai conquistando aliados dentro do reino e destitui o pai do reinado, fazendo com que fugisse de Jerusalém.



(This post was edited by weston on Apr 27, 2003, 12:47 PM)


Luis
Veteran

Apr 27, 2003, 1:06 PM

Post #3 of 169 (17275 views)
Shortcut
Re: [weston] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Yes. Nothing to do with the editor but with my test page. As I'm using the page to test Hebrew Texts, default encoding is UTF-8. before using the editor Click on View/Encoding/Western European (Windows) (in the menu bar of the browser) and then test it. Everything will go fine. Thanks anyway for the advise.


Don't give up!!
http://webstationone.com/test/htmlarea


idi3
Novice

Apr 28, 2003, 4:40 AM

Post #4 of 169 (17238 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hello Luis.

The font name and font size selections aren't working well in your test. I can't change the font name.

Bye


Luis
Veteran

Apr 28, 2003, 11:44 AM

Post #5 of 169 (17195 views)
Shortcut
Re: [idi3] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

They are working properly for my purposes. As I never use the tag font in any of my sites, I decided to strip it out and never allow the user to change the look of the fonts, since the look of my sites relies in standarized CSS. (Of course, in my working programs I don't have The Fonts pulldowns).

As I mentioned in my first posting, it's very easy to customize which tags or attributes to clear. But you are right, I will enable the Font tag back, so everybody can test without problems. It will be until tonight 'cause I'm not in my working computer.

The buggy part in this mod is that it updates the contents switching to HTML mode, therefore if you change the fonts and you don't switch to HTML Mode, all changes will remain without be cleared.

I'm going to work a little bit around this, even when this is not an issue for my purposes. If I don't come with a solution, and you like the mod as is, maybe somebody else can do it.


Don't give up!!
http://webstationone.com/test/htmlarea


idi3
Novice

Apr 28, 2003, 12:00 PM

Post #6 of 169 (17189 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

I'm sorry, my english isn't good and I didn't tell you what was my problem.

I want to say that the "Font Name" and the "Font size" of the htmlarea aren't working properly.

Example: Type something into the editor and change the font name (ex: from Verdana to Courier new) you will note that the font name select doesn't show the new font name. If you change another time the font name (ex: to windings) then you can't type anymore.

There are similar problems with the font size.

I'm using IE 6.0

Thanks.


Luis
Veteran

Apr 28, 2003, 12:21 PM

Post #7 of 169 (17185 views)
Shortcut
Re: [idi3] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hey man. This doesn't happen in my editor. It's working well in my end.


Don't give up!!
http://webstationone.com/test/htmlarea


idi3
Novice

Apr 28, 2003, 12:37 PM

Post #8 of 169 (17180 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

What version of IE do you have?


Luis
Veteran

Apr 28, 2003, 12:42 PM

Post #9 of 169 (17182 views)
Shortcut
Re: [idi3] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

It's tested in IE 5.5 and 6.O all SP's in Windows 98, 2000 and XP.


Don't give up!!
http://webstationone.com/test/htmlarea


Hawk92
Novice

Apr 29, 2003, 6:08 PM

Post #10 of 169 (17101 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Luis - were you going to post the files for your htmlarea with the word cleaner?


mbourque
Novice

Apr 30, 2003, 9:26 AM

Post #11 of 169 (17057 views)
Shortcut
Re: [Hawk92] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

I can't wait for this awesome mod!

Great work!


cjfnagel
New User

May 7, 2003, 9:53 AM

Post #12 of 169 (16875 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Truly a great job, congratulations!

A minor problem, though: if a user pastes text by right-clicking the mouse in the htmlarea and choosing "paste", the text is inserted "as is", unfiltered.

Is there a possibility to intercept "onRightClick"?

Other than that: like many others, i'm really anxious to get my hands on this great mod.


cjfnagel
New User

May 7, 2003, 9:56 AM

Post #13 of 169 (16873 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Oops, you said so yourself:


Quote
Have it working with Shift+Insert and Context Menu's Paste option


Sorry. I think it's great anyway, so do you see any possibility to post the mod as a "beta" without the refinements you intended to do?


mbourque
Novice

May 9, 2003, 4:16 PM

Post #14 of 169 (16775 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Still waiting for this mod. Luis, are you still working on it?


snooper
User

May 11, 2003, 10:36 AM

Post #15 of 169 (16712 views)
Shortcut
Re: [mbourque] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

excellent - look forward to seeing this

:)


fantasydreaming
New User

May 21, 2003, 12:11 PM

Post #16 of 169 (16488 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi Luis,

Looks like several of us are waiting for the packaged deal :) This sure looks like a neat feature to include!

I threw it into a subroutine:


function myclean(editdoc) {
//if (confirm("This function will clean the HTML code of the contents in your clipboard overwriting the current selection and cannot be undone.\nAre you sure you want to perform this action?")){

var oTags = editdoc.all.tags("SPAN"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}
oTags = editdoc.all.tags("DIV"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}
oTags = editdoc.all.tags("FONT"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}
// must disable handling of <P> tags for now, it doublespaces everything! uggh!
//oTags = editdoc.all.tags("P"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {alert("outer is " + oTags.outerHTML + " and inner is '" + oTags.innerHtml);oTags.outerHTML = "<br>";}}
//oTags = editdoc.all.tags("P"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("B"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H1"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H2"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H3"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H4"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H5"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("H6"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("BLOCKQUOTE"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("OL"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}
oTags = editdoc.all.tags("UL"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {cleanEmptyTag(oTags);}}

//}
}


and then called it from the keypress event section like so:

if (ctrlKey && (ord == 86) && editEvent.type == 'keydown') { //cleans up the code while pasting on CTRL+V
editEvent.returnValue = false; editEvent.cancelBubble = true;
editdoc.execCommand('Paste');
myclean(editdoc);
}
if (shiftKey && (ord == 45) && editEvent.type == 'keydown') { //cleans up the code while pasting on Shift+INS
editEvent.returnValue = false; editEvent.cancelBubble = true;
editdoc.execCommand('Paste');
myclean(editdoc);
}



and copied in the cleanEmptyTag() function from your editor.js function into my default editor.js



Only now I'm having trouble with it doublespacing documents I paste in from word or other htmlarea forms. I am using the <br> instead of <p> patch. I tried replacing the outerhtml with "<br>" (commented out, above), but that doesnt work since they have children, so I assume something needs to be done in the cleanEmptyTag() function, though I can't figure out where to check if there are no children and if the tag is <p>, perhaps you can help...

Thanks,

Kevin
kevin at allpoetry.com


fantasydreaming
New User

May 21, 2003, 12:17 PM

Post #17 of 169 (16479 views)
Shortcut
Re: [fantasydreaming] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

also, as someone above said it seems to remove fonts because word stores them as <SPAN
style="FONT-SIZE: 14pt; mso-bidi-font-size: 10.0pt">my font</SPAN>, which is too bad, can you think of any way to allow the span font style, or transalte it to the traditional font tag?

It would be nice to get rid of the u1:p and st1:PersonName tags that word throws in everywhere too, but that would require removal of matching tags which is more complicated?

Thanks for any help you an give me,

Kevin


Luis
Veteran

May 21, 2003, 12:42 PM

Post #18 of 169 (16480 views)
Shortcut
Re: [fantasydreaming] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi fantasydreamig:
You made my own fantasydream true!. I was playing around a subroutine and for some reason I never could make it work. Thanks a lot.
As for your question, its a hard task to find out how many different ways Word uses to write HTML, dependig on the Word's version and the user's settings. Let me play around this a little bit and if I find something I'll let you know.

Luis


Don't give up!!
http://webstationone.com/test/htmlarea


Luis
Veteran

May 22, 2003, 2:38 AM

Post #19 of 169 (16437 views)
Shortcut
Re: [fantasydreaming] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post


In Reply To
Only now I'm having trouble with it doublespacing documents I paste in from word or other htmlArea forms. I am using the
instead of <p> patch. I tried replacing the outerhtml with "
" (commented out, above), but that doesnt work since they have children, so I assume something needs to be done in the cleanEmptyTag() function, though I can't figure out where to check if there are no children and if the tag is <p>, perhaps you can help...

Thanks,

Kevin
kevin at allpoetry.com



First, thank you for the function. it works great.

Regarding the quoted question, could you attach a sample of both markups, what you are obtaining and what you would like to have?

It would make easier for me to understand it.

Regarding the SPAN tag with fonts styles, i had not paid attention on it since I rarely allow a user to set up their own styles. Everything matches the styles of the website. Anyway, I tried several tricks and none worked out.

For the FONT tag, in order it not be automatically stripped, I commented it out in the function myclean(editdoc), and added the ability on-demand, from a button click.

else if (cmdID == 'RemoveFont') {
oTags = editdoc.all.tags("FONT"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}
}


Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea


joransrb
New User

May 27, 2003, 3:22 AM

Post #20 of 169 (16208 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi!

This looks great :):)

When og where will the download be posted...??

Keep up the good work :)

Regards


Garve
Novice

Jun 2, 2003, 11:06 AM

Post #21 of 169 (15991 views)
Shortcut
Re: [joransrb] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi Luis

I've tried your demo and the Word Cleaner function is exactly what I need. I'm using htmlArea in a slightly different way, allowing users just about as little functionality as possible and trying to force input to conform to strict styling standards. Therefore they have no access to change fonts etc, and a limited number of styles/headers they can use. They've been able to get round this by cutting and pasting from Word, which I'm keen to prevent.

I've modified v2.02 quite extensively to do this (although I've got very little knowledge of javascript), but have not been able to add your mods to it successfully.

Do you have a list of the changes I'd have to make?


Luis
Veteran

Jun 2, 2003, 11:41 AM

Post #22 of 169 (15988 views)
Shortcut
Re: [Garve] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Unfortunatelly not. If you don't mind, send me a copy of your editor and I'll gladly include the changes there. I think it's the easier way.


Don't give up!!
http://webstationone.com/test/htmlarea


MK
Novice

Jun 3, 2003, 2:09 AM

Post #23 of 169 (15955 views)
Shortcut
Re: [Luis] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hallo Luis!

I´ve got the same problem. Is it OK for me to send you my editor? If yes - where to send it?

Thanks

Mats


antiqueone
New User

Jun 12, 2003, 10:18 AM

Post #24 of 169 (15723 views)
Shortcut
Re: [MK] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

I am using html area 2.03 with geeklog. The installation is completely standard with no changes. I have absolutely no experience with Javascript.

I have tried these various word cleanup functions and I either get htmlarea not loading or nothing happening at all. Can anyone tell me in simpletons language how I get a word cleaner up and running?

Thanks in advance.

Antiqueone


Luis
Veteran

Jun 12, 2003, 11:14 AM

Post #25 of 169 (15715 views)
Shortcut
Re: [antiqueone] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Send me your editor. I can do the changes for you if you don't mind.


Don't give up!!
http://webstationone.com/test/htmlarea

First page Previous page 1 2 3 4 5 6 7 Next page Last page  View All
 
 


Search for (options)