Spellcheck Extension for Arbitrary Web Pages

From CDOT Wiki
Revision as of 21:38, 23 September 2008 by Ajhooper (talk | contribs)
Jump to: navigation, search

Project Name

Spellcheck Extension for Arbitrary Web Pages

Project Description

Description should be no longer than a paragraph. Include links to any relevant on-line resources. For example, http://google.com or MDC.

Project Leader(s)

Name(s) of primary people working on the project. If you want to join a project as leader, discuss with other leaders first. Include links to personal pages within wiki

Project Contributor(s)

Name(s) of people casually working on the project, or who have contributed significant help. Include links to personal pages within wiki

NOTE: only Project Leader(s) should add names here. You can’t add your own name to the Contributor list.

Project Details

Provides more depth than the Project Description. This is the place for technical discussions, project specs, or other details. If this gets very long, you might consider breaking this part into multiple pages and linking to them.

Project News

This is where your regular updates will go. In these you should discuss the status or your work, your interactions with other members of the community (e.g., Seneca and Mozilla), problems you have encountered, etc.

Put detailed technical information into the Project Details page (i.e., update it as you go), and save this section for news about participation in the project.

IRC log of conversation about this extension

  • 12:14 <@dave> how hard would it be to add Tools > Spell-Check?
  • 12:14 <@dave> i.e., for an arbitrary page vs. textbox
  • 12:14 < shaver> good question
  • 12:15 <@dave> or probably what I mean is Tools > Highlight Spelling Mistakes
  • 12:19 < shaver> you'd want a presentation like the findbar?
  • 12:19 <@dave> depends on use case, but that's one good one, yeah
  • 12:19 <@dave> I'm thinking of being able to just underline all mispelled words on the page
  • 12:23 < mfinkle> look into http://mxr.mozilla.org/seamonkey/source/editor/txtsvc/public/nsIInlineSpellChecker.idl
  • 12:23 < mfinkle> it is keyed to use an editor
  • 12:23 < mfinkle> but the code inside could be useful
  • 12:23 <@dave> I should talk to enn I guess
  • 12:24 < mfinkle> the red squiggle is done using a special kind of selection type
  • 12:25 <@dave> mfinkle: yeah, I've seen that code before.
  • 12:25 <@dave> the selection
  • 12:25 < mfinkle> http://mxr.mozilla.org/seamonkey/source/extensions/spellcheck/src/mozInlineSpellChecker.cpp
  • 12:25 <@dave> but this idl looks interesting
  • 12:25 < mfinkle> is an inline spellcheck implementation for editors
  • 12:26 < mfinkle> DoSpellCheck does some heavy lifting
    http://mxr.mozilla.org/seamonkey/source/extensions/spellcheck/src/mozInlineSpellChecker.cpp#1223
  • 12:27 < mfinkle> whoops, down a few lines
  • 12:28 <@dave> 1278 if (! editor)
  • 12:28 <@dave> 1279 return NS_ERROR_FAILURE;
  • 12:28 <@dave> hm
  • 12:28 < mfinkle> yeah, but it seems to use ranges, so swapping in a document shouldn't be impossible
  • 12:29 < mfinkle> and notice that mSpellCheck is an instance of the real spellcheck engine
  • 12:29 <@dave> yeah
  • 12:29 <@dave> I'm trying to find uses of editor, and it's thin
  • 12:31 < mfinkle> well mSpellCheck is a nsIEditorSpellCheck
  • 12:31 < mfinkle> must go deeper
  • 12:33 < mfinkle> crap, nsISpellCheck is not public - wtf
  • 12:33 <@dave> weird
  • 12:33 < shaver> fixable, I bet
  • 12:34 < mfinkle> I suppose building directly against the tree (instead of the sdk) is doable
  • 12:34 <@dave> so this is a tree exercise vs. an ext
  • 12:34 < mfinkle> kinda like vlad's canvas3d
  • 12:34 < mfinkle> right
  • 12:34 < shaver> no, it's an extension
  • 12:34 < mfinkle> well, it can be an extension
  • 12:34 < shaver> it's just not one that can use only frozen APIs
  • 12:34 < mfinkle> but it needs the tree
  • 12:34 < shaver> like basically any useful extension
  • 12:34 <@dave> :)
  • 12:34 < mfinkle> sadly
  • 12:35 < mfinkle> but anyway - onward
  • 12:35 <@dave> I think I'll take some notes here and craft a project for future
  • 12:35 < mfinkle> http://mxr.mozilla.org/seamonkey/source/extensions/spellcheck/src/mozSpellChecker.cpp
  • 12:35 < mfinkle> implements the nsISpellCheck interface
  • 12:36 < mfinkle> takes an nsITextServicesDocument
  • 12:36 <@dave> how generic is that?
  • 12:38 < mfinkle> can be initialized with a document! http://mxr.mozilla.org/seamonkey/source/editor/txtsvc/src/nsTextServicesDocument.cpp#175
  • 12:38 < mfinkle> promising

Relevant Links