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:
Spell Checking?


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.

 


bantar76
New User

Dec 20, 2002, 1:46 PM

Post #1 of 25 (8726 views)
Shortcut
Spell Checking? Can't Post

Hi;

I'm liking the HTMLArea, but I need to be able to spell check its contents. I was using ieSpell, which works great, but not for HTML Area. I can sometimes get it to do the spell check on it, but the its far from optimum. Are there any spell checkers that will work with HTMLArea? Is there some mod I can do to get to work?



TIA


Benjamin
Staff


Dec 20, 2002, 3:55 PM

Post #2 of 25 (8714 views)
Shortcut
Re: [bantar76] Spell Checking? [In reply to] Can't Post

You could take a look at the following post:
http://www.interactivetools.com/forum/forum.cgi?post=4616

JohnH kindly posted some code which allows htmlArea to use Word's spell-checking capabilities. And I'm ashamed to say I still haven't gotten round to finish trying it out...
Ben
interactivetools.com


bantar76
New User

Dec 20, 2002, 4:45 PM

Post #3 of 25 (8709 views)
Shortcut
Re: [Benjamin] Spell Checking? [In reply to] Can't Post

Benjamin;

Thanks for the info, but I cant seem to get it to work. First I cant seem to locate the line that the instructions say to look for, begins with

"<button id="Unerline", perhaps this code was written for a prior version? So, I went ahead and placed the CheckDocument() code into my editor.js, but get an automation error "Automation Server can't create object" on the line:

oShell= new ActiveXObject("WScript.Shell");


Could it be security settings or something like that?

Thanks...


bantar76
New User

Dec 20, 2002, 4:53 PM

Post #4 of 25 (8707 views)
Shortcut
Re: [bantar76] Spell Checking? [In reply to] Can't Post

Ok, I turned off activex security for the local intranet zone, but it's still not working right. Works inconsistently, puts wrong stuff in field, etc....


redspider
User

Dec 22, 2002, 3:10 AM

Post #5 of 25 (8671 views)
Shortcut
Re: [bantar76] Spell Checking? [In reply to] Can't Post

Bantar76,

I've put the spell check with succes in version 2.03 last friday.

To get it work follow the next steps:
  1. Put a ['copy'], line to the "this.toolbar = [" section.
  2. Put the following line to the this.btnList = { part of the script
    "copy": ['copy', 'copy','editor_action(this.id);CheckDocument()', 'spellcheck.gif'],
  3. At last put de next code block on the end of the script:
    function CheckDocument()
    {
    oShell= new
    ActiveXObject("WScript.Shell");
    oShell.SendKeys( "^c" ); // copy
    oWord = new ActiveXObject("Word.Application");
    oWord.Documents.Add();
    oWord.Selection.Paste();
    oWord.ActiveDocument.CheckSpelling();
    oWord.Selection.WholeStory();
    oWord.Selection.Copy();
    oWord.ActiveDocument.Close(0);
    oWord.Quit();
    var nRet= oShell.Popup(
    "Wijzigingen doorvoeren?\nklik op OK om alle geselecteerde tekst te overschrijven.\nBest klik u de Word-filter aan om de overtollige HTML-code te verwijderen.",
    0,
    "Spellingscontrole is uitgevoerd.",
    33 );
    if ( nRet == 1 ) {
    oShell.SendKeys( "^v" ); // paste
    }}



I think the spell check script is still a little bugy but it it's better than no spell check

Geetz

redspider
(belgium)
greetz

Redspider
Belgium
http://www.tielt.be


mixmuis
User

Dec 22, 2002, 1:22 PM

Post #6 of 25 (8653 views)
Shortcut
Re: [redspider] Spell Checking? [In reply to] Can't Post

its reporting, invalid argument, on line 411 char 12

it does not work here.. can u help


redspider
User

Dec 24, 2002, 7:40 AM

Post #7 of 25 (8629 views)
Shortcut
Re: [mixmuis] Spell Checking? [In reply to] Can't Post

Mixmuis,

In Attach i put a zip-file with all my example files (editor.js, example.asp, images and popups)

The example contains extra: Word-filter, Print function, Special characters, ....

For the spell check look out that the activeX components are set correct
see: http://www.interactivetools.com/forum/gforum.cgi?post=4648#4648 for discription

I hope that you can do something with te files.

greetz

redspider
belgium
greetz

Redspider
Belgium
http://www.tielt.be

(This post was edited by redspider on Dec 28, 2002, 1:03 PM)
Attachments: htmlarea_wme.zip (42.9 KB)


mixmuis
User

Dec 27, 2002, 5:51 AM

Post #8 of 25 (8600 views)
Shortcut
Re: [redspider] Spell Checking? [In reply to] Can't Post

thnx, it works fine now, it's great to work with this version of the editor :)


luisfer
Novice

Feb 12, 2003, 6:15 AM

Post #9 of 25 (8407 views)
Shortcut
mixmuis [In reply to] Can't Post

Muis Ur are the best.......loved ur script changes verry useful



Baie dankie Cool

Luis


geekgirljess
New User

Mar 18, 2003, 8:39 AM

Post #10 of 25 (8160 views)
Shortcut
Re: [redspider] Spell Checking? [In reply to] Can't Post


In Reply To
The example contains extra: Word-filter, Print function, Special characters, ....

For the spell check look out that the activeX components are set correct
see: http://www.interactivetools.com/forum/gforum.cgi?post=4648#4648 for discription

I hope that you can do something with te files.

greetz

redspider
belgium


I love what you've done with the htmlArea, adding the spelling checker and print function. I would like to use it for a school project, but I don't know the language (dutch?). Could anybody possibly translate some of it for me (to english), or point me towards a translator? Thank you so much. :)


