summaryrefslogtreecommitdiff
path: root/vimperator/content
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2009-11-08 20:54:31 -0500
committerKris Maglione <maglione.k@gmail.com>2009-11-08 20:54:31 -0500
commit6a25312c7dbd913322490a6b14674772b3076e63 (patch)
tree8b634b9a6ffaabff3e577c8a2d86289de07b0d36 /vimperator/content
parent46b7a29fb71210c51cbff3ad91fd69283d392614 (diff)
downloadpentadactyl-6a25312c7dbd913322490a6b14674772b3076e63.tar.gz
Recfactoring:
* Standard module format. All modules are explicitly declared as modules, they're created via a constructor and instantiated automatically. They're dependency aware. They stringify properly. * Classes are declared the same way (rather like Structs already were). They also stringify properly. Plus, each instance has a rather nifty closure member that closes all of its methods around 'this', so you can pass them to map, forEach, setTimeout, etc. Modules are themselves classes, with a special metaclass, as it were. * Doug Crockford is dead, metaphorically speaking. Closure-based classes just don't fit into any of the common JavaScript frameworks, and they're inefficient and confusing. Now, all class and module members are accessed explicitly via 'this', which makes it very clear that they're class members and not (e.g.) local variables, without anything nasty like Hungarian notation. * Strictly one module per file. Classes that belong to a module live in the same file. * For the moment, there are quite a few utility functions sitting in base.c, because my class implementation used them, and I haven't had the time or inclination to sort them out. I plan to reconcile them with the current mess that is the util namespace. * Changed bracing style.
Diffstat (limited to 'vimperator/content')
-rw-r--r--vimperator/content/config.js34
1 files changed, 2 insertions, 32 deletions
diff --git a/vimperator/content/config.js b/vimperator/content/config.js
index c9c6e9d9..4c799850 100644
--- a/vimperator/content/config.js
+++ b/vimperator/content/config.js
@@ -110,6 +110,8 @@ const config = { //{{{
scripts: [
"browser.js",
"bookmarks.js",
+ "history.js",
+ "quickmarks.js",
"sanitizer.js",
"tabs.js"
],
@@ -128,38 +130,6 @@ const config = { //{{{
init: function ()
{
- // load Vimperator specific modules
- // FIXME: Why aren't these listed in config.scripts?
- // FIXME: Why isn't this automatic? -> how would one know which classes to load where? --mst
- // Something like:
- // liberator.addModule("search", function Search() { ...
- // for all modules, or something similar. For modules which
- // require other modules, well, there's addObserver("load_foo",
- // or we could just make sure that they're all sourced in order.
- // The scripts could even just instantiate them themselves.
- // --Kris
- liberator.loadModule("browser", Browser);
- liberator.loadModule("finder", Finder);
- liberator.loadModule("bookmarks", Bookmarks);
- liberator.loadModule("history", History);
- liberator.loadModule("tabs", Tabs);
- liberator.loadModule("marks", Marks);
- liberator.loadModule("quickmarks", QuickMarks);
- liberator.loadModule("hints", Hints);
- liberator.loadModule("sanitizer", Sanitizer);
-
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////// STYLES //////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////{{{
-
- /////////////////////////////////////////////////////////////////////////////}}}
- ////////////////////// MAPPINGS ////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////{{{
-
- /////////////////////////////////////////////////////////////////////////////}}}
- ////////////////////// COMMANDS ////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////{{{
-
commands.add(["winon[ly]"],
"Close all other windows",
function ()