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.



Luis
Veteran

Apr 27, 2003, 5:01 AM

Post #1 of 169 (17380 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 (17299 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 (17282 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 (17245 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 (17202 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 (17196 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 (17192 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 (17187 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 (17189 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 (17108 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 (17064 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 (16882 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 (16880 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 (16782 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 (16719 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 (16495 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 (16486 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 (16487 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 (16444 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 (16215 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 (15998 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 (15995 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 (15962 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 (15730 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 (15722 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


antiqueone
New User

Jun 16, 2003, 3:40 PM

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

Thanks Luis - I attach my editor.Smile
Attachments: editor.js (46.5 KB)


polel129
New User

Jun 17, 2003, 8:14 AM

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

Hi,

First of all thanks Luis for your amazing function.

I've implemented your function and it works without errors but it strips some spaces (" " not "&nbsp;") from the text when I paste.

I've posted my editor.js. I'd be grateful if someone could help

Thanks

Eleni
Attachments: editor.js (53.6 KB)


Luis
Veteran

Jun 17, 2003, 11:23 AM

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

Hi Eleni:
I've noticed you have a very initial version of the mod. The problem with the blank spaces stripping is the <SPAN> tag. I'll make a fix for you later tonight.

Greetings


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


Luis
Veteran

Jun 17, 2003, 8:58 PM

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

Here it is:

The MS Filtering is applied onpaste, so I enabled a paste button.

Currently, the clean up is setup for my own needs. If you need not to strip some tag, comment it out. If you have some problems, contact me again.

Good Luck!


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_antiqueone.js (54.9 KB)
  ed_paste.gif (0.90 KB)


Luis
Veteran

Jun 17, 2003, 10:34 PM

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

Hi Eleni, here it is:

The MS Filtering is applied onpaste, so I enabled a paste button.

Currently, the clean up is setup for my own needs. If you need not to strip some tag, comment it out. If you have some problems, contact me again.

BTW. Your editor had an error somewhere in Function: editor_event , I fixed it.

Be aware that pasting using the context menu (right-click) the MS Filtering is not applied. If you want to prevent pasting unfiltered content, let me know to tell you how to disable it.

I tested it with about 20 different documents and it worked well.

Good Luck!


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: ed_paste.gif (0.90 KB)
  editor_eleni.js (55.2 KB)


antiqueone
New User

Jun 18, 2003, 5:22 PM

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

Thanks a lot Luis. This is great it really reduces the size of the html file. I must now get down to fully cusomising to meet my needs.

htmlarea and the help in this forum continually amazes me.


polel129
New User

Jun 23, 2003, 4:45 AM

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

Thanks Luis! It doesn't strip the spaces now.

I have a question regarding the cleanHTML function. It doesn't work on paste but when I click the View HTML source button (I can see that you call this function in editor_updateOutput).

Why is this happening?

Thanks

Eleni


Luis
Veteran

Jun 23, 2003, 11:29 AM

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

Hi Eleni:
I'm at work now. I'll go into this later tonight to see what's happening.

Luis


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


Luis
Veteran

Jun 23, 2003, 9:42 PM

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

Hi Eleni:

It should work as it does on my side. Anyway, try changing

editor_updateOutput(objname);

with:

editor_setmode(objname, '');
editor_setmode(objname, 'init');

This change could give you an error message, which I don't remember where in editor.js it is. If this is the case, you can kill the error message adding this script in the head section of your htmlarea page.:

<SCRIPT>
function stoperror(){
return true
}
window.onerror=stoperror
</SCRIPT>

The error doesn't seem to affect anything. Hope this helps better now.


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


barcsdad
Novice

Jul 8, 2003, 1:47 PM

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

Luis,

I've recently tried out your latest version, but seem to be getting some error when hyperlinking something in the editor. I haven't really made any modifications to anything. Here are two things that I've noticed:

1. If I bring up the link dialog box and do not enter anything in and click OK, then I don't get any errors (but what good does that do?).

2. If I do enter a URL and click OK, I get another browser window opening up with a 405 error on http://mywebsite.com/Editor/popups/insert_link.html

Any ideas?

Marty


Luis
Veteran

Jul 9, 2003, 1:19 AM

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

Hi barcsdad:

I cannot figure out what's happening. It works well in my editor, but maybe you have an oudated version. The original mod by Barry-Hunter had a bug and was fixed by himself. The fix is in the post#3 of this page:

http://www.interactivetools.com/forum/gforum.cgi?post=10849


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


greiner
New User

Jul 9, 2003, 1:33 AM

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

Hi Luis,

I implemented your solution for automatically cleaning Word files using the editor.js file you posted and it all seems to work perfectly up until the cleaning routine finishes. At this point I get an 'Unknown runtime error' on Line 452, Character 33.

Even though I get the error, the cleanup function does seem to work.

Any ideas on what's causing me to get this error?

Cheers and congrats on becoming a HTMLArea Expert!!


Mosschop
New User

Jul 9, 2003, 2:57 AM

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

I'm not sure whether I have a problem or not. Whenever I import word documents using Luis' tools, all the images come up as blanks. Is this expected behaviour?

I ought to add that I'm not a programmer and suspect that I have one of the configuration settings wrong as the html behind the imported document is looking for the images in c:\htmlarea\. I presume that the default configuration tries to save them elsewhere?


(This post was edited by Mosschop on Jul 9, 2003, 3:08 AM)


brad1213
New User

Jul 9, 2003, 11:32 AM

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

I'm using the Word cleaner, when I paste in a doc that has bullet points in it strips them out, I tried commenting the lines out that seem to do the replacing, but nothing happens. I commented out the whole function still does the same.

Is there a way to repalce words bullet points with <ul> tags?

Thanks

Brad


barcsdad
Novice

Jul 9, 2003, 2:51 PM

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

Luis,

