mozdev.org

Monday October 13th 2008 In 14 hundred and 92, Columbus sailed …

Dict

What's New
10/22/2008
Ver. 0.6.75 Released
7/4/2008
Ver. 0.6.74 Released
4/19/2008
Ver. 0.6.73 Released

The Dict project is a Mozilla extension that lets you easily look up the definition of words on a Web page using an online dictionary. Simply select a word, right-click, and you'll see a menu option to define the selected word. The definitions are returned in a new window.

The Dict project is an implementation of a DICT protocol client. The DICT protocol is defined in RFC 2229. By default, the Dict extension queries the DICT server on dict.org for definitions, but it can be configured to use any DICT server.

Feature Set

The latest release of the Dict project is usable, but does not support the full set of features planned for the 1.0.0 release. The following features have been implemented:

A "define selection" pop-up menu item that defines the selected word. When no definitions are found, a page of nearest matches is returned. When only one nearest match is found, its definition is returned. Can be configured to use a user-selected server. Depending on the chosen server, the extension can be used to define words in other languages and/or translate words from one language to another. Rudimentary support for the "dict" URI scheme.

The following set of features are not yet supported:

Support for selecting different databases within a server. Intelligent database-specific formatting. Right now, all definitions are presented in a fixed-width font that is formatted within the database (and formatted for 80 column ttys). Locale-independent code.

Tips for Power-Users

Here are some tips for power-users.
Customizing userContent.css to reskin the HTML popups

As of version 0.5.12, the HTML popups are marked up with CSS styles. This means you can customize what they look like by modifing your $MOZ_USER_DIR/chrome/userContent.css file. The set of CSS classes and their uses are given in the following table.

CSS Class Name Where it's Used
dict-database The style that encloses the name of the database from which the definition comes. This is already enclosed in bold tags (<B>), so you may want to add font-weight: normal; to your style sheet.
dict-definition The style that encloses the definintion of each word. This is enclosed in code tags (<CODE>), so you may be unable to change the font that is used.
dict-heading The style for all generic headings. Currently, the only one is in the "Closest Matches" page that is returned by the "dict" protocol handler. It contains the text "Closest Matches". This is already enclosed in bold tags (<B>), so you may want to add font-weight: normal; to your style sheet.
dict-horizontal-rule The style of all <HR> tags. Currently, the only one is in the "Closest Matches" page that is returned by the "dict" protocol handler. The rule is between the text that explains the page and the list of close matches.
dict-page The style on the BODY element. Use this to control the overall look and feel of the entire page.
dict-text The style for all non-definition text. Currently, the only one is in the "Closest Matches" page that is returned by the "dict" protocol handler. It encloses the text that explains the purpose of the page.
Using a non-standard DICT server

The Dict extension UI does not allow users to specify their own DICT server. The stock selection of DICT servers (which includes localhost) is sufficient for most use-cases, but this does not cover all use-cases. For example, some users may have a centralized DICT server somewhere on their intranet.

As a work-around, users can customize their preferences outside of the standard preferences UI:

Type "about:config" in the address bar and press ENTER. Type "extensions.dict" in the Filter field. Right-click on "extensions.dict.defaultservername" - select modify, and change it to the hostname or IP address of the desired server. If the DICT server is listening on a non-standard port, right-click on "extensions.dict.defaultserverport", select modify, and change it to the port on which the DICT server is listening.

Related Project

The dictionarysearch has the same functional goals as the Dict project. Instead of using the DICT protocol, it uses HTTP to talk to a multitude of dictionary Web sites and opens a new tab with professionally formatted definitions.

For questions or comments about dict, please email the author.
For questions or comments not about a specific project, please read our feedback page.
This page was last updated on Oct 13, 2008.
Copyright © 2008. All rights reserved.


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser