874
edits
(Added section on LINK REL code service) |
(added more information) |
||
Line 4: | Line 4: | ||
[[Image:Ubiquity_0.1.3_Architecture.png]] | [[Image:Ubiquity_0.1.3_Architecture.png]] | ||
== Application-wide Objects == | |||
The objects described in this section are shared by the entire XULRunner application; many of them are singletons. The construction of most of these objects begins in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/setup.js ubiquity/modules/setup.js]. | |||
* '''Mixed Code Source Collection''' and '''Code Source''' classes are defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/codesource.js ubiquity/modules/codesource.js]. A better name for <tt>MixedCodeSourceCollection</tt> would probably be <tt>DecoratedCodeSourceCollection</tt>, since the general idea is to take a single piece of code—what's commonly referred to as a "command feed" in Ubiquity—and add a header or preamble that contains common utilities, such as the <tt>Utils</tt> and <tt>CmdUtils</tt> namespaces, and a footer that contains finalization and post-processing logic. The headers, footers, and built-in (non-unsubscribable) command feeds are contained in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/feed-parts/ ubiquity/feed-parts/], while most the standard (and unsubscribable) feeds are in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/standard-feeds/ ubiquity/standard-feeds/]. Iterating over a <tt>MixedCodeSourceCollection</tt> yields Code Sources that are full representations of all code that ultimately gets executed in a command feed's sandbox. | * '''Mixed Code Source Collection''' and '''Code Source''' classes are defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/codesource.js ubiquity/modules/codesource.js]. A better name for <tt>MixedCodeSourceCollection</tt> would probably be <tt>DecoratedCodeSourceCollection</tt>, since the general idea is to take a single piece of code—what's commonly referred to as a "command feed" in Ubiquity—and add a header or preamble that contains common utilities, such as the <tt>Utils</tt> and <tt>CmdUtils</tt> namespaces, and a footer that contains finalization and post-processing logic. The headers, footers, and built-in (non-unsubscribable) command feeds are contained in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/feed-parts/ ubiquity/feed-parts/], while most the standard (and unsubscribable) feeds are in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/standard-feeds/ ubiquity/standard-feeds/]. Iterating over a <tt>MixedCodeSourceCollection</tt> yields Code Sources that are full representations of all code that ultimately gets executed in a command feed's sandbox. | ||
* '''LINK REL Code Service''' is defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/linkrel_codesvc.js ubiquity/modules/linkrel_codesvc.js] and is responsible for detecting <tt><nowiki><LINK REL="commands"></nowiki></tt> tags on web pages, displaying notification box messages to the user, and managing command feed subscriptions. When iterated over, it yields a Code Source object for each subscribed-to command feed, each of which are subsequently decorated by <tt>MixedCodeSourceCollection</tt>. | * '''LINK REL Code Service''' is defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/linkrel_codesvc.js ubiquity/modules/linkrel_codesvc.js] and is responsible for detecting <tt><nowiki><LINK REL="commands"></nowiki></tt> tags on web pages, displaying notification box messages to the user, and managing command feed subscriptions. When iterated over, it yields a Code Source object for each subscribed-to command feed, each of which are subsequently decorated by <tt>MixedCodeSourceCollection</tt>. | ||
* '''Command Source''' is defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/cmdsource.js ubiquity/modules/cmdsource.js] and is responsible for executing command feed code in sandboxes and retrieving commands, noun types, and page load functions from them. It's also responsible for re-loading command feeds when they've changed. | |||
* '''Sandbox Factory''' is a simple abstraction for the creation of JavaScript sandboxes and the evaluation of code within them. It's defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/sandboxfactory.js ubiquity/modules/sandboxfactory.js]. | |||
* '''Globals Maker''' is a factory that sets up global variables, such as <tt>Application</tt> and <tt>XMLHttpRequest</tt>, in a new sandbox object. It's defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/setup.js ubiquity/modules/setup.js]. | |||
* '''Message Service''' is a simple abstraction that encapsulates the display of messages and the reporting of errors to the end-user; it's defined in [http://hg.toolness.com/ubiquity-firefox/file/9a629fab9402/ubiquity/modules/msgservice.js ubiquity/modules/msgservice.js]. |
edits