I just created a "clean" version of your editor (downloaded from http://www.webstationone.com/test/htmlarea/index2.html) and put it up at http://www.docuplate.com/clean/Editor.

The only change I made to the code was this line:


Code

And I still get the error when trying to add a hyperlink. Very odd. Any thoughts?

Marty


Luis
Veteran

Jul 9, 2003, 3:33 PM

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

Hi barcsdad:
I don't know what to tell you. Perhaps the insert_link.html file in my zip is outdated. I'll take a look at it later tonight. In the meantime, could you attach your editor.js and your insert_link.html files?

It might be faster if you do.


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


barcsdad
Novice

Jul 9, 2003, 3:38 PM

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

Luis,

No problem. Like I said, these files are fresh out of your zip file. They are not modified. Thanks.

Marty
Attachments: editor.js (106 KB)
  insert_link.html (4.85 KB)


Luis
Veteran

Jul 9, 2003, 3:38 PM

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

Hi brad1213:

I've faced that problem too. It has nothing to do with the editor, but with the way as the word documents are created.

Those dots that resemble a bulleted list are not real lists, but simple bullets (&#149;) or some styles maybe.

Send me a word document which is causing you this problem and I'll try to make a fix. No promise to succeed but I do to give it a try.


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


(This post was edited by Luis on Jul 9, 2003, 3:39 PM)


Luis
Veteran

Jul 9, 2003, 3:59 PM

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

Hi barcsdad:

try adding the onsubmit event to your form tag:

<form method="post" name="set" onsubmit="returnSelected();return false;">

let me know if it worked.


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


Luis
Veteran

Jul 10, 2003, 12:41 AM

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

Hi Mosschop:

Yes. It has nothing to do with the WordOpener, but with the MSWord behaviour. It will happen even when copying and pasting from word.

As per your words "all the images come up as blanks" and is looking for the images in c:\htmlarea\, I assume that you are not using the code cleaner functions: function cleanHTML(unclean) and function myclean(editdoc)

The function cleanHTML(unclean), clears the images and returns only text.

At this moment I don't have a workaround to keep the images and it might be a very hard task. Why? because the directory where MSWord stores the images vary from user to user, from platform to platform and from Word Version to Word Version.

I've been trying to get a bullet-proof function to translate the weird tag that Word uses to insert images into proper HTML. (notice the path to my temp directory).

<v:imagedata o:title="rainbow" src="file:///C:/DOCUME~1/LUISFE~1/LOCALS~1/Temp/msoclip1/01/clip_image001.jpg"></v:imagedata>

If we succed, then the approach will be not to clear the images with the code cleaner but to use the (now visible) images as place holders and then, update the image url after being uploaded.

If somebody experienced in regex could help with this I'm certain everybody here will love him.


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


IanIppolito
Novice

Jul 19, 2003, 2:09 PM

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

Luis,

I used your MOD and it worked PERFECTLY. Fantastic work!Smile

I was reading through this thread and saw you said something to Eleni that wasn't included in your source code (at least I assumed not, because your web demo doesn't seem to implement it.)

You said:

>>>Be aware that pasting using the context menu (right-click) the MS Filtering is not applied. If you want to prevent pasting unfiltered content, let me know to tell you how to disable it.

Can you tell me how you did this?

Many thanks!
Ian


Luis
Veteran

Jul 19, 2003, 2:38 PM

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

Hi IanIppolito:

It's quite simple. In your editor.js, search for this line:

+ ' oncontextmenu="parent.editor_cMenu_generate(window,\'' +objname+ '\');"'

and replace it with:

+ ' oncontextmenu="return false;"'
// + ' oncontextmenu="parent.editor_cMenu_generate(window,\'' +objname+ '\');"'

Be careful with the wrapping. Must be single lines.

Working context menus are coming up. Stay tuned!!


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


(This post was edited by Luis on Jul 19, 2003, 2:40 PM)


IanIppolito
Novice

Jul 19, 2003, 4:23 PM

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

WinkAwesome Luis...thanks I'll try it out right now.

You're doing an awful lot of work for me and everyone on this board. Do you mind if I send you a small donation of a few bucks?

Ian


Luis
Veteran

Jul 19, 2003, 4:35 PM

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

No way! Money is not an issue for me when it comes to help somebody.

I really think the only way to express how grateful I am with life is giving the life back what life has given to me. You can do the same posting here all your improvement or sharing your ideas or concerns with each other.

Each questions I read here in the forum helps me to better understand how htmlArea works and to improve my short skills in javascript, so I'm the most grateful with this forum and all of you.

Greetings


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


IanIppolito
Novice

Jul 20, 2003, 9:53 AM

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

Luis,

You are truly special and a fantastic resource. Thanks again.

Ian


Rorrah
Novice

Jul 23, 2003, 7:03 PM

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

The longer I look at this code the more my brain tries to dribble out my ear. Can anyone tell me how to put the word cleaner into the V3.0 version of HTMLArea?

Thanks


Luis
Veteran

Jul 23, 2003, 8:25 PM

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

Hi Rorrah:

This code works with V2.3 only. Check in V3 Forum. I know there is some work around there.


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


Rorrah
Novice

Jul 23, 2003, 9:12 PM

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

I looked...I swear....I failed.

Ah well...thanks tho


wahooka27
New User

Jul 29, 2003, 3:14 PM

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

hi luis-

this sounds like an awesome addon, but i cant seem to get your sample page to work. when i paste from word into your editor its great, but i see opening a word document is also an option. i couldn't get it to work though. it gives me an error 'document.body' is null or not an object.

does this feature work or are you planning on implementing at some later point? thanks for the awesome addon


Luis
Veteran

Jul 29, 2003, 3:23 PM

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

Hi Wahooka27:

You need some settings in your computer to enable ActiveX:

instructions are in post #3 of this page:
http://www.interactivetools.com/forum/gforum.cgi?post=14813

Greetings!


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


wahooka27
New User

Jul 30, 2003, 8:54 AM

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

great. got it working thanks for the help and the great, great addon to an already very cool editor.

i have one other problem that maybe you could help me with. my htmlArea stores itself in a mysql db and when i create and add something in htmlArea and add it to the db, it works great.

but when i try to edit it, an odd thing happens. "Internet Explorer cannot open the Internet site http://mysite/editfield.php Operation Aborted" but if i click back after getting the error, the field is filled in and works. like say i get the error, click back and make a change and click "Edit" it works. so it seems like there is a problem intially loading the saved html code and loading it into the editor. why it works when i click back doesn't make too much sense...

also i should note, this problem is only with stuff i either pasted in from word or opened directly from word which makes me think it might be an issue with a certain tag or something, but the word cleanup works great so i cant figure it out.

do you or anyone have any idea why i could be having this problem? i sure could use the help
thanks once again!


(This post was edited by wahooka27 on Jul 30, 2003, 8:58 AM)


wahooka27
New User

Aug 1, 2003, 1:42 PM

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

did some more investigation and i found a post that helped me out.

http://www.interactivetools.com/forum/gforum.cgi?post=8609

basically for some reason the code like this:

<script language="JavaScript1.2" defer>
editor_generate('customcontracts');

has to come after your form where you have a textarea. so after you close your form like " </form> " then put that javascript. i am pretty sure this has fixed it for me at least. thanks for the help editi


(This post was edited by wahooka27 on Aug 1, 2003, 1:43 PM)


siadmin
Novice

Aug 2, 2003, 4:02 AM

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

Hiya, this is a rocking application, have been looking for something like this for a long time then found the original htmlArea then stumbled across this......... excellent work man.

Got a question for you well while I am here Sly

I am using ColdFusion to handle the forms and writting them to a mysql database..... everything works fine with the Word cleaner function apart from when I paste a document with a ' (apostrophe) the apostrophe turns into 3 boxes. The preview shows that everything is fine, just when I recall the information from the database it seems to play up. Looking at the field directly in the database it shows ’

Any help would be greatly appreciated.


QUIET! I can't hear you and the little voice in my head at the same time. Crazy


Luis
Veteran

Aug 2, 2003, 4:27 AM

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

Hi siadmin:

Try putting this line at the end of the function:

unclean = unclean.replace(/’/gi, '\'');


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


siadmin
Novice

Aug 2, 2003, 4:42 AM

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

Hiya Luis,

That didn't seem to make any difference......... if I manually go through the document pasted and change called apostrophes then it seems to work perfectly.

The apostrophe that appears in the textarea is different to the one if you were to type in the apostrophe.

Will see this works:

<pasted from word> the child’s parent/guardian

<changed within textarea> the child's parent/guardian


QUIET! I can't hear you and the little voice in my head at the same time. Crazy


Luis
Veteran

Aug 2, 2003, 4:47 AM

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

If the other one doesn't work, then try

unclean = unclean.replace(/’/gi, '\'');


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


siadmin
Novice

Aug 2, 2003, 5:20 AM

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

Sorry still doesn't seem to work.

Displaying the page it gives me &#65506;&#65408;&#65433; looking at the database directly it gives me &#915;Çô or GÇÖ or ’ there doesn't seen to be a regular occurance of this.

Have put all of the above into the .js file replacing the ' within unclean = unclean.replace(/’/gi, '\'');


QUIET! I can't hear you and the little voice in my head at the same time. Crazy


siadmin
Novice

Aug 2, 2003, 7:34 AM

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

If anyone is interested, I manged to get around this problem using a ColdFusion tag, not sure if it is just ColdFusion that has experienced this. Here is what I did:

Used to replace the Apostrophe generated by Word to a chr value
<cfset details = REReplace("#form.details#", "#chr(226)##chr(128)##chr(153)#", "#chr(39)#", "ALL")>

Used to replace another type of Apostrophe generated by Word to a chr value
<cfset details = REReplace("#details#", "#chr(226)##chr(128)##chr(152)#", "#chr(39)#", "ALL")>

Used to replace the hyphen generated by Word to a chr value
<cfset details = REReplace("#details#", "#chr(226)##chr(128)##chr(147)#", "#chr(45)#", "ALL")>


QUIET! I can't hear you and the little voice in my head at the same time. Crazy


philps
New User

Aug 7, 2003, 2:45 PM

Post #64 of 169 (6678 views)
Shortcut
Trouble replacing original editor.js with "modded" [In reply to] Can't Post

Luis,
I've replaced the original htmlArea with the one provided at your website as of July 27th. With your editor.js, the <textarea> value is no longer set. I can use the editor normally, but when I submit the form, the <textarea> is blank. Have you (or anybody else) ever experienced that? If not, do you have an idea of what may be causing that?
Thanks,
Felipe

Life's a cabaret.


Luis
Veteran

Aug 7, 2003, 5:04 PM

Post #65 of 169 (6671 views)
Shortcut
Re: [philps] Trouble replacing original editor.js with "modded" [In reply to] Can't Post

Hi Philips:

I don't get it right. Is there a place where I can see your implementation working? If you don't want to make your url public send me a PM with it or attach your files to take a look.

Greetings


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


geroreilly
Novice

Aug 7, 2003, 9:07 PM

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

Luis,
This is some brilliant work and really appreciated. I read a previous post saying that you werent interested in any donations!... So there really are some genuine nice guys left! Thanks

Of course, after all that flattery I have a request that you may be able to help me with. I am using your editor.js and am having a problem with anchor tags - when I create a new Anchor and when I open a Word Document in the HTML Area. It always puts the link as the full URL that is currently being used. However, I have an edit page and a viewing page so when the viewer opens the page and clicks on an anchor link it will bring them to the edit page rather than staying in the viewer page.

