Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#469 closed defect (fixed)

New Client-Side Spell Check Plugin for XINHA using ieSpell

Reported by: anonymous Owned by: gogo
Priority: normal Milestone:
Component: Plugin_Other Version:
Severity: normal Keywords: spellcheck iespell
Cc:

Description

It's a client-side IE only option, but it works great if you need a spellcheck and can't use aspell. A lot of WYSIWYG editors use it, and FCKEditor has a config option to use either IESpell or SpellerPages?, which is similar to Xinha's PHP Aspell spellcheck.

Attachments (7)

ClientsideSpellcheck.zip (1.9 KB) - added by mharrisonline 13 years ago.
client-side spellcheck for XINHA (no ASPELL!)
ClientsideSpellcheckV2.zip (2.1 KB) - added by mharrisonline 13 years ago.
Fixed version, the js file was uppercase in the first zip file, which doesn't work in LINUX…
ClientsideSpellcheckV3.zip (2.1 KB) - added by mharrisonline 13 years ago.
Another fix, also I figured out how to make it not appear in Mozilla
ClientsideSpellcheckV4.zip (2.3 KB) - added by mharrisonline 13 years ago.
Newest version of plugin, now it really does hide in Firefox
.2 (0 bytes) - added by mharrisonline 13 years ago.
last problem fixed, ready to use
ClientsideSpellcheck_final.zip (2.2 KB) - added by mharrisonline 13 years ago.
The final version
ClientsideSpellcheck.2.zip (2.2 KB) - added by mharrisonline 13 years ago.
version with uneeded line of code removed

Download all attachments as: .zip

Change History (23)

comment:1 Changed 13 years ago by mharrisonline

I bet it would be easy to do... In Kevin Roth's public domain editor RTE this is all the code it takes:

function checkspell() {
	dlgCleanUp();
	//function to perform spell check
	try {
		var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
		tmpis.CheckAllLinkedDocuments(document);
	}
	catch(exception) {
		if(exception.number==-2146827859) {
			if (confirm("ieSpell not detected.  Click Ok to go to download page."))
				window.open("http://www.iespell.com/download.php","DownLoad");
		} else {
			alert("Error Loading ieSpell: Exception " + exception.number);
		}
	}
}

comment:2 Changed 13 years ago by mharrisonline

Well, this almost worked...sort of...

I replaced all the functions in spell-checker.js with:

SpellChecker.prototype._lc = function(string) {
    return HTMLArea._lc(string, 'SpellChecker');
}

SpellChecker.prototype.buttonPress = function(editor) {

	
		content : editor.getHTML()
	

	try {
		var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
		tmpis.CheckAllLinkedDocuments(html);
	}
	catch(exception) {
 		if(exception.number==-2146827859) {
			if (confirm("ieSpell not detected.  Click Ok to go to download page."))
				window.open("http://www.iespell.com/download.php","DownLoad");
		} else {
			alert("Error Loading ieSpell: Exception " + exception.number);
		}
	}



		editor.insertHTML( html );
	}

I get exception number 2146828275 and it pastes all the HTML into the editor where the cursor is... but at least it did something...

comment:3 Changed 13 years ago by mharrisonline

I found the developer api online at

http://www.iespell.com/developerapi.htm

It looks there is a better api for WYSIWYGs than before...

Changed 13 years ago by mharrisonline

client-side spellcheck for XINHA (no ASPELL!)

comment:4 Changed 13 years ago by mharrisonline

  • Component changed from Plugin_SpellChecker to Plugin_Other
  • Summary changed from Has anyone ever gotten IE Spell to work with XINHA? to Client-Side Spell Check Plugin for XINHA using ieSpell

I made the plugin and attached it, hopefully it will be useful to anyone that can't use Aspell.

Changed 13 years ago by mharrisonline

Fixed version, the js file was uppercase in the first zip file, which doesn't work in LINUX...

comment:5 Changed 13 years ago by mharrisonline

I wonder how I could make the button not appear if the user isn't using IE...

Changed 13 years ago by mharrisonline

Another fix, also I figured out how to make it not appear in Mozilla

comment:6 Changed 13 years ago by mharrisonline

  • Keywords spellcheck iespell added

I figured out how to make it not appear in the if someone is using Firefox, it looks for the saveas button, which only shows up in IE. So, IE users will see the spellcheck and will be able to use it, Mozilla users won't see the button.

If you aren't displaying the saveas button, you can change line 26 of clientside-spellcheck.js from:

  cfg.addToolbarElement("clientsidespellcheck", "saveas", 1);

to


cfg.addToolbarElement("clientsidespellcheck", "print", 1);

...basically change "saveas" to the button named in htmlarea.js that you want it to appear after.

comment:7 Changed 13 years ago by mharrisonline

Actually, making it appear after a gecko-only button just makes it go to the front of the toolbar in Firefox. What would be the best way to make it only appear to IE users?

comment:8 Changed 13 years ago by niko

try this:

if(HTMLArea.is_ie) {
  cfg.addToolbarElement("clientsidespellcheck", "print", 1);
}

Changed 13 years ago by mharrisonline

Newest version of plugin, now it really does hide in Firefox

comment:9 Changed 13 years ago by mharrisonline

It works! Thanks, Niko! I uploaded the fixed version.

comment:10 Changed 13 years ago by mharrisonline

Uh oh, it finds everything that is misspelled, but the changes aren't made...

Changed 13 years ago by mharrisonline

last problem fixed, ready to use

Changed 13 years ago by mharrisonline

The final version

comment:11 Changed 13 years ago by mharrisonline

Ah, iespell had already changed the words and I was overwriting the changes by returning the original HTML. It's all fixed now and ready to go in ClientsideSpellcheck_final.zip

comment:12 Changed 13 years ago by mharrisonline

  • Summary changed from Client-Side Spell Check Plugin for XINHA using ieSpell to New Client-Side Spell Check Plugin for XINHA using ieSpell

comment:13 Changed 13 years ago by mharrisonline

Niko, you were right, you don't really need Xinha to do anything with this. The line I currently have in the plugin

content : editor.getHTML()

isn't needed at all by iespell, and currently getHTML triggers a nasty bug in full page mode (ticket 434) so this line should be removed...

Changed 13 years ago by mharrisonline

version with uneeded line of code removed

comment:14 Changed 13 years ago by mharrisonline

Maybe, possibly, is there any way someone could check this in? :)

comment:15 Changed 13 years ago by gocher

  • Resolution set to fixed
  • Status changed from new to closed

checked in at revision: 335

comment:16 Changed 13 years ago by mharrisonline

Thank you!

Note: See TracTickets for help on using tickets.