redesign buffer-modes and page-modes
commit9702666241a792f1eb3a363c31bddf149724c1db
authorJohn Foerch <jjfoerch@earthlink.net>
Sat, 28 Jan 2012 02:28:55 +0000 (27 21:28 -0500)
committerJohn Foerch <jjfoerch@earthlink.net>
Sat, 28 Jan 2012 03:03:35 +0000 (27 22:03 -0500)
tree2ede16a2e89d662d0cb5693a214d94670f58df7a
parent3463732ceb5a9227f93ddc8f9f6d6d602afa28b1
redesign buffer-modes and page-modes

multiple page modes may be enabled at the same time.  this will allow for
granulated page-modes, a one-to-one relationship between modes and
features, allowing the user to easily configure which features they want
in a uniform way across all page-modes.  (splitting up existing page-modes
is a project for future patches.)

call forms of both define_buffer_mode and define_page_mode have changed.  'enable'
and 'disable' are now both required positional arguments instead of keyword arguments,
and define_page_mode also takes its test regexp/function as an argument.

buffer-modes and page-modes are now js objects instead of functions.  these objects
have 'enable' and 'disable' methods to turn them on and off, instead of the emacs style
of having a toggle function that takes a -1/1 (or true/false) argument.  the new style
is more idiomatic of js, and not so arbitrary.

buffer-mode classes removed: no longer any need for mutually exclusive groups
of modes, like page-modes were.  if need arises later, it's easy to add back.

buffer.page now exists whether any page-modes are running or not.  page-local
variables apart from page-modes can be useful with cwd (setting cwd based on
current host) for example.
23 files changed:
modules/buffer.js
modules/caret.js
modules/content-buffer.js
modules/page-modes/dailymotion.js
modules/page-modes/duckduckgo.js
modules/page-modes/github.js
modules/page-modes/gmail.js
modules/page-modes/gmane.js
modules/page-modes/google-calendar.js
modules/page-modes/google-gqueues.js
modules/page-modes/google-images.js
modules/page-modes/google-maps.js
modules/page-modes/google-reader.js
modules/page-modes/google-search-results.js
modules/page-modes/google-video.js
modules/page-modes/google-voice.js
modules/page-modes/reddit.js
modules/page-modes/stackexchange.js
modules/page-modes/twitter.js
modules/page-modes/wikipedia.js
modules/page-modes/xkcd.js
modules/page-modes/youtube.js
modules/quote.js