I saw something in your editor.js file and played around with the syntax many many times but couldnt get it to work.

I also posted this on the HTML area section as follows which may help explain some more.....
Hello,
I am using the WebStation version of htmlArea from Luis and have almost =
everything working OK except for Anchor links within a page.

I have tried using the unclean script as referred to in the editor.js =
but it still doesnt work. The code I used was :
unclean =3D =
unclean.replace(/http\:\/\/intranet\/cgi-bin\/vdc2_kb\/WService=3Dkb_dev\=
/kb\/portal\/src\/Admin\MaintDetail?/gi, ' ');=20

The URL in the browser is =
http://intranet/cgi-bin/vdc2_kb/WService=3Dkb_dev/kb/portal/src/Admin/Mai=
ntDetail?cArticleID=3DdmpiOCTq9S78231682&cArticleNumber=3D100007 but the =
ArticleID and ArticleNumber change all the time.

The MaintDetail page is where Admins update content but viewers actually =
view it through a different URL. Therefore, using the obsolute url is =
not what I want to do in this case.

In the editor if I just type http://intranet/test.html it appears OK. =
BUt if I type in #testing then the href used is:
http://intranet/cgi-bin/vdc2_kb/WService=3Dkb_dev/kb/portal/src/Admin/Mai=
ntDetail?cArticleID=3DdmpiOCTq9S78231682&amp;cArticleNumber=3D100007#test=
whereas I just want #test so that the link stays within the same =
document..... relative link.

Any idea how I can achieve this result?

Thanks again in advance and thanks for all this great effort....


Luis
Veteran

Aug 7, 2003, 9:34 PM

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

Hi geroreilly:

When this strange change occurs in the code? while you are in the editor and switch to HTMLView, or just after submitting the form?

Anyway, the code here is very confusing. It seems to me that your browser is encoding special characters like &.

Could you send me a clean original URL of one of your articles. the ones included in your message seems to be corrupted with = signs that I don't know if belong or not to the url. the dynamic articles ID and Name could be a problem, but I think It's achievable.

Greetings.


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


Rorrah
Novice

Aug 11, 2003, 7:26 PM

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

I managed to get a little overzealous in my customizations of the cleanhtml area of the script. It wasn't managing to catch all the variations of crap that Word could put after the <p> tag. So I ended up doing thing

/<p[^>]*>/gi '<p>'

Which works wonderfully...except I just realized I've killed the ability of my users to center text. One of the few things I was actually allowing them to do. So I need to find a way to kill ALL attributes inside the <p> tag except align. My regex subexpressions skills aren't up for this one tho. Can anyone help?


Luis
Veteran

Aug 11, 2003, 8:33 PM

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

Hi Rorrah:

Actually, the function that takes care of it is not in the function cleanHTML(unclean), but the function myclean(editdoc), where the approach is quite different and you don't need to make any replacement or use regex.

Download my editor from the url below. I made some changes to improve the cleanup functions. The cleanHTML(unclean) got reduced substantially. In addition, I added a sort of Word's detection, so class and style attributes get cleared only when pasted contents come from Word while keeping them when those attributes are manually inserted or come from another sources.

The other parts affected are:

else if (cmdID.toLowerCase() == 'paste') .....