Luis
Veteran

Mar 21, 2003, 3:46 AM

Post #11 of 25 (8081 views)
Shortcut
Spell checker bugs corrected. [In reply to] Can't Post

I have made some small modification to the excellent Spell Checker developed by JohnH, to prevent some of the noticed bugs. It's still not perfect, but almost. I would love a function to perform the Word Cleaning while pasting. Does somebody knows of such a method?

Anyway, in the meantime, I have added some alerts to advise the user to clean the code up after spellchecking and a text range detection to prevent of activating the Spell Checker if nothing is selected, avoiding the previous bug that pasted the clipboard contents at the insertion point, even when nothing was spell checked.

Please report some other unnoticed bugs.

Download the attached file with the code and detailed instructions.

You can see it working at

http://webstationone.com/test/htmlarea


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: spell check code.txt (3.75 KB)
  ed_spellcheck.gif (0.11 KB)


Len_kranendonk
New User

Mar 21, 2003, 6:24 AM

Post #12 of 25 (8063 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

Sorry, I've almost no javascript experience, but is there a way to alert if
ActiveXObject("WScript.Shell"); fails ?

Len


Luis
Veteran

Mar 21, 2003, 11:29 AM

Post #13 of 25 (8036 views)
Shortcut
Re: [Len_kranendonk] Spell checker bugs corrected. [In reply to] Can't Post

This issue is in my pendings list. I'll do a research.
I know absolutelly nothing about ActiveX and WScript, but I love challenges.
My first impression is that it can be difficult 'cause (I think) the program would need to check high security levels in the user's computer. I'll let you know if I find something.


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


jchastain
New User

Mar 21, 2003, 5:47 PM

Post #14 of 25 (8017 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

Luis -

What I would really like to be able to do is have it automatically select the entire text for checking and remove the highlighting step. That seems like it should be fairly simple. Mind giving me a quick tip on how to do it?


Luis
Veteran

Mar 21, 2003, 6:52 PM

Post #15 of 25 (8006 views)
Shortcut
Re: [jchastain] Spell checker bugs corrected. [In reply to] Can't Post

Fairly simple, but a little buggy.

Replace the cmdID =='spell' with this code

else if (cmdID == 'spell') {editdoc.execCommand('copy');
if (editdoc.selection.createRange().text != "") {
CheckDocument(); return true;

}
//else {alert('Nothing to spellcheck. Please select the text you want HTMLArea to check.\nTo avoid unexpected results, we recommend you to select complete paragraphs.');}
//Uncomment the previous line and comment out the next two to send an alert if nothing is selected, as opposite to automatically selecting the complete text if nothing selected.
else {editdoc.execCommand('selectall');editdoc.execCommand('copy');}
CheckDocument(); return true;
}


I only see one problem with this. You cannot prevent the user to select just a part of a paragraph, and there is no way to advise him to select complete paragraphs.

When somebody selects a part of a paragraph only, the Spell check will work and that line will be split in three lines. (Some of IE strange assumptions that the final word is the end of a paragraph and the beginning of a new one). As the returned text is returned within <P></P>tags, there is not way to correct it but manually. I don't remember if there is a method to check if everything is selected. I promise to research, but now, this is all I can do.

Hope it helps. Please let me know.


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


jchastain
New User

Mar 21, 2003, 7:13 PM

Post #16 of 25 (8000 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

Great. Thanks!


Hmmmm. One little issue. If nothing is selected but something is already in the clipboard, then it checks whatever is in the clipboard. So when writing multiple messages, if I select nothing and hit the spell checker it actually re-checks the previous message. Obviously this would prevent the warning message from displaying also.

Is there some way to clear the clipboard prior to copying the selected text?


(This post was edited by jchastain on Mar 21, 2003, 7:58 PM)


Luis
Veteran

Mar 21, 2003, 9:26 PM

Post #17 of 25 (7983 views)
Shortcut
Re: [jchastain] Spell checker bugs corrected. [In reply to] Can't Post

I don't understand what you mean. With these modifications, if nothing is selected, it will automatically select and copy all the text to the clipboard, overwriting any previous content in it.

In the other hand, if you manually select something, it will only copy what you select. Please note that you will need to make the modifications in your files. I will keep the previous one in my test site.

If you are still having problems, let me know.


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


jchastain
New User

Mar 21, 2003, 9:37 PM

Post #18 of 25 (7979 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

