Googiespell MOD - نوشته شده در (12719 Views)
Senior Member
leatherlips
مطلب: 1838
1838
I've just created my very first mod! It is a spell checker mod called Googiespell. You can download it from SnitzBitz by clicking here.
The purpose of this mod is to add a spell check feature to your Snitz forum. Not only does this spell check mod find spelling errors within your posts,
but it also provides suggestions to correct the errors. I have tested this in Internet Explorer, Firefox, Opera, Mozilla and Netscape.
It is very easy to install and is a great spell checker. Please let me know what you think. Also let me know if you encounter any problems.
I've set up a demo forum so you can see it in action.
Go here to see what it is like.
Log in is demo/demo

<moved to="MOD Add-On Forum (W/Code)" by="Shaggy" /><
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
I've definitely got to check it out when I get home. Glad you got this working and set up as a MOD. bigsmile<
نوشته شده در
Senior Member
bobby131313
مطلب: 1163
1163


She's up and runnin' on my site, looking good!
Thank you!
I asked my members to report any bugs along with browser and OS to me.
<
نوشته شده در
Average Member
Roger Fredriksson
مطلب: 556
556
Without logging in I tried it with "Ja måste kålla min satfning". It is Swedish and means "I have to check my spelling" but it is very badly spelled. The spell checker considered it to be English although I choosed Swedish. I like the mod but why does it not work for Swedish (to small language? ;))
<
rf/www.avgifter.com
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
MarshalMix,

I made the changes you suggested. It will make it easier for others to install. The download at SnitzBitz has been updated.
Roger Fredriksson,

I'm looking into the language issue. I'm very close to solving it.<
نوشته شده در
Senior Member
bobby131313
مطلب: 1163
1163
I too, changed the CSS with no problems, classes are named very nicely.
I also changed some messages in the JS file, lines 47-52 ...
this.lang_chck_spell = "Check spelling";
this.lang_revert = "Revert to";
this.lang_close = "Close";
this.lang_rsm_edt = "Stop spell checking";
this.lang_no_error_found = "Congratulations! No mistakes!";
this.lang_no_suggestions = "Sorry, you're on your own.";

Just to be a little more "unofficiallike". bigsmile

<
نوشته شده در
Forum Moderator
dayve
مطلب: 5820
5820
Just implemented it at my forum. As it was already stated, it was very easy to get it going. The only quirk I didn't like is that there are CSS declarations made outside of the CSS file so it was kind of a pain to start getting some of the colors and font size I wanted. I also wanted to make mine look like the button I was using before with the IESpell feature I had (Snitz has same one). I found in the documentation that you can create a container (<span>) to put the spell checker link anywhere you wanted so it worked out great. You can the placement and action I used at my forum.

PS. I haven't updated my Quick Reply Check Spelling button yet ... that one still uses the IESpell component.
<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
dayve. You took it to another level! I like how you implemented it.
Care to share how you did it that way?
One of the things that bothers me is the text style. On my forum, the font style changes to something different and I can't figure out where to change it. Where did you find the other css declarations?<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
I need help trying to figure out the language issue. Currently, regardless of which language you select, it only checks for English.
I found in the googie.asp file two different lines:

r = getURL("https://www.google.com/tbproxy/spell?lang=en", r, "","")

and
response.write getURL("https://www.google.com/tbproxy/spell?lang=en", t, "","")

If I change the parts in red above to a different language such as French (fr), it will use that language instead of English. But again, it will only check in that language regardless of which language is chosen from the dropdown.
Anyone have any ideas of how to fix this? I've tried leaving out the en but then the spell checker doesn't work at all.<
نوشته شده در
Forum Moderator
dayve
مطلب: 5820
5820
Originally posted by leatherlips
dayve. You took it to another level! I like how you implemented it.
Care to share how you did it that way?
One of the things that bothers me is the text style. On my forum, the font style changes to something different and I can't figure out where to change it. Where did you find the other css declarations?
Some of the CSS I had to modify was in the googiespell.js file, particularly this segment:
Code:

//////
// Edit layer (the layer where the suggestions are stored)
//////
GoogieSpell.prototype.createEditLayer = function(width, height) {
this.edit_layer = AJS.DIV({'class': 'googie_edit_layer'});

//Set the style so it looks like edit areas
this.edit_layer.className = this.text_area.className;
this.edit_layer.style.border = "1px solid #660000";
this.edit_layer.style.backgroundColor = "#330000";
this.edit_layer.style.padding = "0px";
this.edit_layer.style.margin = "0px";
this.edit_layer.style.fontSize = "11px";
this.edit_layer.style.fontWeight = "bold";
I added the fontSize and fontWeight lines to keep in design with my pre-existing textarea.
Since the dynamic text was being created by an innerHTML it gives me full control over how I want the messages to look. I wanted it to look like a button so I changed these lines:
Code:

this.lang_chck_spell = "<input type='button' value='Check Spelling'>";
this.lang_rsm_edt = " <input type='button' style='color:#FFD700;' value='Resume Editing'>";
I also changed the boolean to remove the spell checker and language images, since I'm using a button I didn't need it.
Code:

this.show_change_lang_pic = false;
this.show_spell_img = false;
Last but not least, I used the custom spell_container object to put the button wherever I wanted. I placed mine next to the Preview button:
Code:

Response.Write " <input name=""Preview"" type=""button"" value="" Preview "" id=""Preview"" onclick=""OpenPreview()""><span id=""spell_container""></span>"
and then anywhere underneath this container, the following code:
Code:

<SCRIPT type="text/javascript">
var googie1 = new GoogieSpell("googiespell/", "./googiespell/googie.asp?lang=");
googie1.setSpellContainer("spell_container");
googie1.decorateTextarea("ta1");
</SCRIPT>
This takes place of the default method you used:
Code:

Response.Write "<SCRIPT type=""text/javascript""> var googie1 = new GoogieSpell(""googiespell/"", ""./googiespell/googie.asp?lang=""); googie1.decorateTextarea(""ta1""); </SCRIPT>"

That should be it.
<
نوشته شده در
Starting Member
mikegodwin
مطلب: 18
18
This works great!
Thanks for the work!<
شما باید یک متن وارد کنید