if (ctrlKey && (ord == 86) ...... and

if (ctrlKey && (ord == 45)


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


Rorrah
Novice

Aug 11, 2003, 8:46 PM

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

Oh...well thats where I run into trouble. See I'm using the newer version of editor, as at least half of the people who are using this seem to be using Mac's. (Old mac's no less, evil evil things) So I actually pulled out your code and put it into something independent of the editor. Basically I pull the text from the DB, clean it and put it back in. Not the most efficient, but works with my skill set and doesn't freak out at all. Unfortuantly when I did that, I couldn't get the myclean part of it to work. It threw errors all over the place.

So I managed to get most of what I needed back into the cleanhtml part of it. So I'm back to how do I pull out everything but align= from the <p> tags


Luis
Veteran

Aug 11, 2003, 8:55 PM

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

Hi again Rorrah:

I'm sorry. I wrongly assumed your posting was regarding Version 2. As you talk about Mac, I guess you are using Version 3, such a case my mods won't work. I apologize for the confussion.

Regarding your original question, my "gray matter" is not enough to figure out how to achieve it.

Once again, I'm sorry.


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


Rorrah
Novice

Aug 11, 2003, 9:02 PM

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

Thats okay...like I said. I'm using part of it after the fact.

So I just need to incorporate all the cleaning into the cleanHTML part of the code and it works great.



So does anyone know regex enough to offer a suggestion.


Luis
Veteran

Aug 12, 2003, 2:38 AM

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

Hi again Rorrah:

I managed to do it using three expressions. Hope this helps.

(/<P [^>]*align/gi, "<p align");
(/<P class[^>]*>/gi, "<p>");
(/<P style[^>]*>/gi, "<p>");


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


geroreilly
Novice

Aug 13, 2003, 10:46 PM

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

Luis,

Thanks for replying. It was the Queens birthday here in Thailand so they gave us a few days off work!

When I insert an anchor link using the link option and switch to the HTML View it already puts the complete URL in the ahref - thats before I submit my form.

Yes the last example I gave you had many = (equals) which were just a result of a copy paste. The complete correct URL for example is http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/MaintDetail.html?ArticleID=IFX234345435GHTY ( so the only equals signs are WService=ws_katie and ArticleID=IFX).

Instead of the editor putting the complete URL as the ahref I would like to be able to link to an anchor on the same page. Example, <ahref="#anchortag">go to anchor tag </a> instead of the complete URL in the ahref.

Obviously the Article ID's can change so I need to consider that.....

I hope you can come up with a solution for me.......

If you need any further info please let me know.


Luis
Veteran

Aug 14, 2003, 12:05 AM

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

Hi geroreilly:

I have only two questions to clarify and make it bullet-proof.

1.- Is Article Id the only variable part?

2.- Is some other part of the URL likely to appear somewhere else in an article besides the anchor tags, which you wouldn't need to be removed, for example a link or reference to another page that matches part ot he Url? If so, which part?

I can anticipate it's achiveable, all I need is this information.

I expect for your answer.
Greetings.


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


geroreilly
Novice

Aug 14, 2003, 2:19 AM

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

Yes ArticleID is the only variable part but there may be extra variables that I pass through the URL but these are ALWAYS after the ArticleID. Example: http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/MaintDetail.html?ArticleID=IFX234345435GHTY&ArticleType=training&ArticleOwner=123456.

The only other situation where the URL before ArticleID will change is when I am on my test server so instead of http://katie/cgi-bin etc etc I will have http://katietest/cgi-bin.

Yes there could be links to other articles, files, etc within the text of an article that could have the complete URL. I could use the absolute URL as the hyperlink: "http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/MaintDetail.html?ArticleID=IFX234345435GHTY" OR I could use a relative link "../ViewArticle.html?ArticleID=123456789.

But ideally I would like to have the option to choose either absolute or relative for all links outside of the document but to ALWAYS use the relative link when using anchors within a page. Therefore the HTML to be created when I insert an anchor link in the editor should be <ahref="#gotothisanchor">Go to here</a>.

I also attach my editor.js which may help.

Maybe something that is connected to this but the drpopdown box for Formatting options does not work for me. I see the list fromt he formatblocks function but when I choose one of them they dont apply within the editor.

Whats the best way to work around this? I would like to use css to apply standards across my site but that the user can choose to format their own way using these formatting options in the dropdown box.

Thanks again for helping me out...


Luis
Veteran

Aug 14, 2003, 3:52 AM

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

Hi geroreilly:

I think I have information enough. I'll start working on it tomorrow.

Regarding FormatBlocks, I guess the problem is that you are using a computer in a language different to English. Am I right?

If this is the case, run the attached file in your computer. it will list all formats as read by the system in the language you are using. Then, open your editor.js (by the way, your attachment didn't came in) and search for:

this.formatblocks = [
{tag: "", formatblocklangs: [{lang: "en", name: "Normal"},
{lang: "nl", name: "Normaal"}]},


and add a line for your corresponding language per each format as read from the attached file, ie.

this.formatblocks = [
{tag: "", formatblocklangs: [{lang: "en", name: "Normal"},
{lang: "xx", name: "Format Name in your Lang"},

{lang: "nl", name: "Normaal"}]},


where xx is the International identifier for your language.


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


(This post was edited by Luis on Aug 14, 2003, 3:53 AM)
Attachments: FormatBlock.html (0.56 KB)


geroreilly
Novice

Aug 14, 2003, 5:44 AM

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

HI Luis,

Thanks. I will try the formatting fix.

I also attach 2 files. The first is my editor.js and the second is a MS Word file that I am having problems with when opening in the editor. It does not retain the correct format for all the bulletpoints and indents. Some files seem to work OK but others dont at all. When it loads it first it all looks perfectly formatted but then it auto refreshes and almost the bullet points are lost. Any ideas on this? Should I use a standard Word template when creating the Word files?

Thanks again for helping me out with all this...........


geroreilly
Novice

Aug 14, 2003, 7:36 PM

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

Luis,

Sorry - was having problems uploading attachments. Hopefully you can get these ones OK. Thanks
Attachments: editor.js (106 KB)
  TrainingPMT_program_modules.doc (28.0 KB)


Luis
Veteran

Aug 14, 2003, 8:50 PM

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

Right this time geroreilly!!


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


Luis
Veteran

Aug 14, 2003, 11:37 PM

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

Hi geroreilley:

The problem with the word document relies on Word. It seems that Word doesn't know to make nested lists in a HTMLized manner, so it renders the nested lists with a lot of weird spans and styles. Therefore, the Word cleaner is destroying all the formatting. I've had this problem before and have not found any way to avoid it or any hidden setting in Word that prevents it. The worst part is that HTMLArea doesn't accept nested lists either, so there is no way to reformat the text, but doing it in HTMLMode. A list manager which allows nested lists plus different bullets or numbers types would be nice. I'll experiment on it later.

Greetings.


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


geroreilly
Novice

Aug 14, 2003, 11:48 PM

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

Luis,

Thanks. THe Format Blocks work OK now with the Thai language fix.

As I am using the Word cleaner more and more I have come across af ew thins that you may be able to help me with.

Firstly, Can I keep text colours?
Secondly, when using the Word open document option it seems to create a process for each time but never closes that process so when I look at processes in my task manager I have many many WINWORD.exe open and I have to kill them manually.
Thirdly, is there a file size restrictionn? When I open a document bigger than 250k and submit it it just shows a blank text area. If I cut half, submit, then paste the other half and submit again it accepts it all correctly. Strange but true.

Maybe you can shed some light on these/..... please and thanks


Luis
Veteran

Aug 15, 2003, 1:06 AM

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

Hi again geroreilly:

Everything is possible, some things harder than others. However the ideal is just that, only ideal. Sometimes to achieve something we need to sacrifice something else.

The big problem with Word is that it's unpredictable how Word is going to render HTML the next time. Sometimes it makes the font color in a font tag, other times in a style, without any apparent reason to make it differently from one case to the other.

You can control which attributes or tags to strip out or not, but of course, if for example you decide not to strip the style attribute, you will keep everything inside it, not just the color. (all you have to do is comment out this line:oAttribs.removeNamedItem('style') )

Or you can keep the font tag commenting out this other line:
oTags = editdoc.all.tags("FONT"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}

Regarding multiple instances of Word open at a time, it shouldn't happen. The script takes care of it. In openword.html line #43 word.Quit(); is supposed to close Word after inserting the document. This is the way as it works in my side. Maybe your Thai version doesn't understand the instruction ??? A good question for Microsoft, although I'm pretty sure that Windows Scripting Language is universal.

Regarding File Size restriction, it must there be for sure, but not too small as 250 Kb. I don't know a precise number, but I use to post through htmlArea really big documents (Around 60+ pages in Word as an average). I have tested with up to 200 pages without any problem. More than that I've experienced some problems but they are due to server time out, not to htmlArea or the Word opener performance. Could it have something to do with your processing script? Try to replicate all this in my editor to start discarding possible causes.

Greetings!



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


(This post was edited by Luis on Aug 15, 2003, 1:10 AM)


geroreilly
Novice

Aug 15, 2003, 1:38 AM

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

Luis,

Somethign else that my users are asking for is to allow definition lists. When they are creating lists they do not want a line break between the title of the list and the actual entries in the list. I can do this in HTML using the <dl> tag but I cannot get this working in the editor. I have tried adding Definition List to the formatblocks section but that doesnt work. Any idea how I can allow the users show their lists without the line breaks at thestart...thansk

I attache html example
Attachments: html.txt (90 B)


Luis
Veteran

Aug 15, 2003, 1:51 AM

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

Hi geroreilley:

It's the same problem. They are nested lists.

<dl>
test
<ol>
<li>test</li>
<li>testone</li>
</ol>
</dl>


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


geroreilly
Novice

Aug 15, 2003, 2:45 AM

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

Hi Luis,

I commented out the code as you suggested for the styles and the font but it still doesnt keep the formatting. When it open the Word document the first time in the editor it looks exactly as I want it to look with the styles and colour. But after 2 or 3 seconds it refreshes and i am left with a very bare document. I have attached my editor just in case I have done something really silly. Can you take a look please? Thanks for all your help so far.....
Attachments: editor.js (106 KB)


Luis
Veteran

Aug 15, 2003, 3:09 AM

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

Waw!! You have an old version. I'll update it tomorrow with some major fixes. I'm sleepy now. it's 1:10 AM here in San Diego.


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


geroreilly
Novice

Aug 15, 2003, 3:41 AM

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

Luis,

That would be great if you could update it for me.... much appreciated! Sorry for keeping you up so late - but in Bangkok we never sleep!! Talk to you soon.


mercator
New User

Aug 16, 2003, 5:57 AM

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

Hi,

Will there be a Word cleaner available for htmlArea 3 in the near future, or can someone convert it?
It's a really nice function, and I'd love to use it with version 3 Wink


geroreilly
Novice

Aug 18, 2003, 7:44 PM

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

Luis, Thanks a lot for the new editor. I loaded it yesterday and fixed a few things to get it working but I am still having a problem with one or two others. The new changecase.html file I do not have. Can you send me a copy. Also, when I use the openpage icon i get an error. What exactly should the openpage do - does it act like a template? On the open word option I am still having problems keeping the existing format and style from Word. When I open the word file in the editor it originally shows with the correct format but after 2 or 3 seconds the formatting is removed. In the editor.js I commented out the following lines as you recommended but this didnt seem to help. function cleanEmptyTag(oElem) {
if (oElem.hasChildNodes) {
var tmp = oElem
for (var k = tmp.children.length; k >= 0; k--) {
if (tmp.children[k] != null) {cleanEmptyTag(tmp.children[k]);}
}
}

var oAttribs = oElem.attributes;
if (oAttribs != null) {
for (var j = oAttribs.length - 1; j >=0; j--) {
var oAttrib = oAttribs[j];
if (oAttrib.nodeValue != null) {
//oAttribs.removeNamedItem('style')
//oAttribs.removeNamedItem('title')
//oAttribs.removeNamedItem('class')
}
}}

if (oElem.style) oElem.style.cssText = '';
if (oElem.innerHTML == '' || oElem.innerHTML == '&nbsp;');
//if (oElem.outerHTML != '<BR>') oElem.outerHTML = '';
}
function cleanTable(oElem) {
oElem.style.cssText = '';
var oAttribs = oElem.attributes;
if (oAttribs != null) {for (var j = oAttribs.length - 1; j >=0; j--) {var oAttrib = oAttribs[j];
if (oAttrib.nodeValue != null) {
//oAttribs.removeNamedItem('class')
//oAttribs.removeNamedItem('style')
}
}
}
var oTR = oElem.rows;
if (oTR != null) {for (var r = oTR.length - 1; r >= 0; r--) {oTR[r].style.cssText = '';}}
var oTD = oElem.cells;
if (oTD != null) {for (var t = oTD.length - 1; t >= 0; t--) {oTD[t].style.cssText = '';}}
}
Any ideas on how I can keep some Word formatting? Any luck on developments with the anchor tags and/or nested tables? Thanks again for all your help. Much appreciated.


Luis
Veteran

Aug 18, 2003, 8:43 PM

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

Hi geroreilly:

First. I'm attaching here the changecase.html popup.

Second. For the Word Cleaner, what you did is ok. Now, Comment out all the variables in function myclean(editdoc)

//oTags = editdoc.all.tags("SPAN"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}

etc., etc. and try with one of your Word documents, then look at the code to begin un-commenting out in both places (function cleanEmptyTag(oElem) andfunction myclean(editdoc)) what you don't want to keep. Be aware that depending on what you disable, the cleaner will be less efficient.

For the openpage, I think you are missing the popup file. I'm attaching it here too. The open page is to open an existing page from your local disk, inserting it in the editor. If you plan to use this function, be aware that due to the IFRAME where the editor works, everything not inside <BODY> and </BODY> gets cleared, so any script or style you have in the head section is lost.

Regarding the anchors and relative links, I'm still working on it.

Let me know if you keep having problems.
Greetings


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


(This post was edited by Luis on Aug 18, 2003, 8:45 PM)
Attachments: openpage.html (2.21 KB)
  changecase.html (2.81 KB)


weeezl
Novice

Aug 19, 2003, 11:43 PM

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

I have a working version of a v3 HTML cleaner. Just waiting to hear from Mishoo about how I can include it in the code.

-weez


mercator
New User

Aug 20, 2003, 3:39 AM

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

ah, ok. Thanks already.


Luis
Veteran

Aug 26, 2003, 2:58 AM

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

hi geroreilley:

Try this out:

In your editor's page (MaintDetail.html), just below
_editor_url = ""; // URL to htmlArea files

put the full url to your working page (single lines, no wrapping). Change it to reflect the url you see in your browser until before the query string.

absolute_url = http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/MaintDetail.html;


fullscreen_url = "http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/
/popups/fullscreen.html"

Then, test the attached editor, editing line 2124, replacing the word Body to reflect the name of your textarea. (question mark must remain)

This will change for example,

<A HREF= "http://katie/cgi-bin/katie/WService=ws_katie/kb/portal/src/Admin/MaintDetail.html?ArticleID=IFX234345435GHTY#MyAnchor">Link Text</A>

into

<A HREF="#MyAnchor">Link Text</A>

Let me know if this worked for you.

Relative links is taking long. I've able to convert them, however they become un-editable. The insert_link popup needs to be modifyed. (Very hard task)

May you be well. (if you have problems with this contact me again)


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


(This post was edited by Luis on Aug 26, 2003, 3:08 AM)
Attachments: editor_gero.js (109 KB)


brando
Novice

Aug 27, 2003, 1:48 PM

Post #95 of 169 (8084 views)
Shortcut
Re: [Luis] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Hello Luis and friends,

I am a newbie at all of this but of done a decent job of instituting the htmlArea in a textarea.

I am also trying to solve the Absolute Linking problem. Trying to make all links return.

Luis, I did try your idea of adding the :

<SCRIPT language=Javascript1.2><!-- // load htmlarea
_editor_url = "http://www.bournes.net/php/htmlarea/"; // URL to htmlarea files
absolute_url = "http://www.bournes.net/php/archive_editform.php?articleID/";
fullscreen_url = "http://www.bournes.net/php/htmlarea/popups/fullscreen.html?body/";

with no avail. I did add the editor.js addtion as well.

Does anyone have a fix for this. I will continue plugging. Thanks all.
Brando
VtWebDesigners.com


Luis
Veteran

Aug 27, 2003, 2:24 PM

Post #96 of 169 (8081 views)
Shortcut
Re: [brando] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Hi brando:

You made some mistakes. Try:
absolute_url ="http://www.bournes.net/php/archive_editform.php";

and

fullscreen_url ="http://www.bournes.net/php/htmlarea/popups/fullscreen.html";

However, this workaround doesn't handle relative links at all, only links of first level in the directory tree.

Another problem is that links with a query string can't be retrieved for editing.


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


(This post was edited by Luis on Aug 27, 2003, 2:27 PM)


brando
Novice

Aug 27, 2003, 2:41 PM

Post #97 of 169 (8078 views)
Shortcut
Re: [Luis] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Thanks so much for your reply Luis. However, still no resolution. I am using the editor in a form page that update a database. The URL of the textarea form page that htmlArea is on, is what is displayed as the link code and not the home page that I need it to.
Ex.
If Edit Form Page is : http://me.com/editform.php?article=1
then link becomes: http://me.com/editform.php?article=1#top

I need the links to become relative: /#top or /home.php?article=1#top

Also, after submiting the form to the database and coming back to the edit page and trying the link feature again I get 2 errors:
1)'myValues' href_attribute is null or not an object
2)'URLtext' is null or not an object

Yet, when I close the browser and try again, it is fine. I know I have solved something like this before by getting the the _editor_url correct. Maybe something is wrong with the absolute_url?

here is the code I put at the top of the page:

<SCRIPT language=Javascript1.2> <!-- // load htmlArea
_editor_url = "http://www.me.com/php/htmlarea/"; // URL to htmlArea files
absolute_url = "http://www.me.com/php/edit_openform.php/"; (end slash or no end slash)
fullscreen_url = "http://www.me.com/php/htmlarea/popups/fullscreen.html/";
_editor_field = "body";

Any ideas? Anyone who can help?

Thanks so much. Luis, I really appreciate your sharring of knowledge! Wink
Brando
VtWebDesigners.com


(This post was edited by brando on Aug 27, 2003, 7:27 PM)
Attachments: editor.js (109 KB)
  insert_link.html (4.96 KB)


Luis
Veteran

Aug 27, 2003, 8:56 PM

Post #98 of 169 (8055 views)
Shortcut
Re: [brando] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Can you attach your edit_openform.php file? If possible, attach also the code as it is after the script is executed so I can check what is wrong.

I'm pretty sure it works if it is correctly set up.


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


brando
Novice

Aug 28, 2003, 9:13 AM

Post #99 of 169 (8037 views)
Shortcut
Re: [Luis] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Thanks so much luis. After making the below changes I was able to get it to work.
I saw this in another post (http://www.interactivetools.com/forum/gforum.cgi?post=14137#14137) and was able to fix it.

function cleanHTML(unclean) {
unclean = unclean.replace(/http\:\/\/www\.bournes\.net\/php\/htmlarea\/popups\/fullscreen\.html\?body/gi, '');
unclean = unclean.replace(/http\:\/\/www\.bournes\.net\/php\/edit_openform\.php/gi, '');
return unclean;
}

However...

When switching from the normal mode to the popup fullscreen mode, all the links change to:
href="http://www.bournes.net/php/htmlarea/popups/fullscreen.html?page=products#oil">

Although, when changing the links back to something like " #top " in the Fullscreen editor it stays. It is only when switching between them that all the links change.

Also - The New Window is hard coded to be always set. How do we get rid of this? I will continue reading and testing from the posts that are out there. thanks again.

And..Error messages like: "Unexpected quantifer" and "object doesn't support" still occasinally occur after a submission to the database.

In case, I attached a zip of all my files in question.

Thanks again all.
Brando
VtWebDesigners.com


(This post was edited by brando on Aug 28, 2003, 1:14 PM)
Attachments: brando_files.zip (29.9 KB)


Luis
Veteran

Aug 28, 2003, 10:27 PM

Post #100 of 169 (7991 views)
Shortcut
Re: [brando] Relative Anchors and Links , Not Absolute [In reply to] Can't Post

Hi Brando:

It seems that you were adding oranges with apples. Your editor has pieces of different versions and of course it's likely to misbehave one way or the other.

First. I fixed the cleanHTML function with the correct regular expressions. Your settings in edit_openform.php are correct.

Second. The insert_link.html popup is an outdated version. I attach here a newer one.

Third. This quick workaround doesn't take care of relative links at all. It's intended to take rid of absolute paths to anchor links only. The unexpected quantifier error is due to the query string in your links. The insert link file needs major modifications to correct it and to calculate backguard links without any problem. I don't plan to work in it because I don't need this modifications.

Fourth. <A HREF="/#top"> doesn't mean a link relative to the currrent page, but a link relative to the document root. A link relative to the current page must be written <A HREF="#top"> without the slash.

I hope this be of help.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_brando.js (109 KB)
  insert_link.html (4.92 KB)


geroreilly
Novice

Sep 18, 2003, 2:48 AM

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

Luis,

Thanks for all your help. Yes your "fix" worked and Users can now add internal hyperlinks within a page using anchors. Thank you very very much for all the effort and patience you have shown me. It is truelly appreciated. I am more and more AMAZED (as your post title goes) with how much can be achieved through an open forum like this. Thanks again. Sorry for delay in thanking you but users were so excited with the edtor that I have spent most of my time dealing with real "user" problems!!!!!! Its a nice change from code problems..... at least there are some funny stories!


Luis
Veteran

Sep 18, 2003, 11:43 AM

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

Hi Geroreilly:

Nice to hear of you. Welcome back.


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


tcamos
Novice

Oct 6, 2003, 2:34 PM

Post #103 of 169 (6596 views)
Shortcut
Post deleted by tcamos [In reply to]

 


Luis
Veteran

Oct 6, 2003, 3:38 PM

Post #104 of 169 (6584 views)
Shortcut
Re: [tcamos] I need the amazing word cleaner! [In reply to] Can't Post

Hi Tcamos:

Your post came without attachment. Attach it and I'll gladly do it for you.

Greetings


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


tcamos
Novice

Oct 6, 2003, 4:29 PM

Post #105 of 169 (6578 views)
Shortcut
Post deleted by tcamos [In reply to]

 


Luis
Veteran

Oct 7, 2003, 9:37 PM

Post #106 of 169 (6542 views)
Shortcut
Re: [tcamos] I need the amazing word cleaner! [In reply to] Can't Post

Hi tcamos:

Here it goes.

greetings.


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_tcamos.js (58.2 KB)


tcamos
Novice

Oct 8, 2003, 8:48 AM

Post #107 of 169 (6530 views)
Shortcut
Post deleted by tcamos [In reply to]

 


Luis
Veteran

Oct 9, 2003, 2:10 AM

Post #108 of 169 (6503 views)
Shortcut
Re: [tcamos] I need the amazing word cleaner! [In reply to] Can't Post

Hi tcamos:


Added:
function myclean(editdoc)
function cleanHTML(unclean)
function cleanEmptyTag(oElem)
function cleanTable(oElem)
else if (cmdID.toLowerCase() == 'paste')

Replaced:
function editor_event(objname,runDelay)
to add control for CTRL+V and SHIFT+INS and correct and old bug from the original download.

Make a search for myclean and cleanHTML to see where the functions are called.

The mod takes care of the paste button in the editor, CTRL+V and SHIFT+INS.
It doesn't take care of pasting from Context Menu, (mouse right click) nor of the paste button in the browser.

You can cancel the right click functions or add your own context menus, but you cannot cancel the browser's buttons.
If you need help on cancelling the right click options, post me back.

Greetings


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


ajones
Novice

Oct 9, 2003, 10:19 AM

Post #109 of 169 (6483 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post

Ok..I know this has been discussed a great deal, but given my attached editor.js file, what do i need to include to clean MS Word special characters (strip them out) There are so many posts and versions, I don't know what the latest is.

THanks so much!


Luis
Veteran

Oct 9, 2003, 10:01 PM

Post #110 of 169 (6475 views)
Shortcut
Re: [ajones] I need the amazing word cleaner! [In reply to] Can't Post

Your post came without attachment. Attach it and I'll gladly do it for you.

Greetings


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


ajones
Novice

Oct 13, 2003, 10:19 AM

Post #111 of 169 (6445 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post

Luis,

Thanks. I think the word cleaner now works with the version I've attached here, but it won't work when I right click in the text area and paste. It does work when I use a Ctl-V. Any help is greatly appreciated.

-Anthony
Attachments: editor.js (55.2 KB)


Luis
Veteran

Oct 13, 2003, 9:40 PM

Post #112 of 169 (6427 views)
Shortcut
Re: [ajones] I need the amazing word cleaner! [In reply to] Can't Post

Hi Ajones:

To make it work with the right click menu, you will need to add custom context menus. Although the functionality is already made, to implement it is quite complicated. If you want to do so, prepare with a can of aspirins and wait a few days. I'm going to post a new version that works in multiple instances, hopefully this week. If in the meantime you want to prevent the user to paste unclean code using the right click menu, you can just cancel it, adding this code in line 834 of your editor:

+ ' oncontextmenu="return false;"'

I hope this be of help.


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


ralof
Novice

Oct 21, 2003, 9:51 AM

Post #113 of 169 (6264 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post

Hi, I have read the entire thread but I might have missed something important, but this is how I understand that the cleaner works:
  • I cleans while or before the paste operation
  • It cleans the Word specific tags and styles


What I would like is a trigger that checks the code on the onpaste event and just informs the user that there is formatting included that they might want to remove (y/n).

I would also like to have the buttons:
  • "Remove all font & size information"
  • "Remove all style attributes"
  • "remove all class attributes"


In short, I would like to have a javascript function like:
cleanHTML(editor, 'font');
cleanHTML(editor, 'class');
cleanHTML(editor, 'msoffice');


As a webmaster I could then for instance force a cleanHTML(editor, 'font') & cleanHTML(editor, 'msoffice') when the content is saved, or the user can do it while editing, or they can be called automatically onpaste.

Would that not be a quite flexible and nice solution? Adding more cleantypes in cleanHTML(editor,cleanType) would also be quite easy?




Luis
Veteran

Oct 21, 2003, 12:06 PM

Post #114 of 169 (6244 views)
Shortcut
Re: [ralof] I need the amazing word cleaner! [In reply to] Can't Post

Hi Ralof:

My htmlArea is intended to be used by people with null knowledge on HTML in the first place. They hardly will know what a class or a span is (I bet 1 in 1000). Why ask somebody if they want to perform an operation that I'm sure they don't know what it means?

As a webmaster, my work is to prepare my htmlArea to render the results I want according to every specific site and I'll never use htmlArea to design my own websites. htmlArea is intended to be a TEXTAREA replacement, not an HTML Editor, but I'm talking for me and my personal experience.

If your question is if it is possible, the answer is yes.
My personal opinion about being a quite flexible, nice and easier solution: NO. I don't think so. I'm pretty sure it would make your user's lives harder.

Greetings


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


(This post was edited by Luis on Oct 21, 2003, 9:09 PM)


Shwing_Gal
Novice

Oct 22, 2003, 9:55 PM

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

Ola Luis!

Can I send my editor?

Smile


Luis
Veteran

Oct 23, 2003, 12:28 AM

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

Sure.


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


Bill Dawes
Novice

Oct 23, 2003, 4:00 PM

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


In Reply To
Sure.



Hi Luis, you must be groaning under the weight of all these requests for the Word cleanup. Are you going to build it in as standard in the next version?

Maybe you should make a specific posting or a page on this site somewhere detailing the routines and explaining where to add them etc. Or if you have already done that, maybe you could tell me where it is?

And, failing that, can I be so bold as to ask if I can send you my editor.js and you bolt the word cleanup routines into it?

Very many thanks

Bill


Luis
Veteran

Oct 23, 2003, 8:37 PM

Post #118 of 169 (6171 views)
Shortcut
Re: [Bill Dawes] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi Bill:

I'm very lazy and bad to write instructions that take me hours thinking and thinking how to explain things better. To make the changes myself takes me 5-10 minutes, that's why I rather you to send me your editor.

Greetings and I wait for it.


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


Shwing_Gal
Novice

Oct 24, 2003, 1:35 AM

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

I'm embarrassed --- I don't know where my editor is.

It came with AM when I upgraded to version 1.31

I can't find it -- sorry I'm not a programmer.

Tongue


Bill Dawes
Novice

Oct 24, 2003, 4:54 AM

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


In Reply To
OK, I understand! You are very kind and I really appreciate this.

Attachments: editor_500.js (47.4 KB)


ralof
Novice

Oct 28, 2003, 3:10 AM

Post #121 of 169 (6102 views)
Shortcut
Re: [Bill Dawes] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post


In Reply To

In Reply To
Sure.



Hi Luis, you must be groaning under the weight of all these requests for the Word cleanup. Are you going to build it in as standard in the next version?

Maybe you should make a specific posting or a page on this site somewhere detailing the routines and explaining where to add them etc. Or if you have already done that, maybe you could tell me where it is?

And, failing that, can I be so bold as to ask if I can send you my editor.js and you bolt the word cleanup routines into it?

Very many thanks

Bill



ralof
Novice

Oct 28, 2003, 3:18 AM

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

Ack, there is a bug in the editor here, my post was stripped of all my own comments, it just contained what I quoted :)

Anyway, I just wanted to say I agree with Bill that it is getting very difficult to follow the different versions of the cleaner. Would it not be a good idea to release The Cleaner 0.9 Beta? There seem to be zillions of different versions of the code out there and it soon is almost easier to build a cleaner from scratch than to learn about the different flavours and bug in the different versions available....

Where can I actually find the latest version?

Regards

Stefan


jchatham
New User

Nov 3, 2003, 12:42 AM

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

Luis,

Over the weekend, I was working on a project and found the wonderful htmlArea while doing some searching for code on the web. I started with the basic features and then started looking into the forums for the answer to a couple of questions and discovered your Word cleaner. I noticed that there is a spell checker included, but I have been unable to make it function at this time. Do you have any suggestions?

Thanks,

jchatham


Luis
Veteran

Nov 3, 2003, 8:44 PM

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

Hi jchatham:

See the Help File in my test site at the address below.

Instructions are a the end of the help file.

Greetings


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


The Flash
New User

Nov 5, 2003, 3:49 PM

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

Hi Luis,

I had a look at your editor at http://webstationone.com/test/htmlarea
however it doesn't seem to work in Mozilla on my PC.

Is it able to work on Mozilla?

One of the errors was the following tag in red was missing:
onload="goContext(); javascript:(hide();)"

The other one I still get is:
WriteMenuItems is not defined

Cheers


Luis
Veteran

Nov 5, 2003, 4:07 PM

Post #126 of 169 (7100 views)
Shortcut
Re: [The Flash] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi The Flash:

My editor doesn't work on Mozilla. It's version 2. It works in IE 5.5+ WIN 98+ for PC Only.

I have no plans to do it for other browsers until content editable platform for mozilla gets stable.

Greetings


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


The Flash
New User

Nov 5, 2003, 4:27 PM

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

Sweet, thanks for the info,
I will just find that version 3 way of editing tables.


interacting
New User

Jan 19, 2004, 11:01 PM

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

The word.Quit(); function must not be working for me either. I get an instance of WINWORD.EXE open every time a view a page with an HTMLArea in it. I'm using Windows XP, IE 6.

Please advise.


BenSeb
New User

Feb 3, 2004, 9:35 AM

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

Hi Luis

This mod is very useful for what we are doing - I've attached my version if you wouldnt mind editing it? I think its actually standard 2.03 apart from the first few commented lines

Thanks!
Attachments: editor.js (46.4 KB)


markrenn
New User

Feb 3, 2004, 8:38 PM

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

sorry if this is out of the topic, but im really in dire need of a solution

im integrating webstation's html area v2 with a click tracker. i've added a link_name field on the insert_link.html so the user can specify a unique name on each link he has on every page even if it points to the same url, so at present when a user inserts a link, e.g. http://www.yahoo.com, and gives it a link_name like link1, the actual link in the code will show

Code
  <a href="http://www.mydomain.com/clicktracker.php?link_name=link1&url=http://www.yahoo.com>  
yahoo link
</a>

this is working well for me, my problem is when i try to edit the link, the whole long link shows up in the link field. i would want only the url & link_name to show up in each of their own field.

is there anybody who can help?


Kona
Novice

Feb 3, 2004, 10:10 PM

Post #131 of 169 (6739 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post

Luis,

Wow, what a following you have. We have been using htmlArea (2.x) for 1 year or so and it has been pretty stable thus far. In looking at some text on your Word cleaner I was wondering if you have found it to fix a problem we have had where some tags are not removed and text can not be changed without editing the HTML...for example, there is a string of bold words and no matter what you do in htmlArea, it will not change them.

I am attaching my latest editor.js...pretty basic, if you would not mind adding your Cleaner modifications.

Any guidance is very appreciated. Very nice work from what I have seen. In your opinion is there a strong reason to consider the 3.x version as of yet?

Cheers,

Kona
Attachments: editor.js (49.7 KB)


Luis
Veteran

Feb 5, 2004, 12:18 AM

Post #132 of 169 (6714 views)
Shortcut
Re: [Kona] I need the amazing word cleaner! [In reply to] Can't Post

Hi kona:

Here you go!!

The cleaner will be applied onpaste. The mod is modified so it only cleans MS code when it detects a word document is being pasted. If it's not a word document, it will only format the code a little bit, removing unnecessary tags and double quoting attributes.

This mod also takes care of relative links. If you prefer to use absolute links instead, change this line:

this.RelativePaths=1; and make it
this.RelativePaths=0;

Regarding the bold strings you cannot remove, it's because they are not bold tags. <H3>text</H3> looks exactly as <B>text</B>. To remove the format, select Normal from the Format pull down (I added it to your editor).

I hope this be of help. If you have any problem or further questions don't hesitate to contact me.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_kona.js (70.5 KB)


fetlock
Novice

Feb 5, 2004, 10:35 PM

Post #133 of 169 (6691 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post

Luis,

Could you point me to any topics on your insert image files?



dragonian
New User

Feb 10, 2004, 5:35 PM

Post #134 of 169 (6624 views)
Shortcut
I want the Word Cleaner Mod... [In reply to] Can't Post

I could not find the download link from Webstation.com/test/htmlarea. Where can I download this amazing mod?...


Luis
Veteran

Feb 10, 2004, 7:25 PM

Post #135 of 169 (6621 views)
Shortcut
Re: [dragonian] I want the Word Cleaner Mod... [In reply to] Can't Post

Hi dragonian:

It's temporarily disabled. I'll put it back hopefully next week. Sorry for the inconvinience.


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


Sara
Novice

Feb 12, 2004, 4:17 AM

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

Where kan I download your editor? Word Cleaner is really what I need, and then I have a problem with making hyperlinks from images, it doesn´t work (anymore?) in my heavily changed copy of the editor. Thought I could find the problem looking at your code...


Luis
Veteran

Feb 12, 2004, 11:22 AM

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

Hi Sara:

My editor is not currently available to download. I'll post it back hopefully lately next week.

In the meantime, you can send me your editor and I'll gladly integrate the Word cleaner for you and will take a look into the links problem. (I can do it during the weekend)

Greetings


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


fetlock
Novice

Feb 16, 2004, 8:14 AM

Post #138 of 169 (6500 views)
Shortcut
Re: I need the amazing word cleaner! [In reply to] Can't Post

Anyone know the history/source of Luis' insert/upload image functionality?

Did it come from one of the existing mods, or are some of those based on this one?

I'm looking to implement a custom image insert/upload, and want to start from one similar to the one shown in Luis's example.

Specifically I'm looking for the image dimension (width, height, and keep aspect ratio) code. I like how it fills the selected images's info in, and calculates the ratio.

Right now I'm fitting my image selection code into the 2nd version of this (it's asp): http://www.engvall.nu/WYSIWYG11/example.html

Any links, etc, are appreciated.

Thanks.


(This post was edited by fetlock on Feb 16, 2004, 9:55 AM)


Luis
Veteran

Feb 17, 2004, 2:02 AM

Post #139 of 169 (6477 views)
Shortcut
Re: [fetlock] I need the amazing word cleaner! [In reply to] Can't Post

Hi fetlock:

Do you already have the Image Manager installed and running?

If you are using the same version I am (PHP), I can help you with the width and height issue, but I need you to have it up and runing first.

Unfortunatelly I don't know ASP, so I can't help you with Randy's version.

Let me know.

Greetings


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


Hoyala
Novice

Feb 17, 2004, 2:30 PM

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

Hi Luis!

Is it possible to download your version of HTMLAREA?



Thanks


Luis
Veteran

Feb 17, 2004, 4:49 PM

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

Hi Hoyala:

Download of my version is temporarily disabled. I'll put it back as soon as I solve some issues with it. (hopefully one to two weeks)

Greetings.


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


fetlock
Novice

Feb 17, 2004, 6:15 PM

Post #142 of 169 (6417 views)
Shortcut
Re: [Luis] I need the amazing word cleaner! [In reply to] Can't Post


In Reply To

Hi Luis, thanks for the reply.

I don't know where to get the php version you have. Where could I find it? It sounds like you're not distributing it. I'm using the asp version from Randy for the moment. I have no problem with the asp or with getting it to work. It's up and running fine.

I just want to add in the extra functionality for height, width, aspect ratio. If you can nudge me in the right direction, I will work on making it work for randy's version.

My php skills are a little rusty, but I'm game.Smile


BenSeb
New User

Feb 19, 2004, 6:15 AM

Post #143 of 169 (6374 views)
Shortcut
Re: [fetlock] I need the amazing word cleaner! [In reply to] Can't Post

Hi Luis

I wonder if you got a chance to amend the editor.js I attached above? Should be out of the box I think. Much appreciated!



Ben


itzik
New User

Feb 19, 2004, 8:04 AM

Post #144 of 169 (6371 views)
Shortcut
Re: [BenSeb] I need the amazing word cleaner! [In reply to] Can't Post

   

hey Luis!

i see your editor, good job!!

I using very simple editor based on 2.3.. i not need all things you have in your editor.. their are option to add the "word remove" to 2.3 editor?


skarbratt
New User

Mar 5, 2004, 12:53 PM

Post #145 of 169 (6137 views)
Shortcut
Bulletlists from Power Point [In reply to] Can't Post

I have problem when inserting bulletlists from Power Point. They don't get the bulletlist formating after insertion. I quess it depends on that PP formates bulletlists in a diffrent way than Word does, but is it possible to get a bulletlist from PP?


mosiondz
New User

May 4, 2004, 7:42 PM

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

Luis,

I'm having problems getting the editor to strip MS Word special characters. Can you take a look at my script? It'd be greatly appreciated.
Attachments: editor.js (64.5 KB)


Luis
Veteran

May 4, 2004, 11:51 PM

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

Hi mosiondz:

Here you go!

You were missing significant pieces of code all around the script. i made some other changes to apply the cleaner when using the browser's button too.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_mozionds.js (65.0 KB)


mosiondz
New User

May 5, 2004, 12:40 PM

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


In Reply To
You were missing significant pieces of code all around the script. i made some other changes to apply the cleaner when using the browser's button too.



Significant pieces of code? I was under the impression I was just missing a variable declaration or something else minor. I'll check your update, but in general what was I missing that was vital?

Thanks again!


Luis
Veteran

May 5, 2004, 8:57 PM

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

Hi mosiondz:

I mean significant not for the amount but for its importance. What you were missing was to update the contents of the editor with the clean code. Lines 636 and 737 of your editor. Glad it works now.

Greetings


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


puntagorda
New User

May 5, 2004, 9:37 PM

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

Luis,

I would love to have the word cleaner. I have attached my editor.js file.

Thanks
Attachments: editor.js (47.0 KB)


Luis
Veteran

May 6, 2004, 3:00 AM

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

Hi puntagorda:

here you go!!


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_puntagorda.js (63.6 KB)


mosiondz
New User

May 10, 2004, 12:49 PM

Post #152 of 169 (11834 views)
Shortcut
Re: Links and New Windows [In reply to] Can't Post

Everything seems to be working perfectly, Luis. Thanks again!

One other question I had was about opening links in new windows. Is there a way to set it up so that links added in the editor include target="_new" in all of the link references?


EDIT: I think I have this working now! All is good! Smile


(This post was edited by mosiondz on May 13, 2004, 5:41 PM)


cmanquan
New User

May 14, 2004, 2:50 AM

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

Hi Luis,

First congratulation for your huge work on the HTML AREA and its add-on. I am pretty a noob in JS. I'dd like (as a lot of people here ) to remove the font face and size when I copy and past from another document. I suppose you need my editor.js and my textarea (named script.html idd). I attach there right now. As I am a totally noobish, I hope you will be able to help me.

Regards,

Christophe


edit : gosh, I realize I was still using HTMLAREA 2.03... I will use directly your HTML AREA including clean word feature.


(This post was edited by cmanquan on May 14, 2004, 4:28 AM)
Attachments: editor.js (46.7 KB)
  script.html (3.36 KB)


kipa
Novice

May 23, 2004, 12:25 AM

Post #154 of 169 (11669 views)
Shortcut
Hi Luis, [In reply to] Can't Post

can u help my with my code?

Thanks!Wink
Attachments: simpleeditor.js (96.5 KB)
  editor.js (97.1 KB)


malibu82
Novice

Jul 29, 2004, 8:18 AM

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

Hi, Luis. I love what you've done with htmlArea. I was hoping you might be able to add the Word cleaner to my editor.js as well? Also, I'm having a hard time getting the "onchange" mod to work. Maybe you can add that, too?

Thank you soooo much for taking the time to do this for me. It is very appreciated!
Attachments: editor.js (46.9 KB)


Luis
Veteran

Aug 4, 2004, 2:18 AM

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

Hi malibu82:

Here you go!

Regarding OnChange, you cannot set an OnChange handler, because the editor is indeed an IFRAME which replaces dynamically the original textarea and OnChange doesn't apply to IFRAMES. It applies to some form elements only. (INPUT TEXT, SELECT, INPUT FILE and TEXTAREA)

What do you want to do with OnChange? Sure it can be done but using a different method.

Greetings.


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


(This post was edited by Luis on Aug 4, 2004, 2:19 AM)
Attachments: editor_malibu82.js (63.1 KB)


malibu82
Novice

Aug 4, 2004, 8:35 AM

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


In Reply To
Hi malibu82:

Here you go!

Regarding OnChange, you cannot set an OnChange handler, because the editor is indeed an IFRAME which replaces dynamically the original textarea and OnChange doesn't apply to IFRAMES. It applies to some form elements only. (INPUT TEXT, SELECT, INPUT FILE and TEXTAREA)

What do you want to do with OnChange? Sure it can be done but using a different method.

Greetings.



Wow, thanks a lot for doing this. It is greatly appreciated. :)

For the "onchange" functionality, I need it because I have built a web app for our intranet that allows policies/procedures to be created and edited. I want the browser to prompt users on leaving the page when they have edited some fields if they haven't saved their work. The "onbeforeunload" function is being used in my app and checks for an "isDirty" variable that is set to true when a form field has been manipulated. Everything works great for the fields that aren't IFrame-based (non-WYSIWYG) but as you know changes made to htmlArea never register with the browser, so my app is only prompting for some parts of the form and not others.

Is there a workaround you can help me with?

Thanks again!
-malibu82


Luis
Veteran

Aug 4, 2004, 11:41 AM

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

Hi malibu82:

This ability was developed sometime ago by Ilvni900.
You can find the files in post#18 of this page:
http://www.interactivetools.com/forum/gforum.cgi?post=8533

The function is called discardOnExit(). There are some other settings and functions related. If you have problems doing it, let me know and I'll do it for you next weekend.

greetings


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


malibu82
Novice

Aug 4, 2004, 1:41 PM

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


In Reply To
Hi malibu82:

This ability was developed sometime ago by Ilvni900.
You can find the files in post#18 of this page:
http://www.interactivetools.com/forum/gforum.cgi?post=8533

The function is called discardOnExit(). There are some other settings and functions related. If you have problems doing it, let me know and I'll do it for you next weekend.

greetings



Since I've had the darndest time trying to edit Ilvni900's functionality into this file, I don't mind waiting until after this weekend as long as you don't mind doing it. :)

I modified it slightly since receiving it from you this morning (integration with JSpell spell-checker) so I have attached the "latest and greatest" version for you to tinker with.

Again, thanks a million.

malibu82

(This post was edited by malibu82 on Aug 4, 2004, 1:46 PM)
Attachments: editor.js (63.2 KB)


Luis
Veteran

Aug 12, 2004, 12:10 AM

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

Hi malibu82:

I just realized that I never sent you your editor with the Ilvni900's functionality .

Here you go!. Sorry for the delay.


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_malibu82.js (65.6 KB)


kipa
Novice

Aug 12, 2004, 7:50 AM

Post #161 of 169 (11076 views)
Shortcut
"WORD FREE" [In reply to] Can't Post

Hi,

First thanks for this great project!

If someone can help me put the word Cleaner on this scripts (including when the user is copy pasting)

Thanks!
Attachments: editor.js (97.1 KB)
  simpleeditor.js (96.5 KB)


malibu82
Novice

Aug 13, 2004, 6:19 AM

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


In Reply To
Hi malibu82:

I just realized that I never sent you your editor with the Ilvni900's functionality .

Here you go!. Sorry for the delay.



No need to apologize! Thanks a million!

-malibu82


malibu82
Novice

Aug 16, 2004, 9:39 AM

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

Hey Luis, thanks again for your help in getting the onchange functionality into my editor.js.

One question, though: Is it possible not to have the JS focus remain on the last form item? I'd prefer the browser window to stay at the top of the document instead of bringing the user all the way down to the bottom.

I did manage to rearrange the order of the form fields so that when generated, the topmost field is last (thus leaving the focus there) but it's still scrolled down a tad since it isn't located at the absolute top of the document.

Thoughts?


(This post was edited by malibu82 on Aug 16, 2004, 9:40 AM)


nick buick
New User

Aug 23, 2004, 12:55 AM

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

Hey Luis, your content manager blew my freak`n socks off.... Crazy

Elite!!

Does it work on Mac os X running IE? One of my friends uses a mac and I was showing her and it didn't work, just a normal text box. Frown


Luis
Veteran

Aug 23, 2004, 2:12 AM

Post #165 of 169 (10832 views)
Shortcut
Re: [nick buick] See the ultimate Word cleaner. Amazing!! [In reply to] Can't Post

Hi nick buick:

Unfortunatelly not. It works on IE 5.5+ for PC only.


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


nick buick
New User

Aug 23, 2004, 2:17 AM

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

Does anyone know of ANY of these html area versions that run on IE on MAC OSX?


malibu82
Novice

Aug 27, 2004, 7:23 AM

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

hey luis, not sure if you saw my post from 8/16... any feedback you might have on my issue re: the js focus? thanks!


Luis
Veteran

Aug 27, 2004, 11:34 AM

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

Hi malibu82:

I had overseen it. The answer is in post #2 of this page:
http://www.interactivetools.com/forum/gforum.cgi?post=31404

Greetings


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


malibu82
Novice

Aug 27, 2004, 12:51 PM

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

Awesome - it worked like a charm. Thanks again, Luis!

 
 


Search for (options)