That is not the result I am getting. If nothing is selected, then it performs a spell check on whatever was in my clipboard previously. So if I move a few lines of code around in wordpad using a cut and paste, then start up a browser, go to the HTMLArea page and type a few sentences and just hit the spell check button, it begins to check the spelling in my code from wordpad. (WinXP, IE 6.0)

Odd. I just tried the same thing on your "example" page and it caught it and gave me the alert. The behavior in my page in unchanged though. Obviously the problem is something in the details of my implementation. Time to pull out a magnifying glass.


Luis
Veteran

Mar 21, 2003, 10:38 PM

Post #19 of 25 (7975 views)
Shortcut
Re: [jchastain] Spell checker bugs corrected. [In reply to] Can't Post

Have you tried cleaning the cache up?

I'm using XP IE 6 too. Even more, I also tested it in Win 2000 IE 6 and Win 98 IE 5.5 and both versions worked as intended. Try in this other page and let me know.

http://www.webstationone.com/test/htmlarea/temp.html

Or, download the attached file and test it on your server. It is exactly as in my test site. If it still doesn't work, then the problem is in some of your computer's settings. If it works, the problem is in your code.


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


(This post was edited by Luis on Mar 21, 2003, 11:09 PM)
Attachments: editor2.js (92.9 KB)


jchastain
New User

Mar 22, 2003, 8:41 AM

Post #20 of 25 (7951 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

There comes a time that the best option is to go back to a "clean" version and redo the mods. That's what I did and it cleaned up the problem. I have no idea what I could possibly have done to introduce that little "feature" but everything is working now. Thanks for all your help.


Len_kranendonk
New User

May 9, 2003, 9:28 AM

Post #21 of 25 (7482 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

I found a solution for checking if Active X is enabled and if Word is available:

At the begin of editor.js:

document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('spellEnabled = (IsObject(CreateObject("Word.Application"))) \n');
document.write('</SCR' + 'IPT\> \n');


And in the "else if" block for spell:

else if (cmdID == 'spell') {
if(typeof(spellEnabled) == 'undefined') alert('Unable to start MS Word for spell checking.\n Active X is not enabled for this site or MS Word is not available.'); editdoc.execCommand('copy');
if (editdoc.selection.createRange().text != "") {CheckDocument(); return true;}
else {alert('Nothing to spellcheck. Please select the text you want HTMLArea to check.\nTo avoid unexpected results, we recommend you to select complete paragraphs.');}
}


Luis
Veteran

May 10, 2003, 12:50 AM

Post #22 of 25 (7430 views)
Shortcut
Re: [Len_kranendonk] Spell checker bugs corrected. [In reply to] Can't Post

Thanks Len. This works great!

I just added an additional else {} to prevent it to continue after the first alert:

else if (cmdID == 'spell') {
if(typeof(spellEnabled) == 'undefined')
alert('Unable to start MS Word for spell checking.\n Active X is not enabled for this site or MS Word is not available.\n For more information, refer to the Help section of the editor.');
else {
editdoc.execCommand('copy');
if (editdoc.selection.createRange().text != "") {
CheckDocument(); return true;
}
else {alert('Nothing to spellcheck. Please select the text you want htmlArea to check.\nTo avoid unexpected results, we recommend you to select complete paragraphs.');
}
} }


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


bills
New User

May 11, 2003, 8:34 AM

Post #23 of 25 (7380 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

On Mar. 21 you posted a copy of editor2.js. Would it be possible for you to zip up all the button images and popup codes used and post them as well.

Also, for some reason I am finding that when I 'Sweep MS-word' tags after running spellcheck, all images in the editor are also 'swept'

Thanks in advance.


(This post was edited by bills on May 11, 2003, 8:46 AM)


Luis
Veteran

May 11, 2003, 10:03 PM

Post #24 of 25 (7346 views)
Shortcut
Re: [bills] Spell checker bugs corrected. [In reply to] Can't Post

Hi Bills!

My files are posted in the Add-Ons forum.

Regarding the images being cleared after spellchecking, this is a Word issue. The spellchecker works copying the contents of HTMLArea and pasting them in a Word document where the Word's spellchecker does the job. When the contents are pasted in the Word document, Word converts the code to Office's styes and changes the path to a local file (???). When the content returns to HTMLArea after being spellchecked, all images are gone.

The only way that I've found to avoid it is not to select images.

I added some instructions to the spellcheck function to prevent as much as possible that it happens.

It also happens if you copy a Word document containing images and paste it into HTMLArea.

I know it's kind of annoying, but unfortunatelly (or fortunatelly) this is the only working spellchecker we have today which I think is better than nothing. Don't you agree?

Greetings.


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


bills
New User

May 11, 2003, 11:49 PM

Post #25 of 25 (7337 views)
Shortcut
Re: [Luis] Spell checker bugs corrected. [In reply to] Can't Post

>I know it's kind of annoying, but unfortunatelly (or
> fortunatelly) this is the only working spellchecker
> we have today which I think is better than nothing.
> Don't you agree?

AGREED!!!!

 
 
 


Search for (options)