From 80beaa41df9ef3d6e62ecb189451146cb52eb21d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 16 Mar 2009 15:54:02 +1100 Subject: [PATCH 01/87] And xulmus was born. --- License.txt | 1 + Makefile | 2 +- common/Makefile.common | 4 +- common/content/buffer.js | 21 +- common/content/completion.js | 10 + common/content/events.js | 35 +- common/content/liberator.js | 12 +- common/content/modes.js | 1 + common/content/services.js | 4 +- common/content/tabs.js | 29 +- common/content/ui.js | 4 +- common/content/util.js | 2 +- common/make_jar.sh | 11 +- common/skin/liberator.css | 4 +- xulmus/Makefile | 9 + xulmus/NEWS | 1 + xulmus/chrome.manifest | 24 + xulmus/components/chrome-data.js | 87 ++ xulmus/content/bookmarks.js | 1146 ++++++++++++++++++++ xulmus/content/config.js | 496 +++++++++ xulmus/content/liberator.dtd | 6 + xulmus/content/player.js | 219 ++++ xulmus/content/xulmus.png | Bin 0 -> 2226 bytes xulmus/content/xulmus.svg | 88 ++ xulmus/content/xulmus.xul | 52 + xulmus/contrib/vim/Makefile | 9 + xulmus/contrib/vim/ftdetect/vimperator.vim | 1 + xulmus/contrib/vim/mkvimball.txt | 2 + xulmus/contrib/vim/syntax/vimperator.vim | 104 ++ xulmus/install.rdf | 58 + xulmus/locale/en-US/Makefile | 2 + xulmus/locale/en-US/asciidoc.conf | 86 ++ xulmus/locale/en-US/autocommands.txt | 91 ++ xulmus/locale/en-US/browsing.txt | 349 ++++++ xulmus/locale/en-US/buffer.txt | 361 ++++++ xulmus/locale/en-US/cmdline.txt | 80 ++ xulmus/locale/en-US/developer.txt | 88 ++ xulmus/locale/en-US/eval.txt | 84 ++ xulmus/locale/en-US/gui.txt | 90 ++ xulmus/locale/en-US/help.js | 24 + xulmus/locale/en-US/hints.txt | 67 ++ xulmus/locale/en-US/index.txt | 316 ++++++ xulmus/locale/en-US/insert.txt | 30 + xulmus/locale/en-US/intro.txt | 115 ++ xulmus/locale/en-US/map.txt | 413 +++++++ xulmus/locale/en-US/marks.txt | 249 +++++ xulmus/locale/en-US/message.txt | 22 + xulmus/locale/en-US/options.txt | 815 ++++++++++++++ xulmus/locale/en-US/overlay.dtd | 4 + xulmus/locale/en-US/overlay.properties | 1 + xulmus/locale/en-US/pattern.txt | 70 ++ xulmus/locale/en-US/print.txt | 34 + xulmus/locale/en-US/repeat.txt | 145 +++ xulmus/locale/en-US/starting.txt | 60 + xulmus/locale/en-US/styling.txt | 131 +++ xulmus/locale/en-US/tabs.txt | 218 ++++ xulmus/locale/en-US/tutorial.txt | 253 +++++ xulmus/locale/en-US/various.txt | 111 ++ xulmus/locale/en-US/xhtml11.css | 349 ++++++ xulmus/skin/icon.png | Bin 0 -> 514 bytes xulmus/vimperatorrc.example | 21 + 61 files changed, 7085 insertions(+), 36 deletions(-) create mode 100755 xulmus/Makefile create mode 100755 xulmus/NEWS create mode 100755 xulmus/chrome.manifest create mode 100755 xulmus/components/chrome-data.js create mode 100755 xulmus/content/bookmarks.js create mode 100755 xulmus/content/config.js create mode 100755 xulmus/content/liberator.dtd create mode 100755 xulmus/content/player.js create mode 100755 xulmus/content/xulmus.png create mode 100755 xulmus/content/xulmus.svg create mode 100755 xulmus/content/xulmus.xul create mode 100755 xulmus/contrib/vim/Makefile create mode 100755 xulmus/contrib/vim/ftdetect/vimperator.vim create mode 100755 xulmus/contrib/vim/mkvimball.txt create mode 100755 xulmus/contrib/vim/syntax/vimperator.vim create mode 100755 xulmus/install.rdf create mode 100755 xulmus/locale/en-US/Makefile create mode 100755 xulmus/locale/en-US/asciidoc.conf create mode 100755 xulmus/locale/en-US/autocommands.txt create mode 100755 xulmus/locale/en-US/browsing.txt create mode 100755 xulmus/locale/en-US/buffer.txt create mode 100755 xulmus/locale/en-US/cmdline.txt create mode 100755 xulmus/locale/en-US/developer.txt create mode 100755 xulmus/locale/en-US/eval.txt create mode 100755 xulmus/locale/en-US/gui.txt create mode 100755 xulmus/locale/en-US/help.js create mode 100755 xulmus/locale/en-US/hints.txt create mode 100755 xulmus/locale/en-US/index.txt create mode 100755 xulmus/locale/en-US/insert.txt create mode 100755 xulmus/locale/en-US/intro.txt create mode 100755 xulmus/locale/en-US/map.txt create mode 100755 xulmus/locale/en-US/marks.txt create mode 100755 xulmus/locale/en-US/message.txt create mode 100755 xulmus/locale/en-US/options.txt create mode 100755 xulmus/locale/en-US/overlay.dtd create mode 100755 xulmus/locale/en-US/overlay.properties create mode 100755 xulmus/locale/en-US/pattern.txt create mode 100755 xulmus/locale/en-US/print.txt create mode 100755 xulmus/locale/en-US/repeat.txt create mode 100755 xulmus/locale/en-US/starting.txt create mode 100755 xulmus/locale/en-US/styling.txt create mode 100755 xulmus/locale/en-US/tabs.txt create mode 100755 xulmus/locale/en-US/tutorial.txt create mode 100755 xulmus/locale/en-US/various.txt create mode 100755 xulmus/locale/en-US/xhtml11.css create mode 100755 xulmus/skin/icon.png create mode 100755 xulmus/vimperatorrc.example diff --git a/License.txt b/License.txt index 7efdb050..d589f3c4 100644 --- a/License.txt +++ b/License.txt @@ -11,6 +11,7 @@ for the specific language governing rights and limitations under the License. Copyright (c) 2006-2009 by Martin Stubenschrott +Copyright (c) 2009 by Prathyush Thota Alternatively, the contents of this file may be used under the terms of either the GNU General Public License Version 2 or later (the "GPL"), or diff --git a/Makefile b/Makefile index c0c3842b..2b2594b4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -DIRS = vimperator muttator +DIRS = muttator vimperator xulmus TARGETS = clean distclean doc help info jar release xpi .SILENT: diff --git a/common/Makefile.common b/common/Makefile.common index d0e1210b..0820a039 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -9,7 +9,7 @@ LOCALEDIR = locale DOC_SRC_FILES = $(wildcard $(LOCALEDIR)/*/*.txt) LOCALES = $(foreach locale,$(wildcard $(LOCALEDIR)/*),$(word 2,$(subst /, ,$(locale)))) -MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" sh $(BASE)/make_jar.sh +MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" bash $(BASE)/make_jar.sh # TODO: specify source files manually? JAR_BASES = $(TOP) $(BASE) @@ -45,7 +45,7 @@ TARGETS = all help info doc jar xpi install clean distclean $(JAR) $(TARGETS:%=\%.%): echo MAKE $* $(@:$*.%=%) $(MAKE) -C $* $(@:$*.%=%) - + echo $$SHELL .PHONY: $(TARGETS) all: help diff --git a/common/content/buffer.js b/common/content/buffer.js index 7f535692..cf406134 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -42,8 +42,9 @@ function Buffer() //{{{ ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - // FIXME: This doesn't belong here. - let mainWindowID = config.mainWindowID || "main-window"; + // FIXME: This doesn't belong here. + let mainWindowID = config.mainWindowID || "mainplayer"; + let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize; styles.registerSheet("chrome://liberator/skin/liberator.css"); @@ -214,7 +215,13 @@ function Buffer() //{{{ mappings.add(myModes, [""], "Stop loading", - function () { window.BrowserStop(); }); + function () + { + if(config.name == "Xulmus") + getBrowser().mCurrentBrowser.stop(); + else + window.BrowserStop(); + }); // scrolling mappings.add(myModes, ["j", "", ""], @@ -596,7 +603,13 @@ function Buffer() //{{{ commands.add(["st[op]"], "Stop loading", - function () { window.BrowserStop(); }, + function () + { + if(config.name == "Xulmus") + getBrowser().mCurrentBrowser.stop(); + else + window.BrowserStop(); + }, { argCount: "0" }); commands.add(["vie[wsource]"], diff --git a/common/content/completion.js b/common/content/completion.js index 9cd8010a..d06a0497 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1381,6 +1381,16 @@ function Completion() //{{{ completion.urls(context, tags); }, + songCompletion: function songCompletion(context, args) + { + if (args.completeArg == 0) + context.completions = getArtists(); + else if (args.completeArg == 1) + context.completions = getAlbums(args[0]); + else if (args.completeArg == 2) + context.completions = getTracks(args[0],args[1]); + }, + buffer: function buffer(context) { filter = context.filter.toLowerCase(); diff --git a/common/content/events.js b/common/content/events.js index 8d25106d..80d3858b 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -628,7 +628,7 @@ function Events() //{{{ // return true when load successful, or false otherwise function waitForPageLoaded() events.waitForPageLoad(); - // load all macros inside ~/.vimperator/macros/ + // load all macros inside ~/.xulmus/macros/ // setTimeout needed since io. is loaded after events. setTimeout(function () { try @@ -678,16 +678,16 @@ function Events() //{{{ function () { events.onEscape(); }); // add the ":" mapping in all but insert mode mappings - mappings.add([modes.NORMAL, modes.VISUAL, modes.HINTS, modes.MESSAGE, modes.COMPOSE, modes.CARET, modes.TEXTAREA], + mappings.add([modes.NORMAL, modes.PLAYER, modes.VISUAL, modes.HINTS, modes.MESSAGE, modes.COMPOSE, modes.CARET, modes.TEXTAREA], [":"], "Enter command line mode", function () { commandline.open(":", "", modes.EX); }); // focus events - mappings.add([modes.NORMAL, modes.VISUAL, modes.CARET], + mappings.add([modes.NORMAL, modes.PLAYER, modes.VISUAL, modes.CARET], [""], "Advance keyboard focus", function () { document.commandDispatcher.advanceFocus(); }); - mappings.add([modes.NORMAL, modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA], + mappings.add([modes.NORMAL, modes.PLAYER,modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA], [""], "Rewind keyboard focus", function () { document.commandDispatcher.rewindFocus(); }); @@ -704,12 +704,12 @@ function Events() //{{{ function () { return; }); // macros - mappings.add([modes.NORMAL, modes.MESSAGE], + mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE], ["q"], "Record a key sequence into a macro", function (arg) { events.startRecording(arg); }, { flags: Mappings.flags.ARGUMENT }); - mappings.add([modes.NORMAL, modes.MESSAGE], + mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE], ["@"], "Play a macro", function (count, arg) { @@ -1037,8 +1037,8 @@ function Events() //{{{ // (i.e., cntrl codes 27--31) // --- // For more information, see: - // [*] Vimp FAQ: http://vimperator.org/trac/wiki/Vimperator/FAQ#WhydoesntC-workforEscMacOSX - // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/vimperator/2008-May/001548.html + // [*] Vimp FAQ: http://xulmus.org/trac/wiki/Xulmus/FAQ#WhydoesntC-workforEscMacOSX + // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/xulmus/2008-May/001548.html // [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \" // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227 // [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa @@ -1226,6 +1226,21 @@ function Events() //{{{ } } + if(config.name == "Xulmus") + { + // Switch to -- PLAYER -- mode for Songbird Media Player. + if(config.isPlayerWindow) + { + liberator.mode = modes.PLAYER; + } + else + { + liberator.mode = modes.NORMAL; + } + return; + } + + urlbar = document.getElementById("urlbar"); if (elem == null && urlbar && urlbar.inputField == lastFocus) liberator.threadYield(true); @@ -1421,8 +1436,8 @@ function Events() //{{{ // XXX: ugly hack for now pass certain keys to Firefox as they are without beeping // also fixes key navigation in combo boxes, submitting forms, etc. // FIXME: breaks iabbr for now --mst - if ((config.name == "Vimperator" && liberator.mode == modes.NORMAL) - || liberator.mode == modes.INSERT) + if (((config.name == "Xulmus" || config.name == "Vimperator") && liberator.mode == modes.NORMAL || liberator.mode == modes.INSERT)) + { if (key == "") return false; diff --git a/common/content/liberator.js b/common/content/liberator.js index a26ed8fa..3a0cec85 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -26,6 +26,7 @@ the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL. }}} ***** END LICENSE BLOCK *****/ + /** @scope modules */ Cu.import("resource://gre/modules/XPCOMUtils.jsm", modules); @@ -70,7 +71,7 @@ const liberator = (function () //{{{ let nError = 0; function loadModule(name, func) { - let message = "Loading module " + name + "..."; + let message = "Loading module " + name + "..."; try { liberator.log(message, 0); @@ -81,7 +82,10 @@ const liberator = (function () //{{{ catch (e) { if (nError++ == 0) - window.toJavaScriptConsole(); + liberator.dump("Error loading module - "+ name + ".."); + liberator.dump(e); + liberator.dump(e.stack); + window.toJavaScriptConsole(); liberator.reportError(e); } } @@ -1215,8 +1219,6 @@ const liberator = (function () //{{{ startup: function () { let start = Date.now(); - liberator.log("Initializing liberator object...", 0); - config.features = config.features || []; config.features.push(getPlatformFeature()); config.defaults = config.defaults || {}; @@ -1225,7 +1227,7 @@ const liberator = (function () //{{{ config.mailModes = config.mailModes || [modes.NORMAL]; // TODO: suitable defaults? //config.mainWidget - //config.mainWindowID + //config.mainWindowID //config.visualbellWindow //config.styleableChrome config.autocommands = config.autocommands || []; diff --git a/common/content/modes.js b/common/content/modes.js index b00ec691..f0d71735 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -269,6 +269,7 @@ const modes = (function () //{{{ self.addMode("MESSAGE"); // for now only used in Muttator when the message has focus self.addMode("COMPOSE"); self.addMode("CUSTOM", false, function () plugins.mode); + self.addMode("PLAYER"); // Player mode for songbird // extended modes, can include multiple modes, and even main modes self.addMode("EX", true); self.addMode("HINTS", true); diff --git a/common/content/services.js b/common/content/services.js index 925be0a8..338e1c33 100644 --- a/common/content/services.js +++ b/common/content/services.js @@ -48,6 +48,7 @@ function Services() self.add("appStartup", "@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup); self.add("autoCompleteSearch", "@mozilla.org/browser/global-history;2", Ci.nsIAutoCompleteSearch); + //self.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=songbird-autocomplete", Ci.nsIAutoCompleteSearch); self.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService); self.add("cache", "@mozilla.org/network/cache-service;1", Ci.nsICacheService); self.add("console", "@mozilla.org/consoleservice;1", Ci.nsIConsoleService); @@ -64,7 +65,8 @@ function Services() self.add("threadManager", "@mozilla.org/thread-manager;1", Ci.nsIThreadManager); self.add("windowMediator", "@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator); self.add("windowWatcher", "@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher); - + self.add("bookmarks", "@mozilla.org/browser/nav-bookmarks-service;1", Ci.nsINavBookmarksService); + self.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile); self.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind); self.addClass("process", "@mozilla.org/process/util;1", Ci.nsIProcess); diff --git a/common/content/tabs.js b/common/content/tabs.js index 8f5f6578..411f9213 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -109,7 +109,10 @@ function Tabs() //{{{ // hide tabs initially if (config.name == "Vimperator") getBrowser().mStrip.getElementsByClassName("tabbrowser-tabs")[0].collapsed = true; - +/* + if (config.name == "Xulmus") + getBrowser()._strip.getElementsByClassName( + */ /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -148,7 +151,7 @@ function Tabs() //{{{ validator: Option.validateCompleter }); - if (config.name == "Vimperator") + if (config.name == "Vimperator" || config.name == "Xulmus" ) { options.add(["activate", "act"], "Define when tabs are automatically activated", @@ -238,7 +241,7 @@ function Tabs() //{{{ function (count) { tabs.select("-" + (count < 1 ? 1 : count), true); }, { flags: Mappings.flags.COUNT }); - if (config.name == "Vimperator") + if (config.name == "Vimperator" || config.name == "Xulmus") { mappings.add([modes.NORMAL], ["b"], "Open a prompt to switch buffers", @@ -449,7 +452,7 @@ function Tabs() //{{{ function () { tabs.select(0, false); }, { argCount: "0" }); - if (config.name == "Vimperator") + if (config.name == "Vimperator" || config.name == "Xulmus") { // TODO: "Zero count" if 0 specified as arg, multiple args and count ranges? commands.add(["b[uffer]"], @@ -584,7 +587,7 @@ function Tabs() //{{{ }); } - if (liberator.has("session")) + if (liberator.has("session") && config.name != "Xulmus") { // TODO: extract common functionality of "undoall" commands.add(["u[ndo]"], @@ -780,6 +783,22 @@ function Tabs() //{{{ getBrowser().removeTab(tab); else liberator.beep(); + }, + Songbird: function (tab) + { + if (getBrowser().mTabs.length > 1) + getBrowser().removeTab(tab); + else + { + if (buffer.URL != "about:blank" || + window.getWebNavigation().sessionHistory.count > 0) + { + liberator.open("about:blank", liberator.NEW_BACKGROUND_TAB); + getBrowser().removeTab(tab); + } + else + liberator.beep(); + } } }[config.hostApplication] || function () {}; diff --git a/common/content/ui.js b/common/content/ui.js index 6fdf8239..d8f076a4 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -568,7 +568,7 @@ function CommandLine() //{{{ var startHints = false; // whether we're waiting to start hints mode var lastSubstring = ""; - + // the containing box for the promptWidget and commandWidget const commandlineWidget = document.getElementById("liberator-commandline"); // the prompt for the current command, for example : or /. Can be blank @@ -577,7 +577,7 @@ function CommandLine() //{{{ const commandWidget = document.getElementById("liberator-commandline-command"); const messageBox = document.getElementById("liberator-message"); - + commandWidget.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); messageBox.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); diff --git a/common/content/util.js b/common/content/util.js index 5409d0c9..60477acf 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -170,7 +170,7 @@ const util = { //{{{ */ computedStyle: function computedStyle(node) { - while (node instanceof Text && node.parentNode) + while (node instanceof Text && node.parentNode) node = node.parentNode; return node.ownerDocument.defaultView.getComputedStyle(node, null); }, diff --git a/common/make_jar.sh b/common/make_jar.sh index 81c23be3..291dc7d1 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -1,6 +1,7 @@ #!/bin/dash set -e + top=$(pwd) jar=$1 bases=$2 @@ -14,7 +15,7 @@ stage="$top/${jar%.*}" mkdir -p $stage getfiles () { - filter="\.($(echo $1 | tr ' ' '|'))$"; shift + filter="\.($(echo $1 | tr ' ' '|'))$"; shift find "$@" -not -path '*CVS*' 2>/dev/null | grep -E "$filter" || true } copytext () { @@ -33,9 +34,9 @@ do [ ${jar##*.} = jar ] && stage="$stage/${base##*/}" for dir in $dirs do - for f in $(getfiles "$bin" "$dir") + for f in $(getfiles "$bin" "$dir") do - mkdir -p "$stage/${f%/*}" + mkdir -p "$stage/${f%/*}" cp $f "$stage/$f" done for f in $(getfiles "$text" "$dir") @@ -51,6 +52,8 @@ do ) done -(cd $stage; zip -r "$top/$jar" *) +cd $stage +zip -r "$top/$jar" * +cd - rm -rf "$stage" diff --git a/common/skin/liberator.css b/common/skin/liberator.css index 677adbef..48c22c33 100644 --- a/common/skin/liberator.css +++ b/common/skin/liberator.css @@ -174,7 +174,9 @@ statusbarpanel { } #liberator-completions-content *, -#liberator-multiline-output-content * { +#liberator-multiline-output-content *, +#liberator-commandline-prompt *, +#liberator-commandline-command { font: inherit; } diff --git a/xulmus/Makefile b/xulmus/Makefile new file mode 100755 index 00000000..118bb65e --- /dev/null +++ b/xulmus/Makefile @@ -0,0 +1,9 @@ +#### configuration + +VERSION = 0.1 +NAME = xulmus + +include ../common/Makefile.common + +foo: + echo $$SHELL diff --git a/xulmus/NEWS b/xulmus/NEWS new file mode 100755 index 00000000..8b137891 --- /dev/null +++ b/xulmus/NEWS @@ -0,0 +1 @@ + diff --git a/xulmus/chrome.manifest b/xulmus/chrome.manifest new file mode 100755 index 00000000..3911ae16 --- /dev/null +++ b/xulmus/chrome.manifest @@ -0,0 +1,24 @@ +# Songbird +content xulmus content/ +skin xulmus classic/1.0 skin/ +locale liberator en-US locale/en-US/ + +content liberator ../common/content/ +resource liberator ../common/modules/ +skin liberator classic/1.0 ../common/skin/ + +override chrome://liberator/content/liberator.dtd chrome://xulmus/content/liberator.dtd +override chrome://liberator/content/config.js chrome://xulmus/content/config.js + +overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://xulmus/content/xulmus.xul +overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://liberator/content/liberator.xul + + +#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://xulmus/content/xulmus.xul +#overlay chrome://songbird/content/xul/layoutWithBrowserOverlay.xul chrome://liberator/content/liberator.xul + +#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://xulmus/content/xulmus.xul +#overlay chrome://songbird/content/xul/layoutWithoutBrowserOverlay.xul chrome://liberator/content/liberator.xul + +#overlay windowtype:Songbird:Main chrome://liberator/content/liberator.xul +#overlay windowtype:Songbird:Main chrome://xulmus/content/xulmus.xul diff --git a/xulmus/components/chrome-data.js b/xulmus/components/chrome-data.js new file mode 100755 index 00000000..74dc57a2 --- /dev/null +++ b/xulmus/components/chrome-data.js @@ -0,0 +1,87 @@ +/* Adds support for data: URIs with chrome privileges + * and fragment identifiers. + * + * "chrome-data:" [; ]* "," [] + * + * By Kris Maglione, ideas from Ed Anuff's nsChromeExtensionHandler. + * + * Licenced under the MIT License, which allows for sublicensing + * under any compatible license, including the GNU GPL and the MPL. + */ + +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +const NS_BINDING_ABORTED = 0x804b0002; +const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler; + +const ioService = Components.classes["@mozilla.org/network/io-service;1"] + .getService(Components.interfaces.nsIIOService); + +let channel = Components.classesByID["{61ba33c0-3031-11d3-8cd0-0060b0fc14a3}"] + .getService(Components.interfaces.nsIProtocolHandler) + .newChannel(ioService.newURI("chrome://liberator/content/data", null, null)) + .QueryInterface(Components.interfaces.nsIRequest); +const systemPrincipal = channel.owner; +channel.cancel(NS_BINDING_ABORTED); +delete channel; + +var instance; +function ChromeData() {} +ChromeData.prototype = { + contractID: "@mozilla.org/network/protocol;1?name=chrome-data", + classID: Components.ID("{c1b67a07-18f7-4e13-b361-2edcc35a5a0d}"), + classDescription: "Data URIs with chrome privileges", + QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]), + _xpcom_factory: { + createInstance: function (outer, iid) + { + if (!instance) + instance = new ChromeData(); + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + return instance.QueryInterface(iid); + } + }, + + scheme: "chrome-data", + defaultPort: -1, + allowPort: function (port, scheme) false, + protocolFlags: nsIProtocolHandler.URI_NORELATIVE + | nsIProtocolHandler.URI_NOAUTH + | nsIProtocolHandler.URI_IS_UI_RESOURCE, + + newURI: function (spec, charset, baseURI) + { + var uri = Components.classes["@mozilla.org/network/standard-url;1"] + .createInstance(Components.interfaces.nsIStandardURL) + .QueryInterface(Components.interfaces.nsIURI); + uri.init(1, -1, spec, charset, null); + return uri; + }, + + newChannel: function (uri) + { + try + { + if (uri.scheme == this.scheme) + { + let newURI = ioService.newURI(uri.spec.replace(/^.*?:\/*(.*)(?:#.*)?/, "data:$1"), null, null); + let channel = ioService.newChannelFromURI(newURI); + channel.owner = systemPrincipal; + channel.originalURI = uri; + return channel; + } + } + catch (e) {} + throw Components.results.NS_ERROR_FAILURE; + } +}; + +var components = [ChromeData]; + +function NSGetModule(compMgr, fileSpec) +{ + return XPCOMUtils.generateModule(components); +} + +// vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/content/bookmarks.js b/xulmus/content/bookmarks.js new file mode 100755 index 00000000..1e0ca0a0 --- /dev/null +++ b/xulmus/content/bookmarks.js @@ -0,0 +1,1146 @@ +/***** BEGIN LICENSE BLOCK ***** {{{ +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version +1.1 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the +License. + +Copyright (c) 2006-2009 by Martin Stubenschrott + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. +}}} ***** END LICENSE BLOCK *****/ +Components.utils.import("resource://gre/modules/utils.js"); +const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png"; + +// Try to import older command line history, quick marks, etc. +liberator.registerObserver("load", function () { + if (!options.getPref("extensions.xulmus.commandline_cmd_history")) + return; + + let store = storage["history-command"]; + let pref = options.getPref("extensions.xulmus.commandline_cmd_history"); + for (let [k, v] in Iterator(pref.split("\n"))) + store.push(v); + + store = storage["quickmarks"]; + pref = options.getPref("extensions.xulmus.quickmarks") + .split("\n"); + while (pref.length > 0) + store.set(pref.shift(), pref.shift()); + + options.resetPref("extensions.xulmus.commandline_cmd_history"); + options.resetPref("extensions.xulmus.commandline_search_history"); + options.resetPref("extensions.xulmus.quickmarks"); +}); + +// also includes methods for dealing with keywords and search engines +function Bookmarks() //{{{ +{ + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// PRIVATE SECTION ///////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + const historyService = PlacesUtils.history; //Cc["@mozilla.org/browser/global-history;1"].getService(Ci.nsIGlobalHistory); + const bookmarksService = PlacesUtils.bookmarks //Cc["@songbirdnest.com/servicepane/bookmarks;1"].getService(Ci.sbIBookmarks); + const taggingService = PlacesUtils.tagging //Cc["@mozilla.org/browser/tagging-service;1"].getService(Ci.nsITaggingService); + const faviconService = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService); + + // XXX for strange Firefox bug :( + // Error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIObserverService.addObserver]" + // nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" + // location: "JS frame :: file://~firefox/components/nsTaggingService.js :: anonymous :: line 89" + // data: no] + // Source file: file://~firefox/components/nsTaggingService.js + taggingService.getTagsForURI(window.makeURI("http://mysterious.bug"), {}); + + const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id"); + const Keyword = new Struct("keyword", "title", "icon", "url"); + Bookmark.defaultValue("icon", function () getFavicon(this.url)); + Bookmark.prototype.__defineGetter__("extra", function () [ + ["keyword", this.keyword, "Keyword"], + ["tags", this.tags.join(", "), "Tag"] + ].filter(function (item) item[1])); + + const storage = modules.storage; + function Cache(name, store, serial) + { + const rootFolders = [bookmarksService.toolbarFolder, bookmarksService.bookmarksMenuFolder, bookmarksService.unfiledBookmarksFolder]; + const sleep = liberator.sleep; + + let bookmarks = []; + let self = this; + + this.__defineGetter__("name", function () name); + this.__defineGetter__("store", function () store); + this.__defineGetter__("bookmarks", function () this.load()); + + this.__defineGetter__("keywords", + function () [new Keyword(k.keyword, k.title, k.icon, k.url) for each (k in self.bookmarks) if (k.keyword)]); + + this.__iterator__ = function () (val for each (val in self.bookmarks)); + + function loadBookmark(node) + { + let uri = util.newURI(node.uri); + let keyword = bookmarksService.getKeywordForBookmark(node.itemId); + let tags = taggingService.getTagsForURI(uri, {}) || []; + let bmark = new Bookmark(node.uri, node.title, node.icon && node.icon.spec, keyword, tags, node.itemId); + + bookmarks.push(bmark); + + return bmark; + } + + function readBookmark(id) + { + return { + itemId: id, + uri: bookmarksService.getBookmarkURI(id).spec, + title: bookmarksService.getItemTitle(id) + }; + } + + function deleteBookmark(id) + { + let length = bookmarks.length; + bookmarks = bookmarks.filter(function (item) item.id != id); + return bookmarks.length < length; + } + + function findRoot(id) + { + do + { + var root = id; + id = bookmarksService.getFolderIdForItem(id); + } while (id != bookmarksService.placesRoot && id != root); + return root; + } + + let loading = false; + this.load = function load() + { + if (loading) + { + while (loading) + sleep(10); + return bookmarks; + } + + // update our bookmark cache + bookmarks = []; + loading = true; + + let folders = rootFolders.slice(); + let query = historyService.getNewQuery(); + let options = historyService.getNewQueryOptions(); + while (folders.length > 0) + { + query.setFolders(folders, 1); + folders.shift(); + let result = historyService.executeQuery(query, options); + let folder = result.root; + folder.containerOpen = true; + + // iterate over the immediate children of this folder + for (let i = 0; i < folder.childCount; i++) + { + let node = folder.getChild(i); + if (node.type == node.RESULT_TYPE_FOLDER) // folder + folders.push(node.itemId); + else if (node.type == node.RESULT_TYPE_URI) // bookmark + loadBookmark(node); + } + + // close a container after using it! + folder.containerOpen = false; + } + this.__defineGetter__("bookmarks", function () bookmarks); + loading = false; + return bookmarks; + }; + + var observer = { + onBeginUpdateBatch: function onBeginUpdateBatch() {}, + onEndUpdateBatch: function onEndUpdateBatch() {}, + onItemVisited: function onItemVisited() {}, + onItemMoved: function onItemMoved() {}, + onItemAdded: function onItemAdded(itemId, folder, index) + { + // liberator.dump("onItemAdded(" + itemId + ", " + folder + ", " + index + ")\n"); + if (bookmarksService.getItemType(itemId) == bookmarksService.TYPE_BOOKMARK) + { + if (rootFolders.indexOf(findRoot(itemId)) >= 0) + { + let bmark = loadBookmark(readBookmark(itemId)); + storage.fireEvent(name, "add", bmark); + } + } + }, + onItemRemoved: function onItemRemoved(itemId, folder, index) + { + // liberator.dump("onItemRemoved(" + itemId + ", " + folder + ", " + index + ")\n"); + if (deleteBookmark(itemId)) + storage.fireEvent(name, "remove", itemId); + }, + onItemChanged: function onItemChanged(itemId, property, isAnnotation, value) + { + if (isAnnotation) + return; + // liberator.dump("onItemChanged(" + itemId + ", " + property + ", " + value + ")\n"); + let bookmark = bookmarks.filter(function (item) item.id == itemId)[0]; + if (bookmark) + { + if (property == "tags") + value = taggingService.getTagsForURI(util.newURI(bookmark.url), {}); + if (property in bookmark) + bookmark[property] = value; + storage.fireEvent(name, "change", itemId); + } + }, + QueryInterface: function QueryInterface(iid) + { + if (iid.equals(Ci.nsINavBookmarkObserver) || iid.equals(Ci.nsISupports)) + return this; + throw Cr.NS_ERROR_NO_INTERFACE; + } + }; + + bookmarksService.addObserver(observer, false); + } + + function getFavicon(uri) + { + try + { + return faviconService.getFaviconImageForPage(util.newURI(uri)).spec; + } + catch (e) + { + return ""; + } + } + + let bookmarkObserver = function (key, event, arg) + { + if (event == "add") + autocommands.trigger("BookmarkAdd", arg); + statusline.updateUrl(); + }; + + var cache = storage.newObject("bookmark-cache", Cache, false); + storage.addObserver("bookmark-cache", bookmarkObserver, window); + + liberator.registerObserver("enter", function () { + if (options["preload"]) + { + // Forces a load, if not already loaded but wait 10sec + // so most tabs should be restored and the CPU should be idle again usually + setTimeout(function () { liberator.callFunctionInThread(null, function () cache.bookmarks); }, 10000); + } + }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// OPTIONS ///////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + options.add(["defsearch", "ds"], + "Set the default search engine", + "string", "google", + { + completer: function completer(context) + { + completion.search(context, true) + context.completions = [["", "Don't perform searches by default"]].concat(context.completions); + }, + validator: Option.validateCompleter + }); + + options.add(["preload"], + "Speed up first time history/bookmark completion", + "boolean", true); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + var myModes = config.browserModes; + + mappings.add(myModes, ["a"], + "Open a prompt to bookmark the current URL", + function () + { + let title = ""; + if (buffer.title != buffer.URL) + title = " -title=\"" + buffer.title + "\""; + commandline.open(":", "bmark " + buffer.URL + title, modes.EX); + }); + + mappings.add(myModes, ["A"], + "Toggle bookmarked state of current URL", + function () { bookmarks.toggle(buffer.URL); }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + commands.add(["ju[mps]"], + "Show jumplist", + function () + { + let sh = window.getWebNavigation().sessionHistory; + + let entries = [sh.getEntryAtIndex(i, false) for (i in util.range(0, sh.count))]; + let list = template.jumps(sh.index, entries); + commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); + }, + { argCount: "0" }); + + // TODO: Clean this up. + function tags(context, args) + { + let filter = context.filter; + let have = filter.split(","); + + args.completeFilter = have.pop(); + + let prefix = filter.substr(0, filter.length - args.completeFilter.length); + let tags = util.Array.uniq(util.Array.flatten([b.tags for ([k, b] in Iterator(cache.bookmarks))])); + + return [[prefix + tag, tag] for ([i, tag] in Iterator(tags)) if (have.indexOf(tag) < 0)]; + } + + function title(context, args) + { + if (!args.bang) + return [[content.document.title, "Current Page Title"]]; + context.keys.text = "title"; + context.keys.description = "url"; + return bookmarks.get(args.join(" "), args["-tags"], null, { keyword: args["-keyword"], title: context.filter }); + } + + function keyword(context, args) + { + if (!args.bang) + return []; + context.keys.text = "keyword"; + return bookmarks.get(args.join(" "), args["-tags"], null, { keyword: context.filter, title: args["-title"] }); + } + + commands.add(["bma[rk]"], + "Add a bookmark", + function (args) + { + let url = args.length == 0 ? buffer.URL : args[0]; + let title = args["-title"] || (args.length == 0 ? buffer.title : null); + let keyword = args["-keyword"] || null; + let tags = args["-tags"] || []; + + if (bookmarks.add(false, title, url, keyword, tags, args.bang)) + { + let extra = (title == url) ? "" : " (" + title + ")"; + liberator.echomsg("Added bookmark: " + url + extra, 1, commandline.FORCE_SINGLELINE); + } + else + liberator.echoerr("Exxx: Could not add bookmark `" + title + "'", commandline.FORCE_SINGLELINE); + }, + { + argCount: "?", + bang: true, + completer: function (context, args) + { + if (!args.bang) + { + context.completions = [[content.document.documentURI, "Current Location"]]; + return; + } + completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); + }, + options: [[["-title", "-t"], commands.OPTION_STRING, null, title], + [["-tags", "-T"], commands.OPTION_LIST, null, tags], + [["-keyword", "-k"], commands.OPTION_STRING, function (arg) /\w/.test(arg)]] + }); + + commands.add(["bmarks"], + "List or open multiple bookmarks", + function (args) + { + bookmarks.list(args.join(" "), args["-tags"] || [], args.bang, args["-max"]); + }, + { + bang: true, + completer: function completer(context, args) + { + context.quote = null; + context.filter = args.join(" "); + completion.bookmark(context, args["-tags"]); + }, + options: [[["-tags", "-T"], commands.OPTION_LIST, null, tags], + [["-max", "-m"], commands.OPTION_INT]] + }); + + commands.add(["delbm[arks]"], + "Delete a bookmark", + function (args) + { + let url = args.string || buffer.URL; + let deletedCount = bookmarks.remove(url); + + liberator.echomsg(deletedCount + " bookmark(s) with url `" + url + "' deleted", 1, commandline.FORCE_SINGLELINE); + }, + { + argCount: "?", + completer: function completer(context) completion.bookmark(context), + literal: 0 + }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// PUBLIC SECTION ////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + return { + + get format() ({ + anchored: false, + title: ["URL", "Info"], + keys: { text: "url", description: "title", icon: "icon", extra: "extra", tags: "tags" }, + process: [template.icon, template.bookmarkDescription] + }), + + // if "bypassCache" is true, it will force a reload of the bookmarks database + // on my PC, it takes about 1ms for each bookmark to load, so loading 1000 bookmarks + // takes about 1 sec + get: function get(filter, tags, maxItems, extra) + { + return completion.runCompleter("bookmark", filter, maxItems, tags, extra); + }, + + // if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder + add: function add(starOnly, title, url, keyword, tags, force) + { + try + { + let uri = util.createURI(url); + if (!force) + { + for (let bmark in cache) + { + if (bmark[0] == uri.spec) + { + var id = bmark[5]; + if (title) + bookmarksService.setItemTitle(id, title); + break; + } + } + } + if (id == undefined) + id = bookmarksService.insertBookmark( + bookmarksService[starOnly ? "unfiledBookmarksFolder" : "bookmarksMenuFolder"], + uri, -1, title || url); + if (!id) + return false; + + if (keyword) + bookmarksService.setKeywordForBookmark(id, keyword); + if (tags) + taggingService.tagURI(uri, tags); + } + catch (e) + { + liberator.log(e, 0); + return false; + } + + return true; + }, + + toggle: function toggle(url) + { + if (!url) + return; + + let count = this.remove(url); + if (count > 0) + { + commandline.echo("Removed bookmark: " + url, commandline.HL_NORMAL, commandline.FORCE_SINGLELINE); + } + else + { + let title = buffer.title || url; + let extra = ""; + if (title != url) + extra = " (" + title + ")"; + this.add(true, title, url); + commandline.echo("Added bookmark: " + url + extra, commandline.HL_NORMAL, commandline.FORCE_SINGLELINE); + } + }, + + isBookmarked: function isBookmarked(url) + { + try + { + let uri = util.newURI(url); + return (bookmarksService.getBookmarkedURIFor(uri) != null); + } + catch (e) + { + return false; + } + }, + + // returns number of deleted bookmarks + remove: function remove(url) + { + if (!url) + return 0; + + let i = 0; + try + { + let uri = util.newURI(url); + var count = {}; + let bmarks = bookmarksService.getBookmarkIdsForURI(uri, count); + + for (; i < bmarks.length; i++) + bookmarksService.removeItem(bmarks[i]); + } + catch (e) + { + liberator.log(e, 0); + return i; + } + + // update the display of our "bookmarked" symbol + statusline.updateUrl(); + + return count.value; + }, + + getFavicon: function (url) getFavicon(url), + + // TODO: add filtering + // also ensures that each search engine has a Vimperator-friendly alias + getSearchEngines: function getSearchEngines() + { + let searchEngines = []; + let firefoxEngines = services.get("browserSearch").getVisibleEngines({}); + for (let [,engine] in Iterator(firefoxEngines)) + { + let alias = engine.alias; + if (!alias || !/^[a-z0-9_-]+$/.test(alias)) + alias = engine.name.replace(/^\W*([a-zA-Z_-]+).*/, "$1").toLowerCase(); + if (!alias) + alias = "search"; // for search engines which we can't find a suitable alias + + // make sure we can use search engines which would have the same alias (add numbers at the end) + let newAlias = alias; + for (let j = 1; j <= 10; j++) // <=10 is intentional + { + if (!searchEngines.some(function (item) item[0] == newAlias)) + break; + + newAlias = alias + j; + } + // only write when it changed, writes are really slow + if (engine.alias != newAlias) + engine.alias = newAlias; + + searchEngines.push([engine.alias, engine.description, engine.iconURI && engine.iconURI.spec]); + } + + return searchEngines; + }, + + getSuggestions: function getSuggestions(engineName, query, callback) + { + const responseType = "application/x-suggestions+json"; + + let engine = services.get("browserSearch").getEngineByAlias(engineName); + + if (engine && engine.supportsResponseType(responseType)) + var queryURI = engine.getSubmission(query, responseType).uri.spec; + if (!queryURI) + return []; + + function process(resp) + { + let results = []; + try + { + results = services.get("json").decode(resp.responseText)[1]; + results = [[item, ""] for ([k, item] in Iterator(results)) if (typeof item == "string")]; + } + catch (e) {} + if (!callback) + return results; + callback(results); + } + + let resp = util.httpGet(queryURI, callback && process); + + if (!callback) + return process(resp); + }, + + // TODO: add filtering + // format of returned array: + // [keyword, helptext, url] + getKeywords: function getKeywords() + { + return cache.keywords; + }, + + // full search string including engine name as first word in @param text + // if @param useDefSearch is true, it uses the default search engine + // @returns the url for the search string + // if the search also requires a postData, [url, postData] is returned + getSearchURL: function getSearchURL(text, useDefsearch) + { + let url = null; + let aPostDataRef = {}; + let searchString = (useDefsearch ? options["defsearch"] + " " : "") + text; + + // we need to make sure our custom alias have been set, even if the user + // did not :open once before + this.getSearchEngines(); + + + function getShortcutOrURI(aURL, aPostDataRef) + { + var shortcutURL = null; + var keyword = aURL; + var param = ""; + var searchService = Cc['@mozilla.org/browser/search-service;1'].getService(Ci.nsIBrowserSearchService); + var offset = aURL.indexOf(" "); + if (offset > 0) + { + keyword = aURL.substr(0, offset); + param = aURL.substr(offset + 1); + } + if (!aPostDataRef) + { + aPostDataRef = {}; + } + var engine = searchService.getEngineByAlias(keyword); + if (engine) + { + var submission = engine.getSubmission(param, null); + aPostDataRef.value = submission.postData; + return submission.uri.spec; + } + [shortcutURL, aPostDataRef.value] = PlacesUtils.getURLAndPostDataForKeyword(keyword); + if (!shortcutURL) + { + return aURL; + } + var postData = ""; + if (aPostDataRef.value) + { + postData = unescape(aPostDataRef.value); + } + if (/%s/i.test(shortcutURL) || /%s/i.test(postData)) + { + var charset = ""; + const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; + var matches = shortcutURL.match(re); + if (matches) + { + [, shortcutURL, charset] = matches; + } + else + { + try + { + charset = PlacesUtils.history.getCharsetForURI(makeURI(shortcutURL)); + } catch (e) { } + } + var encodedParam = ""; + if (charset) + { + encodedParam = escape(convertFromUnicode(charset, param)); + } else { + encodedParam = encodeURIComponent(param); + } + shortcutURL = shortcutURL.replace(/%s/g, encodedParam).replace(/%S/g, param); + if (/%s/i.test(postData)) + { + aPostDataRef.value = getPostDataStream(postData, param, encodedParam, "application/x-www-form-urlencoded"); + } + } else if (param) { + aPostDataRef.value = null; + return aURL; + } + return shortcutURL; + } + url = getShortcutOrURI(searchString, aPostDataRef); + if (url == searchString) + url = null; + + if (aPostDataRef && aPostDataRef.value) + return [url, aPostDataRef.value]; + else + return url; // can be null + }, + + // if openItems is true, open the matching bookmarks items in tabs rather than display + list: function list(filter, tags, openItems, maxItems) + { + // FIXME: returning here doesn't make sense + // Why the hell doesn't it make sense? --Kris + // Because it unconditionally bypasses the final error message + // block and does so only when listing items, not opening them. In + // short it breaks the :bmarks command which doesn't make much + // sense to me but I'm old-fashioned. --djk + if (!openItems) + return completion.listCompleter("bookmark", filter, maxItems, tags); + let items = completion.runCompleter("bookmark", filter, maxItems, tags); + + if (items.length) + return liberator.open(items.map(function (i) i.url), liberator.NEW_TAB); + + if (filter.length > 0 && tags.length > 0) + liberator.echoerr("E283: No bookmarks matching tags: \"" + tags + "\" and string: \"" + filter + "\""); + else if (filter.length > 0) + liberator.echoerr("E283: No bookmarks matching string: \"" + filter + "\""); + else if (tags.length > 0) + liberator.echoerr("E283: No bookmarks matching tags: \"" + tags + "\""); + else + liberator.echoerr("No bookmarks set"); + } + }; + //}}} +}; //}}} + +function History() //{{{ +{ + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// PRIVATE SECTION ///////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + const historyService = PlacesUtils.history; + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + var myModes = config.browserModes; + + mappings.add(myModes, + [""], "Go to an older position in the jump list", + function (count) { history.stepTo(-(count > 1 ? count : 1)); }, + { flags: Mappings.flags.COUNT }); + + mappings.add(myModes, + [""], "Go to a newer position in the jump list", + function (count) { history.stepTo(count > 1 ? count : 1); }, + { flags: Mappings.flags.COUNT }); + + mappings.add(myModes, + ["H", "", ""], "Go back in the browser history", + function (count) { history.stepTo(-(count > 1 ? count : 1)); }, + { flags: Mappings.flags.COUNT }); + + mappings.add(myModes, + ["L", "", ""], "Go forward in the browser history", + function (count) { history.stepTo(count > 1 ? count : 1); }, + { flags: Mappings.flags.COUNT }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + commands.add(["ba[ck]"], + "Go back in the browser history", + function (args) + { + let url = args.literalArg; + + if (args.bang) + { + history.goToStart(); + } + else + { + if (url) + { + let sh = window.getWebNavigation().sessionHistory; + for (let i in util.range(sh.index, 0, -1)) + { + if (sh.getEntryAtIndex(i, false).URI.spec == url) + { + window.getWebNavigation().gotoIndex(i); + return; + } + } + liberator.echoerr("Exxx: URL not found in history"); + } + else + { + history.stepTo(-Math.max(args.count, 1)); + } + } + }, + { + argCount: "?", + bang: true, + completer: function completer(context) + { + let sh = window.getWebNavigation().sessionHistory; + + context.anchored = false; + context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index, 0, -1))]; + context.keys = { text: function (item) item.URI.spec, description: "title" }; + }, + count: true, + literal: 0 + }); + + commands.add(["fo[rward]", "fw"], + "Go forward in the browser history", + function (args) + { + let url = args.literalArg; + + if (args.bang) + { + history.goToEnd(); + } + else + { + if (url) + { + let sh = window.getWebNavigation().sessionHistory; + for (let i in util.range(sh.index + 1, sh.count)) + { + if (sh.getEntryAtIndex(i, false).URI.spec == url) + { + window.getWebNavigation().gotoIndex(i); + return; + } + } + liberator.echoerr("Exxx: URL not found in history"); + } + else + { + history.stepTo(Math.max(args.count, 1)); + } + } + }, + { + argCount: "?", + bang: true, + completer: function completer(context) + { + let sh = window.getWebNavigation().sessionHistory; + + context.anchored = false; + context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index + 1, sh.count))]; + context.keys = { text: function (item) item.URI.spec, description: "title" }; + }, + count: true, + literal: 0 + }); + + commands.add(["hist[ory]", "hs"], + "Show recently visited URLs", + function (args) { history.list(args.join(" "), args.bang, args["-max"] || 1000); }, + { + bang: true, + completer: function (context) { context.quote = null; completion.history(context); }, + // completer: function (filter) completion.history(filter) + options: [[["-max", "-m"], options.OPTION_INT]] + }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// PUBLIC SECTION ////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + return { + + get format() bookmarks.format, + + get service() historyService, + + get: function get(filter, maxItems) + { + // no query parameters will get all history + let query = historyService.getNewQuery(); + let options = historyService.getNewQueryOptions(); + + if (typeof filter == "string") + filter = { searchTerms: filter }; + for (let [k, v] in Iterator(filter)) + query[k] = v; + options.sortingMode = options.SORT_BY_DATE_DESCENDING; + options.resultType = options.RESULTS_AS_URI; + if (maxItems > 0) + options.maxResults = maxItems; + + // execute the query + let root = historyService.executeQuery(query, options).root; + root.containerOpen = true; + let items = util.map(util.range(0, root.childCount), function (i) { + let node = root.getChild(i); + return { + url: node.uri, + title: node.title, + icon: node.icon ? node.icon.spec : DEFAULT_FAVICON + }; + }); + root.containerOpen = false; // close a container after using it! + + return items; + }, + + // TODO: better names and move to buffer.? + stepTo: function stepTo(steps) + { + let index = window.getWebNavigation().sessionHistory.index + steps; + if (index >= 0 && index < window.getWebNavigation().sessionHistory.count) + window.getWebNavigation().gotoIndex(index); + else + liberator.beep(); // XXX: really wanted? + }, + + goToStart: function goToStart() + { + let index = window.getWebNavigation().sessionHistory.index; + + if (index > 0) + window.getWebNavigation().gotoIndex(0); + else + liberator.beep(); // XXX: really wanted? + + }, + + goToEnd: function goToEnd() + { + let sh = window.getWebNavigation().sessionHistory; + let max = sh.count - 1; + + if (sh.index < max) + window.getWebNavigation().gotoIndex(max); + else + liberator.beep(); // XXX: really wanted? + + }, + + // if openItems is true, open the matching history items in tabs rather than display + list: function list(filter, openItems, maxItems) + { + // FIXME: returning here doesn't make sense + // Why the hell doesn't it make sense? --Kris + // See comment at bookmarks.list --djk + if (!openItems) + return completion.listCompleter("history", filter, maxItems); + let items = completion.runCompleter("history", filter, maxItems); + + if (items.length) + return liberator.open(items.map(function (i) i.url), liberator.NEW_TAB); + + if (filter.length > 0) + liberator.echoerr("E283: No history matching \"" + filter + "\""); + else + liberator.echoerr("No history set"); + } + }; + //}}} +}; //}}} + +function QuickMarks() //{{{ +{ + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// PRIVATE SECTION ///////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + var qmarks = storage.newMap("quickmarks", true); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + var myModes = config.browserModes; + + mappings.add(myModes, + ["go"], "Jump to a QuickMark", + function (arg) { quickmarks.jumpTo(arg, liberator.CURRENT_TAB); }, + { flags: Mappings.flags.ARGUMENT }); + + mappings.add(myModes, + ["gn"], "Jump to a QuickMark in a new tab", + function (arg) + { + quickmarks.jumpTo(arg, + /\bquickmark\b/.test(options["activate"]) ? + liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); + }, + { flags: Mappings.flags.ARGUMENT }); + + mappings.add(myModes, + ["M"], "Add new QuickMark for current URL", + function (arg) + { + if (/[^a-zA-Z0-9]/.test(arg)) + { + liberator.beep(); + return; + } + + quickmarks.add(arg, buffer.URL); + }, + { flags: Mappings.flags.ARGUMENT }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + commands.add(["delqm[arks]"], + "Delete the specified QuickMarks", + function (args) + { + // TODO: finish arg parsing - we really need a proper way to do this. :) + if (!args.bang && !args.string) + { + liberator.echoerr("E471: Argument required"); + return; + } + + if (args.bang && args.string) + { + liberator.echoerr("E474: Invalid argument"); + return; + } + + if (args.bang) + quickmarks.removeAll(); + else + quickmarks.remove(args.string); + }, + { + bang: true, + completer: function (context) + { + context.title = ["QuickMark", "URL"]; + context.completions = qmarks; + } + }); + + commands.add(["qma[rk]"], + "Mark a URL with a letter for quick access", + function (args) + { + let matches = args.string.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/); + if (!matches) + liberator.echoerr("E488: Trailing characters"); + else if (!matches[2]) + quickmarks.add(matches[1], buffer.URL); + else + quickmarks.add(matches[1], matches[2]); + }, + { argCount: "+" }); + + commands.add(["qmarks"], + "Show all QuickMarks", + function (args) + { + args = args.string; + + // ignore invalid qmark characters unless there are no valid qmark chars + if (args && !/[a-zA-Z0-9]/.test(args)) + { + liberator.echoerr("E283: No QuickMarks matching \"" + args + "\""); + return; + } + + let filter = args.replace(/[^a-zA-Z0-9]/g, ""); + quickmarks.list(filter); + }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// PUBLIC SECTION ////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + return { + + add: function add(qmark, location) + { + qmarks.set(qmark, location); + liberator.echomsg("Added Quick Mark '" + qmark + "': " + location, 1); + }, + + remove: function remove(filter) + { + let pattern = RegExp("[" + filter.replace(/\s+/g, "") + "]"); + + for (let [qmark,] in qmarks) + { + if (pattern.test(qmark)) + qmarks.remove(qmark); + } + }, + + removeAll: function removeAll() + { + qmarks.clear(); + }, + + jumpTo: function jumpTo(qmark, where) + { + let url = qmarks.get(qmark); + + if (url) + liberator.open(url, where); + else + liberator.echoerr("E20: QuickMark not set"); + }, + + list: function list(filter) + { + let marks = [k for ([k, v] in qmarks)]; + let lowercaseMarks = marks.filter(function (x) /[a-z]/.test(x)).sort(); + let uppercaseMarks = marks.filter(function (x) /[A-Z]/.test(x)).sort(); + let numberMarks = marks.filter(function (x) /[0-9]/.test(x)).sort(); + + marks = Array.concat(lowercaseMarks, uppercaseMarks, numberMarks); + + if (marks.length == 0) + { + liberator.echoerr("No QuickMarks set"); + return; + } + + if (filter.length > 0) + { + marks = marks.filter(function (qmark) filter.indexOf(qmark) >= 0); + if (marks.length == 0) + { + liberator.echoerr("E283: No QuickMarks matching \"" + filter + "\""); + return; + } + } + + let items = [[mark, qmarks.get(mark)] for ([k, mark] in Iterator(marks))]; + template.genericTable(items, { title: ["QuickMark", "URL"] }); + } + }; + //}}} +}; //}}} + +// vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/content/config.js b/xulmus/content/config.js new file mode 100755 index 00000000..bd7d145e --- /dev/null +++ b/xulmus/content/config.js @@ -0,0 +1,496 @@ +/***** BEGIN LICENSE BLOCK ***** {{{ +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version +1.1 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the +License. + +Copyright (c) 2006-2009 by Martin Stubenschrott + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. +}}} ***** END LICENSE BLOCK *****/ + +const config = { //{{{ + /*** required options, no checks done if they really exist, so be careful ***/ + name: "Xulmus", + hostApplication: "Songbird", + //mainWindowID: "mainplayer", + /*** optional options, there are checked for existence and a fallback provided ***/ + features: ["bookmarks", "hints", "marks","history", "quickmarks", "session", "tabs", "windows", "player"], + defaults: { guioptions: "rb" }, + + guioptions: { + m: ["Menubar", ["toolbar-menubar"]], + T: ["Toolbar", ["nav-bar"]], + B: ["Bookmark bar", ["PersonalToolbar"]] + }, + + //get visualbellWindow() getBrowser().mPanelContainer, + get isPlayerWindow() gBrowser.mCurrentTab._tPos == 0, + // focusContent() focuses this widget gSongbirdWindowController takes care of the focus. + get mainWindowID() "mainplayer", + get visualbellWindow() document.getElementById(this.mainWindowID), + + styleableChrome: "chrome://songbird/content/xul/layoutBaseOverlay.xul", + + autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], + ["ColorScheme", "Triggered after a color scheme has been loaded"], + ["DOMLoad", "Triggered when a page's DOM content has fully loaded"], + ["DownloadPost", "Triggered when a download has completed"], + ["Fullscreen", "Triggered when the browser's fullscreen state changes"], + ["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"], + ["PageLoadPre", "Triggered after a page load is initiated"], + ["PageLoad", "Triggered when a page gets (re)loaded/opened"], + ["ShellCmdPost", "Triggered after executing a shell command with :!cmd"], + ["XulmusEnter", "Triggered after Xulmus starts"], + ["XulmusLeavePre", "Triggered before exiting Xulmus, just before destroying each module"], + ["XulmusLeave", "Triggered before exiting Xulmus"]], + + dialogs: [ + ["about", "About Songbird", + function () { window.openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], + ["addbookmark", "Add bookmark for the current page", + function () { PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksRootId); }], + ["addons", "Manage Add-ons", + function () { window.BrowserOpenAddonsMgr(); }], + ["bookmarks", "List your bookmarks", + function () { window.openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }], + ["checkupdates", "Check for updates", + function () { window.checkForUpdates(); }], + ["cleardata", "Clear private data", + function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }], + ["cookies", "List your cookies", + function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }], + ["console", "JavaScript console", + function () { window.toJavaScriptConsole(); }], + ["customizetoolbar", "Customize the Toolbar", + function () { window.BrowserCustomizeToolbar(); }], + ["dominspector", "DOM Inspector", + function () { try { window.inspectDOMDocument(content.document); } catch (e) { liberator.echoerr("DOM Inspector extension not installed"); } }], + ["downloads", "Manage Downloads", + function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }], + ["history", "List your history", + function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }], + ["import", "Import Preferences, Bookmarks, History, etc. from other browsers", + function () { window.BrowserImport(); }], + ["openfile", "Open the file selector dialog", + function () { window.BrowserOpenFileWindow(); }], + ["pageinfo", "Show information about the current page", + function () { window.BrowserPageInfo(); }], + ["pagesource", "View page source", + function () { window.BrowserViewSourceOfDocument(content.document); }], + ["places", "Places Organizer: Manage your bookmarks and history", + function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }], + ["preferences", "Show Firefox preferences dialog", + function () { window.openPreferences(); }], + ["printpreview", "Preview the page before printing", + function () { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }], + ["printsetup", "Setup the page size and orientation before printing", + function () { PrintUtils.showPageSetup(); }], + ["print", "Show print dialog", + function () { PrintUtils.print(); }], + ["saveframe", "Save frame to disk", + function () { window.saveFrameDocument(); }], + ["savepage", "Save page to disk", + function () { window.saveDocument(window.content.document); }], + ["searchengines", "Manage installed search engines", + function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], + ["selectionsource", "View selection source", + function () { buffer.viewSelectionSource(); }] + ], + + //TODO : Write intro.html and tutorial.html + // they are sorted by relevance, not alphabetically + //helpFiles: [ "intro.html" ], + /* "intro.html", "tutorial.html", "starting.html", "browsing.html", + "buffer.html", "cmdline.html", "insert.html", "options.html", + "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", + "marks.html", "repeat.html", "autocommands.html", "print.html", + "gui.html", "styling.html", "message.html", "developer.html", + "various.html", "index.html", "version.html" + ], */ + + scripts: [ + "bookmarks.js", + "tabs.js", + "player.js", + ], + + init: function () + { + //Adding a mode for Player + //modes.addMode("PLAYER"); // Player mode for songbird + + // var artistArray = getArtists(); + + // TODO: support 'nrformats'? -> probably not worth it --mst + function incrementURL(count) + { + let matches = buffer.URL.match(/(.*?)(\d+)(\D*)$/); + if (!matches) + { + liberator.beep(); + return; + } + + let [, pre, number, post] = matches; + let newNumber = parseInt(number, 10) + count; + let newNumberStr = String(newNumber > 0 ? newNumber : 0); + if (number.match(/^0/)) // add 0009 should become 0010 + { + while (newNumberStr.length < number.length) + newNumberStr = "0" + newNumberStr; + } + + liberator.open(pre + newNumberStr + post); + } + + // load Xulmus 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("search", Search); + liberator.loadModule("bookmarks", Bookmarks); + liberator.loadModule("history", History); + liberator.loadModule("tabs", Tabs); + liberator.loadModule("marks", Marks); + liberator.loadModule("quickmarks", QuickMarks); + liberator.loadModule("hints", Hints); + // Load the Player module + liberator.loadModule("player", Player); + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// STYLES ////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + let img = Image(); + img.src = "chrome://xulmus/content/xulmus.png"; + img.onload = function () { + styles.addSheet(true, "logo", "chrome://liberator/locale/*", + ".xulmus-logo {" + <> + display: inline-block; + background: url({img.src}); + width: {img.width}px; + height: {img.height}px; + + "}", + true); + delete img; + }; + + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + mappings.add([modes.NORMAL], + ["y"], "Yank current location to the clipboard", + function () { util.copyToClipboard(buffer.URL, true); }); + + // opening websites + mappings.add([modes.NORMAL], + ["o"], "Open one or more URLs", + function () { commandline.open(":", "open ", modes.EX); }); + + mappings.add([modes.NORMAL], ["O"], + "Open one or more URLs, based on current location", + function () { commandline.open(":", "open " + buffer.URL, modes.EX); }); + + mappings.add([modes.NORMAL], ["t"], + "Open one or more URLs in a new tab", + function () { commandline.open(":", "tabopen ", modes.EX); }); + + mappings.add([modes.NORMAL], ["t"], + "Open one or more URLs in a new tab", + function () { commandline.open(":", "tabopen ", modes.EX); }); + + mappings.add([modes.NORMAL], ["T"], + "Open one or more URLs in a new tab, based on current location", + function () { commandline.open(":", "tabopen " + buffer.URL, modes.EX); }); + + mappings.add([modes.NORMAL], ["T"], + "Open one or more URLs in a new tab, based on current location", + function () { commandline.open(":", "tabopen " + buffer.URL, modes.EX); }); + + mappings.add([modes.NORMAL], + [""], "Increment last number in URL", + function (count) { incrementURL(count > 1 ? count : 1); }, + { flags: Mappings.flags.COUNT }); + + mappings.add([modes.NORMAL], + [""], "Decrement last number in URL", + function (count) { incrementURL(-(count > 1 ? count : 1)); }, + { flags: Mappings.flags.COUNT }); + + + mappings.add([modes.NORMAL], ["~"], + "Open home directory", + function () { liberator.open("~"); }); + + mappings.add([modes.NORMAL], ["gh"], + "Open homepage", + function () { BrowserHome(); }); + + mappings.add([modes.NORMAL], ["gH"], + "Open homepage in a new tab", + function () + { + let homepages = gHomeButton.getHomePage(); + liberator.open(homepages, /\bhomepage\b/.test(options["activate"]) ? + liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); + }); + + + mappings.add([modes.NORMAL], ["gu"], + "Go to parent directory", + function (count) + { + function isDirectory(url) + { + if (/^file:\/|^\//.test(url)) + { + let file = io.getFile(url); + return file.exists() && file.isDirectory(); + } + else + { + // for all other locations just check if the URL ends with / + return /\/$/.test(url); + } + } + + if (count < 1) + count = 1; + + // XXX + let url = buffer.URL; + for (let i = 0; i < count; i++) + { + if (isDirectory(url)) + url = url.replace(/^(.*?:)(.*?)([^\/]+\/*)$/, "$1$2/"); + else + url = url.replace(/^(.*?:)(.*?)(\/+[^\/]+)$/, "$1$2/"); + } + url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end + + if (url == buffer.URL) + liberator.beep(); + else + liberator.open(url); + }, + { flags: Mappings.flags.COUNT }); + + mappings.add([modes.NORMAL], ["gU"], + "Go to the root of the website", + function () + { + let uri = content.document.location; + if (/(about|mailto):/.test(uri.protocol)) // exclude these special protocols for now + { + liberator.beep(); + return; + } + liberator.open(uri.protocol + "//" + (uri.host || "") + "/"); + }); + + mappings.add([modes.NORMAL], [""], + "Redraw the screen", + function () { commands.get("redraw").execute("", false); }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + commands.add(["downl[oads]", "dl"], + "Show progress of current downloads", + function () + { + liberator.open("chrome://mozapps/content/downloads/downloads.xul", + options.get("newtab").has("all", "downloads") + ? liberator.NEW_TAB : liberator.CURRENT_TAB); + }, + { argCount: "0" }); + + commands.add(["o[pen]", "e[dit]"], + "Open one or more URLs in the current tab", + function (args) + { + if (args.string) + { + liberator.open(args.string); + } + else if (args.bang) + BrowserReloadSkipCache(); + else + BrowserReload(); + }, + { + bang: true, + completer: function (context) completion.url(context), + literal: 0 + }); + + commands.add(["pref[erences]", "prefs"], + "Show " + config.hostApplication + " preferences", + function (args) + { + if (args.bang) // open Firefox settings GUI dialog + { + liberator.open("about:config", + (options["newtab"] && options.get("newtab").has("all", "prefs")) + ? liberator.NEW_TAB : liberator.CURRENT_TAB); + } + else + { + window.openPreferences(); + } + }, + { + argCount: "0", + bang: true + }); + + commands.add(["redr[aw]"], + "Redraw the screen", + function () + { + let wu = window.QueryInterface(Ci.nsIInterfaceRequestor). + getInterface(Ci.nsIDOMWindowUtils); + wu.redraw(); + modes.show(); + }, + { argCount: "0" }); + + // TODO: move sidebar commands to ui.js? + commands.add(["sbcl[ose]"], + "Close the sidebar window", + function () + { + if (!document.getElementById("sidebar-box").hidden) + toggleSidebar(); + }, + { argCount: "0" }); + + commands.add(["sideb[ar]", "sb[ar]", "sbope[n]"], + "Open the sidebar window", + function (args) + { + let arg = args.literalArg; + + // focus if the requested sidebar is already open + if (document.getElementById("sidebar-title").value == arg) + { + document.getElementById("sidebar-box").focus(); + return; + } + + let menu = document.getElementById("viewSidebarMenu"); + + for (let [,panel] in Iterator(menu.childNodes)) + { + if (panel.label == arg) + { + panel.doCommand(); + return; + } + } + + liberator.echoerr("No sidebar " + arg + " found"); + }, + { + argCount: "1", + completer: function (context) completion.sidebar(context), + literal: 0 + }); + + commands.add(["winc[lose]", "wc[lose]"], + "Close window", + function () { window.close(); }, + { argCount: "0" }); + + commands.add(["wino[pen]", "wo[pen]", "wine[dit]"], + "Open one or more URLs in a new window", + function (args) + { + args = args.string; + + if (args) + liberator.open(args, liberator.NEW_WINDOW); + else + liberator.open("about:blank", liberator.NEW_WINDOW); + }, + { + completer: function (context) completion.url(context), + literal: 0 + }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// OPTIONS ///////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + options.add(["online"], + "Set the 'work offline' option", + "boolean", true, + { + setter: function (value) + { + const ioService = services.get("io"); + ioService.offline = !value; + //gPrefService.setBoolPref("browser.offline", ioService.offline); + gPrefs.setBoolPref("browser.offline", ioService.offline); + return value; + }, + getter: function () !services.get("io").offline + }); + + options.add(["titlestring"], + "Change the title of the window", + "string", "Xulmus", + { + setter: function (value) + { + try + { + let id = this.mainWindowID || "mainplayer"; + document.getElementById(id).setAttribute("titlemodifier", value); + if (window.content.document.title.length > 0) + document.title = window.content.document.title + " - " + value; + else + document.title = value; + } + catch (e) + { + liberator.log("Couldn't set titlestring", 3); + } + + return value; + } + }); + + options.add(["urlseparator"], + "Set the separator regexp used to separate multiple URL args", + "string", ",\\s"); + } + //}}} +}; //}}} + +// vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/content/liberator.dtd b/xulmus/content/liberator.dtd new file mode 100755 index 00000000..00be4566 --- /dev/null +++ b/xulmus/content/liberator.dtd @@ -0,0 +1,6 @@ + + + + + + diff --git a/xulmus/content/player.js b/xulmus/content/player.js new file mode 100755 index 00000000..38d48e63 --- /dev/null +++ b/xulmus/content/player.js @@ -0,0 +1,219 @@ +//Import Artist List as this can be huge + +var artists = getArtistsArray(); + +function Player() +{ + + // Get the focus to the visible playlist first + //window._SBShowMainLibrary(); + + mappings.add([modes.PLAYER], + ["x"], "Play Track", + function () + { + gMM.sequencer.play(); + }); + + mappings.add([modes.PLAYER], + ["z"], "Previous Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_previous"); + }); + + mappings.add([modes.PLAYER], + ["c"], "Pause/Unpause Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_playpause"); + }); + + mappings.add([modes.PLAYER], + ["b"], "Next Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_next"); + }); + + mappings.add([modes.PLAYER], + ["v"], "Stop Track", + function () + { + gMM.sequencer.stop(); + }); + + + mappings.add([modes.PLAYER], + ["l"], "Play Media", + function () + { + commandline.open(":","playmedia ", modes.EX); + }); + + mappings.add([modes.PLAYER], + ["s"], "Toggle Shuffle", + function () + { + if (gMM.sequencer.mode != gMM.sequencer.MODE_SHUFFLE) + gMM.sequencer.mode = gMM.sequencer.MODE_SHUFFLE; + else + gMM.sequencer.mode = gMM.sequencer.MODE_FORWARD; + }); + + mappings.add([modes.PLAYER], + ["r"], "Toggle Repeat", + function () + { + switch(gMM.sequencer.repeatMode) + { + case gMM.sequencer.MODE_REPEAT_NONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE; + break; + case gMM.sequencer.MODE_REPEAT_ONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ALL; + break; + case gMM.sequencer.MODE_REPEAT_ALL: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + default: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + } + }); + + commands.add(["playmedia"], + "PLay Media", + function(args) + { + //Store the old view + //var prev_view = gMM.status.view; + var library = LibraryUtils.mainLibrary; + var mainView = library.createView(); + var sqncr = gMM.sequencer; + var customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + .createInstance(Ci.sbIMutablePropertyArray); + + //args + + if (args.length == 1){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + } + else if (args.length == 2){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + customProps.appendProperty(SBProperties.albumName,args[1].toString()); + } + else if (args.length == 3){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + customProps.appendProperty(SBProperties.albumName,args[1].toString()); + customProps.appendProperty(SBProperties.trackName,args[2].toString()); + } + + + sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); + + + }, + { + completer: function(context, args) completion.songCompletion(context, args) + }); + + + +} + +function getArtists() +{ + return this.artists; +} + +function getArtistsArray() +{ + + var list = LibraryUtils.mainLibrary; + + // Create an enumeration listener to count each item + var listener = { + count: 0, + onEnumerationBegin: function(aMediaList) { + this.count = 0; + }, + onEnumeratedItem: function(aMediaList, aMediaItem) { + this.count++; + }, + onEnumerationEnd: function(aMediaList, aStatusCode) {} + }; + + var artistCounts = {}; + var artists = list.getDistinctValuesForProperty(SBProperties.artistName); + var artist; + var artistArray = []; + var i=0; + // Count the number of media items for each distinct artist + while (artists.hasMore()) { + artist = artists.getNext(); + artistArray[i] = [artist,artist]; + list.enumerateItemsByProperty(SBProperties.artistName, + artist, + listener, + Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING); + artistCounts[artist] = listener.count; + i++; + } + + //liberator.dump("Count : "+artistCounts.toSource()); + return artistArray; +} + +function getAlbums(artist) +{ + var list = LibraryUtils.mainLibrary; + var albumArray = []; + var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); + var i = 0; + + while(items.hasMoreElements()) { + album = items.getNext().getProperty(SBProperties.albumName); + albumArray[i] = [album, album]; + i++; + } + + return removeDuplicateElement(albumArray); +} + +function getTracks(artist,album) +{ + var list = LibraryUtils.mainLibrary; + var tracksArray = []; + var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + .createInstance(Ci.sbIMutablePropertyArray); + var i = 0; + + pa.appendProperty(SBProperties.artistName,artist.toString()); + pa.appendProperty(SBProperties.albumName,album.toString()); + var items = list.getItemsByProperties(pa).enumerate(); + + while(items.hasMoreElements()) { + track = items.getNext().getProperty(SBProperties.trackName); + tracksArray[i] = [track, track]; + i++; + } + + return tracksArray; +} + + +function removeDuplicateElement(arrayName) +{ + var newArray=new Array(); +label:for(var i=0; il+#+m7uj1 z2AQi>*rxDjmA*(R z0=w)UKg_wivv==(?(Ocg?6d9tCpYsvXU?2+W}b6r=A4;bnHd!-j5Q{VwE-0>z$iJQ zq~(%K(qp3`zru-!YDOF`lHMpu$J;iNF7i=TUI$ZB$)zX3M@#{dH!1x^K41FtykLEw~B``f+!SKO}0fnMkD1U{Fi+uKhC z?f|;HjR8l2dw`h*ZIiyP0Hy=$fbK}nUSM&=FW~dQ=BQ8RZT0|P#8;=3p4+0ad?sr5 zOlq9>*06Ok@Rvw$kL$dyRv*3XUYCD9u)u!@i=HjOtRgvOo>=KOT=;Kl81`f5`AJ6I zT40wy`<(Bw8nT+5r`HE*8_?&pJzj1DUiHsk&2R<-?so?|2;2w!H5#aI=jc8k_`CBQ z^8vmW*zdGwfw?to-|T!hNBX*frx)NL(HnC{hEWrNBhIs^paaW~ z!x0UCI|&={gm#0|miqSxavU*n#;H-=3LnHi;KB^ue~8+(Mf54a2Cuujgd=wPm@ETY zyiUL(U}ePL1pEScPll}dz@fO$IXY)V{hd+x!@@bh%g+C;RNX2cn?B&;5{}qOSh?QC zKwQxRd^)R7BXUF+zQYyYm|@g4Ubi2ZP-jP+@3e&x?JZ8b*uQt>IAS00h79@ldHuQ+ z{bNplF6##crbUjC`6ES+Sol(w`Vj_JqhHt25$|x`JvsFqUca$~BR&sIuZP3sJ?UU& zgO|$~iiCETne}DVj|2z2+#k{Qr^?fF+HNYwv5Qr%$_G~2>{-n zYjMC%GuvFilL-%6CQF)3SS}$rTfK0pm+NxsH>CJ#;Z8FXt)+y>6yRz?l=+02)jLVu6MaqwqdVnr-Gn_!6JfcCk(WZ!@)(}~$ zpCdtfMuafqEha3*i6bV<^3O-xpkW~IxGSa~jXobF>;u0*h?Z;NP(l661@#GTBRF9v zA6 zo3)a}_F*$S7SW#oW)q^nU88E*02X<9OWFw?MOy#}GifQ9nMvA5NK>`vuqE`P(bj0p zFyv&#%w8bmv;aN@c&u{l-}0QeXPgxZKMpQ}jQ3`H|5xX$WR}c`T>?$`Ue; z5^}CEu+Oc9q~9OPssCV#Z%mPQ#1}`;%TlyP!)b(kRzLh$@OuCH!xaDRgeCX=l0K6q zP*RhmYwCE6mF&M(WawH+Shj1z%z6mPaDXdH=={Ey*GgKD(s^EF%i0pMMjcs8GlU$| zVcBGQp2`3NjgxO{(a31h_LJn=DSP#4nSn6lJo1DIc5JhjL+#c~~z}J9V zB`qfWPA>v|X0|$JG_wv#4+HN79+I?%a3V7gxQP(Vbh*s2M~!6WS_TrR9R`mQ znPGzy+Q%X}LugJ!Ja{u&#g!ZbE3F`^KPjhsA zov<_;HO`D(PAg%C?@7scHHUv1!RfQ~K0tJ;RFKfVXf%`AW|n^q%x{q-vs_nB(m3J0 zfZ|j~f^BBj<2PL{1A5JDtIHWebNWI;>Sjxl){(Rx_!RIR;7h=}3A4&1U^}q2AUBqz zIW7S%BJAT15%P}@COOocb_)mz_NQv`Wwc9doJqKd@Q9gpNjigYg7lJ^?I(grv&|>7AWs_F{=H4jbe4K4R>MW_I&f+f!j=Xqfwm z6;5tcj#!}~kQX&qs8AY`CNjK9t=H31<9d&n1W5mC&_w%514$i(VCZ2QlN4ST# z-E7d`dn9~Kz?o+Ke|1-(!idm6BT8IHxHi6va0#{p_>aUUiR&fWBw8hw5bo;bT|uu< z;keO%vLa!G+rB#q4tW;g^62X#{$9epz+T`gGk*7)T3g|SMZ7fs3ixci+)7L#{Hu{G z2u|4tJOX^vjNPxLp%qSSRA + + + + + + + + + + image/svg+xml + + + + + + vimperator_ + ~ + + diff --git a/xulmus/content/xulmus.xul b/xulmus/content/xulmus.xul new file mode 100755 index 00000000..c2065005 --- /dev/null +++ b/xulmus/content/xulmus.xul @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xulmus/contrib/vim/Makefile b/xulmus/contrib/vim/Makefile new file mode 100755 index 00000000..e2f716f5 --- /dev/null +++ b/xulmus/contrib/vim/Makefile @@ -0,0 +1,9 @@ +VIMBALL = vimperator.vba + +vimball: mkvimball.txt syntax/vimperator.vim ftdetect/vimperator.vim + -echo '%MkVimball! ${VIMBALL} .' | vim -u NORC -N -e -s mkvimball.txt + +all: vimball + +clean: + rm -f ${VIMBALL} diff --git a/xulmus/contrib/vim/ftdetect/vimperator.vim b/xulmus/contrib/vim/ftdetect/vimperator.vim new file mode 100755 index 00000000..cbf9068e --- /dev/null +++ b/xulmus/contrib/vim/ftdetect/vimperator.vim @@ -0,0 +1 @@ +au BufNewFile,BufRead *vimperatorrc*,*.vimp set filetype=vimperator diff --git a/xulmus/contrib/vim/mkvimball.txt b/xulmus/contrib/vim/mkvimball.txt new file mode 100755 index 00000000..96d1629b --- /dev/null +++ b/xulmus/contrib/vim/mkvimball.txt @@ -0,0 +1,2 @@ +syntax/vimperator.vim +ftdetect/vimperator.vim diff --git a/xulmus/contrib/vim/syntax/vimperator.vim b/xulmus/contrib/vim/syntax/vimperator.vim new file mode 100755 index 00000000..aebd6fc1 --- /dev/null +++ b/xulmus/contrib/vim/syntax/vimperator.vim @@ -0,0 +1,104 @@ +" Vim syntax file +" Language: VIMperator configuration file +" Maintainer: Doug Kearns +" Last Change: 2009 Feb 19 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn include @javascriptTop syntax/javascript.vim +unlet b:current_syntax + +syn include @cssTop syntax/css.vim +unlet b:current_syntax + +syn match vimperatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=vimperatorCommand,vimperatorAutoCmd + +syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] + \ bmarks bn[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] + \ cno[remap] colo[rscheme] com[mand] comc[lear] cu[nmap] cuna[bbrev] delbm[arks] delc[ommand] delm[arks] delmac[ros] + \ delqm[arks] dels[tyle] dia[log] dl do[autocmd] doautoa[ll] downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] + \ exu[sage] files fini[sh] fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] + \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] + \ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] + \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] + \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab + \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen + \ tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion] + \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ contained + +syn match vimperatorCommand "!" contained + +syn keyword vimperatorAutoCmd au[tocmd] contained nextgroup=vimperatorAutoEventList skipwhite + +syn keyword vimperatorAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost VimperatorEnter + \ VimperatorLeavePre VimperatorLeave + \ contained + +syn match vimperatorAutoEventList "\(\a\+,\)*\a\+" contained contains=vimperatorAutoEvent + +syn region vimperatorSet matchgroup=vimperatorCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>" + \ end="$" keepend oneline contains=vimperatorOption,vimperatorString + +syn keyword vimperatorOption activate act cdpath cd complete cpt defsearch ds editor eventignore ei extendedhinttags eht + \ followhints fh guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls messages msgs + \ newtab nextpattern pageinfo pa popups pps previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf + \ showstatuslinks ssli showtabline stal suggestengines titlestring urlseparator verbose vbs wildcase wic wildignore wig + \ wildmode wim wildoptions wop wordseparators wsp + \ contained nextgroup=vimperatorSetMod + +" toggle options +syn match vimperatorOption "\<\%(no\|inv\)\=\%(errorbells\|eb\|exrc\|ex\|focuscontent\|fc\|fullscreen\|fs\|ignorecase\|ic\)\>!\=" + \ contained nextgroup=vimperatorSetMod +syn match vimperatorOption "\<\%(no\|inv\)\=\%(incsearch\|is\|insertmode\|im\|hlsearch\|hls\|linksearch\|lks\)\>!\=" + \ contained nextgroup=vimperatorSetMod +syn match vimperatorOption "\<\%(no\|inv\)\=\%(loadplugins\|lpl\|more\|online\|preload\|showmode\|smd\|smartcase\|scs\)\>!\=" + \ contained nextgroup=vimperatorSetMod +syn match vimperatorOption "\<\%(no\|inv\)\=\%(online\|visualbell\|vb\|usermode\|um\)\>!\=" + \ contained nextgroup=vimperatorSetMod + +syn match vimperatorSetMod "\%(\<[a-z_]\+\)\@<=&" contained + +syn region vimperatorJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline +syn region vimperatorJavaScript matchgroup=vimperatorJavascriptDelimiter + \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold + +let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<=' +execute 'syn region vimperatorCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline' +execute 'syn region vimperatorCss matchgroup=vimperatorCssDelimiter' + \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold' + +syn match vimperatorNotation "<[0-9A-Za-z-]\+>" + +syn match vimperatorComment +".*$+ contains=vimperatorTodo,@Spell +syn keyword vimperatorTodo FIXME NOTE TODO XXX contained + +syn region vimperatorString start="\z(["']\)" end="\z1" skip="\\\\\|\\\z1" oneline + +syn match vimperatorLineComment +^\s*".*$+ contains=vimperatorTodo,@Spell + +" NOTE: match vim.vim highlighting group names +hi def link vimperatorAutoCmd vimperatorCommand +hi def link vimperatorAutoEvent Type +hi def link vimperatorCommand Statement +hi def link vimperatorComment Comment +hi def link vimperatorJavascriptDelimiter Delimiter +hi def link vimperatorCssDelimiter Delimiter +hi def link vimperatorNotation Special +hi def link vimperatorLineComment Comment +hi def link vimperatorOption PreProc +hi def link vimperatorSetMod vimperatorOption +hi def link vimperatorString String +hi def link vimperatorTodo Todo + +let b:current_syntax = "vimperator" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: tw=130 et ts=4 sw=4: diff --git a/xulmus/install.rdf b/xulmus/install.rdf new file mode 100755 index 00000000..68e17ae6 --- /dev/null +++ b/xulmus/install.rdf @@ -0,0 +1,58 @@ + + + + {3703dcdb-6ba3-4331-8de8-c18373fb05d1} + 2 + xulmus@vimperator.org + 0.1 + Prathyush Thota + + + VIM for SongBird brothers. + + + + + + + + + + songbird@songbirdnest.com + 0.8.0pre + 1.1.0pre + + + + + + + + + + + xulmus + chrome://xulmus/content/pane.xul + chrome://xulmus/skin/pane-icon.png + 200 + 100 + servicepane + true + + + + + + + + + xulmus + chrome://xulmus/content/media-page.xul + + + + + diff --git a/xulmus/locale/en-US/Makefile b/xulmus/locale/en-US/Makefile new file mode 100755 index 00000000..627ca99b --- /dev/null +++ b/xulmus/locale/en-US/Makefile @@ -0,0 +1,2 @@ +BASE = ../../../common +include $(BASE)/Makefile.doc diff --git a/xulmus/locale/en-US/asciidoc.conf b/xulmus/locale/en-US/asciidoc.conf new file mode 100755 index 00000000..4bcc4288 --- /dev/null +++ b/xulmus/locale/en-US/asciidoc.conf @@ -0,0 +1,86 @@ +[miscellaneous] + +[glossary] +author=Martin Stubenschrott +email=stubenschrott@gmx.net + +[header] + + + + + + + + + + {doctitle} + + +

+ {doctitle} +

+ +[replacements] +LOGO=
+HEADER=
+\[count\]=[count] +\[!\]=[!] + +[macros] +# section:Introduction[tag1,tag2] +(?su)(?.+?)\|(?!\+)=section +# help:helptext[href] +(?su)(?.+?)\|(?!\+)=help + +# maximum 3 tags for now +[section-inlinemacro] + + +

{target}

+{3? {3}} +{2? {2}} +{1? {1}} +
+ +[help-inlinemacro] +{target} + +[quotes] +|=tag +||=key +[o]=#option +'=option2 +[c]=#command +[m]=#mapping +[a]=#argument +# FIXME: this prevents all asciidoc attribute processing +# ^obviously it doesn't? --stepnem +{|}=argument2 +# disable monospaced text as all our text is monospaced and it causes problems for some things ++= +^= + +[tags] +tag=| +key=
|
+option=| +option2='|' +command=| +mapping=| +argument=| +# NOTE: in certain contexts the unescaped '#' is stripped. As we're ditching +# asciidoc I won't bother investigating --djk +argument2=&\#123;|} +argument3=[|] + +[specialwords] +warningwords=WARNING: Warning: IMPORTANT: Important: +infowords=NOTE: Note: + +[warningwords] +{words} + +[infowords] +{words} diff --git a/xulmus/locale/en-US/autocommands.txt b/xulmus/locale/en-US/autocommands.txt new file mode 100755 index 00000000..36104b56 --- /dev/null +++ b/xulmus/locale/en-US/autocommands.txt @@ -0,0 +1,91 @@ +HEADER + +|autocommands| + + +Autocommands are a way to automatically execute code when certain events +happen. + +|:au| |:autocmd| + +||:au[tocmd]|| +________________________________________________________________________________ +Execute commands automatically on events. + +[c]:au[tocmd][c] {event} {pat} {cmd} + +Add {cmd} to the list of commands Vimperator will execute on {event} for a URL matching {pat}: + +* [c]:autocmd[!][c] {events} {pat}: list/remove autocommands filtered by {events} and {pat} +* [c]:autocmd[!][c] {events}: list/remove autocommands matching {events} +* [c]:autocmd[!][c] * {pat}: list/remove autocommands matching {pat} +* [c]:autocmd[!][c]: list/remove all autocommands + +Available {events}: + +`--------------------`---------------------------------------- +*BookmarkAdd* Triggered after a page is bookmarked +*ColorScheme* Triggered after a color scheme has been loaded +*DOMLoad* Triggered when a page's DOM content has fully loaded +*DownloadPost* Triggered when a download has completed +*Fullscreen* Triggered when the browser's fullscreen state changes +*LocationChange* Triggered when changing tabs or when navigating to a new location +*PageLoadPre* Triggered after a page load is initiated +*PageLoad* Triggered when a page gets (re)loaded/opened +*ShellCmdPost* Triggered after executing a shell command with [c]:![c]#{cmd} +*VimperatorEnter* Triggered after Firefox starts +*VimperatorLeavePre* Triggered before exiting Firefox, just before destroying each module +*VimperatorLeave* Triggered before exiting Firefox +-------------------------------------------------------------- + +{pat} is a regular expression, use .* if you want to match all URLs. + +Note: This differs from Vim which uses a glob rather than a regexp for {pat}. + +The following keywords are available where relevant: + +`--------------`---------------------------------------------- +** The URL against which the event was selected. +** The page, bookmark or download title. +*<tab>* The tab in which the event occurred. +*<tags>* The tags applied to <url>. Only for *BookmarkAdd*. +*<keyword>* The keywords applied to the bookmark. Only for *BookmarkAdd*. +*<icon>* The icon associated with <url>. Only for *BookmarkAdd*. +*<size>* The size of a downloaded file. Only for *DownloadPost*. +*<file>* The target destination of a download. Only for *DownloadPost*. +*<state>* The new fullscreen state. Only for *Fullscreen*. +*<name>* The color scheme name. Only for *ColorScheme*. +-------------------------------------------------------------- + +________________________________________________________________________________ + + +|:doautoa| |:doautoall| +||:doautoa[ll] {event} [a][url][a]|| + +________________________________________________________________________________ +Apply the autocommands matching the specified URL to all buffers. If no +[a][url][a] is specified use the current URL. +________________________________________________________________________________ + + +|:do| |:doautocmd| +||:do[autocmd] {event} [a][url][a]|| + +________________________________________________________________________________ +Apply the autocommands matching the specified URL to the current buffer. If no +[a][url][a] is specified use the current URL. +________________________________________________________________________________ + +section:Examples[autocmd-examples] + +Enable _passthrough_ mode on all Google sites: + +\{nbsp}[c]:autocmd LocationChange .* js modes.passAllKeys = /google\.com/.test(buffer.URL)[c] + +Enable _passthrough_ mode on *some* Google sites: + +\{nbsp}[c]:autocmd LocationChange .* js modes.passAllKeys = /(www|mail)\.google\.com/.test(buffer.URL)[c] + +Set the filetype to mail when editing email at Gmail: + +\{nbsp}[c]:autocmd LocationChange .* :set editor=gvim\ -f[c] + +\{nbsp}[c]:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c 'set ft=mail'"[c] + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/browsing.txt b/xulmus/locale/en-US/browsing.txt new file mode 100755 index 00000000..9b44fa8a --- /dev/null +++ b/xulmus/locale/en-US/browsing.txt @@ -0,0 +1,349 @@ +HEADER + +|surfing| |browsing| + + +Vimperator overrides nearly all Firefox keys in order to make browsing more +pleasant for Vim users. On the rare occasions when you want to pass a keystroke +to Firefox, or to the web page, and have it retain its original meaning you +have 2 possibilities: + +|pass-through| |<C-z>| |CTRL-Z| + +||CTRL-Z|| +________________________________________________________________________________ +Disable all Vimperator keys except [m]<Esc>[m] and pass them to the next event +handler. This is especially useful, if JavaScript controlled forms like the +RichEdit form fields of Gmail don't work anymore. To exit this mode, press +[m]<Esc>[m]. If you also need to pass [m]<Esc>[m] in this mode to the web page, +prepend it with [m]<C-v>[m]. +________________________________________________________________________________ + +|send-key| |<C-v>| |CTRL-V| + +||CTRL-V|| +________________________________________________________________________________ +If you only need to pass a single key to a JavaScript form field or another +extension prefix the key with [m]<C-v>[m]. Also works to unshadow Firefox +shortcuts like [m]<C-o>[m] which are otherwise hidden in Vimperator. When +Vimperator mode is temporarily disabled with [m]<C-z>[m], [m]<C-v>[m] will pass +the next key to Vimperator instead of the web page. +________________________________________________________________________________ + +section:Opening{nbsp}web{nbsp}pages[opening] + +|o| |:o| |:open| +||:o[pen][!] [a][arg1][a], [a][arg2][a], ...|| + +||o|| +________________________________________________________________________________ +Open one or more URLs in the current tab. +Multiple URLs can be separated with 'urlseparator' (default: ", " Note that the +space after the comma is required.) +The first URL is opened in the current tab, and all other URLs are +opened in new tabs. +Each token is analyzed and in this order: + +1. Opened as a local file if it is an existing relative or absolute filename. + - [c]:open /etc/fstab[c] shows the file system table. + - [c]:open ../other/foo.html[c] in your home directory opens + [a]/home/other/foo.html[a] +2. Opened with the specified search engine if the token looks like a search + string and the first word is the name of a search engine ([c]:open wikipedia + linus torvalds[c] opens the Wikipedia entry for linus torvalds). The short + name of a search engine is automatically guessed from its name. If you want + to set a custom name, you can change it with [c]:dialog searchengines[c]. +3. Opened with the default search engine or keyword (specified with the + 'defsearch' option) if the first word is no search engine ([c]:open linus + torvalds[c] opens a Google search for linux torvalds). +4. Passed directly to Firefox in all other cases ([c]:open www.osnews.com, + www.slashdot.org[c] opens OSNews in the current, and Slashdot in a new + background tab). + +You can use [c]:open -tags linux torvalds<Tab>[c] to complete bookmarks with +tag "linux" and which contain "torvalds". Note that -tags support is only +available for tab completion, not for the actual command. +The items which are completed on [m]<Tab>[m] are specified in the 'complete' +option. +Without argument, reloads the current page. +Without argument but with [!], reloads the current page skipping the cache. +________________________________________________________________________________ + + +|t| |:t| |:tabopen| |:tabnew| |:tabe| |:tabedit| +||:tabopen[!] [a][arg1][a], [a][arg2][a], ...|| + +||t|| +________________________________________________________________________________ +Just like [c]:open[c] but also uses a new tab for the first URL. When +used with [!], the *tabopen* value of the 'activate' option is negated. +________________________________________________________________________________ + + +|T| + +||T|| +________________________________________________________________________________ +Open one or more URLs in a new tab based on current location. Works like +[m]t[m] but preselects current URL in the [c]:tabopen[c] query. +________________________________________________________________________________ + + +|:tabd| |:tabduplicate| +||:[count]tabd[uplicate][!]|| + +________________________________________________________________________________ +Duplicates current tab [count] times. Uses *tabopen* value of the 'activate' +option to determine if the last cloned tab should be activated. When used with +[!], *tabopen* value is negated. +________________________________________________________________________________ + + +|O| + +||O|| +________________________________________________________________________________ +Open one or more URLs in the current tab based on current location. Works +like [m]o[m] but preselects current URL in the [c]:open[c] query. +________________________________________________________________________________ + + +|:winopen| |:wopen| |:winedit| +||:wino[pen][!] [a][arg1][a], [a][arg2][a], ...|| + +________________________________________________________________________________ +Just like [c]:tabopen[c] but opens the resulting web page(s) in a new window. +________________________________________________________________________________ + + +|<MiddleMouse>| |p| + +||p|| +________________________________________________________________________________ +Open (put) a URL based on the current clipboard contents in the current buffer. +You can also just select (for non-X11 users: copy) some non-URL text, and +search for it with the default search engine or keyword (specified by the +'defsearch' option) with [m]p[m]. +________________________________________________________________________________ + + +|P| + +||P|| +________________________________________________________________________________ +Open (put) a URL based on the current clipboard contents in a new buffer. Works +like [m]p[m] but opens a new tab. + +Whether the new buffer is activated, depends on the 'activate' option. +________________________________________________________________________________ + + +|gP| + +||gP|| +________________________________________________________________________________ +Open (put) a URL based on the current clipboard contents in a new buffer. +Works like [m]P[m] but inverts the 'activate' option. +________________________________________________________________________________ + + +|<C-x>| +||[count]<C-x>|| +________________________________________________________________________________ +Decrements the last number in URL by 1, or by [count] if given. Negative +numbers are not supported, as this is not generally useful, so the number cannot +be decremented past 0. +________________________________________________________________________________ + + +|<C-a>| +||[count]<C-a>|| +________________________________________________________________________________ +Increments the last number in URL by 1, or by [count] if given. +________________________________________________________________________________ + + +|\~| + +||\~|| +________________________________________________________________________________ +Open home directory. You can also use the hints and have the probably fastest +file browser on earth. :) +________________________________________________________________________________ + +section:Navigating[navigating] + +|H| |<C-o>| |CTRL-O| |:ba| |:back| +||:[count]ba[ck] [url]|| + +||:ba[ck]!|| + +||CTRL-o|| +________________________________________________________________________________ +Go [count] pages back in the browser history. If [url] is specified go back to +the first matching URL. The special version [c]:back![c] goes to the beginning +of the browser history. +________________________________________________________________________________ + + +|L| |<C-i>| |CTRL-i| |:fo| |:fw| |:forward| +||:[count]fo[rward] [url]|| + +||:fo[rward]!|| + +||CTRL-i|| +________________________________________________________________________________ +Go [count] pages forward in the browser history. If [url] is specified go +forward to the first matching URL. The special version [c]:forward![c] goes to +the end of the browser history. +________________________________________________________________________________ + + +|:ju| |:jumps| +||:ju[mps]|| +________________________________________________________________________________ +List all jumps aka current tab's history aka session history. + +Current history position is marked with >, jump numbers are counters to be used +with [c]:back[c] (above zero record) or [c]:forward[c] (below zero record). +________________________________________________________________________________ + + +|gh| +||gh|| +________________________________________________________________________________ +Go home. Opens the homepage in the current tab. +________________________________________________________________________________ + + +|gH| + +||gH|| +________________________________________________________________________________ +Go home in a new tab. Opens the homepage in a new tab. Whether the new tab is +activated or not depends on the 'activate' option. +________________________________________________________________________________ + + +|gu| +||[count]gu|| +________________________________________________________________________________ +Go to [count]th parent directory. + + +[m]2gu[m] on _http://www.example.com/dir1/dir2/file.htm_ opens +_http://www.example.com/dir1/_. +________________________________________________________________________________ + + +|gU| +||gU|| +________________________________________________________________________________ +Go to the root of the web site. + + +[m]gU[m] on _http://www.example.com/dir1/dir2/file.htm_ opens +_http://www.example.com/_. +When browsing a local directory, it goes to the root directory. +________________________________________________________________________________ + +section:Reloading[reloading] + +|r| +||r|| +________________________________________________________________________________ +Force reloading of the current page. +________________________________________________________________________________ + + +|R| +||R|| +________________________________________________________________________________ +Force reloading of the current page skipping the cache. +________________________________________________________________________________ + + +|:re| |:reload| + +||:re[load][!]|| +________________________________________________________________________________ +Reload current page. Forces reloading of the current page. If [!] is +given, skip the cache. +________________________________________________________________________________ + + +|:reloada| |:reloadall| + +||:reloada[ll][!]|| +________________________________________________________________________________ +Reload all pages. Forces reloading of all pages. If [!] is given, skip the cache. +________________________________________________________________________________ + +section:Stopping[stopping] + +|<C-c>| +||<C-c>|| +________________________________________________________________________________ +Stop loading the current web page. +________________________________________________________________________________ + + +|:st| |:stop| +||:st[op]|| +________________________________________________________________________________ +Stop loading. Stop loading current web page. +________________________________________________________________________________ + +section:Writing[writing,save-file] + +|:w| |:write| |:sav| |:saveas| + +||:sav[eas][!] [a][file][a]|| +________________________________________________________________________________ +Save current web page to disk. If [a][file][a] is omitted, save to the page's +default filename. Existing documents will only be overwritten if [!] is given. +________________________________________________________________________________ + +section:Quitting[quitting,save-session] + +|:q| |:quit| + +||:q[uit]|| +________________________________________________________________________________ +Quit current tab. If this is the last tab in the window, close the window. If +this was the last window, close Vimperator. When quitting Vimperator, the +session is not stored. +________________________________________________________________________________ + + +|:qa| |:qall| |:quita| |:quitall| + +||:quita[ll]|| +________________________________________________________________________________ +Quit Vimperator. Quit Vimperator, no matter how many tabs/windows are open. +The session is not stored. +________________________________________________________________________________ + + +|:wc| |:wclose| |:winc| |:winclose| +||:winc[lose]|| + +________________________________________________________________________________ +Close window. +________________________________________________________________________________ + + +|:xa| |:xall| |:wq| |:wqa| |:wqall| +||:wqa[ll]|| + +||:xa[ll]|| +________________________________________________________________________________ +Save the session and quit. Quit Vimperator, no matter how many tabs/windows +are open. The session is stored. [c]:wq[c] is different from Vim, as it +closes the window instead of just one tab by popular demand. Complain on the +mailing list, if you want to change that. +________________________________________________________________________________ + + +|ZQ| +||ZQ|| +________________________________________________________________________________ +Quit and don't save the session. Works like [c]:qall[c]. +________________________________________________________________________________ + + +|ZZ| +||ZZ|| +________________________________________________________________________________ +Quit and save the session. Quit Vimperator, no matter how many tabs/windows +are open. The session is stored. Works like [c]:xall[c]. +________________________________________________________________________________ + +section:The{nbsp}current{nbsp}directory[current-directory] + +|:chd| |:chdir| |:cd| +||:cd [-|path]|| +________________________________________________________________________________ +Change the current directory. [c]:cd -[c] changes to the last directory. +________________________________________________________________________________ + + +|:pw| |:pwd| +||:pw[d]|| +________________________________________________________________________________ +Print the current directory name. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/buffer.txt b/xulmus/locale/en-US/buffer.txt new file mode 100755 index 00000000..91022f27 --- /dev/null +++ b/xulmus/locale/en-US/buffer.txt @@ -0,0 +1,361 @@ +HEADER + +|buffer| |document| + + +Vimperator holds exactly one buffer object for each tab. It is usually an +(X)HTML document with advanced features. + +section:Buffer{nbsp}information[buffer-information] + +|<C-g>| + +||<C-g>|| +________________________________________________________________________________ +Print the current file name. Also shows some additional file information like +file size or the last modified date. +________________________________________________________________________________ + + +|g<C-g>| + +||g<C-g>|| +________________________________________________________________________________ +Print file information. Same as [c]:pa[geinfo][c]. +________________________________________________________________________________ + + +|:pa| |:pageinfo| + +||:pa[geinfo]|| +________________________________________________________________________________ +Show various page information. See [c]:help 'pageinfo'[c] for available options. +________________________________________________________________________________ + + +|gf| + +||gf|| +________________________________________________________________________________ +View source. Opens the source code of the current web site with the internal +editor in the current tab. +________________________________________________________________________________ + + +|gF| + +||gF|| +________________________________________________________________________________ +View source with an external editor. Opens the source code of the current web +site with the external editor specified by the 'editor' option. For now the +external editor must be able to download and open files from a remote URL. +________________________________________________________________________________ + + +|:vie| |:viewsource| +||:vie[wsource][!] [a][url][a]|| + +________________________________________________________________________________ +View source code of current document. If [a][url][a] is specified then view the +source of that document. When [!] is given, it is opened with the external +editor. +________________________________________________________________________________ + +section:Motion{nbsp}commands[motion,scrolling] + +|^| |0| + +||0|| +________________________________________________________________________________ +Scroll to the absolute left of the document. Unlike in Vim, [m]0[m] and [m]^[m] +work exactly the same way. +________________________________________________________________________________ + + +|$| + +||$|| +________________________________________________________________________________ +Scroll to the absolute right of the document +________________________________________________________________________________ + + +|<Home>| |gg| + +||[count]gg|| +________________________________________________________________________________ +Go to the top of the document. When used with [count] like in [m]35gg[m], it +scrolls to 35% of the document. +________________________________________________________________________________ + + +|<End>| |G| + +||[count]G|| +________________________________________________________________________________ +Go to the end of the document. When used with [count] like in [m]35G[m], it +scrolls to 35% of the document. +________________________________________________________________________________ + + +|N%| + +||{count}%|| +________________________________________________________________________________ +Scroll to {count} percent of the document. +________________________________________________________________________________ + + +|<Left>| |h| + +||[count]h|| +________________________________________________________________________________ +Scroll document to the left. If [count] is specified then move [count] times as +much to the left. + +If the document cannot scroll more, a beep is emitted (unless 'visualbell' is +set). +________________________________________________________________________________ + + +|<C-e>| |<Down>| |j| + +||[count]j|| +________________________________________________________________________________ +Scroll document down. If [count] is specified then move [count] times as much +down. + +If the document cannot scroll more, a beep is emitted (unless 'visualbell' is +set). +________________________________________________________________________________ + + +|<C-y>| |<Up>| |k| + +||[count]k|| +________________________________________________________________________________ +Scroll document up. If [count] is specified then move [count] times as much up. + +If the document cannot scroll more, a beep is emitted (unless 'visualbell' is +set). +________________________________________________________________________________ + + +|<C-d>| + +||[count]<C-d>|| +________________________________________________________________________________ +Scroll window downwards in the buffer. The number of lines is set by the +'scroll' option which defaults to half a page. If [count] is given 'scroll' is +first set to this value. +________________________________________________________________________________ + + +|<C-u>| + +||[count]<C-u>|| +________________________________________________________________________________ +Scroll window upwards in the buffer. The number of lines is set by the +'scroll' option which defaults to half a page. If [count] is given 'scroll' is +first set to this value. +________________________________________________________________________________ + + +|<Right>| |l| + +||[count]l|| +________________________________________________________________________________ +Scroll document to the right. If [count] is specified then move [count] times +as much to the right. + +If the document cannot scroll more, a beep is emitted (unless 'visualbell' is +set). +________________________________________________________________________________ + + +|<S-Space>| |<PageUp>| |<C-b>| + +||[count]<C-b>|| +________________________________________________________________________________ +Scroll up a full page. Scroll window [count] pages Backwards (upwards) in the buffer. +________________________________________________________________________________ + + +|<Space>| |<PageDown>| |<C-f>| + +||[count]<C-f>|| +________________________________________________________________________________ +Scroll down a full page. Scroll window [count] pages Forwards (downwards) in the buffer. +________________________________________________________________________________ + +section:Jumping{nbsp}to{nbsp}elements[jumping] + +|<Tab>| + +||<Tab>|| +________________________________________________________________________________ +Advance keyboard focus to the next element. +________________________________________________________________________________ + + +|<S-Tab>| + +||<S-Tab>|| +________________________________________________________________________________ +Rewind keyboard focus to the previous element. +________________________________________________________________________________ + + +|gi| + +||[count]gi|| +________________________________________________________________________________ +Focus last used input field. If there is no last input field, it focuses the +first input field. When used with [count] it directly jumps to the [count]th input +field. +________________________________________________________________________________ + + +|]f| + +||[count]]f|| +________________________________________________________________________________ +Focus next frame. Transfer keyboard focus to the [count]th next frame in +order. The newly focused frame is briefly colored red. Does not wrap. +________________________________________________________________________________ + + +|[f| + +||[count][f|| +________________________________________________________________________________ +Focus previous frame. Transfer keyboard focus to the [count]th previous frame +in order. The newly focused frame is briefly colored red. Does not wrap. +________________________________________________________________________________ + + +|]]| + +||[count]]]|| +________________________________________________________________________________ +Follow the link labeled \'next' or \'>' if it exists. Useful when browsing +forums or documentation. Change 'nextpattern' to modify its behavior. It +follows relations between files too. +________________________________________________________________________________ + + +|[[| + +||[count][[|| +________________________________________________________________________________ +Follow the link labeled \'prev', \'previous' or \'<' if it exists. Useful when +browsing forums or documentation. Change 'previouspattern' to modify its +behavior. It follows relations between files too. +________________________________________________________________________________ + +section:Zooming[zooming,zoom] + +The zooming commands are dependent on two properties -- a zoom range and a +series of levels within that range. + +The absolute value of the page zoom is limited to a value within the configured +zoom range (default: 30%--300%). The zoom levels are used by +[m]zi[m]/[m]zo[m], and similar commands, to change the zoom value in steps. The +default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%, +170%, 200%, 240%, 300%. + +The available zoom range can be changed by setting the \'zoom.minPercent' and +\'zoom.maxPercent' Firefox preferences. The zoom levels can be changed using +the \'toolkit.ZoomManager.zoomLevels' preference. + +Note: \'toolkit.ZoomManager.zoomLevels' is specified as a list of values +between 0 and 1, not as a percentage. + +|+| |zi| + +||[count]zi|| +________________________________________________________________________________ +Enlarge text zoom of current web page. Mnemonic: zoom in. +________________________________________________________________________________ + + +|zm| + +||[count]zm|| +________________________________________________________________________________ +Enlarge text zoom of current web page by a larger amount. Mnemonic: zoom more. +________________________________________________________________________________ + + +|-| |zo| + +||[count]zo|| +________________________________________________________________________________ +Reduce text zoom of current web page. Mnemonic: zoom out. +________________________________________________________________________________ + + +|zr| + +||[count]zr|| +________________________________________________________________________________ +Reduce text zoom of current web page by a larger amount. Mnemonic: zoom reduce. +________________________________________________________________________________ + + +|zz| + +||[count]zz|| +________________________________________________________________________________ +Set text zoom value of current web page. Zoom value can be between 30 and 300%. +If it is omitted, text zoom is reset to 100%. +________________________________________________________________________________ + + +|zI| + +||[count]zI|| +________________________________________________________________________________ +Enlarge full zoom of current web page. Mnemonic: zoom in. +________________________________________________________________________________ + + +|zM| + +||[count]zM|| +________________________________________________________________________________ +Enlarge full zoom of current web page by a larger amount. Mnemonic: zoom more. +________________________________________________________________________________ + + +|zO| + +||[count]zO|| +________________________________________________________________________________ +Reduce full zoom of current web page. Mnemonic: zoom out. +________________________________________________________________________________ + + +|zR| + +||[count]zR|| +________________________________________________________________________________ +Reduce full zoom of current web page by a larger amount. Mnemonic: zoom reduce. +________________________________________________________________________________ + + +|zZ| + +||[count]zZ|| +________________________________________________________________________________ +Set full zoom value of current web page. Zoom value can be between 30 and +300%. If it is omitted, full zoom is reset to 100%. +________________________________________________________________________________ + + +|:zo| |:zoom| +||:zo[om][!] [a][value][a]|| + +||:zo[om][!] +{value} | -{value}|| + +________________________________________________________________________________ +Set zoom value of current web page. [a][value][a] can be an absolute value +between 30 and 300% or a relative value if prefixed with "-" or "+". If +[a][value][a] is omitted, zoom is reset to 100%. + +Normally this command operates on the text zoom, if used with [!] it operates +on full zoom. +________________________________________________________________________________ + +section:Copying{nbsp}text[copying,yanking] + +When running in X11, the text of the following commands is not only +copied to the clipboard but is also put into the X11 selection, which +can be pasted with the middle mouse button: + +|y| + +||y|| +________________________________________________________________________________ +Yank current location to the clipboard. When running in X11 the location is +also put into the selection, which can be pasted with the middle mouse button. +________________________________________________________________________________ + + +|Y| + +||Y|| +________________________________________________________________________________ +Copy currently selected text to the system clipboard. +________________________________________________________________________________ + +section:Alternate{nbsp}style{nbsp}sheets[alternate-stylesheet] + +Page authors may specify alternate style sheets for an HTML document. Users can +then switch between these various style sheets, selecting their favorite. + +|:pagest| |:pagestyle| +||:pagest[yle] [a][stylesheet][a]|| + +________________________________________________________________________________ +Select the author style sheet to apply. If [a][stylesheet][a] is not specified +the page's default style sheet is used. + +All author styling can be removed by setting the 'usermode' option. +________________________________________________________________________________ + +// vim: set filetype=asciidoc fdm=marker: diff --git a/xulmus/locale/en-US/cmdline.txt b/xulmus/locale/en-US/cmdline.txt new file mode 100755 index 00000000..9eabc590 --- /dev/null +++ b/xulmus/locale/en-US/cmdline.txt @@ -0,0 +1,80 @@ +HEADER + +|Command-line-mode| |Command-line| |mode-cmdline| + + +Command-line mode is used to enter Ex commands (":") and text search patterns +("/" and "?"). + +|:| + +||:|| +________________________________________________________________________________ +Start Command-line mode. In Command-line mode, you can perform extended +commands, which may require arguments. +________________________________________________________________________________ + + +section:Command-line{nbsp}editing[cmdline-editing] + +|c_<C-c>| + +||<C-c>|| +________________________________________________________________________________ +Quit Command-line mode without executing. +________________________________________________________________________________ + + +|c_<C-]>| + +||<C-]>|| +________________________________________________________________________________ +Expand a Command-line abbreviation. +________________________________________________________________________________ + + +|c_<Up>| + +||<Up>|| +________________________________________________________________________________ +Recall the previous command line from the history list which matches the +current command line. +________________________________________________________________________________ + + +|c_<Down>| + +||<Down>|| +________________________________________________________________________________ +Recall the next command line from the history list which matches the current +command line. +________________________________________________________________________________ + + +|c_<S-Up>| |c_<PageUp>| +||<S-Up>|| + +||<PageUp>|| +________________________________________________________________________________ +Recall the previous command line from the history list. +________________________________________________________________________________ + + +|c_<S-Down>| |c_<PageDown>| +||<S-Down>|| + +||<PageDown>|| +________________________________________________________________________________ +Recall the next command line from the history list. +________________________________________________________________________________ + +section:Command-line{nbsp}completion[cmdline-completion] + +|c_<Tab>| + +||<Tab>|| +________________________________________________________________________________ +Complete the word in front of the cursor according to the behavior specified in +'wildmode'. If 'wildmode' contains "list" and there are multiple matches then +the completion menu window is opened. +________________________________________________________________________________ + + +|c_<S-Tab>| + +||<S-Tab>|| +________________________________________________________________________________ +Complete the previous full match when 'wildmode' contains "full". +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/developer.txt b/xulmus/locale/en-US/developer.txt new file mode 100755 index 00000000..cf875d82 --- /dev/null +++ b/xulmus/locale/en-US/developer.txt @@ -0,0 +1,88 @@ +HEADER + +section:Writing{nbsp}documentation[writing-docs,documentation] + +For every new feature, writing documentation is _mandatory_ for the patch to +be accepted. The docs are written in +http://www.methods.co.nz/asciidoc/index.html[asciidoc] version 8.2.x. +They are placed in the _src/locale/en-US/_ directory and compiled with +_make doc_. Please refer to the +http://www.methods.co.nz/asciidoc/userguide.html[asciidoc documentation] above +for details. Usually you can just write text as is, and mostly it will be +interpreted correctly. The only difficult part is to write special sections +like for help::help[various.html#online-help]. + +---------------------------------------------------------------------------------- +|<F1>| |:help| |:h| |help| +||:h[elp] {subject}|| + +||<F1>|| +____________________________________________________________________________ +Open help window. +The default section is shown unless {subject} is specified. +If you need help for a specific topic, try [c]:help overview[c]. +____________________________________________________________________________ +---------------------------------------------------------------------------------- + +is displayed as: + +++++++++++++++++++++++++++++++++++++++++ +<p><span class="hiddentag"><F1></span> <span +class="hiddentag">:help</span> <span class="hiddentag">:h</span> <span +class="hiddentag">help</span> + +<div class="key">:h[elp] <span class="argument">{subject}</span></div><br /> +<div class="key"><F1></div></p> +<div class="quoteblock"> +<div class="quoteblock-content"> +<p>Open help window. +The default section is shown unless <span class="argument">{subject}</span> is specified. +If you need help for a specific topic, try <span class="command">:help overview</span>.</p> +</div></div> ++++++++++++++++++++++++++++++++++++++++ + +Some notes about the code above: + +- *$$|<F1>|$$* defines a _tag_. A tag is written at the right in magenta and let's + you jump to a topic with [c]:help <F1>[c]. Note that you must write it from + right to left, so in the above example $$|help|$$ will be the most left tag, + and $$|<F1>|$$ the most right one. +- *$$||:h[elp] {subject}|| +$$* and *$$||<F1>||$$* define command or mapping + names and are printed on the left side. Note the + at the end of one + command, that indicates a new line. There is no general rule when a new line + is needed and when not, just try it out and see what looks better. +- The actual help code for this command is embedded in at least 4 underscores + (_). This generates a quoteblock and indents the text so it is more clear + that it belongs to the command. +- Wrap things in *$$[c]$$* and they are drawn like a :command. Also *$$[o]$$*, + *$$[m]$$* and *$$[a]$$* are available to markup options, mappings, and + arguments. +- As a convenience, any string within \{...\} and $$[count]$$ and $$[!]$$ are + automatically marked up as an argument. + +There are also some additional asciidoc commands specifically for writing +Vimperator documentation: + +- *$$section:Writing{nbsp}documentation[writing-docs,documentation]$$* Creates + a new section like _Writing Documentation_ in this help file with 2 tags. +- *$$help:developer{nbsp}information[developer.html#documentation]$$* creates + a link with text _developer information_ to the tag _documentation_ in + the file _developer.html_. + + +If you don't know in which file/section you should put some documentation, ask +on the mailing list or on #vimperator. Usually help should be grouped together +in logically connected subject areas like +help:opening{nbsp}web{nbsp}pages[browsing.html#opening]. + +section:Generating{nbsp}documentation[generating-docs] + +You can also autogenerate most of the asciidoc help after you have written a +new command, mapping or option. For this, use: + + :echo util.generateHelp(commands.get("addons"), "Extra text") + +Now you can copy the asciidoc text but always make sure it looks OK after +you compile the help file with "make doc", as the auto-generation might +not work correctly for all special cases. + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/eval.txt b/xulmus/locale/en-US/eval.txt new file mode 100755 index 00000000..17c71dda --- /dev/null +++ b/xulmus/locale/en-US/eval.txt @@ -0,0 +1,84 @@ +HEADER + +|expression| |expr| |eval| + + +INTRO TO BE WRITTEN... + +|:ec| |:echo| + +||:ec[ho] {expr}|| +________________________________________________________________________________ +Echo the expression. Useful for showing informational messages. Multiple lines +can be separated by \n. {expr} can either be a quoted string, or any expression +which can be fed to eval() like 4+5. You can also view the source code of +objects and functions if the return value of {expr} is an object or function. +________________________________________________________________________________ + + +|:echoe| |:echoerr| +||:echoe[rr] {expr}|| + +________________________________________________________________________________ +Echo the expression as an error message. Just like [c]:ec[ho][c] but echoes +the result highlighted as ErrorMsg and saves it to the message history. +________________________________________________________________________________ + + +|:echom| |:echomsg| +||:echom[sg] {expr}|| + +________________________________________________________________________________ +Echo the expression as an informational message. Just like [c]:ec[ho][c] but +also saves the message in the message history. +________________________________________________________________________________ + + +|:exe| |:execute| +||:exe[cute] {expr}|| + +________________________________________________________________________________ +Execute the string that results from the evaluation of {expr} as an Ex command. +Example: [c]:execute "source " + io.getRCFile().path[c] sources the appropriate +RC file. + +Note: Unlike Vim this currently only supports a single argument. +________________________________________________________________________________ + + +|:js| |:javas| |:javascript| +||:javas[cript] {cmd}|| + +||:javascript <<{endpattern}\n{empty}{script}\n{empty}{endpattern} || + +||:javascript[!]|| +________________________________________________________________________________ +Run any JavaScript command through eval(). Acts as a JavaScript interpreter by +passing the argument to `eval()`. +[c]:javascript alert("Hello world")[c] shows a dialog box with the text "Hello world". +[c]:javascript <<EOF[c] reads all the lines until a line starting with "EOF" +is found, and interpret them with the JavaScript _eval()_ function. + +The special version [c]:javascript![c] opens the JavaScript console of +Firefox. + +[m]<Tab>[m] completion is available for [c]:javascript {cmd}<Tab>[c] (but not +yet for the [c]:js <<EOF[c] multiline widget). Be aware that Vimperator needs +to run {cmd} through eval() to get the completions, which could have unwanted +side effects. +________________________________________________________________________________ + +// >> To make the syntax highlighting happy + +|:let| +||:let {var-name} [+-.]= {expr1}|| + +||:let {var-name}|| + +||:let|| +________________________________________________________________________________ +Sets or lists a variable. Sets the variable {var-name} to the value of the +expression {expr1}. If no expression is given, the value of the variable is +displayed.Without arguments, displays a list of all variables. +________________________________________________________________________________ + + +|:unl| |:unlet| +||:unl[et][!] {name} ...|| + +________________________________________________________________________________ +Deletes the variable {name}. Several variable names can be given. When used +with [!] no error message is output for non-existing variables. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/gui.txt b/xulmus/locale/en-US/gui.txt new file mode 100755 index 00000000..4da826c5 --- /dev/null +++ b/xulmus/locale/en-US/gui.txt @@ -0,0 +1,90 @@ +HEADER + +|gui| + + +Although Vimperator offers the most frequently used Firefox functionality via +Ex and Normal mode commands there may be times when directly accessing the GUI +is required. There are commands for accessing the menu system, standard dialogs +and the sidebar. + +|:emenu| + +||:emenu {menu}|| +________________________________________________________________________________ +Execute {menu} from the command line. This command provides command-line access +to all menu items available from the main Firefox menubar. {menu} is a +hierarchical path to the menu item with each submenu separated by a period. +E.g. [c]:emenu File.Open File...[c] +________________________________________________________________________________ + + +|:addo| |:addons| + +||:addo[ns]|| +________________________________________________________________________________ +Show available Browser Extensions and Themes. +You can add/remove/disable browser extensions from this dialog. +Be aware that not all Firefox extensions work, because Vimperator overrides +some key bindings and changes Firefox's GUI. +________________________________________________________________________________ + + +|:dia| |:dialog| +||:dia[log] [a][firefox-dialog][a]|| + +________________________________________________________________________________ +Open a Firefox dialog. + +Available dialogs: +`------------------`----------------------------------- +*about* About Firefox +*addbookmark* Add bookmark for the current page +*addons* Manage Add-ons +*bookmarks* List your bookmarks +*checkupdates* Check for updates +*cleardata* Clear private data +*cookies* List your cookies +*console* JavaScript console +*customizetoolbar* Customize the Toolbar +*dominspector* DOM Inspector +*downloads* Manage Downloads +*history* List your history +*import* Import Preferences, Bookmarks, History, etc. from other browsers +*openfile* Open the file selector dialog +*pageinfo* Show information about the current page +*pagesource* View page source +*places* Places Organizer: Manage your bookmarks and history +*preferences* Show Firefox preferences dialog +*printpreview* Preview the page before printing +*printsetup* Setup the page size and orientation before printing +*print* Show print dialog +*saveframe* Save frame to disk +*savepage* Save page to disk +*searchengines* Manage installed search engines +*selectionsource* View selection source +------------------------------------------------------- + +________________________________________________________________________________ + + +|:dl| |:downl| |:downloads| + +||:downl[oads]|| +________________________________________________________________________________ +Show progress of current downloads. Open the original Firefox download dialog +in a new tab. Here, downloads can be paused, canceled and resumed. +________________________________________________________________________________ + + +|:sbcl| |:sbclose| + +||:sbcl[ose]|| +________________________________________________________________________________ +Close the sidebar window. +________________________________________________________________________________ + + +|:sbope| |:sbopen| |:sb| |:sbar| |:sideb| |:sidebar| + +||:sidebar {name}|| +________________________________________________________________________________ +Open the sidebar window. {name} is any of the menu items listed under the +standard Firefox View->Sidebar menu. Add-ons, Preferences and Downloads are +also available in the sidebar. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/help.js b/xulmus/locale/en-US/help.js new file mode 100755 index 00000000..ece4273f --- /dev/null +++ b/xulmus/locale/en-US/help.js @@ -0,0 +1,24 @@ + +function checkFragment() +{ + let frag = document.location.hash.substr(1); + if (!frag || document.getElementById(frag)) + return; + let elem = document.evaluate('//*[@class="tag" and text()="' + frag + '"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0); + if (elem) + window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context +} + +document.addEventListener("load", checkFragment, true); +window.addEventListener("message", function (event) { + if (event.data == "fragmentChange") + checkFragment(); +}, true); + +document.addEventListener("click", function (event) { + let evt = document.createEvent("UIEvents"); + evt.initEvent("liberatorHelpLink", true, true); + event.target.dispatchEvent(evt); +}, true); + +// vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/locale/en-US/hints.txt b/xulmus/locale/en-US/hints.txt new file mode 100755 index 00000000..ef3200bb --- /dev/null +++ b/xulmus/locale/en-US/hints.txt @@ -0,0 +1,67 @@ +HEADER + +|quick-hints| |hints| + + +INTRO TO BE WRITTEN... + +|f| + +||#f#{hint}|| +________________________________________________________________________________ +Start QuickHint mode. In QuickHint mode, every hintable item (according to the +'hinttags' XPath query) is assigned a unique number. You can now either type +this number or type any part of the URL which you want to follow, and it is +followed as soon as it can be uniquely identified. Often it can be useful to +combine these techniques to narrow down results with some letters, and then +typing a single digit to make the match unique. Pressing [m]<Leader>[m] +(defaults to [c]:let mapleader = "\"[c]) toggles "escape-mode", where numbers +are treated as normal text. + +[m]<Esc>[m] stops this mode at any time. +________________________________________________________________________________ + + +|F| + +||#F#{hint}|| +________________________________________________________________________________ +Start QuickHint mode, but open link in a new tab. Like normal QuickHint +mode (activated with [m]f[m]) but opens the link in a new tab. The new +tab will be loaded in background according to the +\'browser.tabs.loadInBackground' Firefox preference. +________________________________________________________________________________ + + +|extended-hints| + + +|;| + +||#;#{mode}{empty}{hint}|| +________________________________________________________________________________ +Start an extended hint mode. ExtendedHint mode is useful for performing +operations on hinted elements other than the default left mouse click. For +example, you can yank link locations, open them in a new window or save images. +If you want to yank the location of hint [a]24[a], press [m];y[m] to start this +hint mode. Then press [a]24[a] to copy the hint location. + +{mode} can be one of: + + +* |;;| [m];[m] to focus a link and hover it with the mouse +* |;?| [m]?[m] to show information about the element (incomplete) +* |;s| [m]s[m] to save its destination +* |;a| [m]a[m] to save its destination (prompting for save location) +* |;f| [m]f[m] to focus a frame +* |;o| [m]o[m] to open its location in the current tab +* |;t| [m]t[m] to open its location in a new tab +* |;b| [m]b[m] to open its location in a new background tab +* |;w| [m]w[m] to open its destination in a new window +* |;F| [m]F[m] to follow a sequence of [m]<CR>[m]-delimited hints in background tabs +* |;O| [m]O[m] to generate an [c]:open[c] with hint's URL (like [m]O[m]) +* |;T| [m]T[m] to generate a [c]:tabopen[c] with hint's URL (like [m]T[m]) +* |;W| [m]W[m] to generate a [c]:winopen[c] with hint's URL +* |;v| [m]v[m] to view its destination source +* |;V| [m]V[m] to view its destination source in the external editor +* |;y| [m]y[m] to yank its destination location +* |;Y| [m]Y[m] to yank its text description + +Hintable elements for all extended hint modes can be set in the +'extendedhinttags' XPath string. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/index.txt b/xulmus/locale/en-US/index.txt new file mode 100755 index 00000000..5a6a2fbb --- /dev/null +++ b/xulmus/locale/en-US/index.txt @@ -0,0 +1,316 @@ +HEADER + +|index| + + +This file contains a list of all available commands. + +section:Insert{nbsp}mode[insert-index] + +||[m]<C-i>[m]|| Launch the external editor + +||[m]<C-]>[m]|| Expand an Insert-mode abbreviation + + +section:Normal{nbsp}mode[normal-index] + +||[m]<C-^>[m]|| Select the alternate tab or the [count]th tab + +||[m]<C-a>[m]|| Increment last number in URL + +||[m]<C-b>[m]|| Scroll up a full page + +||[m]<C-c>[m]|| Stop loading + +||[m]<C-d>[m]|| Scroll window downwards in the buffer + +||[m]<C-f>[m]|| Scroll down a full page + +||[m]<C-g>[m]|| Print the current file name + +||[m]<C-i>[m]|| Go to a newer position in the jump list + +||[m]<C-l>[m]|| Redraw the screen + +||[m]<C-o>[m]|| Go to an older position in the jump list + +||[m]<C-u>[m]|| Scroll window upwards in the buffer + +||[m]<C-v>[m]|| Pass through next key + +||[m]<C-x>[m]|| Decrement last number in URL + +||[m]<C-z>[m]|| Temporarily ignore all Vimperator key bindings + + +||[m]<Esc>[m]|| Focus content + + +||[m]<F1>[m]|| Open help window + + +||[m]<S-Tab>[m]|| Rewind keyboard focus + +||[m]<Tab>[m]|| Advance keyboard focus + + +||[m]0[m]|| Scroll to the absolute left of the document + +||[m]$[m]|| Scroll to the absolute right of the document + + +||[m]A[m]|| Toggle bookmarked state of current URL + +||[m]B[m]|| Show buffer list + +||[m]D[m]|| Delete current buffer, focus tab to the left + +||[m]F[m]|| Start QuickHint mode, but open link in a new tab + +||[m]G[m]|| Go to the end of the document + +||[m]H[m]|| Go back in the browser history + +||[m]L[m]|| Go forward in the browser history + +||[m]M[m]|| Add new QuickMark for current URL + +||[m]N[m]|| Find previous + +||[m]O[m]|| Open one or more URLs, based on current location + +||[m]P[m]|| Open (put) a URL based on the current clipboard contents in a new buffer + +||[m]R[m]|| Reload while skipping the cache + +||[m]T[m]|| Open one or more URLs in a new tab, based on current location + +||[m]Y[m]|| Copy selected text or current word + + +||[m]a[m]|| Open a prompt to bookmark the current URL + +||[m]b[m]|| Open a prompt to switch buffers + +||[m]d[m]|| Delete current buffer + +||[m]f[m]|| Start QuickHint mode + +||[m]h[m]|| Scroll document to the left + +||[m]i[m]|| Start Caret mode + +||[m]j[m]|| Scroll document down + +||[m]k[m]|| Scroll document up + +||[m]l[m]|| Scroll document to the right + +||[m]m[m]|| Set mark at the cursor position + +||[m]n[m]|| Find next + +||[m]o[m]|| Open one or more URLs + +||[m]p[m]|| Open (put) a URL based on the current clipboard contents in the current buffer + +||[m]q[m]|| Record a key sequence into a macro + +||[m]r[m]|| Reload current page + +||[m]t[m]|| Open one or more URLs in a new tab + +||[m]u[m]|| Undo closing of a tab + +||[m]y[m]|| Yank current location to the clipboard + + +||[m];[m]|| Start an extended hint mode + + +||[m]:[m]|| Enter Command-line mode + + +||[m]~[m]|| Open home directory + + +||[m]/[m]|| Search forward for a pattern + +||[m]?[m]|| Search backwards for a pattern + +||[m]*[m]|| Find word under cursor + +||[m]#[m]|| Find word under cursor backwards + + +||[m]N%[m]|| Scroll to {count} percent of the document + + +||[m]'[m]|| Jump to the mark in the current buffer + + +||[m]@[m]|| Play a macro + + +||[m].[m]|| Repeat the last keyboard command + + +||[m]]f[m]|| Focus next frame + +||[m][f[m]|| Focus previous frame + +||[m]]] [m]|| Follow the link labeled \'next' or \'>' if it exists + +||[m][[ [m]|| Follow the link labeled \'prev', \'previous' or \'<' if it exists + + +||[m]g$[m]|| Go to the last tab + +||[m]g<[m]|| Redisplay the last command output + +||[m]g0[m]|| Go to the first tab + +||[m]g<C-g>[m]|| Print file information + +||[m]gB[m]|| Repeat last [c]:buffer[!][c] command in reverse direction + +||[m]gF[m]|| View source with an external editor + +||[m]gH[m]|| Open homepage in a new tab + +||[m]gP[m]|| Open (put) a URL based on the current clipboard contents in a new buffer + +||[m]gT[m]|| Go to previous tab + +||[m]gU[m]|| Go to the root of the website + +||[m]gb[m]|| Repeat last [c]:buffer[!][c] command + +||[m]gf[m]|| View source + +||[m]gg[m]|| Go to the top of the document + +||[m]gh[m]|| Open homepage + +||[m]gi[m]|| Focus last used input field + +||[m]gn[m]|| Jump to a QuickMark in a new tab + +||[m]go[m]|| Jump to a QuickMark + +||[m]gt[m]|| Go to the next tab + +||[m]gu[m]|| Go to parent directory + + +||[m]ZQ[m]|| Quit and don't save the session + +||[m]ZZ[m]|| Quit and save the session + +||[m]zI[m]|| Enlarge full zoom of current web page + +||[m]zM[m]|| Enlarge full zoom of current web page by a larger amount + +||[m]zO[m]|| Reduce full zoom of current web page + +||[m]zR[m]|| Reduce full zoom of current web page by a larger amount + +||[m]zZ[m]|| Set full zoom value of current web page + +||[m]zi[m]|| Enlarge text zoom of current web page + +||[m]zm[m]|| Enlarge text zoom of current web page by a larger amount + +||[m]zo[m]|| Reduce text zoom of current web page + +||[m]zr[m]|| Reduce text zoom of current web page by a larger amount + +||[m]zz[m]|| Set text zoom value of current web page + + +section:Command-line{nbsp}editing[ex-edit-index] + +||[m]<C-c>[m]|| Quit Command-line mode without executing + + +||[m]<C-]>[m]|| Expand a command-line abbreviation + + +||[m]<Up>[m]|| Recall the previous command line from the history list which matches the current command line + +||[m]<Down>[m]|| Recall the next command line from the history list which matches the current command line + + +||[m]<Tab>[m]|| Complete the word in front of the cursor according to the behavior specified in 'wildmode' + +||[m]<S-Tab>[m]|| Complete the previous full match when 'wildmode' contains "full" + + +section:Ex{nbsp}commands[ex-cmd-index,:index] + +||[c]:![c]|| Run a command + +||[c]:abbreviate[c]|| Abbreviate a key sequence + +||[c]:abclear[c]|| Remove all abbreviations + +||[c]:addons[c]|| Manage available Extensions and Themes + +||[c]:autocmd[c]|| Execute commands automatically on events + +||[c]:back[c]|| Go back in the browser history + +||[c]:bdelete[c]|| Delete current buffer + +||[c]:beep[c]|| Play a system beep + +||[c]:bmark[c]|| Add a bookmark + +||[c]:bmarks[c]|| List or open multiple bookmarks + +||[c]:buffer[c]|| Switch to a buffer + +||[c]:buffers[c]|| Show a list of all buffers + +||[c]:cabbrev[c]|| Abbreviate a key sequence in Command-line mode + +||[c]:cabclear[c]|| Remove all abbreviations in Command-line mode + +||[c]:cd[c]|| Change the current directory + +||[c]:cmap[c]|| Map a key sequence in Command-line mode + +||[c]:cmapclear[c]|| Remove all mappings in Command-line mode + +||[c]:cnoremap[c]|| Map a key sequence without remapping keys in Command-line mode + +||[c]:colorscheme[c]|| Load a color scheme + +||[c]:comclear[c]|| Delete all user-defined commands + +||[c]:command[c]|| List and define commands + +||[c]:cunabbrev[c]|| Remove an abbreviation in Command-line mode + +||[c]:cunmap[c]|| Remove a mapping in Command-line mode + +||[c]:delbmarks[c]|| Delete a bookmark + +||[c]:delcommand[c]|| Delete the specified user-defined command + +||[c]:delmacros[c]|| Delete macros + +||[c]:delmarks[c]|| Delete the specified marks + +||[c]:delqmarks[c]|| Delete the specified QuickMarks + +||[c]:delstyle[c]|| Delete any matching styles + +||[c]:dialog[c]|| Open a undefined dialog + +||[c]:doautoall[c]|| Apply the autocommands matching the specified URL to all buffers + +||[c]:doautocmd[c]|| Apply the autocommands matching the specified URL to the current buffer + +||[c]:downloads[c]|| Show progress of current downloads + +||[c]:echo[c]|| Echo the expression + +||[c]:echoerr[c]|| Echo the expression as an error message + +||[c]:echomsg[c]|| Echo the expression as an informational message + +||[c]:emenu[c]|| Execute the specified menu item from the command line + +||[c]:execute[c]|| Execute the argument as an Ex command + +||[c]:exusage[c]|| List all Ex commands with a short description + +||[c]:finish[c]|| Stop sourcing a script file + +||[c]:forward[c]|| Go forward in the browser history + +||[c]:hardcopy[c]|| Print current document + +||[c]:help[c]|| Display help + +||[c]:highlight[c]|| Style Vimperator + +||[c]:history[c]|| Show recently visited URLs + +||[c]:iabbrev[c]|| Abbreviate a key sequence in Insert mode + +||[c]:iabclear[c]|| Remove all abbreviations in Insert mode + +||[c]:imap[c]|| Map a key sequence in Insert mode + +||[c]:imapclear[c]|| Remove all mappings in Insert mode + +||[c]:inoremap[c]|| Map a key sequence without remapping keys in Insert mode + +||[c]:iunabbrev[c]|| Remove an abbreviation in Insert mode + +||[c]:iunmap[c]|| Remove a mapping in Insert mode + +||[c]:javascript[c]|| Run a JavaScript command through eval() + +||[c]:jumps[c]|| Show jumplist + +||[c]:let[c]|| Set or list a variable + +||[c]:loadplugins[c]|| Immediately load all unloaded plugins + +||[c]:macros[c]|| List all macros + +||[c]:map[c]|| Map a key sequence + +||[c]:mapclear[c]|| Remove all mappings + +||[c]:mark[c]|| Mark current location within the web page + +||[c]:marks[c]|| Show all location marks of current web page + +||[c]:messages[c]|| Display previously given messages + +||[c]:mkvimperatorrc[c]|| Write current key mappings and changed options to the config file + +||[c]:nohlsearch[c]|| Remove the search highlighting + +||[c]:noremap[c]|| Map a key sequence without remapping keys + +||[c]:normal[c]|| Execute Normal mode commands + +||[c]:open[c]|| Open one or more URLs in the current tab + +||[c]:optionusage[c]|| List all options with a short description + +||[c]:pageinfo[c]|| Show various page information + +||[c]:pagestyle[c]|| Select the author style sheet to apply + +||[c]:play[c]|| Replay a recorded macro + +||[c]:preferences[c]|| Show Firefox preferences dialog + +||[c]:pwd[c]|| Print the current directory name + +||[c]:qmark[c]|| Mark a URL with a letter for quick access + +||[c]:qmarks[c]|| Show all QuickMarks + +||[c]:quit[c]|| Quit current tab + +||[c]:quitall[c]|| Quit undefined + +||[c]:redraw[c]|| Redraw the screen + +||[c]:reload[c]|| Reload current page + +||[c]:reloadall[c]|| Reload all tab pages + +||[c]:restart[c]|| Force undefined to restart + +||[c]:runtime[c]|| Source the specified file from each directory in 'runtimepath' + +||[c]:saveas[c]|| Save current document to disk + +||[c]:sbclose[c]|| Close the sidebar window + +||[c]:scriptnames[c]|| List all sourced script names + +||[c]:set[c]|| Set an option + +||[c]:setglobal[c]|| Set global option + +||[c]:setlocal[c]|| Set local option + +||[c]:sidebar[c]|| Open the sidebar window + +||[c]:style[c]|| Style Vimperator and web sites + +||[c]:source[c]|| Read Ex commands from a file + +||[c]:stop[c]|| Stop loading + +||[c]:tab[c]|| Execute a command and tell it to output in a new tab + +||[c]:tabdetach[c]|| Detach current tab to its own window + +||[c]:tabduplicate[c]|| Duplicate current tab + +||[c]:tablast[c]|| Switch to the last tab + +||[c]:tabmove[c]|| Move the current tab after tab N + +||[c]:tabnext[c]|| Switch to the next or [count]th tab + +||[c]:tabonly[c]|| Close all other tabs + +||[c]:tabopen[c]|| Open one or more URLs in a new tab + +||[c]:tabprevious[c]|| Switch to the previous tab or go [count] tabs back + +||[c]:tabrewind[c]|| Switch to the first tab + +||[c]:time[c]|| Profile a piece of code or run a command multiple times + +||[c]:unabbreviate[c]|| Remove an abbreviation + +||[c]:undo[c]|| Undo closing of a tab + +||[c]:undoall[c]|| Undo closing of all closed tabs + +||[c]:unlet[c]|| Delete a variable + +||[c]:unmap[c]|| Remove a mapping + +||[c]:version[c]|| Show version information + +||[c]:viewsource[c]|| View source code of current document + +||[c]:viusage[c]|| List all mappings with a short description + +||[c]:winclose[c]|| Close window + +||[c]:winopen[c]|| Open one or more URLs in a new window + +||[c]:wqall[c]|| Save the session and quit + +||[c]:zoom[c]|| Set zoom value of current web page + + +section:Options[option-index] + +||'activate'|| Define when tabs are automatically activated + +||'cdpath'|| List of directories searched when executing [c]:cd[c] + +||'complete'|| Items which are completed at the [c]:[tab]open prompt[c] + +||'defsearch'|| Set the default search engine + +||'editor'|| Set the external text editor + +||'errorbells'|| Ring the bell when an error message is displayed + +||'eventignore'|| List of autocommand event names which should be ignored + +||'exrc'|| Allow reading of an RC file in the current directory + +||'extendedhinttags'|| XPath string of hintable elements activated by [m];[m] + +||'focuscontent'|| Try to stay in Normal mode after loading a web page + +||'followhints'|| Change the behaviour of [m]<Return>[m] in Hints mode + +||'fullscreen'|| Show the current window fullscreen + +||'guioptions'|| Show or hide certain GUI elements like the menu or toolbar + +||'helpfile'|| Name of the main help file + +||'hintmatching'|| How links are matched + +||'hinttags'|| XPath string of hintable elements activated by [m]f[m] and [m]F[m] + +||'hinttimeout'|| Timeout before automatically following a non-unique numerical hint + +||'history'|| Number of Ex commands and search patterns to store in the command-line history + +||'hlsearch'|| Highlight previous search pattern matches + +||'ignorecase'|| Ignore case in search patterns + +||'incsearch'|| Show where the search pattern matches as it is typed + +||'insertmode'|| Use Insert mode as the default for text areas + +||'laststatus'|| Show the status line + +||'linksearch'|| Limit the search to hyperlink text + +||'loadplugins'|| Load plugin scripts when starting up + +||'messages'|| Number of messages to store in the message history + +||'more'|| Pause the message list window when more than one screen of listings is displayed + +||'newtab'|| Define which commands should output in a new tab by default + +||'nextpattern'|| Patterns to use when guessing the \'next' page in a document sequence + +||'online'|| Set the \'work offline' option + +||'pageinfo'|| Desired info on [c]:pa[geinfo][c] + +||'popups'|| Where to show requested popup windows + +||'preload'|| Speed up first time history/bookmark completion + +||'previouspattern'|| Patterns to use when guessing the \'previous' page in a document sequence + +||'runtimepath'|| List of directories searched for runtime files + +||'scroll'|| Number of lines to scroll with [m]<C-u>[m] and [m]<C-d>[m] commands + +||'shell'|| Shell to use for executing [c]:![c] and [c]:run[c] commands + +||'shellcmdflag'|| Flag passed to shell when executing [c]:![c] and [c]:run[c] commands + +||'showmode'|| Show the current mode in the command line + +||'showstatuslinks'|| Show the destination of the link under the cursor in the status bar + +||'showtabline'|| Control when to show the tab bar of opened web pages + +||'smartcase'|| Override the 'ignorecase' option if the pattern contains uppercase characters + +||'suggestengines'|| Engine Alias which has a feature of suggest + +||'titlestring'|| Change the title of the window + +||'urlseparator'|| Set the separator regexp used to separate multiple URL args + +||'usermode'|| Show current website with a minimal style sheet to make it easily accessible + +||'verbose'|| Define which info messages are displayed + +||'visualbell'|| Use visual bell instead of beeping on errors + +||'wildcase'|| Completion case matching mode + +||'wildignore'|| List of file patterns to ignore when completing files + +||'wildmode'|| Define how command-line completion works + +||'wildoptions'|| Change how command-line completion is done + +||'wordseparators'|| How words are split for hintmatching + + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/insert.txt b/xulmus/locale/en-US/insert.txt new file mode 100755 index 00000000..c49d440e --- /dev/null +++ b/xulmus/locale/en-US/insert.txt @@ -0,0 +1,30 @@ +HEADER + +|Insert-mode| |Insert| |mode-insert| + + +Insert mode is used to enter text in text boxes and text areas. When +'insertmode' is set, focusing on a text area immediately switches to +Insert mode. + +|i| + +||i|| +________________________________________________________________________________ +Starts Insert mode in text areas when 'insertmode' is not set. +________________________________________________________________________________ + + +section:Insert-mode{nbsp}special{nbsp}keys[ins-special-keys] + +|i_<C-i>| + +||<C-i>|| +________________________________________________________________________________ +Launch the external editor. See the 'editor' option. +________________________________________________________________________________ + +|i_<C-]>| + +||<C-]>|| +________________________________________________________________________________ +Expand an Insert-mode abbreviation. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/intro.txt b/xulmus/locale/en-US/intro.txt new file mode 100755 index 00000000..98c9a70d --- /dev/null +++ b/xulmus/locale/en-US/intro.txt @@ -0,0 +1,115 @@ +LOGO + ++++<div style="text-align: center;">+++ +*First there was a Navigator, then there was an Explorer. +Later it was time for a Konqueror. Now it's time for an Imperator, the +VIMperator :)* ++++</div>+++ + +section:Introduction[intro] + +http://vimperator.org[Vimperator] is a free browser add-on for Firefox, +which makes it look and behave like the http://www.vim.org[Vim] +text editor. It has similar key bindings, and you could call it a modal +web browser, as key bindings differ according to which mode you are in. + +|warning| + +Warning: +To provide the most authentic Vim experience, the Firefox menubar and toolbar +are hidden. + +If you really need them, type: [c]:set guioptions+=mT[c] to get them back. + +If you don't like Vimperator at all, you can uninstall it by typing +[c]:addons[c] and remove/disable it. + +If you like it but can't remember the shortcuts, then press [m]F1[m] or +[c]:help[c] to get this help window back. + +|author| |donation| + +Vimperator was written by mailto:stubenschrott@gmx.net[Martin Stubenschrott]. +If you appreciate my work on Vimperator and want to encourage me working on it +more, you can either send me greetings, patches or make a donation: + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +<!-- the PAYPAL code --> +<form style="text-align: center;" action="https://www.paypal.com/cgi-bin/webscr" method="post"><fieldset class="paypal"> +<input type="hidden" name="cmd" value="_s-xclick"/> +<input type="image" src="chrome://liberator/content/x-click-but21.gif" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!"/> +<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBDDJfc+lXLBSAM9XSWv/ebzG/L7PTqYiIXaWVg8pfinDsfYaAcifcgCTuApg4v/VaZIQ/hLODzQu2EvmjGXP0twErA/Q8G5gx0l197PJSyVXb1sLwd1mgOdLF4t0HmDCdEI9z3H6CMhsb3xVwlfpzllSfCIqzlSpx4QtdzEZGzLDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI8ZOwn5QkHgaAgZjjtPQxB7Vw2rS7Voap9y+xdVLoczUQ97hw+bOdZLcGykBtfoVjdn76MS51QKjGp1fEmxkqTuQ+Fxv8+OVtHu0QF/qlrhmC3fJBRJ0IFWxKdXS+Wod4615BDaG2X1hzvCL443ffka8XlLSiFTuW43BumQs/O+6Jqsk2hcReP3FIQOvtWMSgGTALnZx7x5c60u/3NSKW5qvyWKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDMyMTIyMzI1OFowIwYJKoZIhvcNAQkEMRYEFCirrvlwYVHQiNEEbM6ikfx9+Dm5MA0GCSqGSIb3DQEBAQUABIGAtbsR8GdCdURLziozXLSdtY+zJZUPPeQFXXy2V1S/3ldiN+pRvd4HI7xz8mOY1UaKJZpwZnOosy9MflL1/hbiEtEyQ2Dm/s4jnTcJng/NjLIZu+0NYxXRJhB+zMJubnMMMjzNrGlqI4F2HAB/bCA1eOJ5B83Of3dA4rk/T/8GoSQ=-----END PKCS7-----"/> +</fieldset></form> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Of course as a believer in free open source software, only make a donation +if you really like Vimperator and the money doesn't hurt -- otherwise just use +it, recommend it and like it :) + +section:Help{nbsp}topics[overview] + +- help:Tutorial[tutorial.html]: A quick-start tutorial for new users. +- help:Initialization[starting.html]: How Vimperator starts up, where it reads + the config file... +- help:Browsing[browsing.html]: Basic mappings and commands needed for a + browsing session (how to open a web page or go back in history). +- help:Buffer{nbsp}commands[buffer.html]: Operations on the current document + like scrolling or copying text. +- help:Command-line[cmdline.html]: Command-line editing. +- help:Insert-mode[insert.html]: Insert-mode editing. +- help:Options[options.html]: A description of all options. +- help:Search{nbsp}commands[pattern.html]: Searching for text in the + current buffer. +- help:Tabs[tabs.html]: Managing your tabbed browsing session. +- help:Hints[hints.html]: Selecting hyperlinks. +- help:Key{nbsp}mapping{nbsp}and{nbsp}abbreviations[map.html]: Defining new key + mappings, abbreviations and user commands. +- help:Expression{nbsp}evaluation[eval.html]: Executing JavaScript. +- help:Marks[marks.html]: Using bookmarks, QuickMarks, history and local marks. +- help:Repeating{nbsp}commands[repeat.html]: Using macros to repeat recurring workflows. +- help:Autocommands[autocommands.html]: Automatically executing code on certain + events. +- help:Print[print.html]: Printing pages. +- help:GUI[gui.html]: Accessing Firefox menus, dialogs and the sidebar. +- help:Styling[styling.html]: Changing the styling of content pages and Vimperator itself. +- help:Messages[message.html]: A description of messages and error messages. +- help:Developer{nbsp}information[developer.html]: How to write docs or + plugins. +- help:Various[various.html]: Other help which didn't fit into any other + category. +- help:Index[index.html]: An index of all commands and options. + +You can also jump directly to the help of a specific command with [c]:help o[c] +or [c]:help :set[c]. + +section:Features[features] + +* Vim-like keybindings ([m]h[m], [m]j[m], [m]k[m], [m]l[m], + [m]gg[m], [m]G[m], [m]0[m], [m]$[m], [m]ZZ[m], [m]<C-f>[m], etc.) +* Ex commands ([c]:quit[c], [c]:open www.foo.com[c], ...) +* Tab completion available for all commands with support for 'longest' matching when set in 'wildmode' +* Hit-a-hint like navigation of links (start with [m]f[m] to follow a link) +* Advanced completion of bookmark and history URLs (searching also in title, not only URL) +* Vim-like statusline with a wget-like progress bar +* Minimal GUI (easily hide useless menubar and toolbar with [c]:set guioptions=[c]) +* Ability to [c]:source[c] JavaScript files, and to use a [a]~/.vimperatorrc[a] file + with syntax highlighting if you install scripts/vimperator.vim +* Easy quick searches ([c]:open foo[c] will search for "foo" in google, + [c]:open ebay terminator[c] will search for "terminator" on ebay) + with support for Firefox keyword bookmarks and search engines +* Count supported for many commands ([m]3<C-o>[m] will go back 3 pages) +* Beep on errors +* Marks support ([m]ma[m] to set mark a on a web page, [m]'a[m] to go there) +* QuickMarks support (quickly go to previously marked web pages with [m]go[m][a]\\{a-zA-Z0-9\\}[a]) +* [c]:map[c] and [c]:command[c] support (and feedkeys() for script writers) +* [c]:time[c] support for profiling +* Move the text cursor and select text with Vim keys and a Visual mode +* External editor support +* Macros to replay key strokes +* AutoCommands to execute action on certain events +* A comprehensive help file, explaining all commands, mappings and options. + +section:Contact[contact] + +Please send comments/bug reports/patches to the mailing list, where I will +properly answer any questions. You can also join the #vimperator IRC channel +on irc.freenode.net or check the Wiki for frequently asked questions. Make +sure, you have read the TODO file first, as I am aware of many things which +can be improved when I find time for it or get patches. + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt new file mode 100755 index 00000000..4e9af03a --- /dev/null +++ b/xulmus/locale/en-US/map.txt @@ -0,0 +1,413 @@ +HEADER + +Key mappings, abbreviations, and user-defined commands. + +section:Key{nbsp}mapping[key-mapping,mapping,macro] + +The key mapping commands can be used to either redefine the standard key +bindings or define new ones. A mapping consists of a key, or sequence of keys, +which are translated to a string of characters. Example: + + :map <F2> :echo new Date().toDateString()<CR> + +will echo the current date to the command line when [m]<F2>[m] is pressed. + +There are separate key mapping tables for each of the Normal, Insert, and +Command-line modes. + +|:map-special-chars| + + +|<Nop>| + +||<Nop>|| +________________________________________________________________________________ +Do nothing. This command is useful for disabling a specific mapping. [c]:map +<C-n> <Nop>[c] will prevent [m]<C-n>[m] from doing anything. +________________________________________________________________________________ + + +|<CR>| |map_return| + +||<CR>|| +________________________________________________________________________________ +Expand to a line terminator in a key mapping. An Ex command in the {rhs} of a +mapping requires a line terminator after it so that it is executed when the +mapping is expanded. [m]<CR>[m] should be used for this purpose. +________________________________________________________________________________ + + +|<Leader>| |mapleader| + +||<Leader>|| +________________________________________________________________________________ +Expands to the value of the "mapleader" variable in key mapping. If +"mapleader" is unset or empty then "\" is used. Example: + +\{nbsp}[c]:map <Leader>h :echo "Hello"<CR>[c] + +works like + +\{nbsp}[c]:map \h :echo "Hello"<CR>[c] + +but after + +\{nbsp}[c]let mapleader = ","[c] + +it works like + +\{nbsp}[c]:map ,h :echo "Hello"<CR>[c] +________________________________________________________________________________ + + +|:map| +||:map {lhs} {rhs}|| + +||:map {lhs}|| + +||:map|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs}. The {rhs} is remapped, allowing for +nested and recursive mappings. + +Warning: Mappings are NOT saved between sessions, make sure you put them in your +vimperatorrc file! +________________________________________________________________________________ + + +|:cm| |:cmap| +||:cmap {lhs} {rhs}|| + +||:cmap {lhs}|| + +||:cmap|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs} (in Command-line mode). The {rhs} is +remapped, allowing for nested and recursive mappings. + +Warning: Mappings are NOT saved between sessions, make sure you put them in your +vimperatorrc file! +________________________________________________________________________________ + + +|:im| |:imap| +||:imap {lhs} {rhs}|| + +||:imap {lhs}|| + +||:imap|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs} (in Insert mode). The {rhs} is remapped, +allowing for nested and recursive mappings. + +Warning: Mappings are NOT saved between sessions, make sure you put them in your +vimperatorrc file! +________________________________________________________________________________ + + +|:mapc| |:mapclear| + +||:mapc[lear]|| +________________________________________________________________________________ +Remove all mappings. All user-defined mappings which were set by [c]:map[c] or +[c]:noremap[c] are cleared. +________________________________________________________________________________ + + +|:cmapc| |:cmapclear| + +||:cmapc[lear]|| +________________________________________________________________________________ +Remove all mappings (in Command-line mode). All user-defined mappings which +were set by [c]:cmap[c] or [c]:cnoremap[c] are cleared. +________________________________________________________________________________ + + +|:imapc| |:imapclear| + +||:imapc[lear]|| +________________________________________________________________________________ +Remove all mappings (in Insert mode). All user-defined mappings which were set +by [c]:imap[c] or [c]:inoremap[c] are cleared. +________________________________________________________________________________ + + +|:no| |:noremap| + +||:no[remap] {lhs} {rhs}|| + +||:no[remap] {lhs}|| + +||:no[remap]|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs}. No remapping of the {rhs} is performed. +________________________________________________________________________________ + + +|:cno| |:cnoremap| + +||:cno[remap] {lhs} {rhs}|| + +||:cno[remap] {lhs}|| + +||:cno[remap]|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs} (in Command-line mode). No remapping of +the {rhs} is performed. +________________________________________________________________________________ + + +|:ino| |:inoremap| + +||:ino[remap] {lhs} {rhs}|| + +||:ino[remap] {lhs}|| + +||:ino[remap]|| +________________________________________________________________________________ +Map the key sequence {lhs} to {rhs} (in Insert mode). No remapping of the +{rhs} is performed. +________________________________________________________________________________ + + +|:map-<silent>| + +________________________________________________________________________________ +When the first argument to one of the mapping commands is <silent>, +{rhs} is not echoed to the command line, nor, for that matter, anything +else until the command has completed. +________________________________________________________________________________ + + + +|:unm| |:unmap| + +||:unm[ap] {lhs}|| +________________________________________________________________________________ +Remove the mapping of {lhs}. +________________________________________________________________________________ + + +|:cunm| |:cunmap| + +||:cunm[ap] {lhs}|| +________________________________________________________________________________ +Remove the mapping of {lhs} (in Command-line mode). +________________________________________________________________________________ + + +|:iunm| |:iunmap| + +||:iunm[ap] {lhs}|| +________________________________________________________________________________ +Remove the mapping of {lhs} (in Insert mode). +________________________________________________________________________________ + +section:Abbreviations[abbreviations] + +Vimperator can automatically replace words identified as abbreviations, +which may be used to save typing or to correct commonly misspelled +words. An abbreviation can be one of three types that are defined by the +types of constituent characters. Whitespace and quotes are non-keyword +types, and all other characters are keyword types. + +1. A "full-id" abbreviation consists entirely of keyword characters +(e.g., "teh", "msoft"). + +2. An "end-id" abbreviation ends in keyword character but otherwise +contains all non-keyword characters (e.g., "'i"). + +3. A "non-id" abbreviation ends in a non-keyword character but otherwise +contains any non-whitespace character (e.g., "def'"). + +Strings that cannot be abbreviations include "a'b" and "a b". + +An abbreviation is recognized when a space, quote character, or +[m]<C-]>[m] is typed after the abbreviation. There are no default +abbreviations, and abbreviations are never recursive. + +|:ab| |:abbreviate| +||:ab[breviate] {lhs} {rhs}|| + +||:ab[breviate] {lhs}|| + +||:ab[breviate]|| +________________________________________________________________________________ +Abbreviate a key sequence. Abbreviate {lhs} to {rhs}. If only {lhs} is given, +list all abbreviations that start with {lhs}. If no arguments are given, +list all abbreviations. +________________________________________________________________________________ + + +|:ca| |:cabbrev| +||:ca[bbrev] {lhs} {rhs}|| + +||:ca[bbrev] {lhs}|| + +||:ca[bbrev]|| +________________________________________________________________________________ +Abbreviate a key sequence for Command-line mode. Same as [c]:ab[reviate][c], +but for Command-line mode only. +________________________________________________________________________________ + + +|:ia| |:iabbrev| +||:ia[bbrev] {lhs} {rhs}|| + +||:ia[bbrev] {lhs}|| + +||:ia[bbrev]|| +________________________________________________________________________________ +Abbreviate a key sequence for Insert mode. Same as [c]:ab[breviate][c] but +for Insert mode only. +________________________________________________________________________________ + + +|:una| |:unabbreviate| +||:una[bbreviate] {lhs}|| + +________________________________________________________________________________ +Remove an abbreviation. +________________________________________________________________________________ + + +|:cuna| |:cunabbrev| +||:cuna[bbrev] {lhs}|| + +________________________________________________________________________________ +Remove an abbreviation for Command-line mode. Same as [c]:una[bbreviate][c], +but for Command-line mode only. +________________________________________________________________________________ + + +|:iuna| |:iunabbrev| +||:iuna[bbrev] {lhs}|| + +________________________________________________________________________________ +Remove an abbreviation for Insert mode. Same as [c]:una[bbreviate][c] but for +Insert mode only. +________________________________________________________________________________ + + +|:abc| |:abclear| + +||:abc[lear]|| +________________________________________________________________________________ +Remove all abbreviations. +________________________________________________________________________________ + + +|:cabc| |:cabclear| + +||:cabc[lear]|| +________________________________________________________________________________ +Remove all abbreviations for Command-line mode. +________________________________________________________________________________ + + +|:iabc| |:iabclear| + +||:iabc[lear]|| +________________________________________________________________________________ +Remove all abbreviations for Insert mode. +________________________________________________________________________________ + +section:User-defined{nbsp}commands[user-commands] + +|:com| |:command| +||:com[mand]|| + +________________________________________________________________________________ +List all user-defined commands. +________________________________________________________________________________ + +||:com[mand] {cmd}|| + +________________________________________________________________________________ +List all user-defined commands that start with {cmd}. +________________________________________________________________________________ + + +||:com[mand][!] [{attr}...] {cmd} {rep}|| + +________________________________________________________________________________ +Define a new user command. The name of the command is {cmd} and its replacement +text is {rep}. The command's attributes are {attr}. If a command with this name +already exists an error is reported unless [!] is specified, in which case the +command is redefined. Unlike Vim, the command may start with a lowercase +letter. + +The command's behavior can be specified by providing attributes when the +command is defined. + +|E175| |E176| |:command-nargs| + +Argument handling + +By default user commands accept no arguments. This can be changed by specifying +the -nargs attribute. + +The valid values are: +`----------`-------------------------------------------------------------------- +*-nargs=0* No arguments are allowed (default) +*-nargs=1* One argument is allowed +*-nargs=** Zero or more arguments are allowed +*-nargs=?* Zero or one argument is allowed +*-nargs=+* One or more arguments are allowed +-------------------------------------------------------------------------------- + +|E180| |E181| |:command-complete| + +Argument completion + +Completion for arguments to user defined commands is not available by default. +Completion can be enabled by specifying one of the following arguments to the +-complete option when defining the command. +`----------------`-------------------------------------------------------------- +*altstyle* alternate author style sheets +*bookmark* bookmarks +*buffer* buffers +*color* color schemes +*command* Ex commands +*dialog* Firefox dialogs +*dir* directories +*environment* environment variables +*event* autocommand events +*file* files +*help* help tags +*highlight* highlight groups +*javascript* JavaScript expressions +*macro* named macros +*mapping* user mappings +*menu* menu items +*option* Vimperator options +*preference* Firefox preferences +*search* search engines and keywords +*shellcmd* shell commands +*sidebar* sidebar panels +*url* URLs +*usercommand* user commands +*custom,{func}* custom completion, provided by {func} +-------------------------------------------------------------------------------- + +|E467| |E468| |:command-completion-custom| + +Custom completion + +Custom completion can be provided by specifying the "custom,{func}" argument to +-complete. The {func} is called with two arguments, a completion context, and +an object describing the command's arguments. It should set the context's +\'completions' property, or return an object, with \'start' and \'items' +properties, describing the completions and where the replacement is to start. + +*start* is the index into the word being completed at which the returned values +should be applied and *completions* is a two dimensional array of the form: +[[arg1, description1], [arg2, description2], ...] + +// TODO: add examples + +|E177| |E178| |:command-count| + +Count handling + +By default user commands do not accept a count. Use the -count attribute if +you'd like to have a count passed to your user command. This will then be +available for expansion as <count> in the argument. + +|:command-bang| + +Special cases + +By default a user command does not have a special version, i.e. a version +executed with the ! modifier. Providing the -bang attribute will enable this +and <bang> will be available in the argument. + +|:command-replacement-text| + +Replacement text + +The replacement text {rep} is scanned for escape sequences and these are +replaced with values from the user-entered command line. The resulting string +is then executed as an Ex command. + +The valid escape sequences are: +`----------`-------------------------------------------------------------------- +*<args>* The command arguments exactly as supplied +*<count>* Any supplied count, e.g. 5 +*<bang>* ! if the command was executed with the ! modifier +*<lt>* A literal '<' character to allow for a literal copy of one of the escape sequences. E.g. <lt>args> will expand to a literal <args> +-------------------------------------------------------------------------------- + +"q-" can be prefixed to the escape sequence so that the value is quoted, making +it suitable for expression evaluation. Example: <q-args> +________________________________________________________________________________ + + +|:comc| |:comclear| + +||:comc[lear]|| +________________________________________________________________________________ +Delete all user-defined commands. +________________________________________________________________________________ + + +|:delc| |:delcommand| +||:delc[ommand] {cmd}|| + +________________________________________________________________________________ +Delete the user-defined command {cmd}. +________________________________________________________________________________ + +section:Examples[command-examples] + +Add a :Google command to search via google: + + :command -nargs=* Google open google <args> + +// TODO: add decent examples + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/marks.txt b/xulmus/locale/en-US/marks.txt new file mode 100755 index 00000000..837268be --- /dev/null +++ b/xulmus/locale/en-US/marks.txt @@ -0,0 +1,249 @@ +HEADER + +|different-marks| |marks| + + +Vimperator supports a number of different marks: + +- Bookmarks which allow you to mark a web page as one of your favorites for + easy access. +- QuickMarks allow you to define up to 62 (a-zA-Z0-9) web sites (or groups of + web sites) which you visit most often. +- Local marks to store the position within a web page. +- History is also a special type of marks, as Vimperator automatically + remembers sites which you have visited in the past. + +section:Bookmarks[bookmarks] + +|a| |:bma| |:bmark| +||:bma[rk][!] [a][-title=title][a] [a][-keyword=kw][a] [a][-tags=tag1,tag2][a] [a][url][a]|| + +||a|| +____________________________________________________________________________ +Add a bookmark. + + +The following options are interpreted: + +- -title="custom title" (short option: -t) +- -tags=comma,separated,tag,list (short option: -T) +- -keyword=keyword (short option: -k) + +If [!] is present, a new bookmark is always added. Otherwise, the first +bookmark matching [a][url][a] is updated. + +When creating a new bookmark, if [a][-title][a] isn't given, either the web +page's title or URL is used. You can omit the optional [a][url][a] argument, so +just do [c]:bmark[c] to bookmark the currently loaded web page with a default +title and without any tags. +____________________________________________________________________________ + + +|A| + +||A|| +________________________________________________________________________________ +Toggle bookmarked state of current URL. Add/remove a bookmark for the current +location, depending on if it is already bookmarked or not. In contrast to the +[c]:bmark[c] command, the bookmark is just _starred_ which means it is placed +in the _Unfiled Bookmarks Folder_ instead of the bookmarks menu. +________________________________________________________________________________ + + +|:bmarks| +||:bmarks[!] [a][filter][a]|| + +________________________________________________________________________________ +List or open multiple bookmarks. Open the message window at the bottom of the +screen with all bookmarks which match [a][filter][a] either in the title or +URL. + +The special version [c]:bmarks![c] works the same as [c]:bmarks[c] except it +opens all the found bookmarks in new tabs. + +Filter can also contain the following options: + +-tags=comma,separated,tag,list (short option: -T) + +-max=N (short options: -m) +________________________________________________________________________________ + + +|:delbm| |:delbmarks| +||:delbm[arks] [a][url][a]|| + +________________________________________________________________________________ +Delete a bookmark. Deletes *all* bookmarks which match the [a][url][a]. If +omitted, [a][url][a] defaults to the URL of the current buffer. Use [m]<Tab>[m] +key on a string to complete the URL which you want to delete. + +The following options WILL be interpreted in the future: + +* [!] a special version to delete ALL bookmarks +________________________________________________________________________________ + +section:History[history] + +|<C-o>| + +||[count]<C-o>|| +________________________________________________________________________________ +Go to an older position in the jump list. The jump list is just the browser +history for now. +________________________________________________________________________________ + + +|<C-i>| + +||[count]<C-i>|| +________________________________________________________________________________ +Go to a newer position in the jump list. The jump list is just the browser +history for now. +________________________________________________________________________________ + + +|<M-Left>| |<A-Left>| |H| + +||[count]H|| +________________________________________________________________________________ +Go back in the browser history. If [count] is specified go back [count] pages. +________________________________________________________________________________ + + +|<M-Right>| |<A-Right>| |L| + +||[count]L|| +________________________________________________________________________________ +Go forward in the browser history. If [count] is specified go forward [count] +pages. +________________________________________________________________________________ + + +|:ba| |:back| +||:[count]ba[ck][!] [a][url][a]|| + +________________________________________________________________________________ +Go back in the browser history. If [count] is specified go back [count] pages. + +The special version [c]:back![c] goes to the beginning of the browser history. +________________________________________________________________________________ + + +|:fw| |:fo| |:forward| +||:[count]fo[rward][!] [a][url][a]|| + +________________________________________________________________________________ +Go forward in the browser history. If [count] is specified go forward [count] +pages. + +The special version [c]:forward![c] goes to the end of the browser history. +________________________________________________________________________________ + + +|:hs| |:hist| |:history| +||:hist[ory][!] [a][filter][a]|| + +________________________________________________________________________________ +Show recently visited URLs. Open the message window at the bottom of the screen +with all history items which match [a][filter][a] either in the title or URL. + +The special version [c]:history![c] works the same as [c]:history[c] except +it opens all the found items in new tabs. + +Filter can also contain the following options: + +-max=N (short options: -m) +________________________________________________________________________________ + +section:QuickMarks[quickmarks] + +|go| + +||go[a]\\{a-zA-Z0-9\\}[a]|| +________________________________________________________________________________ +Jump to a QuickMark in the current tab. Open any QuickMark in the current tab. +You can mark any URLs with [m]M[m][a]\\{a-zA-Z0-9\\}[a]. These QuickMarks are +persistent across browser sessions. +________________________________________________________________________________ + + +|gn| + +||gn[a]\\{a-zA-Z0-9\\}[a]|| +________________________________________________________________________________ +Jump to a QuickMark in a new tab. Works like [m]go[m][a]\\{a-zA-Z0-9\\}[a] but +opens the QuickMark in a new tab. Whether the new tab is activated or not +depends on the 'activate' option. + +Mnemonic: Go in a new tab. [m]gt[m] would make more sense but is already +taken. +________________________________________________________________________________ + + +|M| + +||M[a]\\{a-zA-Z0-9\\}[a]|| +________________________________________________________________________________ +Add new QuickMark for current URL. You can go to a marked URL in the current +tab with [m]go[m][a]\\{a-zA-Z0-9\\}[a] or in a new tab with +[m]gn[m][a]\\{a-zA-Z0-9\\}[a]. These QuickMarks are persistent across browser +sessions. +________________________________________________________________________________ + + +|:delqm| |:delqmarks| +||:delqm[arks] {marks}|| + +||:delqm[arks]!|| +________________________________________________________________________________ +Delete the specified QuickMarks. QuickMarks are presented as a list. + +Examples: + +* [c]:delqmarks Aa b p[c] deletes QuickMarks A, a, b and p + +* [c]:delqmarks b-p[c] deletes all QuickMarks in the range b to p + +* [c]:delqmarks![c] deletes all QuickMarks + +________________________________________________________________________________ + + +|:qma| |:qmark| +||:qma[rk] {a-zA-Z0-9} [a][url][a]|| + +________________________________________________________________________________ +Mark a URL with a letter for quick access. You can also mark whole groups like this: + +[c]:qmark f +++http://forum1.com+++, +++http://forum2.com+++, imdb some artist[c] +________________________________________________________________________________ + + +|:qmarks| +||:qmarks [a][arg][a]|| +________________________________________________________________________________ +Show all QuickMarks. If [a][arg][a] is specified then limit the list to those +QuickMarks mentioned. +________________________________________________________________________________ + +section:Local{nbsp}marks[localmarks] + +|m| + +||m[a]\\{a-zA-Z\\}[a]|| +________________________________________________________________________________ +Set mark at the cursor position. Marks a-z are local to the buffer, whereas +A-Z are valid between buffers. +________________________________________________________________________________ + + +|\`| |\'| + +||\'[a]\\{a-zA-Z\\}[a]|| +________________________________________________________________________________ +Jump to the mark in the current buffer. Marks a-z are local to the buffer, +whereas A-Z are valid between buffers. +________________________________________________________________________________ + + +|:delm| |:delmarks| +||:delm[arks] {marks}|| + +||:delm[arks]!|| +________________________________________________________________________________ +Delete the specified marks. Marks are presented as a list. + +Examples: + +* [c]:delmarks Aa b p[c] deletes marks A, a, b and p + +* [c]:delmarks b-p[c] deletes all marks in the range b to p + +* [c]:delmarks![c] deletes all marks for the current buffer + +________________________________________________________________________________ + + +|:ma| |:mark| +||:ma[rk] {a-zA-Z}|| +________________________________________________________________________________ +Mark current location within the web page. +________________________________________________________________________________ + + +|:marks| + +||:marks [a][arg][a]|| +________________________________________________________________________________ +Show all location marks of the current web page. If [a][arg][a] is specified then +limit the list to those marks mentioned. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/message.txt b/xulmus/locale/en-US/message.txt new file mode 100755 index 00000000..99c1d723 --- /dev/null +++ b/xulmus/locale/en-US/message.txt @@ -0,0 +1,22 @@ +HEADER + +|message-history| + + +Vimperator stores all info and error messages in a message history. The type of +info messages output can be controlled by the 'verbose' option. + +|:mes| |:messages| + +||:mes[sages]|| +________________________________________________________________________________ +Display previously given messages. +________________________________________________________________________________ + + +|g<| + +||g<|| +________________________________________________________________________________ +Redisplay the last command output. Only the most recent command's output is +available. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/options.txt b/xulmus/locale/en-US/options.txt new file mode 100755 index 00000000..a16aa9f6 --- /dev/null +++ b/xulmus/locale/en-US/options.txt @@ -0,0 +1,815 @@ +HEADER + +|options| + + +Vimperator has a number of internal variables and switches which can be set to +achieve special effects. These options come in 5 forms: +`------------`----------------------------------------- +*boolean* can only be on or off +*number* has a numeric value +*string* has a string value +*charlist* like a string but with unique characters +*stringlist* a comma-separated list of strings +------------------------------------------------------- + +section:Setting{nbsp}options[set-option,E764] + +|:set| |:se| + +||:se[t]|| +____ +Show all options that differ from their default value. +____ + +||:se[t] all|| +____ +Show all options. +____ + +|E518| |E519| +||:se[t] {option}?|| +____ +Show value of {option}. +____ + +||:se[t] {option} [...]|| +____ +Toggle option: set, switch it on. + +Number option: show value. + +String option: show value. +____ + +||:se[t] no[a]{option}[a] [...]|| + +____ +Toggle option: Reset, switch it off. +____ + +||:se[t] {option}! [...]|| + +||:se[t] inv[a]{option}[a] [...]|| + +____ +Toggle option: Invert value. +____ + +||:se[t] inv[a]{option}[a]={value} [...]|| + +||:se[t] {option}!={value} [...]|| + +____ +For list options, toggle the specified values. + +If the option is a list, the given values are toggled. Given + +\{nbsp}[c]:set opt=foo,bar[c] + +then, + +\{nbsp}[c]:set opt!=foo,baz[c] + +results in + +\{nbsp}opt=bar,baz +____ + +|:set-default| +||:se[t] {option}& [...]|| +____ +Reset option to its default value. +____ + +||:se[t] all&|| +____ +Set all options to their default value. +____ + +|:set-args| |E487| |E521| +||:se[t] {option}={value} [...]|| + +____ +Set string or number option to {value}. + +For numeric options the value must be given in decimal. +The old value can be inserted by typing [m]<Tab>[m]. +____ + +|:set+=| +||:se[t] {option}+={value} [...]|| + +____ +Add the {value} to a number option, or append the {value} to a string option. +When the option is a comma separated list, a comma is added, unless the value +was empty. If the option is a list of flags, superfluous flags are removed. +When adding a flag that was already present the option value doesn't change. +____ + +|:set^=| +||:se[t] {option}^={value} [...]|| + +____ +Multiply the {value} to a number option, or prepend the {value} to a string +option. When the option is a comma separated list, a comma is added, unless the +value was empty. +____ + +|:set-=| +||:se[t] {option}-={value} [...]|| + + +____ +Subtract the {value} from a number option, or remove the {value} from a string +option, if it is there. If the {value} is not found in a string option, there +is no error or warning. When the option is a comma separated list, a comma is +deleted, unless the option becomes empty. When the option is a list of flags, +{value} must be exactly as they appear in the option. Remove flags one by one +to avoid problems. +____ + +|:setlocal| |:setl| +||:setl[ocal]|| + +||:setl[ocal] all|| + +||:setl[ocal] {option}?|| + +||:setl[ocal] {option}|| + +||:setl[ocal] no[a]{option}[a]|| + +||:setl[ocal] inv[a]{option}[a]|| + +||:setl[ocal] {option}&|| + +||:setl[ocal] all&|| + +||:setl[ocal] {option}={value}|| + +||:setl[ocal] {option}+={value}|| + +||:setl[ocal] {option}^={value}|| + +||:setl[ocal] {option}-={value}|| + + +____ +The same as [c]:set[c] command, but operates on current tab options +only. See [c]:set[c] for details. +____ + +|:setglobal| |:setg| +||:setg[lobal]|| + +||:setg[lobal] all|| + +||:setg[lobal] {option}?|| + +||:setg[lobal] {option}|| + +||:setg[lobal] no[a]{option}[a]|| + +||:setg[lobal] inv[a]{option}[a]|| + +||:setg[lobal] {option}&|| + +||:setg[lobal] all&|| + +||:setg[lobal] {option}={value}|| + +||:setg[lobal] {option}+={value}|| + +||:setg[lobal] {option}^={value}|| + +||:setg[lobal] {option}-={value}|| + + +____ +The same as [c]:set[c] command, but operates on global options only. +See [c]:set[c] for details. +____ + + +|expand-environment-var| |expand-env| |:set_env| + + +Environment variables are expanded for path options like 'cdpath' and +'runtimepath'. The variable notation is _$VAR_ (terminated by a non-word +character) or _$\\{VAR}_. _%VAR%_ is also supported on Windows. + +section:Setting{nbsp}Firefox{nbsp}options[firefox-options,preferences] + +Firefox options can be viewed and set with the following commands: + +|:prefs| |:preferences| +||:pref[erences]|| +________________________________________________________________________________ +Show the Firefox preferences dialog. You can change the browser preferences +from this dialog. Be aware that not all Firefox preferences work, because +Vimperator overrides some key bindings and changes Firefox's GUI. +________________________________________________________________________________ + +|:prefs!| |:preferences!| +||:pref[erences]!|| +________________________________________________________________________________ +Opens about:config in the current tab where you can change advanced Firefox +preferences. +________________________________________________________________________________ + +|:set!| |:set-!| +||:se[t]! {preference}={value}|| + +________________________________________________________________________________ +Change any Firefox {preference} (those in the about:config window). You can also +reset/delete those preferences with [c]:set! {preference}&[c]. +________________________________________________________________________________ + +|overridden-preferences| + + +Vimperator sets several Firefox preferences at startup. If this is undesirable, +they can be changed to a different value in your RC file using +[c]:set! {preference}={value}[c] + +The following preferences are set: + +* browser.startup.page +* dom.popup_allowed_events +* accessibility.typeaheadfind.autostart +* accessibility.typeaheadfind + +// TODO: others? + +section:List{nbsp}of{nbsp}options[list-options] + +|\'act'| |\'activate'| +||'activate' 'act'|| stringlist (default: "homepage,quickmark,tabopen,paste") +____ +Define when tabs are automatically activated. Available items: + +`-----------`-------------------------------- +*homepage* [m]gH[m] mapping +*quickmark* [m]go[m] and [m]gn[m] mappings +*tabopen* [c]:tabopen[!][c] command +*paste* [m]P[m] and [m]gP[m] mappings +--------------------------------------------- + +____ + + +|$CDPATH| +|\'cd'| |\'cdpath'| +||'cdpath' 'cd'|| string (default: equivalent to _$CDPATH_ or ",,") +____ +List of directories searched when executing the [c]:cd[c] command. This is +only used for relative paths, if an absolute path is specified then the option +is ignored. +____ + + +|\'cpt'| |\'complete'| +||'complete' 'cpt'|| charlist (default: sfl) +____ +Items which are completed at the [c]:[tab]open[c] prompt. Available items: + +`---`-------------------------------------------------------------------------------- +*s* Search engines and keyword URLs +*f* Local files +*l* Firefox location bar entries (bookmarks and history sorted in an intelligent way) +*b* Bookmarks +*S* Suggest engines +------------------------------------------------------------------------------------- + +The order is important, so [c]:set complete=bs[c] would list bookmarks first, +and then any available quick searches. +____ + + +|\'ds'| |\'defsearch'| +||'defsearch' 'ds'|| string (default: "google") +____ +Sets the default search engine. The default search engine name is used in the +[c]:[tab]open [arg][c] command if [a][arg][a] neither looks like a URL or like +a specified search engine/keyword. + +This means, it you set 'defsearch' to "youtube", then [c]:open arnold +schwarzenegger[c] will be exactly the same as [c]:open youtube arnold +schwarzenegger[c]. Therefore, you need to add a keyword or search engine +"youtube" first. + +If 'defsearch' is empty, then Firefox will always attempt to open the +raw [a][arg][a]. +____ + + +|\'editor'| |i_<C-i>| +||'editor'|| string (default: "gvim -f") +____ +Set the external text editor. +Sets the editor to run when [m]<C-i>[m] is pressed in INSERT and TEXTAREA +modes. + +Warning: Vimperator will not behave correctly if the editor forks its own +process, such as with gvim without the -f argument. +____ + +|\'noex'| |\'noexrc'| |\'ex'| |\'exrc'| +||'exrc' 'ex'|| boolean (default: off) +____ +Allow reading of an RC file in the current directory. This file is sourced in +addition to, and after, your default RC file. +____ + +|\'eht'| |\'extendedhinttags'| +||'extendedhinttags' 'eht'|| string +____ +(default: +++//*[@onclick or @onmouseover or @onmousedown or @onmouseup or +@oncommand or @class='lk' or @role='link'] | //input[not(@type='hidden')] | //a +| //area | //iframe | //textarea | //button | //select | +//xhtml:input[not(@type='hidden')] | //xhtml:a | //xhtml:area | //xhtml:iframe +| //xhtml:textarea | //xhtml:button | //xhtml:select+++) + +The XPath string of hintable elements activated by [m];[m]. +____ + + +|\'noeb'| |\'noerrorbells'| |\'eb'| |\'errorbells'| +||'errorbells' 'eb'|| boolean (default: off) +____ +Ring the bell when an error message is displayed. +____ + + +|\'ei'| |\'eventignore'| +||'eventignore'|| stringlist (default: "") +____ +A list of autocommand event names which should be ignored. If the list contains +the value "all" then all events are ignored. +____ + + +|\'nofc'| |\'nofocuscontent'| |\'fc'| |\'focuscontent'| +||'focuscontent' 'fc'|| boolean (default: off) +____ +Focus the content after a page has loaded. This is useful, if you always +want to stay in Normal mode when browsing between web sites. When "on", it +blurs any textbox which often is automatically focused on page load. +If you usually like 'focuscontent' but sometimes you'd like to focus the +first input field, you can use [m]gi[m] to jump to it. +____ + + +|\'nofs'| |\'nofullscreen'| |\'fs'| |\'fullscreen'| +||'fullscreen' 'fs'|| boolean (default: off) +____ +Show the current window fullscreen. Also hide certain GUI elements like the +statusline. +____ + + +|\'go'| |\'guioptions'| +||'guioptions' 'go'|| charlist (default: "") +____ +Show or hide certain GUI elements like the menu or toolbar. Supported characters: + +`---`----------- +*m* Menubar +*T* Toolbar +*B* Bookmark bar +*n* Tab number +*N* Tab number over image +*b* Bottom scrollbar +*r* Right scrollbar +*l* Left scrollbar +---------------- + +You can also hide the tab bar with [c]:set showtabline=0[c]. +____ + + +|\'hf'| |\'helpfile'| +||'helpfile' 'hf'|| string (default: "intro.html") +____ +Name of the main help file. This is the tail component of the chrome URL as +displayed in the status line when viewing the page. +____ + + +|\'hm'| |\'hintmatching'| +||'hintmatching' 'hm'|| string (default: contains) +____ + +Change the hint matching algorithm during Hints mode. Possible values: + +`--------------------`------------------------------------------------------------------------------------------------------------------------------- +*contains* The typed characters are split on whitespace, and these character groups have to match anywhere inside the text of the link. +*wordstartswith* The typed characters are matched with the beginning of the first word (see 'wordseparators') in the link as long as possible. If no matches occur in the current word, then the matching is continued at the beginning of the next word. The words are worked through in the order they appear in the link. If the typed characters contain spaces, then the characters are split on whitespace. These character groups are then matched with the beginning of the words, beginning at the first one and continuing with the following words in the order they appear in the link. +*firstletters* Behaves like wordstartswith, but non-matching words aren't overleaped. +*custom* Delegate to a custom function: liberator.plugins.customHintMatcher(hintString) +----------------------------------------------------------------------------------------------------------------------------------------------------- + +____ + + +|\'fh'| |\'followhints'| +||'followhints' 'fh'|| number (default: 0) +____ + +Change the behaviour of [m]<Return>[m] in Hints mode. Possible values: + +`---------`---------------------------------------------------------- +*0* Follow the first hint as soon as typed text uniquely identifies it. + Follow the selected hint on [m]<Return>[m]. +*1* Follow the selected hint on [m]<Return>[m]. +*2* Follow the selected hint on [m]<Return>[m] only if it's been [m]<Tab>[m]-selected. +--------------------------------------------------------------------- + +____ + + +|\'ht'| |\'hinttags'| +||'hinttags' 'ht'|| string +____ +(default: +++//*[@onclick or @onmouseover or @onmousedown or @onmouseup or +@oncommand or @class='lk' or @role='link'] | //input[not(@type='hidden')] | //a +| //area | //iframe | //textarea | //button | //select | +//xhtml:input[not(@type='hidden')] | //xhtml:a | //xhtml:area | //xhtml:iframe +| //xhtml:textarea | //xhtml:button | //xhtml:select+++) + +XPath string of hintable elements activated by [m]f[m] and [m]F[m] +____ + + +|\'hto'| |\'hinttimeout'| +||'hinttimeout' 'hto'|| number (default: 0) +____ +Timeout before automatically following a non-unique numerical hint. Set to 0 +(the default) to only follow numeric hints after pressing [m]<Return>[m] or +when the hint is unique. +____ + + +|\'hi'| |\'history'| +||'history' 'hi'|| number (default: 500) +____ +Number of Ex commands and search patterns to store in the command-line history. +____ + + +|\'nohls'| |\'nohlsearch'| |\'hls'| |\'hlsearch'| +||'hlsearch' 'hls'|| boolean (default: off) +____ +Highlight previous search pattern matches +____ + + +|\'noic'| |\'noignorecase'| |\'ic'| |\'ignorecase'| +||'ignorecase' 'ic'|| boolean (default: on) +____ +Ignore case in search patterns. +____ + + +|\'nois'| |\'noincsearch'| |\'is'| |\'incsearch'| +||'incsearch' 'is'|| boolean (default: on) +____ +Show where the search pattern matches as it is typed. + +Note: Incremental searching currently only works in the forward direction. +____ + + +|\'noim'| |\'noinsertmode'| |\'im'| |\'insertmode'| +||'insertmode' 'im'|| boolean (default: on) +____ +Use Insert mode as the default for text areas. +Makes Vimperator work in a way that Insert mode is the default mode for text areas. +Useful if you want to use Vimperator as a modeless editor, keeping the known Firefox interface for editing text areas. +____ + + +|\'ls'| |\'laststatus'| +||'laststatus' 'ls'|| number (default: 2) +____ +Determines when the last window will have a status line. Possible values: + +`---`--------------------------------- +*0* Never +*1* Only if there are multiple windows +*2* Always +-------------------------------------- + +Note: laststatus=1 not implemented yet. +____ + + +|\'nolks'| |\'nolinksearch'| |\'lks'| |\'linksearch'| +||'linksearch' 'lks'|| boolean (default: off) +____ +Limit the search to hyperlink text. +This includes (X)HTML elements with an "href" atrribute and XLink "simple" links. +____ + + +|\'nolpl'| |\'lpl'| |\'noloadplugins'| |\'loadplugins'| +||'loadplugins' 'lpl'|| boolean (default on) +____ +Load plugin scripts when starting up. When on, yet unloaded plugins are +automatically loaded after the vimperatorrc file has been sourced. To +load plugins earlier, use the [c]:loadplugins[c] command within the +vimperatorrc. +____ + + +|\'msgs'| |\'messages'| +||'messages' 'msgs'|| number (default: 100) +____ +Number of messages to store in the message history. +____ + + +|\'nomore'| |\'more'| +||'more'|| boolean (default: on) +____ +Pause the message list window when more than one screen of listings is displayed +____ + + +|\'nextpattern'| +||'nextpattern'|| stringlist +____ +(default: \bnext,^>$,^(>>|»)$,^(>|»),(>|»)$,\bmore\b) + +Patterns to use when guessing the \'next' page in a document sequence. Each +pattern, in order, is matched against all links in the page with the first +match being used. The patterns are case insensitive regular expressions and the +link elements are those defined by 'hinttags'. +____ + + +|\'newtab'| +||'newtab'|| stringlist (default: "") +____ +Define which Ex commands output the result in a new tab automatically. You can +also use [c]:tab command[c] to manually output a command in a new tab. + +The possible values: +`------------`--------------------------------------------- +*all* All commands +*addons* [c]:addo[ns][c] command +*downloads* [c]:downl[oads][c] command +*help* [c]:h[elp][c] command +*javascript* [c]:javascript![c] or [c]:js![c] command +*prefs* [c]:pref[erences]![c] or [c]:prefs![c] command +----------------------------------------------------------- + +____ + + +|\'noonline'| |\'online'| +||'online'|| boolean (default on) +____ +Show and set the \'work offline' behavior. +____ + + +|\'pageinfo' \'pa'| +||'pageinfo' 'pa'|| +charlist (default: gfm) +____ +Desired info on [c]:pa[geinfo][c]. Available items: + +.--------`---------------- +*g* General info +*f* Feeds +*m* Meta tags +-------------------------- + +The order matters. +____ + + +|\'pps'| |\'popups'| +||'popups' 'pps'|| number (default: 1) +____ +Define where to show requested popup windows. +Does not apply to windows which are opened by middle clicking a link, +they always open in a new tab. Possible values: + +.---`------------------------------------------------------------------------------------------------ +*0* Force to open in the current tab (Warning: this can stop some web sites from working correctly!) +*1* Always open in a new tab +*2* Open in a new window if it has a specific requested size (default in Firefox) +*3* Always open in a new window +*4* Open in the same tab unless it has a specific requested size +----------------------------------------------------------------------------------------------------- + +Note: This option does not change the popup blocker of Firefox in any way. +____ + + +|\'nopreload'| |\'preload'| +||'preload' 'nopreload'|| boolean (default: on) +____ +Speed up first time history/bookmark completion + +History access can be quite slow for a large history. +Vimperator maintains a cache to speed it up significantly on subsequent access. +In order to also speed up first time access, it is cached at startup, if this option is set (recommended). +____ + + +|\'previouspattern'| +||'previouspattern'|| stringlist +____ +(default: \bprev|previous\b,^<$,^(<<|«)$,^(<|«),(<|«)$) + +Patterns to use when guessing the \'previous' page in a document sequence. Each +pattern, in order, is matched against all links in the page with the first +match being used. The patterns are case insensitive regular expressions and the +link elements are those defined by 'hinttags'. +____ + + +|$VIMPERATOR_RUNTIME| +|\'rtp'| |\'runtimepath'| +||'runtimepath' 'rtp'|| stringlist +____ +(default: _$VIMPERATOR_RUNTIME_ or Unix, Mac: "\~/.vimperator", Windows: "\~/vimperator") + +List of directories searched for runtime files: + +colors/ + +macros/ + +plugin/ + + +Example: [c]:set runtimepath=\~/myvimperator,\~/.vimperator[c] + +This will search for plugins in both "\~/myvimperator/plugin" and +"\~/.vimperator/plugin" + +On startup, if the environment variable _$VIMPERATOR_RUNTIME_ does not +exist, Vimperator will set it to match this value. +____ + + +|\'scr'| |\'scroll'| +||'scroll' 'scr'|| number (default: 0) +____ +Number of lines to scroll with [m]<C-u>[m] and [m]<C-d>[m] commands. +The number of lines scrolled defaults to half the window size. +When a [count] is specified to the [m]<C-u>[m] or [m]<C-d>[m] commands this is +used to set the value of 'scroll' and also used for the current command. The +value can be reset to half the window height with [c]:set scroll=0[c]. +____ + + +|\'shell'| |\'sh'| +||'shell' 'sh'|| string (default: _$SHELL_ or "sh", Win32: "cmd.exe") +____ +Shell to use for executing [c]:![c] and [c]:run[c] commands. +____ + + +|\'shellcmdflag'| |\'shcf'| +||'shellcmdflag' 'shcf'|| string (default: "-c", Win32: "/c") +____ +Flag passed to shell when executing [c]:![c] and [c]:run[c] commands. + +E.g. "bash -c gvim" +____ + + +|\'nosmd'| |\'noshowmode'| |\'smd'| |\'showmode'| +||'showmode' 'smd'|| boolean (default: on) +____ +Show the current mode in the command line. +____ + + +|\'ssli'| |\'showstatuslinks'| +||'showstatuslinks' 'ssli'|| number (default: 1) +____ +Show the destination of the link under the cursor in the status bar. +Also links which are focused by keyboard commands like [m]<Tab>[m] are shown. Possible values: + +.---`-------------------------------------- +*0* Don't show link destination +*1* Show the link in the status line +*2* Show the link in the command line +------------------------------------------- + +____ + + +|\'stal'| |\'showtabline'| +||'showtabline' 'stal'|| number (default: 2) +____ +Control when to show the tab bar of opened web pages. Possible values: + +.---`-------------------------------------- +*0* Never show tab bar +*1* Show tab bar only if more than one tab is open +*2* Always show tab bar +------------------------------------------- + +____ + + +|\'noscs'| |\'nosmartcase'| |\'scs'| |\'smartcase'| +||'smartcase' 'scs'|| boolean (default: on) +____ +Override the 'ignorecase' option if the pattern contains uppercase characters. +This is only used if the 'ignorecase' option is set. +____ + + +|\'suggestengines'| +||'suggestengines' || stringlist (default: "google") +____ +Set the search engines which can be used for completion suggestions. +Add "S" to the 'complete' option if you want to use this feature. + +Warning: This feature could make tab-completion slower because it needs to +wait for changes, so use it only if you have a fast internet connection. +____ + + +|\'titlestring'| +||'titlestring'|| string (default: "Vimperator") +____ +Change the title of the browser window. +Vimperator changes the browser title from "Title of web page - Mozilla Firefox" to +"Title of web page - Vimperator". + +If you don't like that, you can restore it with: +[c]:set titlestring=Mozilla\ Firefox[c]. +____ + + +|\'noum'| |\'nousermode'| |\'um'| |\'usermode'| +||'usermode' 'um'|| boolean (default: off) +____ +Show current website with a minimal style sheet to make it easily accessible. + +Note: this is a local option for now, a global value may be supported in the +future. +____ + + +|\'urlseparator'| +||'urlseparator'|| string (default: ",\s") +____ +Set the separator regexp used to separate multiple URL args. Multiple arguments +can be specified for [c]:open[c], and similar commands, using this regexp as +the separator. Using whitespace alone is not generally useful since it is often +contained in a single argument. E.g. [c]:open linus torvalds[c] should perform +a single search for the key words "linus" and "torvalds" +____ + + +|\'verbose', \'vbs'| +||'verbose' 'vbs'|| number (default: 1) +____ +Define which info messages are displayed. +When bigger than zero, Vimperator will give messages about what it is doing. +These can be viewed at any time with the [c]:messages[c] command. The highest +value is 15, being the most verbose mode. + +TODO: list levels and associated messages +____ + + +|\'novb'| |\'novisualbell'| |\'vb'| |\'visualbell'| +||'visualbell' 'vb'|| boolean (default: off) +____ +Use visual bell instead of beeping on errors. The visual bell style is +controlled by [c]:hi Bell[c]. +____ + + +|\'wildcase'| |\'wic'| +||'wildcase' 'wic'|| string (default: "smart") +____ +Defines how completions are matched with regard to character case. + +`---------------`------------------------ +"smart" Case is significant when capital letters are typed +"match" Case is always significant +"ignore" Case is never significant +----------------------------------------- + +____ + + +|\'wildignore'| |\'wig'| +||'wildignore' 'wig'|| stringlist (default: "") +____ +List of file patterns to ignore when completing files. E.g. to ignore object +files and Vim swap files [c]:set wildignore=".*\.o,\..*\.s[a-z]\\{2}"[c] + +Note: Unlike Vim each pattern is a regexp rather than a glob. +____ + + +|\'wim'| |\'wildmode'| +||'wildmode' 'wim'|| stringlist (default: "list:full") +____ +Defines how command-line completion works. +It is a comma-separated list of parts, where each part specifies +what to do for each consecutive use of the completion key. +The first part specifies the behavior for the first use of the completion key, +the second part for the second use, etc. + +These are the possible values for each part: +`---------------`------------------------ +"" Complete only the first match. +"full" Complete the next full match. After the last, the original string is used. +"longest" Complete till the longest common string. +"list" When more than one match, list all matches. +"list:full" When more than one match, list all matches and complete the first match. +"list:longest" When more than one match, list all matches and complete till the longest common string. \ + When there is only a single match, it is fully completed regardless of the case. +----------------------------------------- + +____ + + +|\'wop'| |\'wildoptions'| +||'wildoptions' 'wop'|| stringlist (default: "") +____ +A list of words that change how command-line completion is done. + +Possible words: +`--------`------------------------------- +*auto* Automatically show completions while you are typing. +*sort* Always sort the completion list, overriding the 'complete' option. +----------------------------------------- + +____ + + +|\'wsp'| |\'wordseparators'| + +||'wordseparators' 'wsp'|| string +____ +(default: [\.,!\?:;/\\"\^\$%&?\(\)\[\]\\{\\}<>#\\*\+\\|=~ _\\-]) + +A regexp which defines the word separators which are used for the +'hintmatching' types "wordstartswith" and "firstletters" to split the words in +the text of a link. +____ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/overlay.dtd b/xulmus/locale/en-US/overlay.dtd new file mode 100755 index 00000000..9005d9c4 --- /dev/null +++ b/xulmus/locale/en-US/overlay.dtd @@ -0,0 +1,4 @@ +<!ENTITY auditortest1.helloworld.label "Do HelloWorld"> +<!ENTITY auditortest1.helloworld.accesskey "H"> +<!ENTITY auditortest1.pane.label "This is a Display Pane"> +<!ENTITY auditortest1.pane.button "Learn More"> \ No newline at end of file diff --git a/xulmus/locale/en-US/overlay.properties b/xulmus/locale/en-US/overlay.properties new file mode 100755 index 00000000..82aef91d --- /dev/null +++ b/xulmus/locale/en-US/overlay.properties @@ -0,0 +1 @@ +helloMessage=Hello World! diff --git a/xulmus/locale/en-US/pattern.txt b/xulmus/locale/en-US/pattern.txt new file mode 100755 index 00000000..6462a897 --- /dev/null +++ b/xulmus/locale/en-US/pattern.txt @@ -0,0 +1,70 @@ +HEADER + +|text-search-commands| + + +Vimperator provides a Vim-like interface to Firefox's standard text search +functionality. There is no support for using regular expressions in search +commands as Firefox does not provide native regexp support. It is unlikely that +this will ever be available. + +|/| + +||/{pattern}[/]<CR>|| + +________________________________________________________________________________ +Search forward for the first occurrence of {pattern}. + +If "\c" appears anywhere in the pattern the whole pattern is handled as though +'ignorecase' is on. "\C" forces case-sensitive matching for the whole pattern. + +If "\l" appears in the pattern only the text of links is searched for a +match as though 'linksearch' is on. "\L" forces the entire page to be searched +for a match. +________________________________________________________________________________ + + +|?| + +||?{pattern}[?]<CR>|| + +________________________________________________________________________________ +Search backwards for {pattern}. + +{pattern} can use the same modifiers as for [m]/[m]. + + +Note: incremental searching currently only works in the forward direction. +________________________________________________________________________________ + + +|n| + +||n|| +________________________________________________________________________________ +Find next. Repeat the last search 1 time (until count is supported). +________________________________________________________________________________ + + +|N| + +||N|| +________________________________________________________________________________ +Find previous. Repeat the last search 1 time (until count is supported) in the +opposite direction. +________________________________________________________________________________ + + +|\*| + +||\*|| +________________________________________________________________________________ +Search forward for the next word under the cursor. +________________________________________________________________________________ + + +|\#| + +||\#|| +________________________________________________________________________________ +Search backward for the previous word under the cursor. +________________________________________________________________________________ + + +|:noh| |:nohlsearch| + +||:noh[lsearch]|| +________________________________________________________________________________ +Remove the search highlighting. The document highlighting is turned back on +when another search command is used or the 'hlsearch' option is set. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/print.txt b/xulmus/locale/en-US/print.txt new file mode 100755 index 00000000..8cf3d180 --- /dev/null +++ b/xulmus/locale/en-US/print.txt @@ -0,0 +1,34 @@ +HEADER + +|printing| + + +|:ha| |:hardcopy| + +||:ha[rdcopy][!]|| +________________________________________________________________________________ +Print current document. Open a GUI dialog where you can select the printer, +number of copies, orientation, etc. When used with [!], the dialog is skipped +and the default printer used. +________________________________________________________________________________ + + +||:ha[rdcopy][!] >{filename}|| + +________________________________________________________________________________ +As above, but write the output to {filename}. + +Note: Not available on Windows. +________________________________________________________________________________ + +section:Firefox{nbsp}printing{nbsp}dialogs[firefox-print-dialogs] + +The "Print Preview" and "Page Setup" dialogs can be opened via the [c]:dialog[c] +command + +\{nbsp}[c]:dialog printpreview[c] + +and + +\{nbsp}[c]:dialog printsetup[c] + +respectively. + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/repeat.txt b/xulmus/locale/en-US/repeat.txt new file mode 100755 index 00000000..2817c980 --- /dev/null +++ b/xulmus/locale/en-US/repeat.txt @@ -0,0 +1,145 @@ +HEADER + +|repeat| + + +Vimperator can repeat a number of commands and record macros. + +section:Macros[macros,complex-repeat] + +|q| +||q{0-9a-zA-Z}|| + +____________________________________________________________________________ +Record a key sequence into a macro. +Available macros are {0-9a-zA-Z} (uppercase to append). +Type [m]q[m] to stop recording. +____________________________________________________________________________ + + +|:macros| +||:mac[ros] [a][pat][a]|| + +________________________________________________________________________________ +List recorded macros matching the optional regular expression [a][pat][a]. If +no regexp is given, list all macros. +________________________________________________________________________________ + + +|:delmac| |:delmacros| +||:delmac[ros] {args}|| + +||:delmac[ros]!|| +________________________________________________________________________________ +Delete recorded macros matching the regular expression {args}. If [!] is given +all macros are deleted. +________________________________________________________________________________ + + +|@| |:play| +||:pl[ay] {arg}|| + +||[count]@{arg}|| +____________________________________________________________________________ +Plays the contents of macro with name {arg} [count] times. The [m]@[m] mapping +only accepts {0-9a-z} as {arg}. +____________________________________________________________________________ + + +|@@| +||[count]@@|| +____________________________________________________________________________ +Replay the last executed macro [count] times. +____________________________________________________________________________ + + +|.| +||[count].|| +____________________________________________________________________________ +Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this +does not apply solely to editing commands, mainly because Vimperator doesn't +have them. +____________________________________________________________________________ + + +section:Using{nbsp}scripts[using-scripts] + +|:so| |:source| +||:so[urce][!] {file}|| + +________________________________________________________________________________ +Read Ex commands, JavaScript, or CSS from {file}. You can either source files +which mostly contain Ex commands like [c]map < gt[c] and put JavaScript code +within a: + +-------------------------------------------------------------------------------- +js <<EOF +hello = function () { + alert("Hello world"); +} +EOF +-------------------------------------------------------------------------------- +Or you can alternatively source a file which ends in _.js_. These files are +automatically sourced as pure JavaScript files. + +Note: In both cases you must add functions to the global window object like +shown above, functions written as: +-------------------------------------------------------------------------------- +function hello2() { + alert("Hello world"); +} +-------------------------------------------------------------------------------- +are only available within the scope of the script. + +The _.vimperatorrc_ file in your home directory and any files in +_\~/.vimperator/plugin/_ are always sourced at startup. \~ is supported as a +shortcut for the _$HOME_ directory. If [!] is specified, errors are not +printed. +________________________________________________________________________________ + + +|:lpl| |:loadplugins| +||:loadplugins|| + +________________________________________________________________________________ +Load all unloaded plugins immediately. Because plugins are automatically +loaded after vimperatorrc is sourced, this command must be placed early +in the vimperatorrc file if vimperatorrc also includes commands that are +implemented by plugins. Additionally, this command allows for sourcing +new plugins without restarting Vimperator. +________________________________________________________________________________ + + +|:ru| |:runtime| +||:runt[ime][!] {file} ...|| + +________________________________________________________________________________ +Source the specified file from each directory in 'runtimepath'. Example: + +[c]:runtime plugin/foobar.vimp[c] + +Only the first found file is sourced. When [!] is given, all found files are +sourced. +________________________________________________________________________________ + + +|:scrip| |:scriptnames| +||:scrip[tnames]|| + +________________________________________________________________________________ +List all sourced script names, in the order they were first sourced. +________________________________________________________________________________ + + +|:fini| |:finish| +||:fini[sh]|| + +________________________________________________________________________________ +Stop sourcing a script file. This can only be called from within a Vimperator +script file. +________________________________________________________________________________ + +section:Profiling[profile,profiling] + +|:time| +||:[count]time[!] {code|:command}|| + +________________________________________________________________________________ +Profile a piece of code or a command. Run {code} [count] times (default 1) +and returns the elapsed time. {code} is always passed to JavaScript's eval(), +which might be slow, so take the results with a grain of salt. + +If {code} starts with a [c]:[c], it is executed as a Vimperator command. + +Use the special version with [!] if you just want to run any command multiple +times without showing profiling statistics. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/starting.txt b/xulmus/locale/en-US/starting.txt new file mode 100755 index 00000000..df384fd0 --- /dev/null +++ b/xulmus/locale/en-US/starting.txt @@ -0,0 +1,60 @@ +HEADER + +Vimperator does not yet read any command-line options. When it does, they will +be documented here. + +section:Initialization[initialization,startup] + +At startup, Vimperator completes the following tasks in order. + +1. Vimperator can perform user initialization commands. When +one of the following is successfully located, it is executed, and no +further locations are tried. + + a. |$VIMPERATOR_INIT| + _$VIMPERATOR_INIT_ -- May contain a single Ex command (e.g., + "[c]:source {file}[c]"). + b. [a]\~/_vimperatorrc[a] -- Windows only. If this file exists, its contents + are executed. + c. [a]\~/.vimperatorrc[a] -- If this file exists, its contents are executed. + +2. If 'exrc' is set, then any RC file in the current directory is also sourced. + +3. All directories in 'runtimepath' are searched for a "plugin" +subdirectory and all yet unloaded plugins are loaded. For each plugin +directory, all *.\{js,vimp} files (including those in further +subdirectories) are sourced alphabetically. No plugins will be sourced +if 'noloadplugins' is set. Any particular plugin will not be loaded if +it has already been loaded (e.g., by an earlier [c]:loadplugins[c] +command). + +The user's ~ (i.e., "home") directory is determined as follows: + +* On Unix and Mac, the environment variable _$HOME_ is used. +* On Windows, Vimperator checks for the existence of _%HOME%_, then +_%USERPROFILE%_, and then _%HOMEDRIVE%%HOMEPATH%_. It uses the first one +it finds. + +section:Saving{nbsp}settings[save-settings] + +|:mkv| |:mkvimperatorrc| +||:mkv[imperatorrc][!] [a][file][a]|| + +________________________________________________________________________________ +Write current key mappings and changed options to [a][file][a]. If no +[a][file][a] is specified then _~/.vimperatorrc_ is written unless this file +already exists. The special version [c]:mkvimperatorrc![c] will overwrite +[a][file][a] if it exists. + +Warning: this differs from Vim's behavior which defaults to writing the file +in the current directory. +________________________________________________________________________________ + +section:Restarting[restarting] + +|:res| |:restart| + +||:res[tart]|| +________________________________________________________________________________ +Force the browser to restart. Useful when installing extensions. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/styling.txt b/xulmus/locale/en-US/styling.txt new file mode 100755 index 00000000..a4ba91a2 --- /dev/null +++ b/xulmus/locale/en-US/styling.txt @@ -0,0 +1,131 @@ +HEADER + +|styling| + + +Vimperator allows you to style both the browser and any web pages you view. All +styling is specified via CSS. Although you may style any user interface element +via the [c]:style[c] command, most Vimperator elements can be styled with the +[c]:highlight[c] command, for convenience. + +|E185| |:colo| |:colorscheme| + +||:colo[rscheme] {name}|| + +________________________________________________________________________________ +Load a color scheme. {name} is found by searching the 'runtimepath' for the +first file matching colors/{name}.vimp. + +The ColorScheme autocommand is triggered after the color scheme has been +sourced. +________________________________________________________________________________ + +|:hi| |:highlight| + +||:hi[ghlight][!] [-append] {group}[{selector}] [{css}]|| + +________________________________________________________________________________ +Highlight {group} with {css}. Normally, {css} is checked for +valid syntax before it's applied. Once you're certain it's +valid, [!] will override the check, to speed Vimperator startup. +{selector} can be any valid CSS selector, such as [c]:hover[c], and +if provided will restrict the match to matching elements. + +Valid groups are: +`--------------------`----------------------------------- +*Bell* Vimperator's visual bell +*Boolean* A JavaScript Boolean object +*CmdLine* The command line +*CmdOutput* +*CompDesc* The description column of the completion list +*CompGroup* +*CompIcon* The favicon of a completion row +*CompItem* A row of completion list +*CompItem[selected]* A selected row of completion list +*CompLess* The indicator shown when completions may be scrolled up +*CompLess::after* The character of indicator shown when completions may be scrolled up +*CompMore* The indicator shown when completions may be scrolled down +*CompMore::after* The character of indicator shown when completions may be scrolled down +*CompMsg* +*CompResult* The result column of the completion list +*CompTitle* Completion row titles +*ErrorMsg* Error messages +*Filter* The matching text in a completion list +*FrameIndicator* The indicator shown when a new frame is selected +*Function* A JavaScript Function object +*Gradient* +*GradientLeft* +*GradientRight* +*Hint* A hint indicator. See [c]:help hints[c] +*HintActive* The hint element of link which will be followed by <Enter> +*HintElem* The hintable element +*HintImage* The indicator which floats above hinted images +*Indicator* +*InfoMsg* Information messages +*Keyword* A bookmark keyword for a URL +*LineNr* The line number of an error +*Message* +*ModeMsg* The mode indicator in the command line +*MoreMsg* The indicator that there is more text to view +*NonText* +*Normal* Normal text in the command line +*Null* A JavaScript Null object +*Number* A JavaScript Number object +*Object* A JavaScript Object +*Preview* +*Question* A prompt for a decision +*Search* Highlighted search results in a web page +*StatusLine* The status bar +*StatusLineBroken* The status bar for a broken web page +*StatusLineSecure* The status bar for a secure web page +*String* A JavaScript String object +*TabClose* The close button of a browser tab +*TabIcon* The icon of a browser tab +*TabIconNumber* The number of a browser tab, over its icon +*TabNumber* The number of a browser tab, next to its icon +*TabText* The text of a browser tab +*Tag* A bookmark tag for a URL +*Title* The title of a listing, including [c]:pageinfo[c], [c]:jumps[c] +*URL* A URL +*WarningMsg* A warning message +------------------------------------------------------- + +Every invocation completely replaces the styling of any previous invocation, +unless *-append* (short option: *-a*) is provided, in which case {css} is +appended to its current value. If {css} is not provided, any styles matching +{group} are listed. +________________________________________________________________________________ + +|:highlight-clear| + +||:hi[light] clear [{group}[{selector}]]|| + +________________________________________________________________________________ +Reset the highlighting for {group} to its default value. If +{group} is not given, reset all highlighting groups. +________________________________________________________________________________ + + +|:sty| |:style| + +||:sty[le][!] [-name={name}] [-append] {filter} [{css}]|| + +________________________________________________________________________________ +Add CSS styles to the browser or to web pages. {filter} is a comma +separated list of URLs to match. URLs ending with *\** are matched as +prefixes, URLs not containing any *:* or */* characters are +matched as domains. If {name} (short option: [c]-n[c]) is provided, any +existing style with the same name is overridden, and the style may later +be deleted using {name}. If *-append* (short option: *-a*) is provided +along with *-name*, {css} and {filter} are appended to its current +value. + +If {css} isn't provided, matching styles are listed. +________________________________________________________________________________ + +|:dels| |:delstyle| + +||:dels[tyle] [-name={name}] [-index={index}] [{filter}] [{css}]|| + +________________________________________________________________________________ +Delete any matching styles. If {filter} is provided, only matching elements of +the filter are disabled. For instance, a filter [c]mozilla.org[c], given a +style for [c]www.google.com,mozilla.org[c], will result in a style for +[c]www.google.com[c]. The available options are: + + * [c]-name[c]: The name provided to [c]:style[c] (short option: + *-n*) + * [c]-index[c]: For unnamed styles, the index listed by [c]:style[c] + (short option: *-i*) +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/tabs.txt b/xulmus/locale/en-US/tabs.txt new file mode 100755 index 00000000..9ccded72 --- /dev/null +++ b/xulmus/locale/en-US/tabs.txt @@ -0,0 +1,218 @@ +HEADER + +|tabs| + + +Tabs are used to be able to view many web pages at the same time. Each tab +contains exactly one buffer -- multiple buffers per tab are not supported. As a +result many buffer and tab commands are interchangeable. + +section:Listing{nbsp}tabs[listing-tabs] + +|B| |:tabs| |:ls| |:files| |:buffers| +||:buffers [a][filter][a]|| + +||B|| +________________________________________________________________________________ +Show a list of buffers (=tabs) matching [a][filter][a]. Without [a][filter][a] +list all tabs. +________________________________________________________________________________ + +section:Opening{nbsp}tabs[opening-tabs] + +|:tab| + +||:tab {cmd}|| +________________________________________________________________________________ +Execute {cmd} and tell it to output in a new tab. Works only for commands that +support it, currently: + +* [c]:tab help[c] +* [c]:tab prefs[!][c] +* [c]:tab addons[c] +* [c]:tab downloads[c] +________________________________________________________________________________ + + +|:tabd| |:tabduplicate| +||:[count]tab[duplicate]|| + +________________________________________________________________________________ +Duplicate the current tab and switch to the duplicate. If [count] is given, +duplicate the tab [count] times. +________________________________________________________________________________ + +//TODO: should the tab commands be moved back here? +See help::open[browsing.html#opening] for other ways to open new tabs. + +section:Changing{nbsp}tabs[changing-tabs] + +|gb| + +||[count]gb|| +________________________________________________________________________________ +Repeat last [c]:buffer[!][c] command. This is useful to quickly jump between +buffers which have a similar URL or title. +________________________________________________________________________________ + + +|gB| + +||[count]gB|| +________________________________________________________________________________ +Repeat last [c]:buffer[!][c] command in reverse direction. Just like [m]gb[m] +but in the other direction. +________________________________________________________________________________ + + +|gt| + +||[count]gt|| +________________________________________________________________________________ +Go to the next tab. Cycles to the first tab, when the last is selected. + +If [count] is specified go to the [count]th tab. +________________________________________________________________________________ + +|<C-PageDown>| |<C-Tab>| |<C-n>| + +||[count]<C-n>|| +________________________________________________________________________________ +Go to the next tab. Cycles to the first tab, when the last is selected. + +If [count] is specified go to the [count]th next tab. +________________________________________________________________________________ + +|<C-PageUp>| |<C-S-Tab>| |<C-p>| |gT| + +||[count]gT|| +________________________________________________________________________________ +Go {count} pages back. Wraps around from the first tab to the last tab. + +If [count] is specified go back [count] tabs. +________________________________________________________________________________ + + +|<C-6>| |<C-^>| + +||[count]<C-^>|| +________________________________________________________________________________ +Select the alternate tab or the [count]th tab. The alternate tab is the last +selected tab. This provides a quick method of toggling between two tabs. +________________________________________________________________________________ + + +|b| |:b| |:buffer| +||:[count]b[uffer][!] [a][url|index][a]|| + +||[count]b|| +________________________________________________________________________________ +Go to the specified buffer from the buffer list. Argument can be either the +buffer index or the full URL. If [count] is given, go to the [count]th buffer. + +If argument is neither a full URL nor an index but uniquely identifies a +buffer, it is selected. With [!] the next buffer matching the argument is +selected, even if it cannot be identified uniquely. Use [m]b[m] as a +shortcut to open this prompt. + +If argument is [a]\#[a], the alternate buffer will be selected (see [m]<C-^>[m]). + +If no argument is given the current buffer remains current. +________________________________________________________________________________ + + +|g^| |g0| |:bf| |:bfirst| |:br| |:brewind| |:tabfir| |:tabfirst| |:tabr| |:tabrewind| +||:tabr[ewind]|| + +||:tabfir[st]|| + +||:br[ewind]|| + +||:bf[irst]|| + +||g0|| + +||g^|| +________________________________________________________________________________ +Switch to the first tab. +________________________________________________________________________________ + + +|g$| |:bl| |:blast| |:tabl| |:tablast| +||:tabl[ast]|| + +||:bl[ast]|| + +||g$|| +________________________________________________________________________________ +Switch to the last tab. +________________________________________________________________________________ + + +|:tabde| |:tabdetach| + +||:tabde[tach]|| +________________________________________________________________________________ +Detach the current tab, and open it in its own window. +________________________________________________________________________________ + + +|:tabm| |:tabmove| +||:tabm[ove] [a][N][a]|| + +||:tabm[ove][!] [a]+N[a] | [a]-N[a]|| + +________________________________________________________________________________ +Move the current tab to a position after tab [a]N[a]. When [a]N[a] is 0, the +current tab is made the first one. Without [a]N[a] the current tab is made the +last one. [a]N[a] can also be prefixed with "+" or "-" to indicate a relative +movement. If [!] is specified the movement wraps around the start or end of the +tab list. +________________________________________________________________________________ + + +|:bn| |:bnext| |:tn| |:tnext| |:tabn| |:tabnext| +||:[count]tabn[ext] [count]|| + +||:[count]tn[ext] [count]|| + +||:[count]bn[ext] [count]|| + +________________________________________________________________________________ +Switch to the next or [count]th tab. Cycles to the first tab when the last is +selected and [count] is not specified. +________________________________________________________________________________ + + +|:tabo| |:tabonly| +||:tabo[nly]|| +________________________________________________________________________________ +Close all other tabs. +________________________________________________________________________________ + + +|:bN| |:bNext| |:bp| |:bprevious| |:tN| |:tNext| |:tabN| |:tabNext| |:tp| |:tprevious| |:tabp| |:tabprevious| + +||:[count]tabp[revious] [count]|| + +||:[count]tp[revious] [count]|| + +||:[count]tabN[ext] [count]|| + +||:[count]bp[revious] [count]|| + +||:[count]bN[ext] [count]|| + +________________________________________________________________________________ +Switch to the previous tab or go [count] tabs back. Wraps around from the +first tab to the last tab. +________________________________________________________________________________ + + + +section:Closing{nbsp}tabs[closing-tabs] + +|d| |:tabc| |:tabclose| |:bun| |:bunload| |:bw| |:bwipeout| |:bd| |:bdelete| +||:[count]bd[elete][!] [a][arg][a]|| + +||[count]d|| +________________________________________________________________________________ +Delete current buffer (=tab). If [count] is specified then [count] tabs are +removed. Afterwards, the tab to the right of the deleted tab(s) is selected. + +When used with [a][arg][a], remove all tabs which contain [a][arg][a] in the +hostname. [!] forces this command to also search for [a][arg][a] in the full +URL and also the title of the tab. Use with care. +________________________________________________________________________________ + + +|D| +||[count]D|| +________________________________________________________________________________ +Like [m]d[m] but selects the tab to the left of the deleted tab. +________________________________________________________________________________ + + +|u| |:u| |:undo| +||:[count]u[ndo] [a][url][a]|| + +||[count]u|| +________________________________________________________________________________ +Undo closing of a tab. If a count is given, don't undo the last but the +[count]th last closed tab. With [a][url][a] restores the tab matching the URL. +________________________________________________________________________________ + + +|:undoa| |:undoall| + +||:undoa[ll]|| +________________________________________________________________________________ +Undo closing of all closed tabs. Firefox stores up to 10 closed tabs, even +after a browser restart. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/tutorial.txt b/xulmus/locale/en-US/tutorial.txt new file mode 100755 index 00000000..461a6aed --- /dev/null +++ b/xulmus/locale/en-US/tutorial.txt @@ -0,0 +1,253 @@ +HEADER + +// Initial revision: Sun Jun 8 10:07:05 UTC 2008 (penryu) + ++++<div style="text-align: center;">+++ +*This is a quickstart tutorial to help get new users up and running in +Vimperator. It is not intended as a full reference explaining all features.* ++++</div>+++ + +section:Quick-start{nbsp}tutorial[tutorial] + +If you've started using Vimperator from scratch (i.e., without any +customization), you should be looking at this help page in a relatively +bare-looking window. The menubar, navigation bar, and bookmark bars are hidden. +In case you missed the notice in the help:Introduction[intro.html], you can +regain these by issuing the command + +\{nbsp}[c]:set go+=mTB<CR>[c] + +where [m]<CR>[m] represents pressing the <Enter> or <Return> key. +If you're a veteran Vim user, this may look familiar. It should. + +However, in this author's opinion, the best way to get familiar with +Vimperator is to leave these disabled for now. (The above action can be +reversed with [c]:set go=<CR>[c]) You can look at the entry for +[o]guioptions[o] in help:options[options.html] for more information on this. + +section:Vimperator's{nbsp}modal{nbsp}interface[modal] + +Vimperator's power, like Vim's, comes from it's modal interface. Keys have +different meanings depending on which mode the browser is in. Vimperator has +several modes, but the 2 most important are ``Normal'' mode and +``Command-line'' mode. + +When Vimperator starts, it is in Normal mode by default. This is probably where +you will spend the majority of your time. + +The other core mode of Vimperator, Command-line mode, can be entered from +Normal mode by typing a \':' (colon). You will frequently see Vimperator +commands start with a \':', indicating that what follows is a command. + +To return to Normal mode from Command-line mode, type [m]<Esc>[m]. Pressing +[m]<Esc>[m] will also return you to Normal mode from most other modes in +Vimperator. + +section:Getting{nbsp}help[getting-help] + +Vim is a great editor but it's not much of a web browser. So even seasoned Vim +users will probably have to look at Vimperator documentation sooner or later. +Most of the documentation for Vimperator's features are easily found using the +[c]:help[c] command. For example, you can find help on the [c]:help[c] command +by typing + +\{nbsp}[c]:help :help<CR>[c] + +Similarly, help on configurable options is available with [c]:help +'{option_name}'[c]. (Note the single quotes around the option name as in Vim.) +Information on all available options is, predictably, [c]:help options[c]. + +and you can find out about the [m]gt[m] and [m]gT[m] mapping with + +\{nbsp}[c]:help gt<CR>[c] + +\{nbsp}[c]:help gT<CR>[c] + +Finally, in addition to the help system itself, [c]:exusage[c], [c]:viusage[c] +and [c]:optionusage[c] are useful quick-reference commands. + +section:Mouseless[living-mouseless] + +*-- or how I learned to stop worrying and love the 80+ buttons I already have.* + +The efficiency of Vimperator, as with the legendary editor it was inspired by, +relies on the user being able to keep his fingers on the keyboard where they +can do the most good. While there are some areas where the mouse is clearly +superior at, such as GUI design or some games, Vimperator acts on the +assumption that a web browser doesn't have to be one of those. + +Here are some areas where the mouse is typically considered indisposable, and +how Vimperator challenges this preconception. + +section:Scrolling[keyboard-scrolling] + +Scrolling the browser window is done with simple keystrokes: + + * [m]j[m]/[m]k[m] -- + scroll window down/up by one line, respectively + * [m]h[m]/[m]l[m] -- + scroll window left/right + * [m]<Space>[m]/[m]<C-b>[m] -- + scroll down/up by one page + * [m]<C-d>[m]/[m]<C-u>[m] -- + scroll down/up by 1/2 page + +Your standard buttons ([m]<Up>[m]/[m]<Down>[m]/[m]<PgUp>[m]/[m]<PgDn>[m]) will +also work as expected. + +section:History{nbsp}and{nbsp}tabs[history-navigation,tab-navigation] + +History navigation (e.g., ``Back'', ``Forward'') are done similarly to +scrolling. + + * [m]<C-o>[m]/[m]<C-i>[m] -- + move Back/Forward in the current window/tab's history, respectively + +Move between tabs using these keystrokes which may also be familiar to tabbing +Vimmers. + + * [m]gt[m]/[m]<C-n>[m] -- + go to the next tab + * [m]gT[m]/[m]<C-p>[m] -- + go to the previous tab + * [m]g0[m]/[m]g$[m] -- + go to the first/last tab + * [m]d[m] -- + close the active tab (delete the buffer) + +To open a web page in a new tab, use the [c]:tabopen {url}[c]. To open a URL in +the current tab, use [c]:open[c]. The Normal mode mappings [m]t[m] and [m]o[m], +respectively, map to these commands, so the following pairs of sequences are +equivalent: + +\{nbsp}[c]:open my.webmail.com<CR>[c] + +\{nbsp}[m]omy.webmail.com<CR>[m] + +\{nbsp}[c]:tabopen vimperator.org<CR>[c] + +\{nbsp}[m]tvimperator.org<CR>[m] + +section:Some{nbsp}hints{nbsp}about{nbsp}surfing...[hints-tutorial] + +So now you can navigate around in Vimperator. But wait... how do you *open* a +page or tab linked in a web page? How do you ``click'' on all those links +without your tailed friend? + +The answer is ``hints''. Activating hints displays a number next to every link +Vimperator can find. To follow the link, simply type the number corresponding +to the hint, a white number inside a red square by default. + +For text links, there's an additional shortcut; you can type some text +contained in the link and Vimperator will search all the links it can find and +only hint the matching links, further narrowing down the list. If the text you +type uniquely identifies any given link, Vimperator will follow that link +immediately without any further user input. + +Whichever way you choose to indicate your target link, once Vimperator has +highlighted the link you want, simply hit <Enter> to open it. + +The most common hint mode is called help:QuickHint{nbsp}mode[various.html,f]. +To activate QuickHint mode, press either [m]f[m] or [m]F[m]. The lower-case +[m]f[m] will open the resulting link in the current tab, while the upper-case +[m]F[m] will open it in a new tab. + +To test it, try this link: http://vimperator.org/[Vimperator Homepage]. +Activate QuickHint mode with [m]f[m] or [m]F[m] to highlight all currently +visible links. Then start typing the text of the link. The link should be +uniquely identified soon, and Vimperator will open it. Once you're done, +remember to use [m]<C-o>[m] (``History Back'') or [m]d[m] (``Delete Buffer'') +to return here, depending on which key you used to activate QuickHint mode. + +section:Common{nbsp}issues[common-issues] + +Say you get half-way done typing in a new URL, only to remember that you've +already got that page open in the previous tab. Your command line might look +something like this: + +\{nbsp}[c]:open my.partial.url/fooba[c] + +You can exit the command line and access the already loaded page with the +following: + +\{nbsp}[m]<Esc>gT[m] + +section:Saving{nbsp}for{nbsp}posterity{nbsp}-{nbsp}vimperatorrc[vimperatorrc] + +Once you get Vimperator set up with your desired options, maps, and commands, +you'll probably want them to be available the next time you open Vimperator. +Continuing the Vim theme, this is done with a vimperatorrc file. + +To save your current settings and allow them to be loaded automatically +next time you start Vimperator, issue the [c]:mkv[c] command. + +This will create the file *_$HOME_/.vimperatorrc* containing your settings. +It is a simple text file, just like a vimrc file and can be easily +edited to suit your preferences. + +section:Find{nbsp}the{nbsp}exit{nbsp}nearest{nbsp}you[quitting-without-menus] + +Vimperator supports all of Vim's classic methods of exiting. + + * [c]:xall[c] -- command to quit and save the current browsing + session for next time; the default. + * [c]:qall[c] -- command to quit _without_ saving the session + * [m]ZZ[m] -- Normal mode mapping equivalent to [c]:xall[c] + * [m]ZQ[m] -- Normal mode mapping equivalent to [c]:qall[c] + +section:Where{nbsp}did{nbsp}Firefox{nbsp}go?[whither-firefox] + +You might feel pretty disoriented now. Don't worry. This is still Firefox +underneath. Here are some ways Vimperator allows Firefox to shine through. See +the [c]:help[c] for these commands and mappings for more information on how to +make the best use of them. + + * [c]:dialog[c] -- + To access some of Firefox's many dialog windows, you can use the + [c]:dialog[c] command. See [c]:help :dialog[c]. + * [c]:bmarks[c] -- + Vimperator provides a new interface to bookmarks, but they're still your + standard Firefox bookmarks under the hood. [c]:bmark[c] will add a new + bookmark, while [c]:bmarks[c] will list the bookmarks currently defined. + * [c]:history[c] -- + It's exactly what it sounds like. This command will display a colorized, + scrollable and clickable list of the locations in Vimperator's history. + * [c]:emenu[c] -- + Access the Firefox menus through the Vimperator command line. + + +Feel free to explore at this point. If you use the [c]:tabopen[c] command, +remember to use the [m]gt[m]/[m]gT[m] mappings to get back to this page. If +using the [c]:open[c] command, use the history keys (e.g., [m]H[m]) to return. +If you get hopelessly lost, just type [c]:help<CR>[c] and click the +``Tutorial'' link to return. + + +// TODO: other sections? + + +section:Get{nbsp}me{nbsp}out{nbsp}of{nbsp}here![removal] + +If you've given it a fair shot and determined ... TODO + +The Vimperator way to do this is with the command [c]:addons[c]. Issuing this +command brings up the Firefox Add-ons dialog window; you can then remove it as +normal, selecting Vimperator from the list and clicking (yes, clicking) +*Uninstall*. + +Alternatively, you can do this the old-fashioned way: re-enable the menubar, +as above, with [c]:set go+=m[c], and select *Add-ons* from the *Tools* menu. + + +section:I'm{nbsp}interested...but{nbsp}lost![support] + +Vimperator has an energetic and growing user base. If you've run into a problem +that you can't seem to solve with Vimperator, or if you think you might have +found a bug, please let us know! There is support available on the +http://vimperator.cutup.org/index.php?title=Main_Page[wiki], or in the +#vimperator IRC channel on http://freenode.net/[freenode]. + +If you have any feature requests or (even better) offers to help, we'd love to +hear from you as well. Developers work on Vimperator whenever possible, but we +are neither infinite nor omnipotent; please bear with us. If you can't wait for +us to get around to it, rest assured patches are welcome! See the +help:Developer[developer.html] page for more information. + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/various.txt b/xulmus/locale/en-US/various.txt new file mode 100755 index 00000000..79d485dc --- /dev/null +++ b/xulmus/locale/en-US/various.txt @@ -0,0 +1,111 @@ +HEADER + +section:Various{nbsp}commands[various] + +|:beep| + +||:beep|| +________________________________________________________________________________ +Play a system beep. +________________________________________________________________________________ + + +|<C-l>| |CTRL-L| |:redr| |:redraw| + +||:redr[aw]|| +____ +Redraws the screen. Useful to update the screen halfway executing a script or function. +____ + +|:norm| |:normal| +||:norm[al][!] {commands}|| + +________________________________________________________________________________ +Execute Normal mode commands {commands}. This makes it possible to execute +Normal mode commands typed on the command line. {commands} is executed like it +is typed. If the [!] is given, mappings will not be used. {commands} should be +a complete command. {commands} cannot start with a space. Put 1 space before +it, 1 space is one space. +________________________________________________________________________________ + + +|:run| |:!| + +||:!{cmd}|| +________________________________________________________________________________ +Run a command. Runs {cmd} through system() and displays its output. Any \'!' in +{cmd} is replaced with the previous external command. But not when there is a +backslash before the \'!', then that backslash is removed. + +Warning: Input redirection (< foo) not done, also do not run commands which +require stdin or it will hang Firefox! +________________________________________________________________________________ + + +|:ve| |:version| + +||:ve[rsion][!]|| +________________________________________________________________________________ +Show version information. You can show the Firefox version page with +[c]:version![c]. +________________________________________________________________________________ + +section:Online{nbsp}help[online-help] + +|<F1>| |:help| |:h| |help| +||:h[elp] [a][subject][a]|| + +||<F1>|| +________________________________________________________________________________ +Open help window. The default page, as specified by 'helpfile' is shown unless +[a][subject][a] is specified. If you need help for a specific topic, try +[c]:help overview[c]. +____________________________________________________________________________ + + +|:exu| |:exusage| + +||:exu[sage][!]|| +________________________________________________________________________________ +Show help on Ex commands. If [!] is given then the help is listed in the +command output window. +________________________________________________________________________________ + + +|:optionu| |:optionusage| + +||:optionu[sage][!]|| +________________________________________________________________________________ +Show help on options. If [!] is given then the help is listed in the command +output window. +________________________________________________________________________________ + + +|:viu| |:viusage| + +||:viu[sage][!]|| +________________________________________________________________________________ +Show help on Normal mode commands. If [!] is given then the help is listed in +the command output window. +________________________________________________________________________________ + + +|42| + + +What is the meaning of life, the universe and everything? +Douglas Adams, the only person who knew what this question really was about is +now dead, unfortunately. So now you might wonder what the meaning of death +is... + + +section:Uncategorized{nbsp}help[uncategorized] + +|<C-[>| |<Esc>| + +||<Esc>|| +________________________________________________________________________________ +Focus content. Exits Command-line or Hints mode and returns to Normal +mode. Also focuses the web page in case a form field has focus and eats +our key presses. +________________________________________________________________________________ + + +|<Insert>| |i| + +||i|| +________________________________________________________________________________ +Start caret mode. This mode resembles the Vim's Normal mode where you see a +text cursor and can move around. If you want to select text in this mode, press +[m]v[m] to start its Visual mode. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/xhtml11.css b/xulmus/locale/en-US/xhtml11.css new file mode 100755 index 00000000..427cbe99 --- /dev/null +++ b/xulmus/locale/en-US/xhtml11.css @@ -0,0 +1,349 @@ +/* keep the mozdev header */ +/* @import url(http://www.mozdev.org/skin/color/mozdev2k.css); */ + +/* + CSS stylesheet for XHTML produced by DocBook XSL stylesheets. + Tested with XSL stylesheets 1.61.2, 1.67.2 +*/ + +span.strong { + font-weight: bold; +} + +a { + color: #4A708B; + text-decoration: none; +} + +body blockquote { + margin-top: .75em; + line-height: 1.5; + margin-bottom: .75em; +} + +html body { + /*margin: 1em 5% 1em 5%;*/ + margin: auto; + padding-left: 25px; + padding-right: 25px; + line-height: 1.2; + font-family: -moz-fixed; + max-width: 800px; +} + +body div { + margin: 0; +} + +h1, h2, h3, h4, h5, h6, +div.toc p b, +div.list-of-figures p b, +div.list-of-tables p b, +div.abstract p.title +{ + color: #527bbd; +} + +div.toc p:first-child, +div.list-of-figures p:first-child, +div.list-of-tables p:first-child, +div.example p.title +{ + margin-bottom: 0.1em; +} + +body h1 { + margin: .0em 0 0 -4%; + line-height: 1.3; + border-bottom: 1px solid silver; +} + +body h2 { + /* necessary, because we put h2 into tables */ + margin-top: 20px !important; + margin-bottom: 0px !important; + line-height: 1.3; + /*border-bottom: 1px solid silver;*/ +} + +body h3 { + margin: .8em 0 0 -3%; + line-height: 1.3; +} + +body h4 { + margin: .8em 0 0 -3%; + line-height: 1.3; +} + +body h5 { + margin: .8em 0 0 -2%; + line-height: 1.3; +} + +body h6 { + margin: .8em 0 0 -1%; + line-height: 1.3; +} + +body hr { + border: none; /* Broken on IE6 */ +} +div.footnotes hr { + border: 1px solid silver; +} + +div.navheader th, div.navheader td, div.navfooter td { + font-size: 0.9em; + font-weight: bold; + color: #527bbd; +} +div.navheader img, div.navfooter img { + border-style: none; +} +div.navheader a, div.navfooter a { + font-weight: normal; +} +div.navfooter hr { + border: 1px solid silver; +} + +body td { + line-height: 1.2 +} + +body th { + line-height: 1.2; +} + +ol { + line-height: 1.2; +} + +ul, body dir, body menu { + line-height: 1.2; +} + +html { + margin: 0; + padding: 0; +} + +body h1, body h2, body h3, body h4, body h5, body h6 { + margin-left: 0 +} + +body pre { + margin: 0.5em 10% 0.5em 1em; + line-height: 1.2; + color: navy; +} + +tt.literal, code.literal { + color: navy; +} + + +.programlisting, .screen, .listingblock { + border: 1px solid silver; + background: #f4f4f4; + margin: 0.5em 10% 0.5em 0; + padding: 0.5em 1em; +} + +div.sidebar { + background: #ffffee; + margin: 1.0em 10% 0.5em 0; + padding: 0.5em 1em; + border: 1px solid silver; +} +div.sidebar * { padding: 0; } +div.sidebar div { margin: 0; } +div.sidebar p.title { + margin-top: 0.5em; + margin-bottom: 0.2em; +} + +div.bibliomixed { + margin: 0.5em 5% 0.5em 1em; +} + +#footer { + margin: 15px; + text-align: center; + color: gray; +} + +div.glossary dt { + font-weight: bold; +} +div.glossary dd p { + margin-top: 0.2em; +} + +dl { + margin: .8em 0; + line-height: 1.2; +} + +dt { + margin-top: 0.5em; +} + +dt span.term { + font-style: italic; +} + +div.variablelist dd p { + margin-top: 0; +} + +div.itemizedlist li, div.orderedlist li { + margin-left: -0.8em; + margin-top: 0.5em; +} + +ul, ol { + list-style-position: outside; +} + +div.sidebar ul, div.sidebar ol { + margin-left: 2.8em; +} + +div.itemizedlist p.title, +div.orderedlist p.title, +div.variablelist p.title +{ + margin-bottom: -0.8em; +} + +div.revhistory table { + border-collapse: collapse; + border: none; +} +div.revhistory th { + border: none; + color: #527bbd; +} +div.revhistory td { + border: 1px solid silver; +} + +/* Keep TOC and index lines close together. */ +div.toc dl, div.toc dt, +div.list-of-figures dl, div.list-of-figures dt, +div.list-of-tables dl, div.list-of-tables dt, +div.indexdiv dl, div.indexdiv dt +{ + line-height: normal; + margin-top: 0; + margin-bottom: 0; +} + +/* + Table styling does not work because of overriding attributes in + generated HTML. +*/ +div.table table, +div.informaltable table +{ + margin-left: 0; + margin-right: 5%; + margin-bottom: 0.8em; +} +div.informaltable table +{ + margin-top: 0.4em +} +div.table thead, +div.table tfoot, +div.table tbody, +div.informaltable thead, +div.informaltable tfoot, +div.informaltable tbody +{ + /* No effect in IE6. */ + border-top: 2px solid #527bbd; + border-bottom: 2px solid #527bbd; +} +div.table thead, div.table tfoot, +div.informaltable thead, div.informaltable tfoot +{ + font-weight: bold; +} + +div.mediaobject img { + border: 1px solid silver; + margin-bottom: 0.8em; +} +div.figure p.title, +div.table p.title +{ + margin-top: 1em; + margin-bottom: 0.4em; +} + +@media print { + div.navheader, div.navfooter { display: none; } +} + +/* my additions */ +span.tag, span.hiddentag { + font-weight: bold; + color: rgb(255, 0, 255); /* magenta */ + padding-left: 15px; + float: right; +} +/* inside a table cell means this tag is part of a section */ +td span.tag { + padding-top: 25px !important; +} + +div.key { + color: rgb(255, 0, 255); /* magenta */ + min-width: 120px; /* with 20px padding actually 140px */ + /*padding-bottom: 5px;*/ + padding-right: 20px; + float: left; +} +span.warning { + font-weight: bold; + color: red; +} +span.info { + font-weight: bold; + color: blue; +} +fieldset.paypal { + border: none; +} + +.argument { + color: #6A97D4; +} +.command { + font-weight: bold; + color: #632610; + white-space: nowrap; +} +.mapping { + font-weight: bold; + color: #102663; +} +.option { + font-weight: bold; + color: #106326; +} + +.option, .mapping, .command { + text-decoration: none; +} +.option:hover, .mapping:hover, .command:hover { + text-decoration: underline; +} + +.quoteblock { + margin-left: 140px; + padding-bottom: 10px; +} diff --git a/xulmus/skin/icon.png b/xulmus/skin/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..e821ed66aa94c38f809f64142d69b2252bb7a622 GIT binary patch literal 514 zcmV+d0{#7oP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXD} z5;H0^PrpF`00DwYL_t(o!|l{PYgADXhw<MAUqBSpQql!cQ3QpEjfz@m69h#NY^*{W z^8xI%)xwub3}Pj*S1jye2xy3nmVzQ~u!x0VLLf0?;UI@)7q+-}wYU#l&SCCw=6`19 z3=RJor*IL!u!x;K{H`N#p=trcxjx7MQ(b)aVFi!t$UrOC?f9G`&J_PQ;VnL4N8RN( zmjXUwTiR}Bc}`->AbR3SinxPgSi@~>EwWWByYLO`_=5Kte4t#)ECh~MefUrxKFh^^ zY|yvgjW*t3DSP0^AO%e0Cq{5J%kVCrW9?kYfa8VjdD?E&9efYI<3*QA`2(xiU*+WM z<RwOND4$`;I38jSC$Le7KHNvlc0T97qqUO>oX6!Z!QoMs=QJj9H|-<1)`x(ZQb0pP z!#}6TAd0;>m_ufPR=bDaFs-i@>WNWemWblpAZCb3;sCKZ{hkq16(=NK6YIqMpTpxR zvDhJKt=QkHTEKncXoqcxI7{3kJ`hX9D`Kqa;D##r4Gxodkce8%Bme*a07*qoM6N<$ Ef`+i&4*&oF literal 0 HcmV?d00001 diff --git a/xulmus/vimperatorrc.example b/xulmus/vimperatorrc.example new file mode 100755 index 00000000..1991c4c4 --- /dev/null +++ b/xulmus/vimperatorrc.example @@ -0,0 +1,21 @@ +" TODO: add some useful examples + +" I don't like beeps +set visualbell + +" autoignore mode on certain pages +:autocmd PageLoad .* :js modes.passAllKeys = /gmail\.com/.test(buffer.URL) + + +" embedded javascript is possible +" You can even add new functions which are then available in the :js command +javascript <<EOF +hello = function(name) +{ + alert("Hello world: " + name); +} +EOF + +echo "vimperatorrc sourced" + +" vim: ft=vimperator: From 1ca0bc0de495d3c2e008b2ee7f0cd453bdd97903 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 16:24:09 +1100 Subject: [PATCH 02/87] Formatting fixes. --- common/content/buffer.js | 14 +- common/content/completion.js | 2 +- common/content/events.js | 11 +- common/content/liberator.js | 14 +- common/content/services.js | 2 +- common/content/tabs.js | 2 +- common/content/ui.js | 4 +- common/content/util.js | 2 +- common/make_jar.sh | 11 +- xulmus/content/player.js | 356 +++++++++++++++++------------------ 10 files changed, 205 insertions(+), 213 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index cf406134..23a56594 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -42,7 +42,7 @@ function Buffer() //{{{ ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - // FIXME: This doesn't belong here. + // FIXME: This doesn't belong here. let mainWindowID = config.mainWindowID || "mainplayer"; let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize; @@ -215,12 +215,12 @@ function Buffer() //{{{ mappings.add(myModes, ["<C-c>"], "Stop loading", - function () + function () { if(config.name == "Xulmus") getBrowser().mCurrentBrowser.stop(); else - window.BrowserStop(); + window.BrowserStop(); }); // scrolling @@ -603,12 +603,12 @@ function Buffer() //{{{ commands.add(["st[op]"], "Stop loading", - function () - { - if(config.name == "Xulmus") + function () + { + if (config.name == "Xulmus") getBrowser().mCurrentBrowser.stop(); else - window.BrowserStop(); + window.BrowserStop(); }, { argCount: "0" }); diff --git a/common/content/completion.js b/common/content/completion.js index d06a0497..431f6f8a 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1381,7 +1381,7 @@ function Completion() //{{{ completion.urls(context, tags); }, - songCompletion: function songCompletion(context, args) + songCompletion: function songCompletion(context, args) { if (args.completeArg == 0) context.completions = getArtists(); diff --git a/common/content/events.js b/common/content/events.js index 80d3858b..bfeb4a93 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -628,7 +628,7 @@ function Events() //{{{ // return true when load successful, or false otherwise function waitForPageLoaded() events.waitForPageLoad(); - // load all macros inside ~/.xulmus/macros/ + // load all macros // setTimeout needed since io. is loaded after events. setTimeout(function () { try @@ -1037,8 +1037,8 @@ function Events() //{{{ // (i.e., cntrl codes 27--31) // --- // For more information, see: - // [*] Vimp FAQ: http://xulmus.org/trac/wiki/Xulmus/FAQ#WhydoesntC-workforEscMacOSX - // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/xulmus/2008-May/001548.html + // [*] Vimp FAQ: http://vimperator.org/trac/wiki/Vimperator/FAQ#WhydoesntC-workforEscMacOSX + // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/vimperator/2008-May/001548.html // [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \" // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227 // [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa @@ -1226,10 +1226,10 @@ function Events() //{{{ } } - if(config.name == "Xulmus") + if (config.name == "Xulmus") { // Switch to -- PLAYER -- mode for Songbird Media Player. - if(config.isPlayerWindow) + if (config.isPlayerWindow) { liberator.mode = modes.PLAYER; } @@ -1437,7 +1437,6 @@ function Events() //{{{ // also fixes key navigation in combo boxes, submitting forms, etc. // FIXME: breaks iabbr for now --mst if (((config.name == "Xulmus" || config.name == "Vimperator") && liberator.mode == modes.NORMAL || liberator.mode == modes.INSERT)) - { if (key == "<Return>") return false; diff --git a/common/content/liberator.js b/common/content/liberator.js index 3a0cec85..1f07dec5 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -71,7 +71,7 @@ const liberator = (function () //{{{ let nError = 0; function loadModule(name, func) { - let message = "Loading module " + name + "..."; + let message = "Loading module " + name + "..."; try { liberator.log(message, 0); @@ -82,10 +82,10 @@ const liberator = (function () //{{{ catch (e) { if (nError++ == 0) - liberator.dump("Error loading module - "+ name + ".."); - liberator.dump(e); - liberator.dump(e.stack); - window.toJavaScriptConsole(); + window.toJavaScriptConsole(); + liberator.dump("Error loading module - "+ name + ".."); + liberator.dump(e); + liberator.dump(e.stack); liberator.reportError(e); } } @@ -1219,6 +1219,8 @@ const liberator = (function () //{{{ startup: function () { let start = Date.now(); + liberator.log("Initializing liberator object...", 0); + config.features = config.features || []; config.features.push(getPlatformFeature()); config.defaults = config.defaults || {}; @@ -1227,7 +1229,7 @@ const liberator = (function () //{{{ config.mailModes = config.mailModes || [modes.NORMAL]; // TODO: suitable defaults? //config.mainWidget - //config.mainWindowID + //config.mainWindowID //config.visualbellWindow //config.styleableChrome config.autocommands = config.autocommands || []; diff --git a/common/content/services.js b/common/content/services.js index 338e1c33..bf11e4fa 100644 --- a/common/content/services.js +++ b/common/content/services.js @@ -66,7 +66,7 @@ function Services() self.add("windowMediator", "@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator); self.add("windowWatcher", "@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher); self.add("bookmarks", "@mozilla.org/browser/nav-bookmarks-service;1", Ci.nsINavBookmarksService); - + self.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile); self.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind); self.addClass("process", "@mozilla.org/process/util;1", Ci.nsIProcess); diff --git a/common/content/tabs.js b/common/content/tabs.js index 411f9213..43776916 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -112,7 +112,7 @@ function Tabs() //{{{ /* if (config.name == "Xulmus") getBrowser()._strip.getElementsByClassName( - */ +*/ /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ diff --git a/common/content/ui.js b/common/content/ui.js index d8f076a4..6fdf8239 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -568,7 +568,7 @@ function CommandLine() //{{{ var startHints = false; // whether we're waiting to start hints mode var lastSubstring = ""; - + // the containing box for the promptWidget and commandWidget const commandlineWidget = document.getElementById("liberator-commandline"); // the prompt for the current command, for example : or /. Can be blank @@ -577,7 +577,7 @@ function CommandLine() //{{{ const commandWidget = document.getElementById("liberator-commandline-command"); const messageBox = document.getElementById("liberator-message"); - + commandWidget.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); messageBox.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); diff --git a/common/content/util.js b/common/content/util.js index 60477acf..5409d0c9 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -170,7 +170,7 @@ const util = { //{{{ */ computedStyle: function computedStyle(node) { - while (node instanceof Text && node.parentNode) + while (node instanceof Text && node.parentNode) node = node.parentNode; return node.ownerDocument.defaultView.getComputedStyle(node, null); }, diff --git a/common/make_jar.sh b/common/make_jar.sh index 291dc7d1..00064e23 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -1,7 +1,6 @@ #!/bin/dash set -e - top=$(pwd) jar=$1 bases=$2 @@ -15,7 +14,7 @@ stage="$top/${jar%.*}" mkdir -p $stage getfiles () { - filter="\.($(echo $1 | tr ' ' '|'))$"; shift + filter="\.($(echo $1 | tr ' ' '|'))$"; shift find "$@" -not -path '*CVS*' 2>/dev/null | grep -E "$filter" || true } copytext () { @@ -31,12 +30,12 @@ do ( set -e cd $base - [ ${jar##*.} = jar ] && stage="$stage/${base##*/}" + [ ${jar##*.} = jar ] && stage="$stage/${base##*/}" for dir in $dirs do - for f in $(getfiles "$bin" "$dir") + for f in $(getfiles "$bin" "$dir") do - mkdir -p "$stage/${f%/*}" + mkdir -p "$stage/${f%/*}" cp $f "$stage/$f" done for f in $(getfiles "$text" "$dir") @@ -52,7 +51,7 @@ do ) done -cd $stage +cd $stage zip -r "$top/$jar" * cd - rm -rf "$stage" diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 38d48e63..ab334ce5 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -2,218 +2,210 @@ var artists = getArtistsArray(); -function Player() +function Player() // {{{ { - - // Get the focus to the visible playlist first - //window._SBShowMainLibrary(); - - mappings.add([modes.PLAYER], - ["x"], "Play Track", - function () - { - gMM.sequencer.play(); - }); - - mappings.add([modes.PLAYER], - ["z"], "Previous Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_previous"); - }); + // Get the focus to the visible playlist first + //window._SBShowMainLibrary(); - mappings.add([modes.PLAYER], - ["c"], "Pause/Unpause Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_playpause"); - }); - - mappings.add([modes.PLAYER], - ["b"], "Next Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_next"); - }); - - mappings.add([modes.PLAYER], - ["v"], "Stop Track", - function () - { - gMM.sequencer.stop(); - }); + mappings.add([modes.PLAYER], + ["x"], "Play Track", + function () + { + gMM.sequencer.play(); + }); + mappings.add([modes.PLAYER], + ["z"], "Previous Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_previous"); + }); - mappings.add([modes.PLAYER], - ["l"], "Play Media", - function () - { - commandline.open(":","playmedia ", modes.EX); - }); + mappings.add([modes.PLAYER], + ["c"], "Pause/Unpause Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_playpause"); + }); - mappings.add([modes.PLAYER], - ["s"], "Toggle Shuffle", - function () - { - if (gMM.sequencer.mode != gMM.sequencer.MODE_SHUFFLE) - gMM.sequencer.mode = gMM.sequencer.MODE_SHUFFLE; - else - gMM.sequencer.mode = gMM.sequencer.MODE_FORWARD; - }); + mappings.add([modes.PLAYER], + ["b"], "Next Track", + function () + { + gSongbirdWindowController.doCommand("cmd_control_next"); + }); - mappings.add([modes.PLAYER], - ["r"], "Toggle Repeat", - function () - { - switch(gMM.sequencer.repeatMode) - { - case gMM.sequencer.MODE_REPEAT_NONE: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE; - break; - case gMM.sequencer.MODE_REPEAT_ONE: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ALL; - break; - case gMM.sequencer.MODE_REPEAT_ALL: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; - break; - default: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; - break; - } - }); + mappings.add([modes.PLAYER], + ["v"], "Stop Track", + function () + { + gMM.sequencer.stop(); + }); - commands.add(["playmedia"], - "PLay Media", - function(args) - { - //Store the old view - //var prev_view = gMM.status.view; - var library = LibraryUtils.mainLibrary; - var mainView = library.createView(); - var sqncr = gMM.sequencer; - var customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] - .createInstance(Ci.sbIMutablePropertyArray); - - //args - - if (args.length == 1){ - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - } - else if (args.length == 2){ - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - customProps.appendProperty(SBProperties.albumName,args[1].toString()); - } - else if (args.length == 3){ - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - customProps.appendProperty(SBProperties.albumName,args[1].toString()); - customProps.appendProperty(SBProperties.trackName,args[2].toString()); - } - + mappings.add([modes.PLAYER], + ["l"], "Play Media", + function () + { + commandline.open(":","playmedia ", modes.EX); + }); - sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); - - - }, - { - completer: function(context, args) completion.songCompletion(context, args) - }); - - + mappings.add([modes.PLAYER], + ["s"], "Toggle Shuffle", + function () + { + if (gMM.sequencer.mode != gMM.sequencer.MODE_SHUFFLE) + gMM.sequencer.mode = gMM.sequencer.MODE_SHUFFLE; + else + gMM.sequencer.mode = gMM.sequencer.MODE_FORWARD; + }); -} + mappings.add([modes.PLAYER], + ["r"], "Toggle Repeat", + function () + { + switch (gMM.sequencer.repeatMode) + { + case gMM.sequencer.MODE_REPEAT_NONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE; + break; + case gMM.sequencer.MODE_REPEAT_ONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ALL; + break; + case gMM.sequencer.MODE_REPEAT_ALL: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + default: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + } + }); + + commands.add(["playmedia"], + "Play Media", + function (args) + { + //Store the old view + //var prev_view = gMM.status.view; + var library = LibraryUtils.mainLibrary; + var mainView = library.createView(); + var sqncr = gMM.sequencer; + var customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + .createInstance(Ci.sbIMutablePropertyArray); + + //args + if (args.length == 1){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + } + else if (args.length == 2){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + customProps.appendProperty(SBProperties.albumName,args[1].toString()); + } + else if (args.length == 3){ + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + customProps.appendProperty(SBProperties.albumName,args[1].toString()); + customProps.appendProperty(SBProperties.trackName,args[2].toString()); + } + + sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); + }, + { + completer: function (context, args) completion.songCompletion(context, args) + }); +} // }}} function getArtists() { - return this.artists; + return this.artists; } function getArtistsArray() { - - var list = LibraryUtils.mainLibrary; - - // Create an enumeration listener to count each item - var listener = { - count: 0, - onEnumerationBegin: function(aMediaList) { - this.count = 0; - }, - onEnumeratedItem: function(aMediaList, aMediaItem) { - this.count++; - }, - onEnumerationEnd: function(aMediaList, aStatusCode) {} - }; - - var artistCounts = {}; - var artists = list.getDistinctValuesForProperty(SBProperties.artistName); - var artist; - var artistArray = []; - var i=0; - // Count the number of media items for each distinct artist - while (artists.hasMore()) { - artist = artists.getNext(); - artistArray[i] = [artist,artist]; - list.enumerateItemsByProperty(SBProperties.artistName, - artist, - listener, - Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING); - artistCounts[artist] = listener.count; - i++; - } - - //liberator.dump("Count : "+artistCounts.toSource()); - return artistArray; + var list = LibraryUtils.mainLibrary; + + // Create an enumeration listener to count each item + var listener = { + count: 0, + onEnumerationBegin: function (aMediaList) { + this.count = 0; + }, + onEnumeratedItem: function (aMediaList, aMediaItem) { + this.count++; + }, + onEnumerationEnd: function (aMediaList, aStatusCode) {} + }; + + var artistCounts = {}; + var artists = list.getDistinctValuesForProperty(SBProperties.artistName); + var artist; + var artistArray = []; + var i = 0; + // Count the number of media items for each distinct artist + while (artists.hasMore()) { + artist = artists.getNext(); + artistArray[i] = [artist,artist]; + list.enumerateItemsByProperty(SBProperties.artistName, + artist, + listener, + Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING); + artistCounts[artist] = listener.count; + i++; + } + + //liberator.dump("Count : "+artistCounts.toSource()); + return artistArray; } function getAlbums(artist) { - var list = LibraryUtils.mainLibrary; - var albumArray = []; - var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); - var i = 0; + var list = LibraryUtils.mainLibrary; + var albumArray = []; + var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); + var i = 0; - while(items.hasMoreElements()) { - album = items.getNext().getProperty(SBProperties.albumName); - albumArray[i] = [album, album]; - i++; - } - - return removeDuplicateElement(albumArray); + while (items.hasMoreElements()) { + album = items.getNext().getProperty(SBProperties.albumName); + albumArray[i] = [album, album]; + i++; + } + + return removeDuplicateElement(albumArray); } function getTracks(artist,album) { - var list = LibraryUtils.mainLibrary; - var tracksArray = []; - var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] - .createInstance(Ci.sbIMutablePropertyArray); - var i = 0; - - pa.appendProperty(SBProperties.artistName,artist.toString()); - pa.appendProperty(SBProperties.albumName,album.toString()); - var items = list.getItemsByProperties(pa).enumerate(); + var list = LibraryUtils.mainLibrary; + var tracksArray = []; + var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + .createInstance(Ci.sbIMutablePropertyArray); + var i = 0; - while(items.hasMoreElements()) { - track = items.getNext().getProperty(SBProperties.trackName); - tracksArray[i] = [track, track]; - i++; - } + pa.appendProperty(SBProperties.artistName,artist.toString()); + pa.appendProperty(SBProperties.albumName,album.toString()); + var items = list.getItemsByProperties(pa).enumerate(); - return tracksArray; + while (items.hasMoreElements()) { + track = items.getNext().getProperty(SBProperties.trackName); + tracksArray[i] = [track, track]; + i++; + } + + return tracksArray; } function removeDuplicateElement(arrayName) { - var newArray=new Array(); -label:for(var i=0; i<arrayName.length;i++ ) - { - for(var j=0; j<newArray.length;j++ ) - { - if(newArray[j].toString()==arrayName[i].toString()) - continue label; - } - newArray[newArray.length] = arrayName[i]; - } - return newArray; + var newArray = new Array(); + label:for (var i = 0; i < arrayName.length; i++) + { + for (var j = 0; j < newArray.length; j++) + { + if (newArray[j].toString() == arrayName[i].toString()) + continue label; + } + newArray[newArray.length] = arrayName[i]; + } + return newArray; } + +// vim: set fdm=marker sw=4 ts=4 et: From d87b1319f80c36b076c82747313d3df681dc264f Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 16:30:05 +1100 Subject: [PATCH 03/87] Update xulmus version to 1.0pre. --- xulmus/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/Makefile b/xulmus/Makefile index 118bb65e..b161489d 100755 --- a/xulmus/Makefile +++ b/xulmus/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 0.1 +VERSION = 0.1pre NAME = xulmus include ../common/Makefile.common From ee3b58f41ff1361e19bc434d9d2f8f8009d45729 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 16:41:07 +1100 Subject: [PATCH 04/87] Begin updating Vim runtime files for xulmus. --- xulmus/contrib/vim/Makefile | 4 +- xulmus/contrib/vim/ftdetect/vimperator.vim | 1 - xulmus/contrib/vim/mkvimball.txt | 4 +- xulmus/contrib/vim/syntax/vimperator.vim | 104 ------------------ ...{vimperatorrc.example => xulmusrc.example} | 4 +- 5 files changed, 6 insertions(+), 111 deletions(-) delete mode 100755 xulmus/contrib/vim/ftdetect/vimperator.vim delete mode 100755 xulmus/contrib/vim/syntax/vimperator.vim rename xulmus/{vimperatorrc.example => xulmusrc.example} (88%) diff --git a/xulmus/contrib/vim/Makefile b/xulmus/contrib/vim/Makefile index e2f716f5..cbbbe046 100755 --- a/xulmus/contrib/vim/Makefile +++ b/xulmus/contrib/vim/Makefile @@ -1,6 +1,6 @@ -VIMBALL = vimperator.vba +VIMBALL = xulmus.vba -vimball: mkvimball.txt syntax/vimperator.vim ftdetect/vimperator.vim +vimball: mkvimball.txt syntax/xulmus.vim ftdetect/xulmus.vim -echo '%MkVimball! ${VIMBALL} .' | vim -u NORC -N -e -s mkvimball.txt all: vimball diff --git a/xulmus/contrib/vim/ftdetect/vimperator.vim b/xulmus/contrib/vim/ftdetect/vimperator.vim deleted file mode 100755 index cbf9068e..00000000 --- a/xulmus/contrib/vim/ftdetect/vimperator.vim +++ /dev/null @@ -1 +0,0 @@ -au BufNewFile,BufRead *vimperatorrc*,*.vimp set filetype=vimperator diff --git a/xulmus/contrib/vim/mkvimball.txt b/xulmus/contrib/vim/mkvimball.txt index 96d1629b..3b0b3ed3 100755 --- a/xulmus/contrib/vim/mkvimball.txt +++ b/xulmus/contrib/vim/mkvimball.txt @@ -1,2 +1,2 @@ -syntax/vimperator.vim -ftdetect/vimperator.vim +syntax/xulmus.vim +ftdetect/xulmus.vim diff --git a/xulmus/contrib/vim/syntax/vimperator.vim b/xulmus/contrib/vim/syntax/vimperator.vim deleted file mode 100755 index aebd6fc1..00000000 --- a/xulmus/contrib/vim/syntax/vimperator.vim +++ /dev/null @@ -1,104 +0,0 @@ -" Vim syntax file -" Language: VIMperator configuration file -" Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2009 Feb 19 - -if exists("b:current_syntax") - finish -endif - -let s:cpo_save = &cpo -set cpo&vim - -syn include @javascriptTop syntax/javascript.vim -unlet b:current_syntax - -syn include @cssTop syntax/css.vim -unlet b:current_syntax - -syn match vimperatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=vimperatorCommand,vimperatorAutoCmd - -syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] - \ bmarks bn[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] - \ cno[remap] colo[rscheme] com[mand] comc[lear] cu[nmap] cuna[bbrev] delbm[arks] delc[ommand] delm[arks] delmac[ros] - \ delqm[arks] dels[tyle] dia[log] dl do[autocmd] doautoa[ll] downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] - \ exu[sage] files fini[sh] fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] - \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] - \ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] - \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] - \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab - \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen - \ tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion] - \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] - \ contained - -syn match vimperatorCommand "!" contained - -syn keyword vimperatorAutoCmd au[tocmd] contained nextgroup=vimperatorAutoEventList skipwhite - -syn keyword vimperatorAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost VimperatorEnter - \ VimperatorLeavePre VimperatorLeave - \ contained - -syn match vimperatorAutoEventList "\(\a\+,\)*\a\+" contained contains=vimperatorAutoEvent - -syn region vimperatorSet matchgroup=vimperatorCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>" - \ end="$" keepend oneline contains=vimperatorOption,vimperatorString - -syn keyword vimperatorOption activate act cdpath cd complete cpt defsearch ds editor eventignore ei extendedhinttags eht - \ followhints fh guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls messages msgs - \ newtab nextpattern pageinfo pa popups pps previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf - \ showstatuslinks ssli showtabline stal suggestengines titlestring urlseparator verbose vbs wildcase wic wildignore wig - \ wildmode wim wildoptions wop wordseparators wsp - \ contained nextgroup=vimperatorSetMod - -" toggle options -syn match vimperatorOption "\<\%(no\|inv\)\=\%(errorbells\|eb\|exrc\|ex\|focuscontent\|fc\|fullscreen\|fs\|ignorecase\|ic\)\>!\=" - \ contained nextgroup=vimperatorSetMod -syn match vimperatorOption "\<\%(no\|inv\)\=\%(incsearch\|is\|insertmode\|im\|hlsearch\|hls\|linksearch\|lks\)\>!\=" - \ contained nextgroup=vimperatorSetMod -syn match vimperatorOption "\<\%(no\|inv\)\=\%(loadplugins\|lpl\|more\|online\|preload\|showmode\|smd\|smartcase\|scs\)\>!\=" - \ contained nextgroup=vimperatorSetMod -syn match vimperatorOption "\<\%(no\|inv\)\=\%(online\|visualbell\|vb\|usermode\|um\)\>!\=" - \ contained nextgroup=vimperatorSetMod - -syn match vimperatorSetMod "\%(\<[a-z_]\+\)\@<=&" contained - -syn region vimperatorJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline -syn region vimperatorJavaScript matchgroup=vimperatorJavascriptDelimiter - \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold - -let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<=' -execute 'syn region vimperatorCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline' -execute 'syn region vimperatorCss matchgroup=vimperatorCssDelimiter' - \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold' - -syn match vimperatorNotation "<[0-9A-Za-z-]\+>" - -syn match vimperatorComment +".*$+ contains=vimperatorTodo,@Spell -syn keyword vimperatorTodo FIXME NOTE TODO XXX contained - -syn region vimperatorString start="\z(["']\)" end="\z1" skip="\\\\\|\\\z1" oneline - -syn match vimperatorLineComment +^\s*".*$+ contains=vimperatorTodo,@Spell - -" NOTE: match vim.vim highlighting group names -hi def link vimperatorAutoCmd vimperatorCommand -hi def link vimperatorAutoEvent Type -hi def link vimperatorCommand Statement -hi def link vimperatorComment Comment -hi def link vimperatorJavascriptDelimiter Delimiter -hi def link vimperatorCssDelimiter Delimiter -hi def link vimperatorNotation Special -hi def link vimperatorLineComment Comment -hi def link vimperatorOption PreProc -hi def link vimperatorSetMod vimperatorOption -hi def link vimperatorString String -hi def link vimperatorTodo Todo - -let b:current_syntax = "vimperator" - -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: tw=130 et ts=4 sw=4: diff --git a/xulmus/vimperatorrc.example b/xulmus/xulmusrc.example similarity index 88% rename from xulmus/vimperatorrc.example rename to xulmus/xulmusrc.example index 1991c4c4..221e7490 100755 --- a/xulmus/vimperatorrc.example +++ b/xulmus/xulmusrc.example @@ -16,6 +16,6 @@ hello = function(name) } EOF -echo "vimperatorrc sourced" +echo "xulmusrc sourced" -" vim: ft=vimperator: +" vim: ft=xulmus: From 648265ac3bbd6d811cda53701534851b2a593986 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 16:53:32 +1100 Subject: [PATCH 05/87] Add AUTHORS and templates for NEWS and TODO. --- xulmus/AUTHORS | 6 ++++++ xulmus/NEWS | 3 ++- xulmus/TODO | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 xulmus/AUTHORS create mode 100644 xulmus/TODO diff --git a/xulmus/AUTHORS b/xulmus/AUTHORS new file mode 100644 index 00000000..9e47ba6d --- /dev/null +++ b/xulmus/AUTHORS @@ -0,0 +1,6 @@ +Main developer/Project founder: + * Prathyush Thota <prathyush@sun.com> + +Developers: + * Martin Stubenschrott (stubenschrott@gmx.net) + * Doug Kearns (dougkearns@gmail.com) diff --git a/xulmus/NEWS b/xulmus/NEWS index 8b137891..9260c32d 100755 --- a/xulmus/NEWS +++ b/xulmus/NEWS @@ -1 +1,2 @@ - +2009-XX-XX: + * version 0.1 (probably) diff --git a/xulmus/TODO b/xulmus/TODO new file mode 100644 index 00000000..dba2a80b --- /dev/null +++ b/xulmus/TODO @@ -0,0 +1,6 @@ +Priority list: +1-9 as in Vim (9 = required for next release, 5 = would be nice, 1 = probably not) + +BUGS: + +FEATURES: From 3704b8cc7d639ed3ef4706c295385695423da4ed Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 17:03:37 +1100 Subject: [PATCH 06/87] Rename completion#songCompletion to completion#song. --- common/content/completion.js | 2 +- xulmus/content/player.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 2c07e833..3135db74 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1390,7 +1390,7 @@ function Completion() //{{{ completion.urls(context, tags); }, - songCompletion: function songCompletion(context, args) + song: function song(context, args) { if (args.completeArg == 0) context.completions = getArtists(); diff --git a/xulmus/content/player.js b/xulmus/content/player.js index ab334ce5..c876d574 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -109,7 +109,7 @@ function Player() // {{{ sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); }, { - completer: function (context, args) completion.songCompletion(context, args) + completer: function (context, args) completion.song(context, args) }); } // }}} From fd7d0d036e821eab25e1ce5e0d2f997a59ad0733 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 17:11:00 +1100 Subject: [PATCH 07/87] Update Prathyush's email address. --- License.txt | 2 +- xulmus/AUTHORS | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/License.txt b/License.txt index d589f3c4..3c775c7f 100644 --- a/License.txt +++ b/License.txt @@ -11,7 +11,7 @@ for the specific language governing rights and limitations under the License. Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@gmx.net> -Copyright (c) 2009 by Prathyush Thota <prathyush@sun.com> +Copyright (c) 2009 by Prathyush Thota <prathyushthota@gmail.com> Alternatively, the contents of this file may be used under the terms of either the GNU General Public License Version 2 or later (the "GPL"), or diff --git a/xulmus/AUTHORS b/xulmus/AUTHORS index 9e47ba6d..8ad48f24 100644 --- a/xulmus/AUTHORS +++ b/xulmus/AUTHORS @@ -1,5 +1,5 @@ Main developer/Project founder: - * Prathyush Thota <prathyush@sun.com> + * Prathyush Thota <prathyushthota@gmail.com> Developers: * Martin Stubenschrott (stubenschrott@gmx.net) From 789d98d31da2eded24db600bf2eeac196bfd53b0 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Mon, 16 Mar 2009 18:55:44 +1100 Subject: [PATCH 08/87] Return mainWindowID default value to 'main-window'. --- common/content/buffer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 23a56594..d0dcd17f 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -43,7 +43,7 @@ function Buffer() //{{{ /////////////////////////////////////////////////////////////////////////////{{{ // FIXME: This doesn't belong here. - let mainWindowID = config.mainWindowID || "mainplayer"; + let mainWindowID = config.mainWindowID || "main-window"; let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize; From f293c4f2123eadb1985a213d92e82a9b5587883e Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Tue, 17 Mar 2009 16:03:31 +1100 Subject: [PATCH 09/87] Replace removeDuplicateElement with use of util.Array.uniq. --- xulmus/content/player.js | 51 ++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index c876d574..bcce7090 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -4,9 +4,17 @@ var artists = getArtistsArray(); function Player() // {{{ { + //////////////////////////////////////////////////////////////////////////////// + ////////////////////// PRIVATE SECTION ///////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + // Get the focus to the visible playlist first //window._SBShowMainLibrary(); + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + mappings.add([modes.PLAYER], ["x"], "Play Track", function () @@ -46,7 +54,7 @@ function Player() // {{{ ["l"], "Play Media", function () { - commandline.open(":","playmedia ", modes.EX); + commandline.open(":", "playmedia ", modes.EX); }); mappings.add([modes.PLAYER], @@ -80,6 +88,10 @@ function Player() // {{{ } }); + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + commands.add(["playmedia"], "Play Media", function (args) @@ -90,17 +102,20 @@ function Player() // {{{ var mainView = library.createView(); var sqncr = gMM.sequencer; var customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] - .createInstance(Ci.sbIMutablePropertyArray); + .createInstance(Ci.sbIMutablePropertyArray); //args - if (args.length == 1){ + if (args.length == 1) + { customProps.appendProperty(SBProperties.artistName,args[0].toString()); } - else if (args.length == 2){ + else if (args.length == 2) + { customProps.appendProperty(SBProperties.artistName,args[0].toString()); customProps.appendProperty(SBProperties.albumName,args[1].toString()); } - else if (args.length == 3){ + else if (args.length == 3) + { customProps.appendProperty(SBProperties.artistName,args[0].toString()); customProps.appendProperty(SBProperties.albumName,args[1].toString()); customProps.appendProperty(SBProperties.trackName,args[2].toString()); @@ -111,6 +126,12 @@ function Player() // {{{ { completer: function (context, args) completion.song(context, args) }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// PUBLIC SECTION ////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + //}}} } // }}} function getArtists() @@ -168,7 +189,7 @@ function getAlbums(artist) i++; } - return removeDuplicateElement(albumArray); + return util.Array.uniq(albumArray); } function getTracks(artist,album) @@ -176,7 +197,7 @@ function getTracks(artist,album) var list = LibraryUtils.mainLibrary; var tracksArray = []; var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] - .createInstance(Ci.sbIMutablePropertyArray); + .createInstance(Ci.sbIMutablePropertyArray); var i = 0; pa.appendProperty(SBProperties.artistName,artist.toString()); @@ -192,20 +213,4 @@ function getTracks(artist,album) return tracksArray; } - -function removeDuplicateElement(arrayName) -{ - var newArray = new Array(); - label:for (var i = 0; i < arrayName.length; i++) - { - for (var j = 0; j < newArray.length; j++) - { - if (newArray[j].toString() == arrayName[i].toString()) - continue label; - } - newArray[newArray.length] = arrayName[i]; - } - return newArray; -} - // vim: set fdm=marker sw=4 ts=4 et: From 89565e3c036b64bc40d8aee2d203fb0fdb861946 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Tue, 17 Mar 2009 17:55:10 +1100 Subject: [PATCH 10/87] Apply CSS to the correct config.styleableChrome window. --- xulmus/content/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index bd7d145e..cc8140aa 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -44,10 +44,10 @@ const config = { //{{{ //get visualbellWindow() getBrowser().mPanelContainer, get isPlayerWindow() gBrowser.mCurrentTab._tPos == 0, // focusContent() focuses this widget gSongbirdWindowController takes care of the focus. - get mainWindowID() "mainplayer", + get mainWindowID() "mainplayer", get visualbellWindow() document.getElementById(this.mainWindowID), - - styleableChrome: "chrome://songbird/content/xul/layoutBaseOverlay.xul", + + styleableChrome: "chrome://gonzo/content/xul/mainplayer.xul", autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], ["ColorScheme", "Triggered after a color scheme has been loaded"], From 16036b504320835d93745a3670143d15cc2d235a Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Tue, 17 Mar 2009 18:19:52 +1100 Subject: [PATCH 11/87] Whitespace fixes. --- xulmus/content/config.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index cc8140aa..4399e187 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -32,7 +32,7 @@ const config = { //{{{ hostApplication: "Songbird", //mainWindowID: "mainplayer", /*** optional options, there are checked for existence and a fallback provided ***/ - features: ["bookmarks", "hints", "marks","history", "quickmarks", "session", "tabs", "windows", "player"], + features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "windows", "player"], defaults: { guioptions: "rb" }, guioptions: { @@ -49,15 +49,15 @@ const config = { //{{{ styleableChrome: "chrome://gonzo/content/xul/mainplayer.xul", - autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], - ["ColorScheme", "Triggered after a color scheme has been loaded"], - ["DOMLoad", "Triggered when a page's DOM content has fully loaded"], - ["DownloadPost", "Triggered when a download has completed"], - ["Fullscreen", "Triggered when the browser's fullscreen state changes"], - ["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"], - ["PageLoadPre", "Triggered after a page load is initiated"], - ["PageLoad", "Triggered when a page gets (re)loaded/opened"], - ["ShellCmdPost", "Triggered after executing a shell command with :!cmd"], + autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"], + ["ColorScheme", "Triggered after a color scheme has been loaded"], + ["DOMLoad", "Triggered when a page's DOM content has fully loaded"], + ["DownloadPost", "Triggered when a download has completed"], + ["Fullscreen", "Triggered when the browser's fullscreen state changes"], + ["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"], + ["PageLoadPre", "Triggered after a page load is initiated"], + ["PageLoad", "Triggered when a page gets (re)loaded/opened"], + ["ShellCmdPost", "Triggered after executing a shell command with :!cmd"], ["XulmusEnter", "Triggered after Xulmus starts"], ["XulmusLeavePre", "Triggered before exiting Xulmus, just before destroying each module"], ["XulmusLeave", "Triggered before exiting Xulmus"]], @@ -114,7 +114,7 @@ const config = { //{{{ ["selectionsource", "View selection source", function () { buffer.viewSelectionSource(); }] ], - + //TODO : Write intro.html and tutorial.html // they are sorted by relevance, not alphabetically //helpFiles: [ "intro.html" ], @@ -123,7 +123,7 @@ const config = { //{{{ "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", "marks.html", "repeat.html", "autocommands.html", "print.html", "gui.html", "styling.html", "message.html", "developer.html", - "various.html", "index.html", "version.html" + "various.html", "index.html", "version.html" ], */ scripts: [ @@ -134,9 +134,9 @@ const config = { //{{{ init: function () { - //Adding a mode for Player + //Adding a mode for Player //modes.addMode("PLAYER"); // Player mode for songbird - + // var artistArray = getArtists(); // TODO: support 'nrformats'? -> probably not worth it --mst @@ -178,7 +178,7 @@ const config = { //{{{ liberator.loadModule("marks", Marks); liberator.loadModule("quickmarks", QuickMarks); liberator.loadModule("hints", Hints); - // Load the Player module + // Load the Player module liberator.loadModule("player", Player); //////////////////////////////////////////////////////////////////////////////// ////////////////////// STYLES ////////////////////////////////////////////////// @@ -222,7 +222,7 @@ const config = { //{{{ mappings.add([modes.NORMAL], ["t"], "Open one or more URLs in a new tab", function () { commandline.open(":", "tabopen ", modes.EX); }); - + mappings.add([modes.NORMAL], ["T"], "Open one or more URLs in a new tab, based on current location", function () { commandline.open(":", "tabopen " + buffer.URL, modes.EX); }); @@ -230,7 +230,7 @@ const config = { //{{{ mappings.add([modes.NORMAL], ["T"], "Open one or more URLs in a new tab, based on current location", function () { commandline.open(":", "tabopen " + buffer.URL, modes.EX); }); - + mappings.add([modes.NORMAL], ["<C-a>"], "Increment last number in URL", function (count) { incrementURL(count > 1 ? count : 1); }, @@ -241,7 +241,6 @@ const config = { //{{{ function (count) { incrementURL(-(count > 1 ? count : 1)); }, { flags: Mappings.flags.COUNT }); - mappings.add([modes.NORMAL], ["~"], "Open home directory", function () { liberator.open("~"); }); @@ -259,7 +258,6 @@ const config = { //{{{ liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); }); - mappings.add([modes.NORMAL], ["gu"], "Go to parent directory", function (count) From cd99b10e53f3b7f3a344015df090e6930162e304 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Tue, 17 Mar 2009 18:23:45 +1100 Subject: [PATCH 12/87] Add Vim runtime files for xulmus. --- xulmus/contrib/vim/ftdetect/xulmus.vim | 2 + xulmus/contrib/vim/syntax/xulmus.vim | 106 +++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100755 xulmus/contrib/vim/ftdetect/xulmus.vim create mode 100755 xulmus/contrib/vim/syntax/xulmus.vim diff --git a/xulmus/contrib/vim/ftdetect/xulmus.vim b/xulmus/contrib/vim/ftdetect/xulmus.vim new file mode 100755 index 00000000..12a00079 --- /dev/null +++ b/xulmus/contrib/vim/ftdetect/xulmus.vim @@ -0,0 +1,2 @@ +" TODO: what's the Xulmus filename extension? +au BufNewFile,BufRead *xulmusrc*,*.xulmus set filetype=xulmus diff --git a/xulmus/contrib/vim/syntax/xulmus.vim b/xulmus/contrib/vim/syntax/xulmus.vim new file mode 100755 index 00000000..3a719078 --- /dev/null +++ b/xulmus/contrib/vim/syntax/xulmus.vim @@ -0,0 +1,106 @@ +" Vim syntax file +" Language: xulmus configuration file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2009 Mar 16 + +" TODO: make this xulmus specific + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn include @javascriptTop syntax/javascript.vim +unlet b:current_syntax + +syn include @cssTop syntax/css.vim +unlet b:current_syntax + +syn match xulmusCommandStart "\%(^\s*:\=\)\@<=" nextgroup=xulmusCommand,xulmusAutoCmd + +syn keyword xulmusCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] + \ bmarks bn[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] + \ cno[remap] colo[rscheme] com[mand] comc[lear] cu[nmap] cuna[bbrev] delbm[arks] delc[ommand] delm[arks] delmac[ros] + \ delqm[arks] dels[tyle] dia[log] dl do[autocmd] doautoa[ll] downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] + \ exu[sage] files fini[sh] fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] + \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] + \ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] + \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] + \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab + \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen + \ tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion] + \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] + \ contained + +syn match xulmusCommand "!" contained + +syn keyword xulmusAutoCmd au[tocmd] contained nextgroup=xulmusAutoEventList skipwhite + +syn keyword xulmusAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost xulmusEnter + \ xulmusLeavePre xulmusLeave + \ contained + +syn match xulmusAutoEventList "\(\a\+,\)*\a\+" contained contains=xulmusAutoEvent + +syn region xulmusSet matchgroup=xulmusCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>" + \ end="$" keepend oneline contains=xulmusOption,xulmusString + +syn keyword xulmusOption activate act cdpath cd complete cpt defsearch ds editor eventignore ei extendedhinttags eht + \ followhints fh guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls messages msgs + \ newtab nextpattern pageinfo pa popups pps previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf + \ showstatuslinks ssli showtabline stal suggestengines titlestring urlseparator verbose vbs wildcase wic wildignore wig + \ wildmode wim wildoptions wop wordseparators wsp + \ contained nextgroup=xulmusSetMod + +" toggle options +syn match xulmusOption "\<\%(no\|inv\)\=\%(errorbells\|eb\|exrc\|ex\|focuscontent\|fc\|fullscreen\|fs\|ignorecase\|ic\)\>!\=" + \ contained nextgroup=xulmusSetMod +syn match xulmusOption "\<\%(no\|inv\)\=\%(incsearch\|is\|insertmode\|im\|hlsearch\|hls\|linksearch\|lks\)\>!\=" + \ contained nextgroup=xulmusSetMod +syn match xulmusOption "\<\%(no\|inv\)\=\%(loadplugins\|lpl\|more\|online\|preload\|showmode\|smd\|smartcase\|scs\)\>!\=" + \ contained nextgroup=xulmusSetMod +syn match xulmusOption "\<\%(no\|inv\)\=\%(online\|visualbell\|vb\|usermode\|um\)\>!\=" + \ contained nextgroup=xulmusSetMod + +syn match xulmusSetMod "\%(\<[a-z_]\+\)\@<=&" contained + +syn region xulmusJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline +syn region xulmusJavaScript matchgroup=xulmusJavascriptDelimiter + \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold + +let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<=' +execute 'syn region xulmusCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline' +execute 'syn region xulmusCss matchgroup=xulmusCssDelimiter' + \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold' + +syn match xulmusNotation "<[0-9A-Za-z-]\+>" + +syn match xulmusComment +".*$+ contains=xulmusTodo,@Spell +syn keyword xulmusTodo FIXME NOTE TODO XXX contained + +syn region xulmusString start="\z(["']\)" end="\z1" skip="\\\\\|\\\z1" oneline + +syn match xulmusLineComment +^\s*".*$+ contains=xulmusTodo,@Spell + +" NOTE: match vim.vim highlighting group names +hi def link xulmusAutoCmd xulmusCommand +hi def link xulmusAutoEvent Type +hi def link xulmusCommand Statement +hi def link xulmusComment Comment +hi def link xulmusJavascriptDelimiter Delimiter +hi def link xulmusCssDelimiter Delimiter +hi def link xulmusNotation Special +hi def link xulmusLineComment Comment +hi def link xulmusOption PreProc +hi def link xulmusSetMod xulmusOption +hi def link xulmusString String +hi def link xulmusTodo Todo + +let b:current_syntax = "xulmus" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: tw=130 et ts=4 sw=4: From 2feddd7f9e52625fb9d42d7a1887d60766cda336 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Wed, 18 Mar 2009 14:17:03 +1100 Subject: [PATCH 13/87] Use "main-menubar" for the 'guioptions' menubar value. Songbird places the menubar in the window's titlebar so "m" may need different handling. --- xulmus/content/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 4399e187..a83bfb74 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -36,7 +36,7 @@ const config = { //{{{ defaults: { guioptions: "rb" }, guioptions: { - m: ["Menubar", ["toolbar-menubar"]], + m: ["Menubar", ["main-menubar"]], T: ["Toolbar", ["nav-bar"]], B: ["Bookmark bar", ["PersonalToolbar"]] }, From 431743b907b6d8092d6a250b028c19e18f7f0870 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Thu, 19 Mar 2009 00:06:45 +1100 Subject: [PATCH 14/87] Fix removal of duplicates from getAlbums() return value. --- xulmus/content/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index bcce7090..90f43460 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -189,7 +189,7 @@ function getAlbums(artist) i++; } - return util.Array.uniq(albumArray); + return util.Array.uniq(albumArray.map(String)); } function getTracks(artist,album) From 5329080b24d1daa82ed640f6f8932c1a58efceca Mon Sep 17 00:00:00 2001 From: kenneslin <ken@kenneslin.(none)> Date: Thu, 19 Mar 2009 03:07:16 +0530 Subject: [PATCH 15/87] Added some media mappings, edited the getAlbums() function, renamed :playmedia to :filter and context titles in autocompletions --- common/content/completion.js | 9 ++++ xulmus/content/player.js | 93 +++++++++++++++++++++++++++--------- 2 files changed, 80 insertions(+), 22 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 3135db74..2a82a54c 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1393,11 +1393,20 @@ function Completion() //{{{ song: function song(context, args) { if (args.completeArg == 0) + { + context.title = ["Artists"]; context.completions = getArtists(); + } else if (args.completeArg == 1) + { + context.title = ["Albums by "+args[0]]; context.completions = getAlbums(args[0]); + } else if (args.completeArg == 2) + { + context.title = ["Tracks from "+args[1]+" by "+args[0]]; context.completions = getTracks(args[0],args[1]); + } }, buffer: function buffer(context) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 90f43460..10611bf4 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -51,10 +51,10 @@ function Player() // {{{ }); mappings.add([modes.PLAYER], - ["l"], "Play Media", + ["f"], "Filter Library", function () { - commandline.open(":", "playmedia ", modes.EX); + commandline.open(":", "filter ", modes.EX); }); mappings.add([modes.PLAYER], @@ -88,12 +88,52 @@ function Player() // {{{ } }); - /////////////////////////////////////////////////////////////////////////////}}} + mappings.add([modes.PLAYER], + ["h"], "Seek -10s", + function () + { + if (gMM.playbackControl.position >= 10000) + gMM.playbackControl.position = gMM.playbackControl.position - 10000; + else + gMM.playbackControl.position = 0; + }); + + mappings.add([modes.PLAYER], + ["l"], "Seek +10s", + function () + { + if ((gMM.playbackControl.duration - gMM.playbackControl.position) >= 10000) + gMM.playbackControl.position = gMM.playbackControl.position + 10000; + else + gMM.playbackControl.position = gMM.playbackControl.duration; + }); + + mappings.add([modes.PLAYER], + ["H"], "Seek -1m", + function () + { + if (gMM.playbackControl.position >= 60000) + gMM.playbackControl.position = gMM.playbackControl.position - 60000; + else + gMM.playbackControl.position = 0; + }); + + mappings.add([modes.PLAYER], + ["L"], "Seek +1m", + function () + { + if ((gMM.playbackControl.duration - gMM.playbackControl.position) >= 60000) + gMM.playbackControl.position = gMM.playbackControl.position + 60000; + else + gMM.playbackControl.position = gMM.playbackControl.duration; + }); + + ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - commands.add(["playmedia"], - "Play Media", + commands.add(["f[ilter]"], + "Filter Tracks", function (args) { //Store the old view @@ -105,20 +145,17 @@ function Player() // {{{ .createInstance(Ci.sbIMutablePropertyArray); //args - if (args.length == 1) + switch (args.length) { - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - } - else if (args.length == 2) - { - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - customProps.appendProperty(SBProperties.albumName,args[1].toString()); - } - else if (args.length == 3) - { - customProps.appendProperty(SBProperties.artistName,args[0].toString()); - customProps.appendProperty(SBProperties.albumName,args[1].toString()); - customProps.appendProperty(SBProperties.trackName,args[2].toString()); + case 3: + customProps.appendProperty(SBProperties.trackName,args[2].toString()); + case 2: + customProps.appendProperty(SBProperties.albumName,args[1].toString()); + case 3: + customProps.appendProperty(SBProperties.artistName,args[0].toString()); + break; + default: + break; } sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); @@ -127,7 +164,7 @@ function Player() // {{{ completer: function (context, args) completion.song(context, args) }); - /////////////////////////////////////////////////////////////////////////////}}} + /////////////////////////////////////////////////////////////////////////////}} } ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -179,17 +216,29 @@ function getArtistsArray() function getAlbums(artist) { var list = LibraryUtils.mainLibrary; - var albumArray = []; + var albumArray = [], returnArray = []; var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); - var i = 0; + var i = 0, j = 0; + while (items.hasMoreElements()) { album = items.getNext().getProperty(SBProperties.albumName); albumArray[i] = [album, album]; + + if (i == 0) + { + returnArray[j] = albumArray[i]; + j++; + } + else if (albumArray[i-1].toString() != albumArray[i].toString()) + { + returnArray[i] = albumArray[i]; + j++; + } i++; } - return util.Array.uniq(albumArray.map(String)); + return returnArray; } function getTracks(artist,album) From a4d178ea18cedd359cbdfe9b0c3fa731b446ce07 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Thu, 19 Mar 2009 13:20:23 +1100 Subject: [PATCH 16/87] Fix :filter {artist}. --- xulmus/content/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 10611bf4..a897f589 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -151,7 +151,7 @@ function Player() // {{{ customProps.appendProperty(SBProperties.trackName,args[2].toString()); case 2: customProps.appendProperty(SBProperties.albumName,args[1].toString()); - case 3: + case 1: customProps.appendProperty(SBProperties.artistName,args[0].toString()); break; default: From 122657730a3be2b42eda7748ccdf8a1b6804cce5 Mon Sep 17 00:00:00 2001 From: Doug Kearns <dougkearns@gmail.com> Date: Fri, 20 Mar 2009 00:44:08 +1100 Subject: [PATCH 17/87] Add initial rough version of player.html help file. --- xulmus/TODO | 1 + xulmus/content/config.js | 4 +++- xulmus/locale/en-US/asciidoc.conf | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xulmus/TODO b/xulmus/TODO index dba2a80b..f03bffc7 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -4,3 +4,4 @@ Priority list: BUGS: FEATURES: +9 Xulmus logo diff --git a/xulmus/content/config.js b/xulmus/content/config.js index a83bfb74..27c6eb87 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -117,7 +117,7 @@ const config = { //{{{ //TODO : Write intro.html and tutorial.html // they are sorted by relevance, not alphabetically - //helpFiles: [ "intro.html" ], + helpFiles: [ "player.html" ], /* "intro.html", "tutorial.html", "starting.html", "browsing.html", "buffer.html", "cmdline.html", "insert.html", "options.html", "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", @@ -134,6 +134,8 @@ const config = { //{{{ init: function () { + options["helpfile"] = "player.html"; + //Adding a mode for Player //modes.addMode("PLAYER"); // Player mode for songbird diff --git a/xulmus/locale/en-US/asciidoc.conf b/xulmus/locale/en-US/asciidoc.conf index 4bcc4288..4187121a 100755 --- a/xulmus/locale/en-US/asciidoc.conf +++ b/xulmus/locale/en-US/asciidoc.conf @@ -13,7 +13,7 @@ email=stubenschrott@gmx.net <meta http-equiv="Content-Type" content="application/xhtml+xml; charset={encoding=UTF-8}" /> <meta name="generator" content="AsciiDoc {asciidoc-version}" /> <link rel="stylesheet" href="xhtml11.css" type="text/css" /> - <link rel="icon" href="chrome://vimperator/skin/icon.png" type="image/png" /> + <link rel="icon" href="chrome://xulmus/skin/icon.png" type="image/png" /> <script type="application/x-javascript;version=1.8" src="help.js"></script> <title>{doctitle} @@ -23,8 +23,8 @@ email=stubenschrott@gmx.net [replacements] -LOGO=
-HEADER=
+LOGO=
+HEADER=
\[count\]=[count] \[!\]=[!] From 56ee77ba4f32e5868cd4c7dd756c9a2906610ea8 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 00:48:41 +1100 Subject: [PATCH 18/87] Whitespace formatting fixes. --- common/content/completion.js | 6 +++--- xulmus/content/player.js | 33 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 2a82a54c..f1a31114 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1399,13 +1399,13 @@ function Completion() //{{{ } else if (args.completeArg == 1) { - context.title = ["Albums by "+args[0]]; + context.title = ["Albums by " + args[0]]; context.completions = getAlbums(args[0]); } else if (args.completeArg == 2) { - context.title = ["Tracks from "+args[1]+" by "+args[0]]; - context.completions = getTracks(args[0],args[1]); + context.title = ["Tracks from " + args[1] + " by " + args[0]]; + context.completions = getTracks(args[0], args[1]); } }, diff --git a/xulmus/content/player.js b/xulmus/content/player.js index a897f589..3ac85dba 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -94,7 +94,7 @@ function Player() // {{{ { if (gMM.playbackControl.position >= 10000) gMM.playbackControl.position = gMM.playbackControl.position - 10000; - else + else gMM.playbackControl.position = 0; }); @@ -107,14 +107,14 @@ function Player() // {{{ else gMM.playbackControl.position = gMM.playbackControl.duration; }); - + mappings.add([modes.PLAYER], ["H"], "Seek -1m", function () { if (gMM.playbackControl.position >= 60000) gMM.playbackControl.position = gMM.playbackControl.position - 60000; - else + else gMM.playbackControl.position = 0; }); @@ -148,17 +148,17 @@ function Player() // {{{ switch (args.length) { case 3: - customProps.appendProperty(SBProperties.trackName,args[2].toString()); + customProps.appendProperty(SBProperties.trackName, args[2].toString()); case 2: - customProps.appendProperty(SBProperties.albumName,args[1].toString()); + customProps.appendProperty(SBProperties.albumName, args[1].toString()); case 1: - customProps.appendProperty(SBProperties.artistName,args[0].toString()); + customProps.appendProperty(SBProperties.artistName, args[0].toString()); break; default: break; } - sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0,Ci.sbIMediaItem))); + sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0, Ci.sbIMediaItem))); }, { completer: function (context, args) completion.song(context, args) @@ -198,9 +198,10 @@ function getArtistsArray() var artistArray = []; var i = 0; // Count the number of media items for each distinct artist - while (artists.hasMore()) { + while (artists.hasMore()) + { artist = artists.getNext(); - artistArray[i] = [artist,artist]; + artistArray[i] = [artist, artist]; list.enumerateItemsByProperty(SBProperties.artistName, artist, listener, @@ -219,9 +220,10 @@ function getAlbums(artist) var albumArray = [], returnArray = []; var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); var i = 0, j = 0; - - while (items.hasMoreElements()) { + + while (items.hasMoreElements()) + { album = items.getNext().getProperty(SBProperties.albumName); albumArray[i] = [album, album]; @@ -241,7 +243,7 @@ function getAlbums(artist) return returnArray; } -function getTracks(artist,album) +function getTracks(artist, album) { var list = LibraryUtils.mainLibrary; var tracksArray = []; @@ -249,11 +251,12 @@ function getTracks(artist,album) .createInstance(Ci.sbIMutablePropertyArray); var i = 0; - pa.appendProperty(SBProperties.artistName,artist.toString()); - pa.appendProperty(SBProperties.albumName,album.toString()); + pa.appendProperty(SBProperties.artistName, artist.toString()); + pa.appendProperty(SBProperties.albumName, album.toString()); var items = list.getItemsByProperties(pa).enumerate(); - while (items.hasMoreElements()) { + while (items.hasMoreElements()) + { track = items.getNext().getProperty(SBProperties.trackName); tracksArray[i] = [track, track]; i++; From b68b0e2f5519863b293e6e2949f0bd567507650d Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Thu, 19 Mar 2009 20:14:13 +0530 Subject: [PATCH 19/87] Removed extra media page and content pane from install.rdf --- xulmus/install.rdf | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/xulmus/install.rdf b/xulmus/install.rdf index 68e17ae6..7dccc3a8 100755 --- a/xulmus/install.rdf +++ b/xulmus/install.rdf @@ -7,16 +7,7 @@ xulmus@vimperator.org 0.1 Prathyush Thota - - - VIM for SongBird brothers. - - - - - - - + Makes Songbird behave like Vim and CMus. songbird@songbirdnest.com @@ -24,35 +15,5 @@ 1.1.0pre - - - - - - - - - xulmus - chrome://xulmus/content/pane.xul - chrome://xulmus/skin/pane-icon.png - 200 - 100 - servicepane - true - - - - - - - - - xulmus - chrome://xulmus/content/media-page.xul - - - From 1ea343d5f815ac98f154210ae0decb2ef65d1451 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 02:31:30 +1100 Subject: [PATCH 20/87] Move some inline functionality to slots of player. --- xulmus/content/player.js | 188 +++++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 87 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 3ac85dba..f949d86e 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -11,122 +11,70 @@ function Player() // {{{ // Get the focus to the visible playlist first //window._SBShowMainLibrary(); + // FIXME: need to test that we're playing - why is gMM.playbackControl.status always null? + // interval (seconds) + function seek(interval, direction) + { + interval = interval * 1000; + + let min = 0; + let max = gMM.playbackControl.duration; + let position = gMM.playbackControl.position + (direction ? interval : -interval); + + gMM.playbackControl.position = Math.min(Math.max(position, min), max) + } + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ mappings.add([modes.PLAYER], ["x"], "Play Track", - function () - { - gMM.sequencer.play(); - }); + function () { player.play(); }); mappings.add([modes.PLAYER], ["z"], "Previous Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_previous"); - }); + function () { player.previous(); }); mappings.add([modes.PLAYER], ["c"], "Pause/Unpause Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_playpause"); - }); + function () { player.togglePlayPause(); }); mappings.add([modes.PLAYER], ["b"], "Next Track", - function () - { - gSongbirdWindowController.doCommand("cmd_control_next"); - }); + function () { player.next(); }); mappings.add([modes.PLAYER], ["v"], "Stop Track", - function () - { - gMM.sequencer.stop(); - }); + function () { player.stop(); }); mappings.add([modes.PLAYER], ["f"], "Filter Library", - function () - { - commandline.open(":", "filter ", modes.EX); - }); + function () { commandline.open(":", "filter ", modes.EX); }); mappings.add([modes.PLAYER], ["s"], "Toggle Shuffle", - function () - { - if (gMM.sequencer.mode != gMM.sequencer.MODE_SHUFFLE) - gMM.sequencer.mode = gMM.sequencer.MODE_SHUFFLE; - else - gMM.sequencer.mode = gMM.sequencer.MODE_FORWARD; - }); + function () { player.toggleShuffle(); }); mappings.add([modes.PLAYER], ["r"], "Toggle Repeat", - function () - { - switch (gMM.sequencer.repeatMode) - { - case gMM.sequencer.MODE_REPEAT_NONE: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE; - break; - case gMM.sequencer.MODE_REPEAT_ONE: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ALL; - break; - case gMM.sequencer.MODE_REPEAT_ALL: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; - break; - default: - gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; - break; - } - }); + function () { player.toggleRepeat(); }); mappings.add([modes.PLAYER], - ["h"], "Seek -10s", - function () - { - if (gMM.playbackControl.position >= 10000) - gMM.playbackControl.position = gMM.playbackControl.position - 10000; - else - gMM.playbackControl.position = 0; - }); + ["h"], "Seek -10s", + function () { player.seekBackward(10); }); mappings.add([modes.PLAYER], - ["l"], "Seek +10s", - function () - { - if ((gMM.playbackControl.duration - gMM.playbackControl.position) >= 10000) - gMM.playbackControl.position = gMM.playbackControl.position + 10000; - else - gMM.playbackControl.position = gMM.playbackControl.duration; - }); + ["l"], "Seek +10s", + function () { player.seekForward(10); }); mappings.add([modes.PLAYER], - ["H"], "Seek -1m", - function () - { - if (gMM.playbackControl.position >= 60000) - gMM.playbackControl.position = gMM.playbackControl.position - 60000; - else - gMM.playbackControl.position = 0; - }); + ["H"], "Seek -1m", + function () { player.seekBackward(60); }); mappings.add([modes.PLAYER], - ["L"], "Seek +1m", - function () - { - if ((gMM.playbackControl.duration - gMM.playbackControl.position) >= 60000) - gMM.playbackControl.position = gMM.playbackControl.position + 60000; - else - gMM.playbackControl.position = gMM.playbackControl.duration; - }); + ["L"], "Seek +1m", + function () { player.seekForward(60); }); ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// @@ -137,11 +85,11 @@ function Player() // {{{ function (args) { //Store the old view - //var prev_view = gMM.status.view; - var library = LibraryUtils.mainLibrary; - var mainView = library.createView(); - var sqncr = gMM.sequencer; - var customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + //let prev_view = gMM.status.view; + let library = LibraryUtils.mainLibrary; + let mainView = library.createView(); + let sqncr = gMM.sequencer; + let customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] .createInstance(Ci.sbIMutablePropertyArray); //args @@ -164,10 +112,76 @@ function Player() // {{{ completer: function (context, args) completion.song(context, args) }); - /////////////////////////////////////////////////////////////////////////////}} } + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + return { + + play: function play() + { + gMM.sequencer.play(); + }, + + stop: function stop() + { + gMM.sequencer.stop(); + }, + + next: function next() + { + gSongbirdWindowController.doCommand("cmd_control_next"); + }, + + previous: function previous() + { + gSongbirdWindowController.doCommand("cmd_control_previous"); + }, + + togglePlayPause: function togglePlayPause() + { + gSongbirdWindowController.doCommand("cmd_control_playpause"); + }, + + toggleShuffle: function toggleShuffle() + { + if (gMM.sequencer.mode != gMM.sequencer.MODE_SHUFFLE) + gMM.sequencer.mode = gMM.sequencer.MODE_SHUFFLE; + else + gMM.sequencer.mode = gMM.sequencer.MODE_FORWARD; + }, + + // FIXME: not really toggling - good enough for now. + toggleRepeat: function toggleRepeat() + { + switch (gMM.sequencer.repeatMode) + { + case gMM.sequencer.MODE_REPEAT_NONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ONE; + break; + case gMM.sequencer.MODE_REPEAT_ONE: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_ALL; + break; + case gMM.sequencer.MODE_REPEAT_ALL: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + default: + gMM.sequencer.repeatMode = gMM.sequencer.MODE_REPEAT_NONE; + break; + } + }, + + seekForward: function seekForward(interval) + { + seek(interval, true); + }, + + seekBackward: function seekBackward(interval) + { + seek(interval, false); + }, + + }; //}}} } // }}} From 43412fbaff7d2930c40a1f996d4e7ac0bb32daa6 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 02:37:53 +1100 Subject: [PATCH 21/87] Fix argCount for :filter - it requires an argument. --- xulmus/content/player.js | 1 + 1 file changed, 1 insertion(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index f949d86e..246ba040 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -109,6 +109,7 @@ function Player() // {{{ sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0, Ci.sbIMediaItem))); }, { + argCount: "+", completer: function (context, args) completion.song(context, args) }); From d0cb38691ee6081b0070019c0eea0b0276bfdd4d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 03:05:56 +1100 Subject: [PATCH 22/87] Add :player{play,pause,next,prev,stop} commands. --- xulmus/content/player.js | 33 +++++++++--- xulmus/locale/en-US/player.txt | 99 ++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 xulmus/locale/en-US/player.txt diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 246ba040..30e3b29f 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -29,23 +29,23 @@ function Player() // {{{ /////////////////////////////////////////////////////////////////////////////{{{ mappings.add([modes.PLAYER], - ["x"], "Play Track", + ["x"], "Play track", function () { player.play(); }); mappings.add([modes.PLAYER], - ["z"], "Previous Track", + ["z"], "Previous track", function () { player.previous(); }); mappings.add([modes.PLAYER], - ["c"], "Pause/Unpause Track", + ["c"], "Pause/Unpause track", function () { player.togglePlayPause(); }); mappings.add([modes.PLAYER], - ["b"], "Next Track", + ["b"], "Next track", function () { player.next(); }); mappings.add([modes.PLAYER], - ["v"], "Stop Track", + ["v"], "Stop track", function () { player.stop(); }); mappings.add([modes.PLAYER], @@ -81,7 +81,7 @@ function Player() // {{{ /////////////////////////////////////////////////////////////////////////////{{{ commands.add(["f[ilter]"], - "Filter Tracks", + "Filter and play tracks", function (args) { //Store the old view @@ -113,6 +113,27 @@ function Player() // {{{ completer: function (context, args) completion.song(context, args) }); + // TODO: better of as a single command, or cmus compatible E.g. :player-next? --djk + commands.add(["playern[ext]"], + "Play next track", + function () { player.next(); }); + + commands.add(["playerpr[ev]"], + "Play previous track", + function () { player.previous(); }); + + commands.add(["players[top]"], + "Stop track", + function () { player.stop(); }); + + commands.add(["playerp[lay]"], + "Play track", + function () { player.play(); }); + + commands.add(["playerpa[use]"], + "Pause/unpause track", + function () { player.togglePlayPause(); }); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt new file mode 100644 index 00000000..57b9f43e --- /dev/null +++ b/xulmus/locale/en-US/player.txt @@ -0,0 +1,99 @@ +HEADER + +|player-mode| |player| + + +The following features apply to Player mode which is activated when the media +tab has focus. + +|x| |:playerp| |:playerplay| +||:playerp[lay]|| + +||x|| +________________________________________________________________________________ +Play the current track. +________________________________________________________________________________ + +|z| |:playerpr| |:playerprev| +||:playerpr[ev]|| + +||z|| +________________________________________________________________________________ +Play the previous track. +________________________________________________________________________________ + + +|b| |:playern| |:playernext| +||:playern[ext]|| + +||b|| +________________________________________________________________________________ +Play the next track. +________________________________________________________________________________ + + +|c| |:playerpa| |:playerpause| +||:playerpa[use]|| + +||c|| +________________________________________________________________________________ +Pause/unpause the current track. +________________________________________________________________________________ + + +|v| |:players| |:playerstop| +||:players[top]|| + +||v|| +________________________________________________________________________________ +Stop playing the current track. +________________________________________________________________________________ + + +|x| +||x|| +________________________________________________________________________________ +Toggle shuffle mode. +________________________________________________________________________________ + + +|r| +||r|| +________________________________________________________________________________ +Toggle repeat mode. +________________________________________________________________________________ + + +|h| +||h|| +________________________________________________________________________________ +Seek +10s. +________________________________________________________________________________ + + +|l| +||l|| +________________________________________________________________________________ +Seek -10s. +________________________________________________________________________________ + + +|H| +||H|| +________________________________________________________________________________ +Seek +1m. +________________________________________________________________________________ + + +|L| +||L|| +________________________________________________________________________________ +Seek -1m. +________________________________________________________________________________ + + +|f| |:f| |:filter| +||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + +||f|| +________________________________________________________________________________ +Filter and play tracks. If only [a][artist][a] is specified then all tracks for +that artist are played in album order. If {album} is also specified then all +tracks for that album are played. A specific track can be specified with +{track}. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: From 0d9c86a547727f52a752e2ca359f557d74cfc6f0 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Fri, 20 Mar 2009 01:19:02 +0530 Subject: [PATCH 23/87] Added increase/decrease commands --- xulmus/content/player.js | 32 ++++++++++++++++++++++++++++---- xulmus/locale/en-US/player.txt | 14 ++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 30e3b29f..f54b39ea 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -16,12 +16,13 @@ function Player() // {{{ function seek(interval, direction) { interval = interval * 1000; - + let min = 0; let max = gMM.playbackControl.duration; + let position = gMM.playbackControl.position + (direction ? interval : -interval); - gMM.playbackControl.position = Math.min(Math.max(position, min), max) + gMM.playbackControl.position = Math.min(Math.max(position, min), max); } /////////////////////////////////////////////////////////////////////////////}}} @@ -75,6 +76,14 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["L"], "Seek +1m", function () { player.seekForward(60); }); + + mappings.add([modes.PLAYER], + ["=","+"], "Increase Volume by 10%", + function () { player.increaseVolume(); }); + + mappings.add([modes.PLAYER], + ["-"], "Decrease Volume by 10%", + function () { player.decreaseVolume(); }); ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// @@ -195,14 +204,29 @@ function Player() // {{{ seekForward: function seekForward(interval) { - seek(interval, true); + if (gMM.playbackControl) + seek(interval, true); }, seekBackward: function seekBackward(interval) { - seek(interval, false); + if (gMM.playbackControl) + seek(interval, false); }, + //FIXME: 10% ? + increaseVolume: function increaseVolume() + { + gMM.volumeControl.volume = gMM.volumeControl.volume * 1.1; + }, + + decreaseVolume: function decreaseVolume() + { + if (gMM.volumeControl.volume == 0) + gMM.volumeControl.volume = 0.1; + else + gMM.volumeControl.volume = gMM.volumeControl.volume * 0.9; + }, }; //}}} } // }}} diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 57b9f43e..8afaf1cc 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -86,6 +86,20 @@ Seek -1m. ________________________________________________________________________________ +|+| |=| +||+|| + +||=|| +________________________________________________________________________________ +Increase volume by 10%. +________________________________________________________________________________ + +|-| +||-|| +________________________________________________________________________________ +Decrease volume by 10%. +________________________________________________________________________________ + + |f| |:f| |:filter| ||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + ||f|| From 032f7c098167753fabddd302013f3cfeb02ab324 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 13:37:52 +1100 Subject: [PATCH 24/87] Add count support to l, L, h and H mappings. --- xulmus/content/player.js | 20 ++++++++++++-------- xulmus/locale/en-US/player.txt | 6 +++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index f54b39ea..a54def75 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -16,7 +16,7 @@ function Player() // {{{ function seek(interval, direction) { interval = interval * 1000; - + let min = 0; let max = gMM.playbackControl.duration; @@ -63,22 +63,26 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["h"], "Seek -10s", - function () { player.seekBackward(10); }); + function (count) { player.seekBackward(count * 10); }, + { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["l"], "Seek +10s", - function () { player.seekForward(10); }); + function (count) { player.seekForward(count * 10); }, + { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["H"], "Seek -1m", - function () { player.seekBackward(60); }); + function (count) { player.seekBackward(count * 60); }, + { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["L"], "Seek +1m", - function () { player.seekForward(60); }); - + function (count) { player.seekForward(count * 60); }, + { flags: Mappings.flags.COUNT }); + mappings.add([modes.PLAYER], - ["=","+"], "Increase Volume by 10%", + ["=", "+"], "Increase Volume by 10%", function () { player.increaseVolume(); }); mappings.add([modes.PLAYER], @@ -226,7 +230,7 @@ function Player() // {{{ gMM.volumeControl.volume = 0.1; else gMM.volumeControl.volume = gMM.volumeControl.volume * 0.9; - }, + } }; //}}} } // }}} diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 8afaf1cc..14768329 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -66,21 +66,21 @@ ________________________________________________________________________________ |l| -||l|| +||[count]l|| ________________________________________________________________________________ Seek -10s. ________________________________________________________________________________ |H| -||H|| +||[count]H|| ________________________________________________________________________________ Seek +1m. ________________________________________________________________________________ |L| -||L|| +||[count]L|| ________________________________________________________________________________ Seek -1m. ________________________________________________________________________________ From da38811c04b5115e546b05a9d4e9f9d33a849388 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 13:53:05 +1100 Subject: [PATCH 25/87] Add / and ? Player mode commands to TODO. --- xulmus/TODO | 1 + xulmus/content/player.js | 1 + 2 files changed, 2 insertions(+) diff --git a/xulmus/TODO b/xulmus/TODO index f03bffc7..1d54f9f2 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -5,3 +5,4 @@ BUGS: FEATURES: 9 Xulmus logo +9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/content/player.js b/xulmus/content/player.js index a54def75..941d9139 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -93,6 +93,7 @@ function Player() // {{{ ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + // TODO: presumably this will eventually just filter the library view like cmus? --djk commands.add(["f[ilter]"], "Filter and play tracks", function (args) From 5d652b78e614a7a3cf13c413e962f0d907990787 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 14:04:00 +1100 Subject: [PATCH 26/87] Update xulmus logo. --- xulmus/TODO | 1 - xulmus/content/xulmus.png | Bin 2226 -> 1081 bytes xulmus/content/xulmus.svg | 6 +++--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xulmus/TODO b/xulmus/TODO index 1d54f9f2..c23341ef 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -4,5 +4,4 @@ Priority list: BUGS: FEATURES: -9 Xulmus logo 9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/content/xulmus.png b/xulmus/content/xulmus.png index 52ff0c8d68884c764a979fac72c1b2ee38753a66..f1b04d4f901d8144716b822feac785b613608427 100755 GIT binary patch delta 1060 zcmV+<1l#+v5xEGEB!3`dNK#Dz0D2|>0Dy!50Qvv`0D$NK0Cg|`0P0`>06Lfe02gqa zx=}m;000DMK}|sb0I`mI`%#ks0004VQb$4nuFf3k00006VoOIv0RI600RN!9r;`8x z010qNS#tmY4#WTe4#WYKD-Ig~00WRoL_t(|+U=ZKNEJ~W#(&4OsK5tlkqUe0Nh2_b zqS6+keY0rKB6}!^%+QMJp`v}Ef~>$6+Ft5KGuuNVO0a?`f+R@7hl*CBjk46+cevk$ zVYuead#;W7{ou#Bv)q|;&iwDp`Ogg3afA>;1d02{`w#fEUZRC*r!Ej8{24N!ZqOM~ z2nC{OyCis~Pk+K3SOJHHS-%nvhG*cSFiA&T1c`~QL?pC5Q=ikYH@pBB!#QvlOoC_O z5?E)czCGYdI2NX|56!l#;BEHJBZXFUfw%&Wgqd(H-0fPnfd{?c@P8_N3G2F(!X<$F5!wjB{g@rNVJqBGoJO{h6ba=okeb$EKEQ?(8 zj(V15TH4nTma}>JZQ!)IG(X^vB12(iFIm|P@53~9cppx0@?jg^u>2He-e;DbE$!{L-@-ggxOmIM3&8X=p|}|CXKbAY4P=!#fPn3Z50K6jt^E(NGPa zasX}y`_Ef(JL4^F=Ma1WSMf646;9`}r7TV6zQAYW=vEzwc??3sAehSo(bg%Y2~6UW znW&8BSTu{5?p$?M^kc*nW`%~(EgX}P_G)DP?|)5fuWy9)sc)fn+o*3H6Sq>1sm*=Y zF_20d)k7PpI;XEG zw11)-Bbs}L`}uj9>kRdg)5XjhZ@6w{gf8FN%&;$dw)qRr+mWDZ)U!35La5KLw!ups@ zeJCu4wJ~gWbL*SNjM?+{2q8pt=)Jkv6VS0~8r^t} zJ+$KzYJWNki z_X%6LAMttLR5t(TGKD(&+d|P&fq2;ozIlzaVBAjxUKe~G0Vg@ZSNBtRmNaiq7aghV egb+fASnwMq-@Lwybc4bG00002AQi>*rxDjmA*(R0=w)UKg_wivv==(?(Ocg?6d9tCpYsvXU?2+ zW}b6r=A4;bnHd!-j5Q{VwE-0>z$iJQq~(%K(qp3`zru-!YDOFk>vx8%4PrcDFOS7bjlG;+V zR!L_chm6xC%^ZgAX_DS3NypnZk}+A*TuEmY@J*0(w)3_OSKlz~YmqcZ(xef}nI>tT zq-piC4FEI4XT{$GPXkL6TKWMlcb>F!9z?ufoCZ-1QKzGO_FCcI=%MsijcIASvP9|!*H zpI`8PCNJKV^>)NL(HnC{hEWrNBhIs^paaW~!x0UCI|&={gm#0|miqSxavU*n#;H-= z3LnHi;KB^ue~8+(Mf54a2Cuujgd=wPm@ETYyiUL(U}ePL1pEScPll}dz@fO$IXY)V z{ePWN_`||Ez{}46tyJAAADcel;u4P7Nm#kw#Xwxq0(?5FPa|?f7rw(4-X1*S!gk@+J9bUh&gd;u=Os|K-<$pctU}b}s%NUA;c9)s;Wz>%Z2fW-L(e|gx z({tKxH?w^i^j~`Uz7+jhFYmUD$kWW8Cu|7--kxi5z)myUT)>kF4_YQmnoL+OAvjyT zaH*H;a_Tpv_-f%!GdnzTlk(A=`o0nPF0fG2IcD}Ogy;bM>@n%MzK_Y)$mrG&^7;A%pY`GlF( zJ4xLWeNG0WJLPcQggr?UVY!Hrmw!)7=*Z!@)(}~$pCdtfMuafqEha3*i6bV<^3O-x zpkW~IxGSa~jXobF>;u0*h?Z;NP(l661@#GTBRF9vA@Szg?qh z*#H)Kc}v;}9YtFJ2s3FZn3+l1M@Un(=ddO8qtVuA%rN9+#mrtH82F>S~IKXp5qYkJxOmO966m!I8K{M*pm&~*P7X3Nw)w$0)8Or!@zF|ClBp} z*=8wl9`JfX4sE1Z54;Un>Sw*1oW6t*MQ^3t9`R?u*MM6kEhhX`mQnPGzy+Q%X}LugJ!Ja{u&#g!ZbE3F`^KPjhsAov<_;HO`D(PAg%C?@7sc zHHUv1!RfQ~K0tJ;RFKfVXf%`AW|n^q%x{q-vs_nB(m3J0fPdmtM}lo;*5fx_E(3ba zY^%!|LUZ~;Lh5EqlGc&59{3dS9pFpAy9u+(Bw#zRwIDZ^q&Y4DE+XvX4iWN?4<Cy>BH1MO}mo zA`e@^!GxsC2!H9Foo4o8i7pNsb5yh*Ls(^BJlkC+5V|7y@g`$+>y9fV-$c(KXMR>3%S#0n=Csy$+bhCt{Hol8+3AO|HkHjX4>m}MGS|yec?&{@TL9bBZxY2*IB4LEvzB>sH zc^2XF=<6c>Uc$Y=Uf?P-e)pPMTj7L7yfps`_-wq~N=zaAtC1@RPT2=M0({eq-LIvg o6;5naXCKWK8Uj_+T%jTGf7Z@+-VOKA`~Uy|07*qoM6N<$f|I2%d;kCd diff --git a/xulmus/content/xulmus.svg b/xulmus/content/xulmus.svg index 7e2983ed..c8e3603d 100755 --- a/xulmus/content/xulmus.svg +++ b/xulmus/content/xulmus.svg @@ -15,9 +15,9 @@ inkscape:version="0.46" version="1.0" sodipodi:docbase="/home/maxauthority/code/vimperator" - sodipodi:docname="vimperator.svg" + sodipodi:docname="xulmus.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/home/maxauthority/code/vimperator/vimperator.png" + inkscape:export-filename="/home/maxauthority/code/vimperator/xulmus.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> vimperator_ + y="29.896835">xulmus_ Date: Fri, 20 Mar 2009 16:04:23 +1100 Subject: [PATCH 27/87] Define missing window#BrowserStop and window#toJavascriptConsole. --- common/content/buffer.js | 16 ++-------------- xulmus/content/config.js | 12 +++++++++++- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 8534f4ee..15b09ae0 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -215,13 +215,7 @@ function Buffer() //{{{ mappings.add(myModes, [""], "Stop loading", - function () - { - if(config.name == "Xulmus") - getBrowser().mCurrentBrowser.stop(); - else - window.BrowserStop(); - }); + function () { window.BrowserStop(); }); // scrolling mappings.add(myModes, ["j", "", ""], @@ -603,13 +597,7 @@ function Buffer() //{{{ commands.add(["st[op]"], "Stop loading", - function () - { - if (config.name == "Xulmus") - getBrowser().mCurrentBrowser.stop(); - else - window.BrowserStop(); - }, + function () { window.BrowserStop(); }, { argCount: "0" }); commands.add(["vie[wsource]"], diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 27c6eb87..e4a28018 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -182,6 +182,7 @@ const config = { //{{{ liberator.loadModule("hints", Hints); // Load the Player module liberator.loadModule("player", Player); + //////////////////////////////////////////////////////////////////////////////// ////////////////////// STYLES ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -489,8 +490,17 @@ const config = { //{{{ options.add(["urlseparator"], "Set the separator regexp used to separate multiple URL args", "string", ",\\s"); + //}}} + + // TODO: mention this to SB devs, they seem keen to provide these + // functions to make porting from FF as simple as possible. + window.toJavaScriptConsole = function () { + toOpenWindowByType("global:console", "chrome://global/content/console.xul"); + } + window.BrowserStop = function () { + getBrowser().mCurrentBrowser.stop(); + } } - //}}} }; //}}} // vim: set fdm=marker sw=4 ts=4 et: From 070332d1527f49e0493f6a9e4ca1426807d13220 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 17:31:54 +1100 Subject: [PATCH 28/87] Add TODO. --- xulmus/TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/xulmus/TODO b/xulmus/TODO index c23341ef..6f60c324 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -5,3 +5,4 @@ BUGS: FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. +7 extended hint mode for opening links in FF From 1423c78b021672ba7e25eb6957c14b6442c354a8 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 18:49:17 +1100 Subject: [PATCH 29/87] Fix count handling of seek commands. --- xulmus/content/player.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 941d9139..e6d80ca3 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -63,22 +63,22 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["h"], "Seek -10s", - function (count) { player.seekBackward(count * 10); }, + function (count) { player.seekBackward(Math.max(1, count) * 10); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["l"], "Seek +10s", - function (count) { player.seekForward(count * 10); }, + function (count) { player.seekForward(Math.max(1, count) * 10); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["H"], "Seek -1m", - function (count) { player.seekBackward(count * 60); }, + function (count) { player.seekBackward(Math.max(1, count) * 60); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["L"], "Seek +1m", - function (count) { player.seekForward(count * 60); }, + function (count) { player.seekForward(Math.max(1, count) * 60); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], From 32292c9823f5324d5f7b9c297265809fa69defd5 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 21 Mar 2009 03:08:12 +1100 Subject: [PATCH 30/87] Add new :volume command. --- xulmus/TODO | 1 + xulmus/content/player.js | 53 ++++++++++++++++++++++++++-------- xulmus/locale/en-US/player.txt | 31 +++++++++++++++----- 3 files changed, 66 insertions(+), 19 deletions(-) diff --git a/xulmus/TODO b/xulmus/TODO index 6f60c324..109039ee 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -2,6 +2,7 @@ Priority list: 1-9 as in Vim (9 = required for next release, 5 = would be nice, 1 = probably not) BUGS: +- SB doesn't support tab-undo yet so :undo and "u" etc don't work FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/content/player.js b/xulmus/content/player.js index e6d80ca3..92322f93 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -11,10 +11,13 @@ function Player() // {{{ // Get the focus to the visible playlist first //window._SBShowMainLibrary(); - // FIXME: need to test that we're playing - why is gMM.playbackControl.status always null? + // FIXME: need to test that we're playing - gMM.status.state // interval (seconds) function seek(interval, direction) { + if (!gMM.playbackControl) + return; + interval = interval * 1000; let min = 0; @@ -127,7 +130,15 @@ function Player() // {{{ completer: function (context, args) completion.song(context, args) }); - // TODO: better of as a single command, or cmus compatible E.g. :player-next? --djk + // TODO: better off as a single command, or cmus compatible E.g. :player-next? --djk + commands.add(["playerp[lay]"], + "Play track", + function () { player.play(); }); + + commands.add(["playerpa[use]"], + "Pause/unpause track", + function () { player.togglePlayPause(); }); + commands.add(["playern[ext]"], "Play next track", function () { player.next(); }); @@ -140,13 +151,26 @@ function Player() // {{{ "Stop track", function () { player.stop(); }); - commands.add(["playerp[lay]"], - "Play track", - function () { player.play(); }); + commands.add(["vol[ume]"], + "Set the volume", + function (args) + { + let arg = args[0]; - commands.add(["playerpa[use]"], - "Pause/unpause track", - function () { player.togglePlayPause(); }); + if (!/^[+-]?\d+$/.test(arg)) + { + liberator.echoerr("E488: Trailing characters"); + return; + } + + let level = parseInt(arg, 10) / 100; + + if (/^[+-]/.test(arg)) + level = player.volume + level; + + player.volume = Math.min(Math.max(level, 0), 1); + }, + { argCount: 1 }); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// @@ -154,6 +178,13 @@ function Player() // {{{ return { + // TODO: check bounds and round, 0 - 1 or 0 - 100? + get volume() gMM.volumeControl.volume, + set volume(value) + { + gMM.volumeControl.volume = value; + }, + play: function play() { gMM.sequencer.play(); @@ -209,14 +240,12 @@ function Player() // {{{ seekForward: function seekForward(interval) { - if (gMM.playbackControl) - seek(interval, true); + seek(interval, true); }, seekBackward: function seekBackward(interval) { - if (gMM.playbackControl) - seek(interval, false); + seek(interval, false); }, //FIXME: 10% ? diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 14768329..3f9d4e97 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -5,6 +5,8 @@ HEADER The following features apply to Player mode which is activated when the media tab has focus. +section:Playing{nbsp}tracks[playing-tracks] + |x| |:playerp| |:playerplay| ||:playerp[lay]|| + ||x|| @@ -57,6 +59,20 @@ ________________________________________________________________________________ Toggle repeat mode. ________________________________________________________________________________ +section:Filtering{nbsp}the{nbsp}library[filter,filtering] + +|f| |:f| |:filter| +||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + +||f|| +________________________________________________________________________________ +Filter and play tracks. If only [a][artist][a] is specified then all tracks for +that artist are played in album order. If {album} is also specified then all +tracks for that album are played. A specific track can be specified with +{track}. +________________________________________________________________________________ + + +section:Seeking{nbsp}to{nbsp}a{nbsp}track{nbsp}position[seeking] |h| ||h|| @@ -86,6 +102,8 @@ Seek -1m. ________________________________________________________________________________ +section:Adjusting{nbsp}the{nbsp}volume[volume] + |+| |=| ||+|| + ||=|| @@ -93,6 +111,7 @@ ________________________________________________________________________________ Increase volume by 10%. ________________________________________________________________________________ + |-| ||-|| ________________________________________________________________________________ @@ -100,14 +119,12 @@ Decrease volume by 10%. ________________________________________________________________________________ -|f| |:f| |:filter| -||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + -||f|| +|:vol| |:volume| +||:vol[ume][!] [a][value][a]|| + +||:vol[ume][!] +{value} | -{value}|| + ________________________________________________________________________________ -Filter and play tracks. If only [a][artist][a] is specified then all tracks for -that artist are played in album order. If {album} is also specified then all -tracks for that album are played. A specific track can be specified with -{track}. +Set the player volume. [a][value][a] can be an absolute value between 0 and +100% or a relative value if prefixed with "-" or "+". ________________________________________________________________________________ // vim: set filetype=asciidoc: From ca4efd13df1f0552b1a19da54abc2343b61cfed1 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 21 Mar 2009 13:18:47 +0530 Subject: [PATCH 31/87] Fixed play() to play first track of the visible view. --- xulmus/content/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 92322f93..beac81f1 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -187,7 +187,7 @@ function Player() // {{{ play: function play() { - gMM.sequencer.play(); + gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); }, stop: function stop() From 0126043a6846a4d98246ea0e3f147084288080a4 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sun, 22 Mar 2009 01:35:55 +0530 Subject: [PATCH 32/87] Added :Filter command for filtering the view, searchTracks() for searching inside a visible view and focusTrack(). --- xulmus/content/player.js | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index beac81f1..2a028246 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -28,6 +28,11 @@ function Player() // {{{ gMM.playbackControl.position = Math.min(Math.max(position, min), max); } + function focusTrack(mediaItem) + { + SBGetBrowser().mediaTab.mediaPage.highlightItem(_SBGetCurrentView().getIndexForItem(mediaItem)); + } + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -55,6 +60,10 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["f"], "Filter Library", function () { commandline.open(":", "filter ", modes.EX); }); + + mappings.add([modes.PLAYER], + ["F"], "Loads current view filtered by the keywords", + function () { commandline.open(":", "Filter ", modes.EX); }); mappings.add([modes.PLAYER], ["s"], "Toggle Shuffle", @@ -124,12 +133,34 @@ function Player() // {{{ } sqncr.playView(mainView, mainView.getIndexForItem(library.getItemsByProperties(customProps).queryElementAt(0, Ci.sbIMediaItem))); + player.focusPlayingTrack(); }, { argCount: "+", completer: function (context, args) completion.song(context, args) }); + commands.add(["F[ilter]"], + "Filter tracks based on keywords {artist/album/track}", + function (args) + { + let library = LibraryUtils.mainLibrary; + let myView = LibraryUtils.createStandardMediaListView(LibraryUtils.mainLibrary, args.string); + if (myView.length == 0) + liberator.echoerr("No Tracks matching the keywords"); + else + { + SBGetBrowser().loadMediaList(LibraryUtils.mainLibrary, null, null, myView, + "chrome://songbird/content/mediapages/filtersPage.xul"); + //TODO: make this focusTrack work ? + focusTrack(myView.getItemByIndex(0)); + } + }, + { + argCount: "+", + // completer: function (context, args) completion.tracks(context, args); + }); + // TODO: better off as a single command, or cmus compatible E.g. :player-next? --djk commands.add(["playerp[lay]"], "Play track", @@ -188,6 +219,7 @@ function Player() // {{{ play: function play() { gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); + focusTrack(gMM.sequencer.currentItem); }, stop: function stop() @@ -208,6 +240,7 @@ function Player() // {{{ togglePlayPause: function togglePlayPause() { gSongbirdWindowController.doCommand("cmd_control_playpause"); + SBGetBrowser().mediaTab.mediaPage.highlightItem(_SBGetCurrentView().getIndexForItem(gMM.sequencer.currentItem)); }, toggleShuffle: function toggleShuffle() @@ -260,7 +293,45 @@ function Player() // {{{ gMM.volumeControl.volume = 0.1; else gMM.volumeControl.volume = gMM.volumeControl.volume * 0.9; + }, + + focusPlayingTrack :function focusPlayingTrack() + { + focusTrack(gMM.sequencer.currentItem); + }, + + listTracks: function listTracks(view) + { + //let myView = LibraryUtils.createStandardMediaListView(LibraryUtils.mainLibrary, args); + let length = view.length; + let tracksList = []; + + for (var i=0; i < length; i++) + { + var mediaItem = view.getItemByIndex(i); + var trackName = mediaItem.getProperty(SBProperties.trackName); + var albumName = mediaItem.getProperty(SBProperties.albumName); + var artistName = mediaItem.getProperty(SBProperties.artistName); + + tracksList[i] = [ trackName, "Album : "+albumName+" Artist : "+artistName ]; + } + return tracksList; + }, + //TODO: Use this for implementing "/" and "?". -ken + searchTracks: function searchTracks(args) + { + let currentView = _SBGetCurrentView(); + let mediaItemList = currentView.mediaList; + let search = _getSearchString(currentView); + let searchString = ""; + if (search != "") + searchString = args + " " + search; + else + searchString = args; + let myView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); + focusTrack(myView.getItemByIndex(0)); } + }; //}}} } // }}} From 310d807746c6f88c38efd5279c7a5f8147eaa591 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sun, 22 Mar 2009 02:18:40 +0530 Subject: [PATCH 33/87] Added entry for :Filter in help page --- xulmus/TODO | 1 + xulmus/locale/en-US/player.txt | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/xulmus/TODO b/xulmus/TODO index 109039ee..16d5bc28 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -7,3 +7,4 @@ BUGS: FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. 7 extended hint mode for opening links in FF +5 Check for default extensions and add commands for them. Ex. Last.fm, Seeqpod e.t.c diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 3f9d4e97..ed7ecb01 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -72,6 +72,15 @@ tracks for that album are played. A specific track can be specified with ________________________________________________________________________________ +|F| |:F| |:Filter| +||:F[ilter] {keywords}|| + +||F|| +________________________________________________________________________________ +Filter and show the tracks as a view. The tracks are filtered by the {keywords} +provided as arguments. This text search applies over the default filter properties, +namely: Genre, Artist, and Album. +________________________________________________________________________________ + section:Seeking{nbsp}to{nbsp}a{nbsp}track{nbsp}position[seeking] |h| From a51cf072c9b145f6b00bd226f72ecbf395fef2de Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sun, 22 Mar 2009 05:42:51 +0530 Subject: [PATCH 34/87] Added TODO --- xulmus/TODO | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xulmus/TODO b/xulmus/TODO index 16d5bc28..c40dc405 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -6,5 +6,6 @@ BUGS: FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. -7 extended hint mode for opening links in FF +8 Playlist/SmartPlaylist operations. +7 extended hint mode for opening links in FF. 5 Check for default extensions and add commands for them. Ex. Last.fm, Seeqpod e.t.c From 2cfd2ee5bae4f139b69372993c7b572e94291c54 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sun, 22 Mar 2009 06:38:07 +0530 Subject: [PATCH 35/87] Modified play() for playing selected tracks in the view --- xulmus/content/player.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 2a028246..5fe543cb 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -218,8 +218,18 @@ function Player() // {{{ play: function play() { - gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); - focusTrack(gMM.sequencer.currentItem); + //Check if there is any selection in place, else play first item of the visible view. + if (_SBGetCurrentView().selection.count != 0) + { + //Play the selection. + gMM.sequencer.playView(_SBGetCurrentView(),_SBGetCurrentView().getIndexForItem(_SBGetCurrentView().selection.currentMediaItem)); + focusTrack(gMM.sequencer.currentItem); + } + else + { + gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); + focusTrack(gMM.sequencer.currentItem); + } }, stop: function stop() From 2216878c9dfd3b4a9a40068cda54c5a26175aea5 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 21 Mar 2009 15:02:09 +1100 Subject: [PATCH 36/87] Use green for the Xulmus logo's tilde. --- xulmus/content/xulmus.png | Bin 1081 -> 1082 bytes xulmus/content/xulmus.svg | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/xulmus.png b/xulmus/content/xulmus.png index f1b04d4f901d8144716b822feac785b613608427..e907ad058435d6df35e595fb1f49da6610a74e5a 100755 GIT binary patch delta 908 zcmV;719SYj2)YQ6lo63hL_t(|+U=ZKNEJ~W#>b_Rr7M3zO0a?`f+R@7hl*CBjk46+ zce>xDVYuead#+vc`@xTMXSp-yocZ6G^Pd^6;|L*y@DuZo_wS3+dWjY$R$U-O@H3=O z-Jmm~5DG-mc8T{)pMcr00uBwbekB|PPs4>ll8%@V5))gANML)WKBr(Wcpff-v*Avd z2+zR9u+D!{eY?XIa12agADV4f!JF)x2MVq50&zJU0W;tlxXZO{Jr8;fToy%bD23hl zc@FFdGhNHg59<-!V_{$Y;0*@2n|822%~RGNejtA4!MqK(!7K0~8~``NdN_~kMGFP2 z>pHldLAU{Kf%$MR9A+sH_cI8K;8ylc1N$)zrt^PnEG&!>?=a}%;91y}rNaYW8D(ua z#BKf@j4lg_XTP zG*o}X#~gs0!T!@$+|D>l+c^lI!IivBcY)KmYza$~xzCTXadfK=#9RiUVIa)mfoSWL z(0C?sNla8maV(n2OLvaCD*Q2GGP6QM;1-U_NP9N2{?{h9*C)jK)VEN(ZPd4piCYQB z)aJhHXfDfEXxRzGqc8!UglkzQaDFgqSWbUwWO-hQ^?AoKCBp5tRbManEssgtbRaH( zW8rJKiu3Y0J)TL7my0Y9!AY*|nt(bCXNFjx%dYJtMX=q?t*=SmcEhQT{|QUrd+p&k zc#YFn6$^OlA=n4cW~jc_x+ zG{pLtOnnF}gS8QCcXR8T%8c3c!wZgS>-k+1(B=_oU-(?1C4>+{2q8px=)Jkf)~7vmO6`x^#fwV7cReYq|_;R%4x5 zF3-jE1a+UVh5Heo_f2Kcdgr7M3TO0a?`f+R@7hl*CBjk46+ zcevk$VYuead#;W7{ou#Bv)q|;&iwDp`Ogg3afA>;1d02{`w#fEUZRC*r!Ej8{24N! zZqOM~2nC{OyCis~Pr@8n0f&WIzY-3HXW*hRNk?1+iHWU5B(yzKpVP26yZ{%&IdB(D zf@k3pSZ9B!zCGYdI2NX|56!l#;BEHJBZXFUfw%&Wgqd(H-0fPnfd{?c@G5)^2f{6|9?s`_exZJZQ!)IG(X^vB12(iFIm|P@53~9cppx0@?jg^u>2He-e;Db zE$!fSv&*yDvXhu8#mYwh*TtnZ(I}FeYo)xPUR`vqX zPz`^dasX}y`_Ef(JL4^F=Ma1WSMf646;9`}r7TV6zQAYW=vEzwc??3sAehSo(bg%Y z2~6UWnW&8BSTu{5?p$?M^kc*nW`%~(EgX}P_G)DP?@es4Z-n)!Z=rVEsBaw;w^EL& z&3)G~T$ZEIvJ;5MU?MyP*Rf3G{BYE;oZ5fL^85(v^MPe*jN5IizFr<$9+S4|KwJpN z!MAWV=M`{z0+SdomslQ#lU>_20d)k7Pp zI;XEGw4xg$ntO)(`FWY^4E2%I#mpLSxNc>HF5lVAurGSH`3uhEAigQgeaabd6nuZ} zS!VNTMRV($PXEL+$6rsLTICtBkeT3lSmIe$!az*odfrQ_NoY>+mWDZ)U!35La5KLw z!ups@eJCu4wJ~gWbL*SNjM?_)?)Igb+dqAw+cOy}8&E(6MP6 z-FS^Xwdw*Pgb+dqA%qY@2qA$KzY zJWNki_X%6LAMttLR5t(TGKD(&+d|P&fq2;ozIlzaVBAjxUKe~G0Vg@ZSNBtRmNaiq h7pd!n5JHGp@EaxHyuOQcgTep+002ovPDHLkV1hB1#wGv& diff --git a/xulmus/content/xulmus.svg b/xulmus/content/xulmus.svg index c8e3603d..9fa8c7b3 100755 --- a/xulmus/content/xulmus.svg +++ b/xulmus/content/xulmus.svg @@ -76,7 +76,7 @@ y="29.896835">xulmus_ Date: Sun, 22 Mar 2009 16:08:18 +1100 Subject: [PATCH 37/87] Normalise case of player command and mapping descriptions. --- xulmus/content/config.js | 1 + xulmus/content/player.js | 53 +++++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index e4a28018..35bd1353 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -497,6 +497,7 @@ const config = { //{{{ window.toJavaScriptConsole = function () { toOpenWindowByType("global:console", "chrome://global/content/console.xul"); } + window.BrowserStop = function () { getBrowser().mCurrentBrowser.stop(); } diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 5fe543cb..d96414db 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -1,4 +1,4 @@ -//Import Artist List as this can be huge +// Import Artist List as this can be huge var artists = getArtistsArray(); @@ -46,7 +46,7 @@ function Player() // {{{ function () { player.previous(); }); mappings.add([modes.PLAYER], - ["c"], "Pause/Unpause track", + ["c"], "Pause/unpause track", function () { player.togglePlayPause(); }); mappings.add([modes.PLAYER], @@ -58,19 +58,19 @@ function Player() // {{{ function () { player.stop(); }); mappings.add([modes.PLAYER], - ["f"], "Filter Library", + ["f"], "Filter library", function () { commandline.open(":", "filter ", modes.EX); }); - + mappings.add([modes.PLAYER], ["F"], "Loads current view filtered by the keywords", function () { commandline.open(":", "Filter ", modes.EX); }); mappings.add([modes.PLAYER], - ["s"], "Toggle Shuffle", + ["s"], "Toggle shuffle", function () { player.toggleShuffle(); }); mappings.add([modes.PLAYER], - ["r"], "Toggle Repeat", + ["r"], "Toggle repeat", function () { player.toggleRepeat(); }); mappings.add([modes.PLAYER], @@ -94,11 +94,11 @@ function Player() // {{{ { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], - ["=", "+"], "Increase Volume by 10%", + ["=", "+"], "Increase volume by 10%", function () { player.increaseVolume(); }); mappings.add([modes.PLAYER], - ["-"], "Decrease Volume by 10%", + ["-"], "Decrease volume by 10%", function () { player.decreaseVolume(); }); ////////////////// ///////////////////////////////////////////////////////////}}} @@ -110,15 +110,15 @@ function Player() // {{{ "Filter and play tracks", function (args) { - //Store the old view - //let prev_view = gMM.status.view; + // Store the old view + // let prev_view = gMM.status.view; let library = LibraryUtils.mainLibrary; let mainView = library.createView(); let sqncr = gMM.sequencer; let customProps = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] .createInstance(Ci.sbIMutablePropertyArray); - //args + // args switch (args.length) { case 3: @@ -152,16 +152,16 @@ function Player() // {{{ { SBGetBrowser().loadMediaList(LibraryUtils.mainLibrary, null, null, myView, "chrome://songbird/content/mediapages/filtersPage.xul"); - //TODO: make this focusTrack work ? - focusTrack(myView.getItemByIndex(0)); + // TODO: make this focusTrack work ? + focusTrack(myView.getItemByIndex(0)); } }, { argCount: "+", - // completer: function (context, args) completion.tracks(context, args); + //completer: function (context, args) completion.tracks(context, args); }); - // TODO: better off as a single command, or cmus compatible E.g. :player-next? --djk + // TODO: better off as a single command (:player play) or cmus compatible (:player-play)? --djk commands.add(["playerp[lay]"], "Play track", function () { player.play(); }); @@ -201,7 +201,7 @@ function Player() // {{{ player.volume = Math.min(Math.max(level, 0), 1); }, - { argCount: 1 }); + { argCount: "1" }); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// @@ -218,18 +218,18 @@ function Player() // {{{ play: function play() { - //Check if there is any selection in place, else play first item of the visible view. + // Check if there is any selection in place, else play first item of the visible view. if (_SBGetCurrentView().selection.count != 0) { - //Play the selection. - gMM.sequencer.playView(_SBGetCurrentView(),_SBGetCurrentView().getIndexForItem(_SBGetCurrentView().selection.currentMediaItem)); + // Play the selection. + gMM.sequencer.playView(_SBGetCurrentView(), _SBGetCurrentView().getIndexForItem(_SBGetCurrentView().selection.currentMediaItem)); focusTrack(gMM.sequencer.currentItem); } else { gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); focusTrack(gMM.sequencer.currentItem); - } + } }, stop: function stop() @@ -291,7 +291,7 @@ function Player() // {{{ seek(interval, false); }, - //FIXME: 10% ? + // FIXME: 10% ? increaseVolume: function increaseVolume() { gMM.volumeControl.volume = gMM.volumeControl.volume * 1.1; @@ -316,28 +316,31 @@ function Player() // {{{ let length = view.length; let tracksList = []; - for (var i=0; i < length; i++) + for (var i = 0; i < length; i++) { var mediaItem = view.getItemByIndex(i); var trackName = mediaItem.getProperty(SBProperties.trackName); var albumName = mediaItem.getProperty(SBProperties.albumName); var artistName = mediaItem.getProperty(SBProperties.artistName); - tracksList[i] = [ trackName, "Album : "+albumName+" Artist : "+artistName ]; + tracksList[i] = [trackName, "Album : " + albumName + " Artist : " + artistName]; } + return tracksList; }, - //TODO: Use this for implementing "/" and "?". -ken + // TODO: Use this for implementing "/" and "?". -ken searchTracks: function searchTracks(args) { let currentView = _SBGetCurrentView(); let mediaItemList = currentView.mediaList; let search = _getSearchString(currentView); let searchString = ""; + if (search != "") searchString = args + " " + search; else - searchString = args; + searchString = args; + let myView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); focusTrack(myView.getItemByIndex(0)); } From 77d57431330b1f73c0125276809d46e982096fb1 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 22 Mar 2009 16:47:22 +1100 Subject: [PATCH 38/87] Add some broken commands to TODO#BUGS. --- xulmus/TODO | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xulmus/TODO b/xulmus/TODO index c40dc405..1a85e4cd 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -2,10 +2,14 @@ Priority list: 1-9 as in Vim (9 = required for next release, 5 = would be nice, 1 = probably not) BUGS: -- SB doesn't support tab-undo yet so :undo and "u" etc don't work +- broken commands: + - SB doesn't support tab-undo yet so :undo and "u" etc don't work + - :tabduplicate + - :back/H, :forward,L FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. 8 Playlist/SmartPlaylist operations. 7 extended hint mode for opening links in FF. 5 Check for default extensions and add commands for them. Ex. Last.fm, Seeqpod e.t.c + Wouldn't these be provided as Xulmus plugins like Vimperator does? --djk From 74dde82355c22b131bb0937da6d3b0f9a486e1f5 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Mon, 23 Mar 2009 04:49:35 +0530 Subject: [PATCH 39/87] Added getPlaylist() and playPlaylist() functions --- xulmus/content/player.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index d96414db..76208183 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -343,6 +343,40 @@ function Player() // {{{ let myView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); focusTrack(myView.getItemByIndex(0)); + }, + + getPlaylists: function getPlaylists() + { + var libraryManager = Components.classes["@songbirdnest.com/Songbird/library/Manager;1"] + .getService(Components.interfaces.sbILibraryManager); + var mainLibrary = libraryManager.mainLibrary; + var playlists = [mainLibrary]; + var playlistsArray = []; + var listener = + { + onEnumerationBegin: function() { }, + onEnumerationEnd: function() { }, + onEnumeratedItem: function(list, item) + { + if (playlistsArray.indexOf(item.name)==-1) + { + playlists.push(item); + playlistsArray.push(item.name); + } + return Components.interfaces.sbIMediaListEnumerationListener.CONTINUE; + } + }; + mainLibrary.enumerateItemsByProperty("http://songbirdnest.com/data/1.0#isList", "1", listener ); + return playlists; + }, + + // Play track at 'row' in 'playlist' + playPlaylist: function playPlaylist(playlist,row) + { + var gMM = Components.classes["@songbirdnest.com/Songbird/Mediacore/Manager;1"] + .getService(Components.interfaces.sbIMediacoreManager); + gMM.sequencer.playView(playlist.createView(),row); + } }; From 77f277ddcc15960b6e35de76e07076322a21e06e Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Tue, 24 Mar 2009 04:18:43 +0530 Subject: [PATCH 40/87] Added :load [playlist], command for loading specified playlist (autocompleted) --- common/content/completion.js | 15 +++++++++++++++ xulmus/content/player.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/common/content/completion.js b/common/content/completion.js index 5592ec36..d90b6bd4 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1409,6 +1409,21 @@ function Completion() //{{{ } }, + playlist: function playlist(context, args) + { + let playlists = Player().getPlaylists(); + let length = playlists.length; + let playlistNames = []; + + for (var i=0; i < length; i++) + { + playlistNames[i] = [playlists[i].name.toString(),playlists[i].name]; + } + + context.title = ["Playlists"]; + context.completions = playlistNames; + }, + buffer: function buffer(context) { filter = context.filter.toLowerCase(); diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 76208183..448055b1 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -203,6 +203,37 @@ function Player() // {{{ }, { argCount: "1" }); + commands.add(["load"], + "Load a playlist", + function (args) + { + + if (args.length != 0) + { + //load the selected playlist/smart playlist + let playlists = player.getPlaylists(); + let length = playlists.length; + let playlistNames = []; + + for (var i=0; i < length; i++) + { + playlistNames[i] = playlists[i].name.toLowerCase(); + } + + let playlist = args.string.replace("\\",""); + SBGetBrowser().loadMediaList(playlists[playlistNames.indexOf(playlist.toLowerCase())]); + focusTrack(_SBGetCurrentView().getItemByIndex(0)); + } + else + { + //load main library if there are no args + _SBShowMainLibrary(); + } + }, + { + //args: + completer: function(context, args) completion.playlist(context, args) + }); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ From 086f9d7971531fdfeff604446dd4387d36b4ebaf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 23 Mar 2009 12:11:46 +1100 Subject: [PATCH 41/87] Formatting fixes. --- xulmus/content/player.js | 41 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 448055b1..8687d91d 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -347,12 +347,12 @@ function Player() // {{{ let length = view.length; let tracksList = []; - for (var i = 0; i < length; i++) + for (let i = 0; i < length; i++) { - var mediaItem = view.getItemByIndex(i); - var trackName = mediaItem.getProperty(SBProperties.trackName); - var albumName = mediaItem.getProperty(SBProperties.albumName); - var artistName = mediaItem.getProperty(SBProperties.artistName); + let mediaItem = view.getItemByIndex(i); + let trackName = mediaItem.getProperty(SBProperties.trackName); + let albumName = mediaItem.getProperty(SBProperties.albumName); + let artistName = mediaItem.getProperty(SBProperties.artistName); tracksList[i] = [trackName, "Album : " + albumName + " Artist : " + artistName]; } @@ -378,18 +378,17 @@ function Player() // {{{ getPlaylists: function getPlaylists() { - var libraryManager = Components.classes["@songbirdnest.com/Songbird/library/Manager;1"] - .getService(Components.interfaces.sbILibraryManager); - var mainLibrary = libraryManager.mainLibrary; - var playlists = [mainLibrary]; - var playlistsArray = []; - var listener = - { + let libraryManager = Components.classes["@songbirdnest.com/Songbird/library/Manager;1"] + .getService(Components.interfaces.sbILibraryManager); + let mainLibrary = libraryManager.mainLibrary; + let playlists = [mainLibrary]; + let playlistsArray = []; + let listener = { onEnumerationBegin: function() { }, onEnumerationEnd: function() { }, - onEnumeratedItem: function(list, item) + onEnumeratedItem: function(list, item) { - if (playlistsArray.indexOf(item.name)==-1) + if (playlistsArray.indexOf(item.name) == -1) { playlists.push(item); playlistsArray.push(item.name); @@ -397,19 +396,17 @@ function Player() // {{{ return Components.interfaces.sbIMediaListEnumerationListener.CONTINUE; } }; - mainLibrary.enumerateItemsByProperty("http://songbirdnest.com/data/1.0#isList", "1", listener ); - return playlists; + mainLibrary.enumerateItemsByProperty("http://songbirdnest.com/data/1.0#isList", "1", listener ); + return playlists; }, // Play track at 'row' in 'playlist' - playPlaylist: function playPlaylist(playlist,row) + playPlaylist: function playPlaylist(playlist, row) { - var gMM = Components.classes["@songbirdnest.com/Songbird/Mediacore/Manager;1"] - .getService(Components.interfaces.sbIMediacoreManager); - gMM.sequencer.playView(playlist.createView(),row); - + let gMM = Components.classes["@songbirdnest.com/Songbird/Mediacore/Manager;1"] + .getService(Components.interfaces.sbIMediacoreManager); + gMM.sequencer.playView(playlist.createView(), row); } - }; //}}} } // }}} From 663cd581a1cd30507802cf1455d8aaca835dd882 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 24 Mar 2009 15:00:18 +1100 Subject: [PATCH 42/87] Fix and document :load. --- common/content/completion.js | 14 ++-------- xulmus/content/player.js | 51 +++++++++++++++++----------------- xulmus/locale/en-US/player.txt | 9 ++++++ 3 files changed, 38 insertions(+), 36 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index d90b6bd4..7596362f 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1411,17 +1411,9 @@ function Completion() //{{{ playlist: function playlist(context, args) { - let playlists = Player().getPlaylists(); - let length = playlists.length; - let playlistNames = []; - - for (var i=0; i < length; i++) - { - playlistNames[i] = [playlists[i].name.toString(),playlists[i].name]; - } - - context.title = ["Playlists"]; - context.completions = playlistNames; + context.title = ["Playlist", "Type"]; + context.keys = { text: "name", description: "type" }; + context.completions = player.getPlaylists(); }, buffer: function buffer(context) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 8687d91d..d5b083b7 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -207,33 +207,37 @@ function Player() // {{{ "Load a playlist", function (args) { - - if (args.length != 0) - { - //load the selected playlist/smart playlist - let playlists = player.getPlaylists(); - let length = playlists.length; - let playlistNames = []; + let arg = args.literalArg; - for (var i=0; i < length; i++) + if (arg) + { + // load the selected playlist/smart playlist + let playlists = player.getPlaylists(); + + for ([i, list] in Iterator(playlists)) { - playlistNames[i] = playlists[i].name.toLowerCase(); + if (util.compareIgnoreCase(arg, list.name) == 0) + { + SBGetBrowser().loadMediaList(playlists[i]); + focusTrack(_SBGetCurrentView().getItemByIndex(0)); + return; + } } - - let playlist = args.string.replace("\\",""); - SBGetBrowser().loadMediaList(playlists[playlistNames.indexOf(playlist.toLowerCase())]); - focusTrack(_SBGetCurrentView().getItemByIndex(0)); + + liberator.echoerr("E475: Invalid argument: " + arg); } else { - //load main library if there are no args + // load main library if there are no args _SBShowMainLibrary(); } }, { - //args: - completer: function(context, args) completion.playlist(context, args) + argCount: "?", + completer: function(context, args) completion.playlist(context, args), + literal: 0 }); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -378,33 +382,30 @@ function Player() // {{{ getPlaylists: function getPlaylists() { - let libraryManager = Components.classes["@songbirdnest.com/Songbird/library/Manager;1"] - .getService(Components.interfaces.sbILibraryManager); - let mainLibrary = libraryManager.mainLibrary; + let mainLibrary = LibraryUtils.mainLibrary; let playlists = [mainLibrary]; - let playlistsArray = []; let listener = { onEnumerationBegin: function() { }, onEnumerationEnd: function() { }, onEnumeratedItem: function(list, item) { - if (playlistsArray.indexOf(item.name) == -1) + // FIXME: why are there null items and duplicates? + if (!playlists.some(function (list) list.name == item.name) && item.name != null) { playlists.push(item); - playlistsArray.push(item.name); } return Components.interfaces.sbIMediaListEnumerationListener.CONTINUE; } }; - mainLibrary.enumerateItemsByProperty("http://songbirdnest.com/data/1.0#isList", "1", listener ); + + mainLibrary.enumerateItemsByProperty("http://songbirdnest.com/data/1.0#isList", "1", listener); + return playlists; }, // Play track at 'row' in 'playlist' playPlaylist: function playPlaylist(playlist, row) { - let gMM = Components.classes["@songbirdnest.com/Songbird/Mediacore/Manager;1"] - .getService(Components.interfaces.sbIMediacoreManager); gMM.sequencer.playView(playlist.createView(), row); } }; diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index ed7ecb01..f4baae92 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -136,4 +136,13 @@ Set the player volume. [a][value][a] can be an absolute value between 0 and 100% or a relative value if prefixed with "-" or "+". ________________________________________________________________________________ +section:Managing{nbsp}playlists[playlists] + +|:load| +||:load [a][playlist][a]|| + +________________________________________________________________________________ +Load [a][playlist][a]. If no playlist is specified then the main library view +is loaded. +________________________________________________________________________________ + // vim: set filetype=asciidoc: From 827f450a549a08ce4570b1e3f2445aa59e2c3a04 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 24 Mar 2009 15:48:36 +1100 Subject: [PATCH 43/87] Add a :seek command. --- xulmus/content/player.js | 78 ++++++++++++++++++++++++++-------- xulmus/locale/en-US/player.txt | 36 ++++++++++------ 2 files changed, 84 insertions(+), 30 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index d5b083b7..6a5e6397 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -11,21 +11,11 @@ function Player() // {{{ // Get the focus to the visible playlist first //window._SBShowMainLibrary(); - // FIXME: need to test that we're playing - gMM.status.state - // interval (seconds) + // interval (milliseconds) function seek(interval, direction) { - if (!gMM.playbackControl) - return; - - interval = interval * 1000; - - let min = 0; - let max = gMM.playbackControl.duration; - - let position = gMM.playbackControl.position + (direction ? interval : -interval); - - gMM.playbackControl.position = Math.min(Math.max(position, min), max); + let position = gMM.playbackControl ? gMM.playbackControl.position : 0; + player.seekTo(position + (direction ? interval : -interval)); } function focusTrack(mediaItem) @@ -75,22 +65,22 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["h"], "Seek -10s", - function (count) { player.seekBackward(Math.max(1, count) * 10); }, + function (count) { player.seekBackward(Math.max(1, count) * 10000); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["l"], "Seek +10s", - function (count) { player.seekForward(Math.max(1, count) * 10); }, + function (count) { player.seekForward(Math.max(1, count) * 10000); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["H"], "Seek -1m", - function (count) { player.seekBackward(Math.max(1, count) * 60); }, + function (count) { player.seekBackward(Math.max(1, count) * 60000); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], ["L"], "Seek +1m", - function (count) { player.seekForward(Math.max(1, count) * 60); }, + function (count) { player.seekForward(Math.max(1, count) * 60000); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], @@ -141,7 +131,7 @@ function Player() // {{{ }); commands.add(["F[ilter]"], - "Filter tracks based on keywords {artist/album/track}", + "Filter tracks based on keywords {genre/artist/album/track}", function (args) { let library = LibraryUtils.mainLibrary; @@ -182,6 +172,44 @@ function Player() // {{{ "Stop track", function () { player.stop(); }); + commands.add(["see[k]"], + "Seek to a track position", + function (args) + { + let arg = args[0]; + + // intentionally supports 999:99:99 + if (!/^[+-]?(\d+[smh]?|(\d+:\d\d:|\d+:)?\d{2})$/.test(arg)) + { + liberator.echoerr("E475: Invalid argument: " + arg); + return; + } + + function ms(t, m) Math.abs(parseInt(t, 10) * { s: 1000, m: 60000, h: 3600000 }[m]) + + if (/:/.test(arg)) + { + let [seconds, minutes, hours] = arg.split(":").reverse(); + hours = hours || 0; + var value = ms(seconds, "s") + ms(minutes, "m") + ms(hours, "h"); + } + else + { + if (!/[smh]/.test(arg.substr(-1))) + arg += "s"; // default to seconds + + value = ms(arg.substring(arg, arg.length - 1), arg.substr(-1)); + } + + if (/^[-+]/.test(arg)) + arg[0] == "-" ? player.seekBackward(value) : player.seekForward(value) + else + player.seekTo(value) + + }, + { argCount: "1" }); + + // TODO: maybe :vol! could toggle mute on/off? --djk commands.add(["vol[ume]"], "Set the volume", function (args) @@ -251,6 +279,7 @@ function Player() // {{{ gMM.volumeControl.volume = value; }, + // FIXME: can't be called from non-media tabs since 840e78 play: function play() { // Check if there is any selection in place, else play first item of the visible view. @@ -326,7 +355,19 @@ function Player() // {{{ seek(interval, false); }, + seekTo: function seekTo(position) + { + if (!gMM.playbackControl) + this.play(); + + let min = 0; + let max = gMM.playbackControl.duration - 5000; // TODO: 5s buffer like cmus desirable? + + gMM.playbackControl.position = Math.min(Math.max(position, min), max); + }, + // FIXME: 10% ? + // I think just general increments of say 0.05 might be better --djk increaseVolume: function increaseVolume() { gMM.volumeControl.volume = gMM.volumeControl.volume * 1.1; @@ -363,6 +404,7 @@ function Player() // {{{ return tracksList; }, + // TODO: Use this for implementing "/" and "?". -ken searchTracks: function searchTracks(args) { diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index f4baae92..8344db4c 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -62,29 +62,29 @@ ________________________________________________________________________________ section:Filtering{nbsp}the{nbsp}library[filter,filtering] |f| |:f| |:filter| -||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + +||:f[ilter] {artist} [a][album][a] [a][track][a]|| + ||f|| ________________________________________________________________________________ -Filter and play tracks. If only [a][artist][a] is specified then all tracks for -that artist are played in album order. If {album} is also specified then all +Filter and play tracks. If only {artist} is specified then all tracks for that +artist are played in album order. If [a][album][a] is also specified then all tracks for that album are played. A specific track can be specified with -{track}. +[a][track][a]. ________________________________________________________________________________ |F| |:F| |:Filter| -||:F[ilter] {keywords}|| + +||:F[ilter] {keywords}|| + ||F|| ________________________________________________________________________________ Filter and show the tracks as a view. The tracks are filtered by the {keywords} -provided as arguments. This text search applies over the default filter properties, -namely: Genre, Artist, and Album. +provided as arguments. This text search applies over the default filter +properties, namely: Genre, Artist, Album and Track. ________________________________________________________________________________ section:Seeking{nbsp}to{nbsp}a{nbsp}track{nbsp}position[seeking] |h| -||h|| +||[count]h|| ________________________________________________________________________________ Seek +10s. ________________________________________________________________________________ @@ -111,6 +111,18 @@ Seek -1m. ________________________________________________________________________________ +|:see]| |:seek| +||:see[k] {[HH:]MM:SS]}|| + +||:see[k] +{time[hms]} | -{time[hms]}|| + +________________________________________________________________________________ +Seek to an absolute or relative position in a track. The position can be given +in seconds (s), minutes (m), or hours (h). If the unit is not specified then +seconds is assumed. The position is absolute unless the value is prefixed with +"-" or "+". + +Positions may also be specified in [a][HH:]MM:SS[a] format. +________________________________________________________________________________ + section:Adjusting{nbsp}the{nbsp}volume[volume] |+| |=| @@ -129,11 +141,11 @@ ________________________________________________________________________________ |:vol| |:volume| -||:vol[ume][!] [a][value][a]|| + -||:vol[ume][!] +{value} | -{value}|| + +||:vol[ume] {value}|| + +||:vol[ume] +{value} | -{value}|| + ________________________________________________________________________________ -Set the player volume. [a][value][a] can be an absolute value between 0 and -100% or a relative value if prefixed with "-" or "+". +Set the player volume. {value} can be an absolute value between 0 and 100% or a +relative value if prefixed with "-" or "+". ________________________________________________________________________________ section:Managing{nbsp}playlists[playlists] From a442aa0798a660cc9282b23dfb91ae9883599d88 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 01:26:16 +1100 Subject: [PATCH 44/87] Add "i" mapping to select the current track. --- xulmus/content/player.js | 4 ++++ xulmus/locale/en-US/player.txt | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 6a5e6397..1a95e81a 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -55,6 +55,10 @@ function Player() // {{{ ["F"], "Loads current view filtered by the keywords", function () { commandline.open(":", "Filter ", modes.EX); }); + mappings.add([modes.PLAYER], + ["i"], "Select current track", + function () { gSongbirdWindowController.doCommand("cmd_find_current_track"); }); + mappings.add([modes.PLAYER], ["s"], "Toggle shuffle", function () { player.toggleShuffle(); }); diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 8344db4c..023faea9 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -59,6 +59,13 @@ ________________________________________________________________________________ Toggle repeat mode. ________________________________________________________________________________ + +|i| +||i|| +________________________________________________________________________________ +Select the currently playing track. +________________________________________________________________________________ + section:Filtering{nbsp}the{nbsp}library[filter,filtering] |f| |:f| |:filter| From b62527f8e6cbca9942d718b7e82743550829dfa3 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 01:52:14 +1100 Subject: [PATCH 45/87] Add "p" to 'guioptions' to show/hide the player controls. Enable for now until the status bar is improved. --- xulmus/content/config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 35bd1353..45bb0c51 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -33,12 +33,13 @@ const config = { //{{{ //mainWindowID: "mainplayer", /*** optional options, there are checked for existence and a fallback provided ***/ features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "windows", "player"], - defaults: { guioptions: "rb" }, + defaults: { guioptions: "mprb" }, // FIXME: "m" seems to be defaulting to on anyway guioptions: { - m: ["Menubar", ["main-menubar"]], - T: ["Toolbar", ["nav-bar"]], - B: ["Bookmark bar", ["PersonalToolbar"]] + m: ["Menubar", ["main-menubar"]], + T: ["Toolbar", ["nav-bar"]], + B: ["Bookmark bar", ["PersonalToolbar"]], // FIXME: used/relevant? + p: ["Player controls", ["player_wrapper"]] }, //get visualbellWindow() getBrowser().mPanelContainer, From 4bfb4b7515f164feae70915fbf30a7b9e109292c Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 02:13:14 +1100 Subject: [PATCH 46/87] Add / mappings for seeking. These are the same as "h" and "l". --- xulmus/content/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 1a95e81a..1984ad56 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -68,12 +68,12 @@ function Player() // {{{ function () { player.toggleRepeat(); }); mappings.add([modes.PLAYER], - ["h"], "Seek -10s", + ["h", ""], "Seek -10s", function (count) { player.seekBackward(Math.max(1, count) * 10000); }, { flags: Mappings.flags.COUNT }); mappings.add([modes.PLAYER], - ["l"], "Seek +10s", + ["l", ""], "Seek +10s", function (count) { player.seekForward(Math.max(1, count) * 10000); }, { flags: Mappings.flags.COUNT }); From ed502d5d61e661ed6bd14af15f308bcc4e9a6c5f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 02:21:24 +1100 Subject: [PATCH 47/87] Document player mode /. --- xulmus/locale/en-US/player.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 023faea9..8053d3c5 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -90,14 +90,14 @@ ________________________________________________________________________________ section:Seeking{nbsp}to{nbsp}a{nbsp}track{nbsp}position[seeking] -|h| +|| |h| ||[count]h|| ________________________________________________________________________________ Seek +10s. ________________________________________________________________________________ -|l| +|| |l| ||[count]l|| ________________________________________________________________________________ Seek -10s. From 349c442eb558858f21ed6b8d7b869facb4d59a08 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 02:32:19 +1100 Subject: [PATCH 48/87] Fix 'showtabline'. --- common/content/tabs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/content/tabs.js b/common/content/tabs.js index 6c4eb16d..0b19514f 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -689,9 +689,10 @@ function Tabs() //{{{ { let tabStrip = null; + // FIXME: why is this app specific conditional code here? if (config.hostApplication == "Firefox") tabStrip = getBrowser().mStrip.getElementsByClassName("tabbrowser-tabs")[0]; - else if (config.hostApplication == "Thunderbird") + else if (/^(Thunderbird|Songbird)$/.test(config.hostApplication)) tabStrip = getBrowser().mStrip; return tabStrip; From 98406ff211bfac968975b1acddc28792d82fb3f7 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 04:03:10 +1100 Subject: [PATCH 49/87] Fix :dialog entries. --- xulmus/content/config.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 45bb0c51..5eed716e 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -63,45 +63,58 @@ const config = { //{{{ ["XulmusLeavePre", "Triggered before exiting Xulmus, just before destroying each module"], ["XulmusLeave", "Triggered before exiting Xulmus"]], + // TODO: remove those which don't make sense, can't be provided. dialogs: [ ["about", "About Songbird", - function () { window.openDialog("chrome://browser/content/aboutDialog.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], + function () { window.openDialog("chrome://songbird/content/xul/about.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], + /* ["addbookmark", "Add bookmark for the current page", function () { PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksRootId); }], + */ ["addons", "Manage Add-ons", - function () { window.BrowserOpenAddonsMgr(); }], + function () { SBOpenPreferences("paneAddons"); }], + /* ["bookmarks", "List your bookmarks", function () { window.openDialog("chrome://browser/content/bookmarks/bookmarksPanel.xul", "Bookmarks", "dialog,centerscreen,width=600,height=600"); }], + */ ["checkupdates", "Check for updates", function () { window.checkForUpdates(); }], ["cleardata", "Clear private data", - function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }], + function () { Sanitizer.showUI(); }], ["cookies", "List your cookies", function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }], ["console", "JavaScript console", function () { window.toJavaScriptConsole(); }], + /* ["customizetoolbar", "Customize the Toolbar", function () { window.BrowserCustomizeToolbar(); }], + */ ["dominspector", "DOM Inspector", function () { try { window.inspectDOMDocument(content.document); } catch (e) { liberator.echoerr("DOM Inspector extension not installed"); } }], ["downloads", "Manage Downloads", function () { window.toOpenWindowByType("Download:Manager", "chrome://mozapps/content/downloads/downloads.xul", "chrome,dialog=no,resizable"); }], + /* ["history", "List your history", function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }], ["import", "Import Preferences, Bookmarks, History, etc. from other browsers", function () { window.BrowserImport(); }], + */ ["openfile", "Open the file selector dialog", - function () { window.BrowserOpenFileWindow(); }], + function () { SBFileOpen(); }], + /* ["pageinfo", "Show information about the current page", function () { window.BrowserPageInfo(); }], + */ ["pagesource", "View page source", function () { window.BrowserViewSourceOfDocument(content.document); }], ["places", "Places Organizer: Manage your bookmarks and history", function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }], ["preferences", "Show Firefox preferences dialog", function () { window.openPreferences(); }], + /* ["printpreview", "Preview the page before printing", function () { PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); }], + */ ["printsetup", "Setup the page size and orientation before printing", function () { PrintUtils.showPageSetup(); }], ["print", "Show print dialog", @@ -382,6 +395,8 @@ const config = { //{{{ }, { argCount: "0" }); + // TODO: service/content pane and right sidebar manipulation commands? --djk + /* // TODO: move sidebar commands to ui.js? commands.add(["sbcl[ose]"], "Close the sidebar window", @@ -423,6 +438,7 @@ const config = { //{{{ completer: function (context) completion.sidebar(context), literal: 0 }); + */ commands.add(["winc[lose]", "wc[lose]"], "Close window", From 8c495eb7ba53565c925432013fbe98b14f23ab01 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 04:13:15 +1100 Subject: [PATCH 50/87] Add Player mode :pmap commands. --- common/content/mappings.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/content/mappings.js b/common/content/mappings.js index 0f222d64..697396bb 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -257,8 +257,11 @@ function Mappings() //{{{ addMapCommands("", [modes.NORMAL], ""); addMapCommands("c", [modes.COMMAND_LINE], "command line"); addMapCommands("i", [modes.INSERT, modes.TEXTAREA], "insert"); + // FIXME if (liberator.has("mail")) addMapCommands("m", [modes.MESSAGE], "message"); + if (liberator.has("player")) + addMapCommands("p", [modes.PLAYER], "player"); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// From c6e675bbdd6cc13db34f4d2b74c3a9e6e0e9507b Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 12:45:46 +1100 Subject: [PATCH 51/87] Fix typo in LocationChange autocomd description. --- xulmus/content/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 5eed716e..220b3a8c 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -55,7 +55,7 @@ const config = { //{{{ ["DOMLoad", "Triggered when a page's DOM content has fully loaded"], ["DownloadPost", "Triggered when a download has completed"], ["Fullscreen", "Triggered when the browser's fullscreen state changes"], - ["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"], + ["LocationChange", "Triggered when changing tabs or when navigation to a new location"], ["PageLoadPre", "Triggered after a page load is initiated"], ["PageLoad", "Triggered when a page gets (re)loaded/opened"], ["ShellCmdPost", "Triggered after executing a shell command with :!cmd"], From d3642a67fa6106b2598b220c86880cf33877d659 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 15:31:24 +1100 Subject: [PATCH 52/87] Whitespace fixes. --- xulmus/content/bookmarks.js | 140 ++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/xulmus/content/bookmarks.js b/xulmus/content/bookmarks.js index 1e0ca0a0..03345b2a 100755 --- a/xulmus/content/bookmarks.js +++ b/xulmus/content/bookmarks.js @@ -57,7 +57,7 @@ function Bookmarks() //{{{ /////////////////////////////////////////////////////////////////////////////{{{ const historyService = PlacesUtils.history; //Cc["@mozilla.org/browser/global-history;1"].getService(Ci.nsIGlobalHistory); - const bookmarksService = PlacesUtils.bookmarks //Cc["@songbirdnest.com/servicepane/bookmarks;1"].getService(Ci.sbIBookmarks); + const bookmarksService = PlacesUtils.bookmarks //Cc["@songbirdnest.com/servicepane/bookmarks;1"].getService(Ci.sbIBookmarks); const taggingService = PlacesUtils.tagging //Cc["@mozilla.org/browser/tagging-service;1"].getService(Ci.nsITaggingService); const faviconService = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService); @@ -571,14 +571,14 @@ function Bookmarks() //{{{ getSuggestions: function getSuggestions(engineName, query, callback) { const responseType = "application/x-suggestions+json"; - + let engine = services.get("browserSearch").getEngineByAlias(engineName); - + if (engine && engine.supportsResponseType(responseType)) var queryURI = engine.getSubmission(query, responseType).uri.spec; if (!queryURI) return []; - + function process(resp) { let results = []; @@ -594,7 +594,7 @@ function Bookmarks() //{{{ } let resp = util.httpGet(queryURI, callback && process); - + if (!callback) return process(resp); }, @@ -620,74 +620,74 @@ function Bookmarks() //{{{ // we need to make sure our custom alias have been set, even if the user // did not :open once before this.getSearchEngines(); - - function getShortcutOrURI(aURL, aPostDataRef) - { - var shortcutURL = null; - var keyword = aURL; - var param = ""; - var searchService = Cc['@mozilla.org/browser/search-service;1'].getService(Ci.nsIBrowserSearchService); - var offset = aURL.indexOf(" "); - if (offset > 0) - { - keyword = aURL.substr(0, offset); - param = aURL.substr(offset + 1); - } - if (!aPostDataRef) - { - aPostDataRef = {}; + + function getShortcutOrURI(aURL, aPostDataRef) + { + var shortcutURL = null; + var keyword = aURL; + var param = ""; + var searchService = Cc['@mozilla.org/browser/search-service;1'].getService(Ci.nsIBrowserSearchService); + var offset = aURL.indexOf(" "); + if (offset > 0) + { + keyword = aURL.substr(0, offset); + param = aURL.substr(offset + 1); } - var engine = searchService.getEngineByAlias(keyword); - if (engine) - { - var submission = engine.getSubmission(param, null); - aPostDataRef.value = submission.postData; - return submission.uri.spec; - } - [shortcutURL, aPostDataRef.value] = PlacesUtils.getURLAndPostDataForKeyword(keyword); - if (!shortcutURL) - { - return aURL; - } - var postData = ""; - if (aPostDataRef.value) - { - postData = unescape(aPostDataRef.value); - } - if (/%s/i.test(shortcutURL) || /%s/i.test(postData)) - { - var charset = ""; - const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; - var matches = shortcutURL.match(re); - if (matches) - { - [, shortcutURL, charset] = matches; - } - else - { - try - { - charset = PlacesUtils.history.getCharsetForURI(makeURI(shortcutURL)); - } catch (e) { } - } - var encodedParam = ""; - if (charset) - { - encodedParam = escape(convertFromUnicode(charset, param)); - } else { - encodedParam = encodeURIComponent(param); - } - shortcutURL = shortcutURL.replace(/%s/g, encodedParam).replace(/%S/g, param); - if (/%s/i.test(postData)) - { - aPostDataRef.value = getPostDataStream(postData, param, encodedParam, "application/x-www-form-urlencoded"); - } - } else if (param) { - aPostDataRef.value = null; - return aURL; + if (!aPostDataRef) + { + aPostDataRef = {}; } - return shortcutURL; + var engine = searchService.getEngineByAlias(keyword); + if (engine) + { + var submission = engine.getSubmission(param, null); + aPostDataRef.value = submission.postData; + return submission.uri.spec; + } + [shortcutURL, aPostDataRef.value] = PlacesUtils.getURLAndPostDataForKeyword(keyword); + if (!shortcutURL) + { + return aURL; + } + var postData = ""; + if (aPostDataRef.value) + { + postData = unescape(aPostDataRef.value); + } + if (/%s/i.test(shortcutURL) || /%s/i.test(postData)) + { + var charset = ""; + const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; + var matches = shortcutURL.match(re); + if (matches) + { + [, shortcutURL, charset] = matches; + } + else + { + try + { + charset = PlacesUtils.history.getCharsetForURI(makeURI(shortcutURL)); + } catch (e) { } + } + var encodedParam = ""; + if (charset) + { + encodedParam = escape(convertFromUnicode(charset, param)); + } else { + encodedParam = encodeURIComponent(param); + } + shortcutURL = shortcutURL.replace(/%s/g, encodedParam).replace(/%S/g, param); + if (/%s/i.test(postData)) + { + aPostDataRef.value = getPostDataStream(postData, param, encodedParam, "application/x-www-form-urlencoded"); + } + } else if (param) { + aPostDataRef.value = null; + return aURL; + } + return shortcutURL; } url = getShortcutOrURI(searchString, aPostDataRef); if (url == searchString) From a3594e5ec371aadd870b6787f2a2b978953427cc Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 17:54:00 +1100 Subject: [PATCH 53/87] Use showtabline=2 as the default. --- xulmus/content/config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 220b3a8c..bb60f14e 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -465,6 +465,8 @@ const config = { //{{{ ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + options.get("showtabline").value = 2; + options.add(["online"], "Set the 'work offline' option", "boolean", true, From c5d201fdb1942210d1a1b1fc0929e10c34bf929d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 18:14:22 +1100 Subject: [PATCH 54/87] Reset the defaultValue for 'showtabline' as well. --- xulmus/content/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index bb60f14e..ddce2519 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -465,7 +465,8 @@ const config = { //{{{ ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - options.get("showtabline").value = 2; + let stal = options.get("showtabline"); + stal.value = stal.defaultValue = 2; options.add(["online"], "Set the 'work offline' option", From e21436d0dbac74abddfbb5e1d8d47dcd83ec5e2d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 19:15:45 +1100 Subject: [PATCH 55/87] Remove "B" from 'guioptions' as SB doesn't have a bookmarks bar. --- xulmus/content/config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index ddce2519..ebf4345a 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -33,12 +33,11 @@ const config = { //{{{ //mainWindowID: "mainplayer", /*** optional options, there are checked for existence and a fallback provided ***/ features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "windows", "player"], - defaults: { guioptions: "mprb" }, // FIXME: "m" seems to be defaulting to on anyway + defaults: { guioptions: "mprb" }, guioptions: { m: ["Menubar", ["main-menubar"]], T: ["Toolbar", ["nav-bar"]], - B: ["Bookmark bar", ["PersonalToolbar"]], // FIXME: used/relevant? p: ["Player controls", ["player_wrapper"]] }, From 3979d4b5ebf2742cfcb90c707dbd933e70a28083 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 19:21:14 +1100 Subject: [PATCH 56/87] Add several player related autocommands. TrackChangePre, TrackChange, ViewChangePre, ViewChange, StreamStart, StreamPause, StreamEnd and StreamStop --- xulmus/content/player.js | 59 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 1984ad56..7e419cf6 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -23,6 +23,51 @@ function Player() // {{{ SBGetBrowser().mediaTab.mediaPage.highlightItem(_SBGetCurrentView().getIndexForItem(mediaItem)); } + var mediaCoreListener = { + onMediacoreEvent: function (event) + { + switch (event.type) + { + case Ci.sbIMediacoreEvent.BEFORE_TRACK_CHANGE: + liberator.log("Before track changed: " + event.data); + autocommands.trigger("TrackChangePre", { track: event.data }); + break; + case Ci.sbIMediacoreEvent.TRACK_CHANGE: + autocommands.trigger("TrackChange", { track: event.data }); + break; + case Ci.sbIMediacoreEvent.BEFORE_VIEW_CHANGE: + liberator.log("Before view changed: " + event.data); + autocommands.trigger("ViewChangePre", { view: event.data }); + break; + case Ci.sbIMediacoreEvent.VIEW_CHANGE: + liberator.log("View changed: " + event.data); + autocommands.trigger("ViewChange", { view: event.data }); + break; + case Ci.sbIMediacoreEvent.STREAM_START: + liberator.log("Track started: " + event.data); + autocommands.trigger("StreamStart", {}); + break; + case Ci.sbIMediacoreEvent.STREAM_PAUSE: + liberator.log("Track paused: " + event.data); + autocommands.trigger("StreamPause", {}); + break; + case Ci.sbIMediacoreEvent.STREAM_END: + liberator.log("Track ended: " + event.data); + autocommands.trigger("StreamEnd", {}); + break; + case Ci.sbIMediacoreEvent.STREAM_STOP: + liberator.log("Track stopped: " + event.data); + autocommands.trigger("StreamStop", {}); + break; + } + } + }; + + gMM.addListener(mediaCoreListener); + liberator.registerObserver("shutdown", function () { + gMM.removeListener(mediaCoreListener); + }); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -139,19 +184,21 @@ function Player() // {{{ function (args) { let library = LibraryUtils.mainLibrary; - let myView = LibraryUtils.createStandardMediaListView(LibraryUtils.mainLibrary, args.string); - if (myView.length == 0) + let view = LibraryUtils.createStandardMediaListView(LibraryUtils.mainLibrary, args.literalArg); + + if (view.length == 0) liberator.echoerr("No Tracks matching the keywords"); else { - SBGetBrowser().loadMediaList(LibraryUtils.mainLibrary, null, null, myView, - "chrome://songbird/content/mediapages/filtersPage.xul"); + SBGetBrowser().loadMediaList(LibraryUtils.mainLibrary, null, null, view, + "chrome://songbird/content/mediapages/filtersPage.xul"); // TODO: make this focusTrack work ? - focusTrack(myView.getItemByIndex(0)); + focusTrack(view.getItemByIndex(0)); } }, { - argCount: "+", + argCount: "1", + literal: 0 //completer: function (context, args) completion.tracks(context, args); }); From 49f3984ba0e3d5f870b3eca52a38a52e0fd4b746 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 19:55:50 +1100 Subject: [PATCH 57/87] Add new autocommands to config and update the help file. --- xulmus/content/config.js | 16 ++++++++++++---- xulmus/locale/en-US/autocommands.txt | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index ebf4345a..31034b2f 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -58,9 +58,17 @@ const config = { //{{{ ["PageLoadPre", "Triggered after a page load is initiated"], ["PageLoad", "Triggered when a page gets (re)loaded/opened"], ["ShellCmdPost", "Triggered after executing a shell command with :!cmd"], - ["XulmusEnter", "Triggered after Xulmus starts"], - ["XulmusLeavePre", "Triggered before exiting Xulmus, just before destroying each module"], - ["XulmusLeave", "Triggered before exiting Xulmus"]], + ["TrackChangePre", "Triggered before a playing track is changed"], + ["TrackChange", "Triggered after a playing track has changed"], + ["ViewChangePre", "Triggered before a sequencer view is changed"], + ["ViewChange", "Triggered after a sequencer view is changed"], + ["StreamStart", "Triggered after a stream has started"], + ["StreamPause", "Triggered after a stream has paused"], + ["StreamEnd", "Triggered after a stream has ended"], + ["StreamStop", "Triggered after a stream has stopped"], + ["XulmusEnter", "Triggered after Songbird starts"], + ["XulmusLeavePre", "Triggered before exiting Songbird, just before destroying each module"], + ["XulmusLeave", "Triggered before exiting Songbird"]], // TODO: remove those which don't make sense, can't be provided. dialogs: [ @@ -130,7 +138,7 @@ const config = { //{{{ //TODO : Write intro.html and tutorial.html // they are sorted by relevance, not alphabetically - helpFiles: [ "player.html" ], + helpFiles: [ "player.html", "autocommands.html" ], /* "intro.html", "tutorial.html", "starting.html", "browsing.html", "buffer.html", "cmdline.html", "insert.html", "options.html", "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", diff --git a/xulmus/locale/en-US/autocommands.txt b/xulmus/locale/en-US/autocommands.txt index 36104b56..ab936a04 100755 --- a/xulmus/locale/en-US/autocommands.txt +++ b/xulmus/locale/en-US/autocommands.txt @@ -12,7 +12,7 @@ Execute commands automatically on events. [c]:au[tocmd][c] {event} {pat} {cmd} -Add {cmd} to the list of commands Vimperator will execute on {event} for a URL matching {pat}: +Add {cmd} to the list of commands Xulmus will execute on {event} for a URL matching {pat}: * [c]:autocmd[!][c] {events} {pat}: list/remove autocommands filtered by {events} and {pat} * [c]:autocmd[!][c] {events}: list/remove autocommands matching {events} @@ -31,9 +31,17 @@ Available {events}: *PageLoadPre* Triggered after a page load is initiated *PageLoad* Triggered when a page gets (re)loaded/opened *ShellCmdPost* Triggered after executing a shell command with [c]:![c]#{cmd} -*VimperatorEnter* Triggered after Firefox starts -*VimperatorLeavePre* Triggered before exiting Firefox, just before destroying each module -*VimperatorLeave* Triggered before exiting Firefox +*TrackChangePre* Triggered before a playing track is changed +*TrackChange* Triggered after a playing track has changed +*ViewChangePre* Triggered before a sequencer view is changed +*ViewChange* Triggered after a sequencer view is changed +*StreamStart* Triggered after a stream has started +*StreamPause* Triggered after a stream has paused +*StreamEnd* Triggered after a stream has ended +*StreamStop* Triggered after a stream has stopped +*XulmusEnter* Triggered after Songbird starts +*XulmusLeavePre* Triggered before exiting Songbird, just before destroying each module +*XulmusLeave* Triggered before exiting Songbird -------------------------------------------------------------- {pat} is a regular expression, use .* if you want to match all URLs. @@ -53,6 +61,8 @@ The following keywords are available where relevant: ** The target destination of a download. Only for *DownloadPost*. ** The new fullscreen state. Only for *Fullscreen*. ** The color scheme name. Only for *ColorScheme*. +** The new sequencer view. Only for *ViewChangePre* and *ViewChange*. +** The new media track. Only for *TrackChangePre* and *TrackChange*. -------------------------------------------------------------- ________________________________________________________________________________ From ace07cef56839f95c138a5faacda00c03140a8b2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 20:13:08 +1100 Subject: [PATCH 58/87] Update options.txt for Xulmus. --- xulmus/content/config.js | 2 +- xulmus/locale/en-US/autocommands.txt | 2 +- xulmus/locale/en-US/options.txt | 68 ++++++++++++++-------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 31034b2f..89590b57 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -138,7 +138,7 @@ const config = { //{{{ //TODO : Write intro.html and tutorial.html // they are sorted by relevance, not alphabetically - helpFiles: [ "player.html", "autocommands.html" ], + helpFiles: [ "player.html", "options.html", "autocommands.html" ], /* "intro.html", "tutorial.html", "starting.html", "browsing.html", "buffer.html", "cmdline.html", "insert.html", "options.html", "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", diff --git a/xulmus/locale/en-US/autocommands.txt b/xulmus/locale/en-US/autocommands.txt index ab936a04..c2af4a9a 100755 --- a/xulmus/locale/en-US/autocommands.txt +++ b/xulmus/locale/en-US/autocommands.txt @@ -26,7 +26,7 @@ Available {events}: *ColorScheme* Triggered after a color scheme has been loaded *DOMLoad* Triggered when a page's DOM content has fully loaded *DownloadPost* Triggered when a download has completed -*Fullscreen* Triggered when the browser's fullscreen state changes +*Fullscreen* Triggered when the player's fullscreen state changes *LocationChange* Triggered when changing tabs or when navigating to a new location *PageLoadPre* Triggered after a page load is initiated *PageLoad* Triggered when a page gets (re)loaded/opened diff --git a/xulmus/locale/en-US/options.txt b/xulmus/locale/en-US/options.txt index a16aa9f6..9ad5f1de 100755 --- a/xulmus/locale/en-US/options.txt +++ b/xulmus/locale/en-US/options.txt @@ -2,7 +2,7 @@ HEADER |options| + -Vimperator has a number of internal variables and switches which can be set to +Xulmus has a number of internal variables and switches which can be set to achieve special effects. These options come in 5 forms: `------------`----------------------------------------- *boolean* can only be on or off @@ -155,35 +155,35 @@ Environment variables are expanded for path options like 'cdpath' and 'runtimepath'. The variable notation is _$VAR_ (terminated by a non-word character) or _$\\{VAR}_. _%VAR%_ is also supported on Windows. -section:Setting{nbsp}Firefox{nbsp}options[firefox-options,preferences] +section:Setting{nbsp}Songbird{nbsp}options[songbird-options,preferences] -Firefox options can be viewed and set with the following commands: +Songbird options can be viewed and set with the following commands: |:prefs| |:preferences| ||:pref[erences]|| ________________________________________________________________________________ -Show the Firefox preferences dialog. You can change the browser preferences -from this dialog. Be aware that not all Firefox preferences work, because -Vimperator overrides some key bindings and changes Firefox's GUI. +Show the Songbird preferences dialog. You can change the player preferences +from this dialog. Be aware that not all Songbird preferences work, because +Xulmus overrides some key bindings and changes Songbird's GUI. ________________________________________________________________________________ |:prefs!| |:preferences!| ||:pref[erences]!|| ________________________________________________________________________________ -Opens about:config in the current tab where you can change advanced Firefox +Opens about:config in the current tab where you can change advanced Songbird preferences. ________________________________________________________________________________ |:set!| |:set-!| ||:se[t]! {preference}={value}|| + ________________________________________________________________________________ -Change any Firefox {preference} (those in the about:config window). You can also -reset/delete those preferences with [c]:set! {preference}&[c]. +Change any Songbird {preference} (those in the about:config window). You can +also reset/delete those preferences with [c]:set! {preference}&[c]. ________________________________________________________________________________ |overridden-preferences| + -Vimperator sets several Firefox preferences at startup. If this is undesirable, +Xulmus sets several Songbird preferences at startup. If this is undesirable, they can be changed to a different value in your RC file using [c]:set! {preference}={value}[c] @@ -231,7 +231,7 @@ Items which are completed at the [c]:[tab]open[c] prompt. Available items: `---`-------------------------------------------------------------------------------- *s* Search engines and keyword URLs *f* Local files -*l* Firefox location bar entries (bookmarks and history sorted in an intelligent way) +*l* Songbird location bar entries (bookmarks and history sorted in an intelligent way) *b* Bookmarks *S* Suggest engines ------------------------------------------------------------------------------------- @@ -253,7 +253,7 @@ schwarzenegger[c] will be exactly the same as [c]:open youtube arnold schwarzenegger[c]. Therefore, you need to add a keyword or search engine "youtube" first. -If 'defsearch' is empty, then Firefox will always attempt to open the +If 'defsearch' is empty, then Songbird will always attempt to open the raw [a][arg][a]. ____ @@ -265,7 +265,7 @@ Set the external text editor. Sets the editor to run when [m][m] is pressed in INSERT and TEXTAREA modes. -Warning: Vimperator will not behave correctly if the editor forks its own +Warning: Xulmus will not behave correctly if the editor forks its own process, such as with gvim without the -f argument. ____ @@ -331,7 +331,7 @@ Show or hide certain GUI elements like the menu or toolbar. Supported characters `---`----------- *m* Menubar *T* Toolbar -*B* Bookmark bar +*p* Player controls *n* Tab number *N* Tab number over image *b* Bottom scrollbar @@ -439,8 +439,8 @@ ____ ||'insertmode' 'im'|| boolean (default: on) ____ Use Insert mode as the default for text areas. -Makes Vimperator work in a way that Insert mode is the default mode for text areas. -Useful if you want to use Vimperator as a modeless editor, keeping the known Firefox interface for editing text areas. +Makes Xulmus work in a way that Insert mode is the default mode for text areas. +Useful if you want to use Xulmus as a modeless editor, keeping the known Songbird interface for editing text areas. ____ @@ -471,9 +471,9 @@ ____ ||'loadplugins' 'lpl'|| boolean (default on) ____ Load plugin scripts when starting up. When on, yet unloaded plugins are -automatically loaded after the vimperatorrc file has been sourced. To +automatically loaded after the xulmusrc file has been sourced. To load plugins earlier, use the [c]:loadplugins[c] command within the -vimperatorrc. +xulmusrc. ____ @@ -555,12 +555,12 @@ they always open in a new tab. Possible values: .---`------------------------------------------------------------------------------------------------ *0* Force to open in the current tab (Warning: this can stop some web sites from working correctly!) *1* Always open in a new tab -*2* Open in a new window if it has a specific requested size (default in Firefox) +*2* Open in a new window if it has a specific requested size (default in Songbird) *3* Always open in a new window *4* Open in the same tab unless it has a specific requested size ----------------------------------------------------------------------------------------------------- -Note: This option does not change the popup blocker of Firefox in any way. +Note: This option does not change the popup blocker of Songbird in any way. ____ @@ -570,7 +570,7 @@ ____ Speed up first time history/bookmark completion History access can be quite slow for a large history. -Vimperator maintains a cache to speed it up significantly on subsequent access. +Xulmus maintains a cache to speed it up significantly on subsequent access. In order to also speed up first time access, it is cached at startup, if this option is set (recommended). ____ @@ -587,23 +587,23 @@ link elements are those defined by 'hinttags'. ____ -|$VIMPERATOR_RUNTIME| +|$XULMUS_RUNTIME| |\'rtp'| |\'runtimepath'| ||'runtimepath' 'rtp'|| stringlist ____ -(default: _$VIMPERATOR_RUNTIME_ or Unix, Mac: "\~/.vimperator", Windows: "\~/vimperator") +(default: _$XULMUS_RUNTIME_ or Unix, Mac: "\~/.xulmus", Windows: "\~/xulmus") List of directories searched for runtime files: + colors/ + macros/ + plugin/ + -Example: [c]:set runtimepath=\~/myvimperator,\~/.vimperator[c] + -This will search for plugins in both "\~/myvimperator/plugin" and -"\~/.vimperator/plugin" +Example: [c]:set runtimepath=\~/myxulmus,\~/.xulmus[c] + +This will search for plugins in both "\~/myxulmus/plugin" and +"\~/.xulmus/plugin" -On startup, if the environment variable _$VIMPERATOR_RUNTIME_ does not -exist, Vimperator will set it to match this value. +On startup, if the environment variable _$XULMUS_RUNTIME_ does not +exist, Xulmus will set it to match this value. ____ @@ -690,13 +690,13 @@ ____ |\'titlestring'| -||'titlestring'|| string (default: "Vimperator") +||'titlestring'|| string (default: "Xulmus") ____ -Change the title of the browser window. -Vimperator changes the browser title from "Title of web page - Mozilla Firefox" to -"Title of web page - Vimperator". + +Change the title of the player window. +Xulmus changes the player title from "Songbird" to +"Title of tab - Xulmus". + If you don't like that, you can restore it with: -[c]:set titlestring=Mozilla\ Firefox[c]. +[c]:set titlestring=Songbird[c]. ____ @@ -725,7 +725,7 @@ ____ ||'verbose' 'vbs'|| number (default: 1) ____ Define which info messages are displayed. -When bigger than zero, Vimperator will give messages about what it is doing. +When bigger than zero, Xulmus will give messages about what it is doing. These can be viewed at any time with the [c]:messages[c] command. The highest value is 15, being the most verbose mode. From 3fad7406d201be3c2d3ebe49eda73cbc4ce0386f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 25 Mar 2009 23:24:45 +1100 Subject: [PATCH 59/87] Use a green tilde for the Xulmus icon. --- xulmus/skin/icon.png | Bin 514 -> 465 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/xulmus/skin/icon.png b/xulmus/skin/icon.png index e821ed66aa94c38f809f64142d69b2252bb7a622..3d16d3fc225a8046756f9e96ba0f839557abc2af 100755 GIT binary patch delta 379 zcmV->0fhd71knSKUw;D`3>G>-+7N>P00B`+L_t(o!|m3wOB_)U$MMe|Vn8COWw5i* zLIM^Bn;2rFjR=N-kjCn;F@J!awHAVvL?oqufMRbUXklY3L;{8su@E!}Nj#fDmgCMW zc)KUE-{vi|!<*lmc{4mpo*3^ii+}imo+f^as9~nn0{UZJkADE04SWXi8(Vo~Ac^%Q z&O*dQ>VF50@D1I0mt!&noT4ji%Tb1p2iQt9u zA+k`zSgSX$WbnC8eNPvC`aYcF5WnIMj1(zg8&?>>rzpd5v}5kfMZjvxwiC9cyo0~O z1$G-u%1hi}sC1Q+ubw@OVmR6`O%)qBz+2p=M8D1u^E}%5ezexJfGK=z5FEZldEVnQ z*1|r3`3wT~(*jCLO4?52K~z(#^J?ywJnmtVJQz6J4v!L0X?F=a{(Gv2vXT_@E-ZQ8 Z+yP*`Kx7U@%8vj5002ovPDHLkV1gaNt>gdz delta 429 zcmV;e0aE_a1A+vQUw;A{5;H0^PrpF`00DwYL_t(o!|l{PYgADXhw&QSW z*X{V6BF+^5H{mTlVMpENIF|xGVq4m7W_eCx%OHB-d8A z8GN8z$}9wqSAF)er(XU-;FljU@3dx$RGtw<0nRNHOufWpJVM@$$;a9?Rna6 z)E#^ezT-ugNq_kRtJq)VRwfSFQ2Lqo$qr^g_Qy*QXdW`S0_hu<)*uNCTvQDT;e;@co*h)LoA zu{r&o5mOZ>BwiEi#QdMb<0-M&A!x1G->O=`ed1_`Z6=5~OWY$q5KF`>Vyx-lhAQ|C X4wHD0h+54g00000NkvXXu0mjfsISS& From 683d569eb286be62582f3f9ad149fb8f3500c74c Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 26 Mar 2009 00:25:59 +1100 Subject: [PATCH 60/87] Remove the unwanted SB margin from the command line. --- common/skin/liberator.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/skin/liberator.css b/common/skin/liberator.css index 48c22c33..a5857cd5 100644 --- a/common/skin/liberator.css +++ b/common/skin/liberator.css @@ -141,13 +141,17 @@ statusbarpanel { } #liberator-commandline-prompt { + background-color: inherit; margin: 0px; padding: 0px; - background-color: inherit; } #liberator-commandline-command { background-color: inherit; color: inherit; + margin: 0px; +} +#liberator-message { + margin: 0px; } #sidebar { From a5b6ec3478758bbed5f636c8d9d8f33638c718c6 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 26 Mar 2009 01:04:02 +1100 Subject: [PATCH 61/87] Refactor player#togglePlayPause. --- xulmus/TODO | 2 ++ xulmus/content/bookmarks.js | 3 ++- xulmus/content/player.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xulmus/TODO b/xulmus/TODO index 1a85e4cd..1585a2fe 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -6,6 +6,8 @@ BUGS: - SB doesn't support tab-undo yet so :undo and "u" etc don't work - :tabduplicate - :back/H, :forward,L + - :open songbird-internal-search searchString + Is this workable anyway? --djk FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/content/bookmarks.js b/xulmus/content/bookmarks.js index 03345b2a..9f73121f 100755 --- a/xulmus/content/bookmarks.js +++ b/xulmus/content/bookmarks.js @@ -621,7 +621,6 @@ function Bookmarks() //{{{ // did not :open once before this.getSearchEngines(); - function getShortcutOrURI(aURL, aPostDataRef) { var shortcutURL = null; @@ -689,7 +688,9 @@ function Bookmarks() //{{{ } return shortcutURL; } + url = getShortcutOrURI(searchString, aPostDataRef); + if (url == searchString) url = null; diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 7e419cf6..670d93b1 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -365,7 +365,7 @@ function Player() // {{{ togglePlayPause: function togglePlayPause() { gSongbirdWindowController.doCommand("cmd_control_playpause"); - SBGetBrowser().mediaTab.mediaPage.highlightItem(_SBGetCurrentView().getIndexForItem(gMM.sequencer.currentItem)); + focusTrack(gMM.sequencer.currentItem); }, toggleShuffle: function toggleShuffle() From 59c1eaa4c80d8650954fa56dd3b646d3a703bedd Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 26 Mar 2009 21:54:28 +1100 Subject: [PATCH 62/87] Add a :mediaview command to change media views. --- common/content/completion.js | 8 +++ xulmus/TODO | 1 + xulmus/content/player.js | 122 +++++++++++++++++++++++++---------- 3 files changed, 96 insertions(+), 35 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 7596362f..0494759b 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1664,6 +1664,14 @@ function Completion() //{{{ context.completions = marks.all; }, + mediaView: function mediaView(context) + { + context.title = ["Media View", "URL"]; + context.anchored = false; + context.keys = { text: "contentTitle", description: "contentUrl" }; + context.completions = player.getMediaPages(); + }, + menuItem: function menuItem(context) { context.title = ["Menu Path", "Label"]; diff --git a/xulmus/TODO b/xulmus/TODO index 1585a2fe..867a6947 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -8,6 +8,7 @@ BUGS: - :back/H, :forward,L - :open songbird-internal-search searchString Is this workable anyway? --djk + - is off by one when alternating with the media tab FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 670d93b1..e3710cf4 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -11,6 +11,9 @@ function Player() // {{{ // Get the focus to the visible playlist first //window._SBShowMainLibrary(); + const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"] + .getService(Components.interfaces.sbIMediaPageManager); + // interval (milliseconds) function seek(interval, direction) { @@ -202,6 +205,41 @@ function Player() // {{{ //completer: function (context, args) completion.tracks(context, args); }); + commands.add(["load"], + "Load a playlist", + function (args) + { + let arg = args.literalArg; + + if (arg) + { + // load the selected playlist/smart playlist + let playlists = player.getPlaylists(); + + for ([i, list] in Iterator(playlists)) + { + if (util.compareIgnoreCase(arg, list.name) == 0) + { + SBGetBrowser().loadMediaList(playlists[i]); + focusTrack(_SBGetCurrentView().getItemByIndex(0)); + return; + } + } + + liberator.echoerr("E475: Invalid argument: " + arg); + } + else + { + // load main library if there are no args + _SBShowMainLibrary(); + } + }, + { + argCount: "?", + completer: function(context, args) completion.playlist(context, args), + literal: 0 + }); + // TODO: better off as a single command (:player play) or cmus compatible (:player-play)? --djk commands.add(["playerp[lay]"], "Play track", @@ -260,6 +298,41 @@ function Player() // {{{ }, { argCount: "1" }); + commands.add(["mediav[iew]"], + "Change the current media view", + function (args) + { + // FIXME: is this a SB restriction? --djk + if (!gBrowser.currentMediaPage) + { + liberator.echoerr("Exxx: Can only set the media view from the media tab"); // XXX + return; + } + + let arg = args[0]; + + if (arg) + { + let pages = player.getMediaPages(); + + for ([,page] in Iterator(pages)) + { + if (util.compareIgnoreCase(arg, page.contentTitle) == 0) + { + player.loadMediaPage(page, gBrowser.currentMediaListView.mediaList, gBrowser.currentMediaListView); + return; + } + } + + liberator.echoerr("E475: Invalid argument: " + arg); + } + }, + { + argCount: "1", + completer: function (context) completion.mediaView(context), + literal: 0 + }); + // TODO: maybe :vol! could toggle mute on/off? --djk commands.add(["vol[ume]"], "Set the volume", @@ -282,41 +355,6 @@ function Player() // {{{ }, { argCount: "1" }); - commands.add(["load"], - "Load a playlist", - function (args) - { - let arg = args.literalArg; - - if (arg) - { - // load the selected playlist/smart playlist - let playlists = player.getPlaylists(); - - for ([i, list] in Iterator(playlists)) - { - if (util.compareIgnoreCase(arg, list.name) == 0) - { - SBGetBrowser().loadMediaList(playlists[i]); - focusTrack(_SBGetCurrentView().getItemByIndex(0)); - return; - } - } - - liberator.echoerr("E475: Invalid argument: " + arg); - } - else - { - // load main library if there are no args - _SBShowMainLibrary(); - } - }, - { - argCount: "?", - completer: function(context, args) completion.playlist(context, args), - literal: 0 - }); - /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -408,6 +446,7 @@ function Player() // {{{ seekTo: function seekTo(position) { + // FIXME: if not playing if (!gMM.playbackControl) this.play(); @@ -500,6 +539,19 @@ function Player() // {{{ playPlaylist: function playPlaylist(playlist, row) { gMM.sequencer.playView(playlist.createView(), row); + }, + + getMediaPages: function getMediaPages() + { + let list = gBrowser.currentMediaPage.mediaListView.mediaList; + let pages = pageService.getAvailablePages(list); + return ArrayConverter.JSArray(pages).map(function (page) page.QueryInterface(Components.interfaces.sbIMediaPageInfo)); + }, + + loadMediaPage: function loadMediaList(page, list, view) + { + pageService.setPage(list, page); + gBrowser.loadMediaList(list, null, null, view, null); } }; //}}} From 1a034069db5c93c8f261fcaf4bcd3b8cf555f231 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 27 Mar 2009 01:40:36 +1100 Subject: [PATCH 63/87] Document :mediaview. --- xulmus/TODO | 1 + xulmus/locale/en-US/player.txt | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/xulmus/TODO b/xulmus/TODO index 867a6947..638bf7c8 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -9,6 +9,7 @@ BUGS: - :open songbird-internal-search searchString Is this workable anyway? --djk - is off by one when alternating with the media tab + - numbered tabs FEATURES: 9 / and ? possibly reusing "Jump to" functionality directly. diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 8053d3c5..40160fef 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -164,4 +164,13 @@ Load [a][playlist][a]. If no playlist is specified then the main library view is loaded. ________________________________________________________________________________ +section:Changing{nbsp}media{nbsp}views[media-view,view] + +|:mediav| |:mediaview| +||:mediav[iew] {view}|| + +________________________________________________________________________________ +Change the media view to {view}. This can only be run when the media tab is the +current tab. +________________________________________________________________________________ + // vim: set filetype=asciidoc: From f06f1d776e28254a9e962512fc04246165450085 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Fri, 27 Mar 2009 23:32:03 +0530 Subject: [PATCH 64/87] Added SearchView - '/', 'n' & 'N' --- common/content/modes.js | 2 ++ xulmus/content/player.js | 73 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/common/content/modes.js b/common/content/modes.js index f0d71735..0ae21289 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -277,6 +277,8 @@ const modes = (function () //{{{ self.addMode("OUTPUT_MULTILINE", true); self.addMode("SEARCH_FORWARD", true); self.addMode("SEARCH_BACKWARD", true); + self.addMode("SEARCH_VIEW_FORWARD", true); + self.addMode("SEARCH_VIEW_BACKWARD", true); self.addMode("MENU", true); // a popupmenu is active self.addMode("LINE", true); // linewise visual mode self.addMode("PROMPT", true); diff --git a/xulmus/content/player.js b/xulmus/content/player.js index e3710cf4..e6198d7f 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -8,11 +8,20 @@ function Player() // {{{ ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + let lastSearchString = ""; + let lastSearchIndex = 0; + let lastSearchView = _SBGetCurrentView(); + // Get the focus to the visible playlist first //window._SBShowMainLibrary(); const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"] .getService(Components.interfaces.sbIMediaPageManager); + // Register Callbacks for searching. + + liberator.registerCallback("change", modes.SEARCH_VIEW_FORWARD, function (command) { player.searchView(command);}); + liberator.registerCallback("submit", modes.SEARCH_VIEW_FORWARD, function (command) { player.searchView(command);}); + //liberator.registerCallback("cancel", modes.SEARCH_VIEW_FORWARD, function (command) { player.searchView(command);}); // interval (milliseconds) function seek(interval, direction) @@ -143,6 +152,18 @@ function Player() // {{{ ["-"], "Decrease volume by 10%", function () { player.decreaseVolume(); }); + mappings.add([modes.PLAYER], + ["/"], "Search View", + function (args) { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); }); + + mappings.add([modes.PLAYER], + ["n"], "Find Next", + function () { player.searchViewAgain(false);}); + + mappings.add([modes.PLAYER], + ["N"], "Find Previous", + function () { player.searchViewAgain(true);}); + ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -495,22 +516,64 @@ function Player() // {{{ return tracksList; }, - // TODO: Use this for implementing "/" and "?". -ken - searchTracks: function searchTracks(args) + searchView: function searchView (args) { let currentView = _SBGetCurrentView(); let mediaItemList = currentView.mediaList; let search = _getSearchString(currentView); let searchString = ""; + let index = 0; if (search != "") searchString = args + " " + search; else searchString = args; - - let myView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); - focusTrack(myView.getItemByIndex(0)); + + lastSearchString = searchString; + + let mySearchView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); + + if (mySearchView.length) + { + lastSearchView = mySearchView; + focusTrack(mySearchView.getItemByIndex(index)); + } + else + { + liberator.echoerr("E486 Pattern not found: "+searchString, commandline.FORCE_SINGLELINE); + } }, + + //FIXME: commandline.echo should work --ken + searchViewAgain: function searchViewAgain(reverse) + { + if (reverse) + { + if (lastSearchIndex == 0) + { + //commandline.echo("Search hit TOP, continuing at BOTTOM", + // commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES | commandline.FORCE_SINGLELINE); + lastSearchIndex = lastSearchView.length - 1; + } + else + lastSearchIndex = lastSearchIndex - 1; + } + else + { + if (lastSearchIndex == (lastSearchView.length -1)) + { + //commandline.echo("Search hit BOTTOM, continuing at TOP", + // commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES | commandline.FORCE_SINGLELINE); + lastSearchIndex = 0; + } + else + lastSearchIndex = lastSearchIndex + 1; + } + + //FIXME: Implement for "?" --ken + commandline.echo("/" + lastSearchString, null, commandline.FORCE_SINGLELINE); + focusTrack(lastSearchView.getItemByIndex(lastSearchIndex)); + }, getPlaylists: function getPlaylists() { From 909485a96c7eaa9eb8694f17aada23d3541bfa6d Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 00:09:53 +0530 Subject: [PATCH 65/87] Documented search operations and fixed typo in :seek --- xulmus/locale/en-US/player.txt | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 40160fef..d2c536a3 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -118,7 +118,7 @@ Seek -1m. ________________________________________________________________________________ -|:see]| |:seek| +|:see| |:seek| ||:see[k] {[HH:]MM:SS]}|| + ||:see[k] +{time[hms]} | -{time[hms]}|| + ________________________________________________________________________________ @@ -141,7 +141,7 @@ ________________________________________________________________________________ |-| -||-|| +||-|| + ________________________________________________________________________________ Decrease volume by 10%. ________________________________________________________________________________ @@ -173,4 +173,26 @@ Change the media view to {view}. This can only be run when the media tab is the current tab. ________________________________________________________________________________ +section:Search{nbsp}commands[search] + +|/| +||/{pattern}|| + +________________________________________________________________________________ +Search for the first occurence of {pattern} in the visisble view. +________________________________________________________________________________ + +|n| +||n|| + +________________________________________________________________________________ +Find next. Repeats the last search. If the search hits BOTTOM of the view, it +continues from TOP. +________________________________________________________________________________ + +|N| +||N|| + +________________________________________________________________________________ +Find previous. Repeats the last search in the opposite direction. If the search +hits TOP of the view, it continues from BOTTTOM. +________________________________________________________________________________ + // vim: set filetype=asciidoc: From 187f7229e22bb66ca42eaffa7d40080520e317cf Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 00:18:27 +0530 Subject: [PATCH 66/87] Updated TODO --- xulmus/TODO | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xulmus/TODO b/xulmus/TODO index 638bf7c8..16d91ee8 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -12,8 +12,8 @@ BUGS: - numbered tabs FEATURES: -9 / and ? possibly reusing "Jump to" functionality directly. -8 Playlist/SmartPlaylist operations. +9 '?' - Reusing '/'. +8 Playlist/SmartPlaylist operations & meta-data operations. 7 extended hint mode for opening links in FF. 5 Check for default extensions and add commands for them. Ex. Last.fm, Seeqpod e.t.c Wouldn't these be provided as Xulmus plugins like Vimperator does? --djk From 2b1010251b6a9e258f316410fa329b6498747a60 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 01:14:08 +0530 Subject: [PATCH 67/87] Added mappings for changing rating of current mediaItem --- xulmus/content/player.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index e6198d7f..2da8215b 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -164,6 +164,32 @@ function Player() // {{{ ["N"], "Find Previous", function () { player.searchViewAgain(true);}); + //FIXME: Better way to do this ? --ken + mappings.add([modes.PLAYER], + [""], "Rate the current media item 0", + function () { player.rateMediaItem(0); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 1", + function () { player.rateMediaItem(1); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 2", + function () { player.rateMediaItem(2); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 3", + function () { player.rateMediaItem(3); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 4", + function () { player.rateMediaItem(4); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 5", + function () { player.rateMediaItem(5); }); + + ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -414,11 +440,13 @@ function Player() // {{{ next: function next() { gSongbirdWindowController.doCommand("cmd_control_next"); + gSongbirdWindowController.doCommand("cmd_find_current_track"); }, previous: function previous() { gSongbirdWindowController.doCommand("cmd_control_previous"); + gSongbirdWindowController.doCommand("cmd_find_current_track"); }, togglePlayPause: function togglePlayPause() @@ -615,6 +643,12 @@ function Player() // {{{ { pageService.setPage(list, page); gBrowser.loadMediaList(list, null, null, view, null); + }, + + rateMediaItem: function rateMediaItem(rating) + { + if (gMM.sequencer.currentItem) + gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); } }; //}}} From 7c9767822843bc52671532492df7870eb4d0dc5a Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 02:43:40 +0530 Subject: [PATCH 68/87] Fixed typo in player.txt --- xulmus/locale/en-US/player.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index d2c536a3..0a807c64 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -178,7 +178,7 @@ section:Search{nbsp}commands[search] |/| ||/{pattern}|| + ________________________________________________________________________________ -Search for the first occurence of {pattern} in the visisble view. +Search for the first occurence of {pattern} in the visible media view. ________________________________________________________________________________ |n| From ec6cfad1e0c6ff3741553e7e697008e78082ac6b Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 03:14:41 +0530 Subject: [PATCH 69/87] Fixed SearchViewAgain --- xulmus/content/player.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 2da8215b..4b22e0a2 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -564,6 +564,7 @@ function Player() // {{{ if (mySearchView.length) { lastSearchView = mySearchView; + lastSearchIndex = 0; focusTrack(mySearchView.getItemByIndex(index)); } else @@ -601,6 +602,7 @@ function Player() // {{{ //FIXME: Implement for "?" --ken commandline.echo("/" + lastSearchString, null, commandline.FORCE_SINGLELINE); focusTrack(lastSearchView.getItemByIndex(lastSearchIndex)); + }, getPlaylists: function getPlaylists() From d3a5d3d229bcd7846ec05774eaa6b05f66c0589c Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 05:02:59 +0530 Subject: [PATCH 70/87] Refactor player.js & Changed the install maxVersion to 1.2.0pre --- common/content/completion.js | 6 +- xulmus/content/player.js | 200 ++++++++++++++++++----------------- xulmus/install.rdf | 2 +- 3 files changed, 107 insertions(+), 101 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 0494759b..c5ee7a1a 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1395,17 +1395,17 @@ function Completion() //{{{ if (args.completeArg == 0) { context.title = ["Artists"]; - context.completions = getArtists(); + context.completions = player.getArtists(); } else if (args.completeArg == 1) { context.title = ["Albums by " + args[0]]; - context.completions = getAlbums(args[0]); + context.completions = player.getAlbums(args[0]); } else if (args.completeArg == 2) { context.title = ["Tracks from " + args[1] + " by " + args[0]]; - context.completions = getTracks(args[0], args[1]); + context.completions = player.getTracks(args[0], args[1]); } }, diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 4b22e0a2..2d8b3c0d 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -1,6 +1,6 @@ // Import Artist List as this can be huge -var artists = getArtistsArray(); + function Player() // {{{ { @@ -11,10 +11,53 @@ function Player() // {{{ let lastSearchString = ""; let lastSearchIndex = 0; let lastSearchView = _SBGetCurrentView(); - + // Get the focus to the visible playlist first //window._SBShowMainLibrary(); + + + function getArtistsArray() + { + var list = LibraryUtils.mainLibrary; + // Create an enumeration listener to count each item + var listener = { + count: 0, + onEnumerationBegin: function (aMediaList) { + this.count = 0; + }, + onEnumeratedItem: function (aMediaList, aMediaItem) { + this.count++; + }, + onEnumerationEnd: function (aMediaList, aStatusCode) {} + }; + + var artistCounts = {}; + var artists = list.getDistinctValuesForProperty(SBProperties.artistName); + var artist; + var artistArray = []; + var i = 0; + // Count the number of media items for each distinct artist + while (artists.hasMore()) + { + artist = artists.getNext(); + artistArray[i] = [artist, artist]; + list.enumerateItemsByProperty(SBProperties.artistName, + artist, + listener, + Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING); + artistCounts[artist] = listener.count; + i++; + } + + //liberator.dump("Count : "+artistCounts.toSource()); + return artistArray; + } + + // Get the artist names before hand. + + let artists = getArtistsArray(); + const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"] .getService(Components.interfaces.sbIMediaPageManager); // Register Callbacks for searching. @@ -550,7 +593,6 @@ function Player() // {{{ let mediaItemList = currentView.mediaList; let search = _getSearchString(currentView); let searchString = ""; - let index = 0; if (search != "") searchString = args + " " + search; @@ -565,7 +607,7 @@ function Player() // {{{ { lastSearchView = mySearchView; lastSearchIndex = 0; - focusTrack(mySearchView.getItemByIndex(index)); + focusTrack(mySearchView.getItemByIndex(lastSearchIndex)); } else { @@ -651,103 +693,67 @@ function Player() // {{{ { if (gMM.sequencer.currentItem) gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); + }, + + getArtists: function getArtists() + { + return artists; + }, + + getAlbums: function getAlbums(artist) + { + var list = LibraryUtils.mainLibrary; + var albumArray = [], returnArray = []; + var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); + var i = 0, j = 0; + + + while (items.hasMoreElements()) + { + album = items.getNext().getProperty(SBProperties.albumName); + albumArray[i] = [album, album]; + + if (i == 0) + { + returnArray[j] = albumArray[i]; + j++; + } + else if (albumArray[i-1].toString() != albumArray[i].toString()) + { + returnArray[i] = albumArray[i]; + j++; + } + i++; + } + + return returnArray; + }, + + getTracks: function getTracks(artist, album) + { + var list = LibraryUtils.mainLibrary; + var tracksArray = []; + var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] + .createInstance(Ci.sbIMutablePropertyArray); + var i = 0; + + pa.appendProperty(SBProperties.artistName, artist.toString()); + pa.appendProperty(SBProperties.albumName, album.toString()); + var items = list.getItemsByProperties(pa).enumerate(); + + while (items.hasMoreElements()) + { + track = items.getNext().getProperty(SBProperties.trackName); + tracksArray[i] = [track, track]; + i++; + } + + return tracksArray; } + }; //}}} } // }}} -function getArtists() -{ - return this.artists; -} - -function getArtistsArray() -{ - var list = LibraryUtils.mainLibrary; - - // Create an enumeration listener to count each item - var listener = { - count: 0, - onEnumerationBegin: function (aMediaList) { - this.count = 0; - }, - onEnumeratedItem: function (aMediaList, aMediaItem) { - this.count++; - }, - onEnumerationEnd: function (aMediaList, aStatusCode) {} - }; - - var artistCounts = {}; - var artists = list.getDistinctValuesForProperty(SBProperties.artistName); - var artist; - var artistArray = []; - var i = 0; - // Count the number of media items for each distinct artist - while (artists.hasMore()) - { - artist = artists.getNext(); - artistArray[i] = [artist, artist]; - list.enumerateItemsByProperty(SBProperties.artistName, - artist, - listener, - Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING); - artistCounts[artist] = listener.count; - i++; - } - - //liberator.dump("Count : "+artistCounts.toSource()); - return artistArray; -} - -function getAlbums(artist) -{ - var list = LibraryUtils.mainLibrary; - var albumArray = [], returnArray = []; - var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); - var i = 0, j = 0; - - - while (items.hasMoreElements()) - { - album = items.getNext().getProperty(SBProperties.albumName); - albumArray[i] = [album, album]; - - if (i == 0) - { - returnArray[j] = albumArray[i]; - j++; - } - else if (albumArray[i-1].toString() != albumArray[i].toString()) - { - returnArray[i] = albumArray[i]; - j++; - } - i++; - } - - return returnArray; -} - -function getTracks(artist, album) -{ - var list = LibraryUtils.mainLibrary; - var tracksArray = []; - var pa = Cc["@songbirdnest.com/Songbird/Properties/MutablePropertyArray;1"] - .createInstance(Ci.sbIMutablePropertyArray); - var i = 0; - - pa.appendProperty(SBProperties.artistName, artist.toString()); - pa.appendProperty(SBProperties.albumName, album.toString()); - var items = list.getItemsByProperties(pa).enumerate(); - - while (items.hasMoreElements()) - { - track = items.getNext().getProperty(SBProperties.trackName); - tracksArray[i] = [track, track]; - i++; - } - - return tracksArray; -} // vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/install.rdf b/xulmus/install.rdf index 7dccc3a8..3851c0af 100755 --- a/xulmus/install.rdf +++ b/xulmus/install.rdf @@ -12,7 +12,7 @@ songbird@songbirdnest.com 0.8.0pre - 1.1.0pre + 1.2.0pre From 2c352c285b41c330b603ac5c7ff4fa98d9e8022e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 02:13:18 +1100 Subject: [PATCH 71/87] Update help files for Xulmus. --- xulmus/content/config.js | 22 +++++++--------- xulmus/locale/en-US/browsing.txt | 24 ++++++++--------- xulmus/locale/en-US/buffer.txt | 4 +-- xulmus/locale/en-US/developer.txt | 2 +- xulmus/locale/en-US/eval.txt | 4 +-- xulmus/locale/en-US/gui.txt | 43 +++++++------------------------ xulmus/locale/en-US/hints.txt | 2 +- xulmus/locale/en-US/index.txt | 41 +++++++++++++++++++++++++---- xulmus/locale/en-US/intro.txt | 43 ++++++++++++++----------------- xulmus/locale/en-US/map.txt | 8 +++--- xulmus/locale/en-US/marks.txt | 4 +-- xulmus/locale/en-US/message.txt | 2 +- xulmus/locale/en-US/pattern.txt | 4 +-- xulmus/locale/en-US/print.txt | 2 +- xulmus/locale/en-US/repeat.txt | 10 +++---- xulmus/locale/en-US/starting.txt | 10 +++---- xulmus/locale/en-US/styling.txt | 4 +-- xulmus/locale/en-US/tabs.txt | 31 +++++++++++----------- xulmus/locale/en-US/various.txt | 4 +-- 19 files changed, 133 insertions(+), 131 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 89590b57..248b6a6e 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -116,7 +116,7 @@ const config = { //{{{ function () { window.BrowserViewSourceOfDocument(content.document); }], ["places", "Places Organizer: Manage your bookmarks and history", function () { PlacesCommandHook.showPlacesOrganizer(ORGANIZER_ROOT_BOOKMARKS); }], - ["preferences", "Show Firefox preferences dialog", + ["preferences", "Show Songbird preferences dialog", function () { window.openPreferences(); }], /* ["printpreview", "Preview the page before printing", @@ -138,14 +138,14 @@ const config = { //{{{ //TODO : Write intro.html and tutorial.html // they are sorted by relevance, not alphabetically - helpFiles: [ "player.html", "options.html", "autocommands.html" ], - /* "intro.html", "tutorial.html", "starting.html", "browsing.html", - "buffer.html", "cmdline.html", "insert.html", "options.html", - "pattern.html", "tabs.html", "hints.html", "map.html", "eval.html", - "marks.html", "repeat.html", "autocommands.html", "print.html", - "gui.html", "styling.html", "message.html", "developer.html", - "various.html", "index.html", "version.html" - ], */ + helpFiles: [ + "intro.html", /*"tutorial.html",*/ "starting.html", "player.html", + "browsing.html", "buffer.html", "cmdline.html", "insert.html", + "options.html", "pattern.html", "tabs.html", "hints.html", "map.html", + "eval.html", "marks.html", "repeat.html", "autocommands.html", + "print.html", "gui.html", "styling.html", "message.html", + "developer.html", "various.html", "index.html", "version.html" + ], scripts: [ "bookmarks.js", @@ -155,8 +155,6 @@ const config = { //{{{ init: function () { - options["helpfile"] = "player.html"; - //Adding a mode for Player //modes.addMode("PLAYER"); // Player mode for songbird @@ -375,7 +373,7 @@ const config = { //{{{ "Show " + config.hostApplication + " preferences", function (args) { - if (args.bang) // open Firefox settings GUI dialog + if (args.bang) // open Songbird settings GUI dialog { liberator.open("about:config", (options["newtab"] && options.get("newtab").has("all", "prefs")) diff --git a/xulmus/locale/en-US/browsing.txt b/xulmus/locale/en-US/browsing.txt index 9b44fa8a..ddbe2add 100755 --- a/xulmus/locale/en-US/browsing.txt +++ b/xulmus/locale/en-US/browsing.txt @@ -2,15 +2,15 @@ HEADER |surfing| |browsing| + -Vimperator overrides nearly all Firefox keys in order to make browsing more +Xulmus overrides nearly all Songbird keys in order to make browsing more pleasant for Vim users. On the rare occasions when you want to pass a keystroke -to Firefox, or to the web page, and have it retain its original meaning you +to Songbird, or to the web page, and have it retain its original meaning you have 2 possibilities: |pass-through| || |CTRL-Z| + ||CTRL-Z|| ________________________________________________________________________________ -Disable all Vimperator keys except [m][m] and pass them to the next event +Disable all Xulmus keys except [m][m] and pass them to the next event handler. This is especially useful, if JavaScript controlled forms like the RichEdit form fields of Gmail don't work anymore. To exit this mode, press [m][m]. If you also need to pass [m][m] in this mode to the web page, @@ -21,10 +21,10 @@ ________________________________________________________________________________ ||CTRL-V|| ________________________________________________________________________________ If you only need to pass a single key to a JavaScript form field or another -extension prefix the key with [m][m]. Also works to unshadow Firefox -shortcuts like [m][m] which are otherwise hidden in Vimperator. When -Vimperator mode is temporarily disabled with [m][m], [m][m] will pass -the next key to Vimperator instead of the web page. +extension prefix the key with [m][m]. Also works to unshadow Songbird +shortcuts like [m][m] which are otherwise hidden in Xulmus. When +Xulmus mode is temporarily disabled with [m][m], [m][m] will pass +the next key to Xulmus instead of the web page. ________________________________________________________________________________ section:Opening{nbsp}web{nbsp}pages[opening] @@ -52,7 +52,7 @@ Each token is analyzed and in this order: 3. Opened with the default search engine or keyword (specified with the 'defsearch' option) if the first word is no search engine ([c]:open linus torvalds[c] opens a Google search for linux torvalds). -4. Passed directly to Firefox in all other cases ([c]:open www.osnews.com, +4. Passed directly to Songbird in all other cases ([c]:open www.osnews.com, www.slashdot.org[c] opens OSNews in the current, and Slashdot in a new background tab). @@ -286,7 +286,7 @@ section:Quitting[quitting,save-session] ||:q[uit]|| ________________________________________________________________________________ Quit current tab. If this is the last tab in the window, close the window. If -this was the last window, close Vimperator. When quitting Vimperator, the +this was the last window, close Xulmus. When quitting Xulmus, the session is not stored. ________________________________________________________________________________ @@ -294,7 +294,7 @@ ________________________________________________________________________________ |:qa| |:qall| |:quita| |:quitall| + ||:quita[ll]|| ________________________________________________________________________________ -Quit Vimperator. Quit Vimperator, no matter how many tabs/windows are open. +Quit Xulmus. Quit Xulmus, no matter how many tabs/windows are open. The session is not stored. ________________________________________________________________________________ @@ -310,7 +310,7 @@ ________________________________________________________________________________ ||:wqa[ll]|| + ||:xa[ll]|| ________________________________________________________________________________ -Save the session and quit. Quit Vimperator, no matter how many tabs/windows +Save the session and quit. Quit Xulmus, no matter how many tabs/windows are open. The session is stored. [c]:wq[c] is different from Vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that. @@ -327,7 +327,7 @@ ________________________________________________________________________________ |ZZ| ||ZZ|| ________________________________________________________________________________ -Quit and save the session. Quit Vimperator, no matter how many tabs/windows +Quit and save the session. Quit Xulmus, no matter how many tabs/windows are open. The session is stored. Works like [c]:xall[c]. ________________________________________________________________________________ diff --git a/xulmus/locale/en-US/buffer.txt b/xulmus/locale/en-US/buffer.txt index 91022f27..50bc589a 100755 --- a/xulmus/locale/en-US/buffer.txt +++ b/xulmus/locale/en-US/buffer.txt @@ -2,7 +2,7 @@ HEADER |buffer| |document| + -Vimperator holds exactly one buffer object for each tab. It is usually an +Xulmus holds exactly one buffer object for each tab. It is usually an (X)HTML document with advanced features. section:Buffer{nbsp}information[buffer-information] @@ -234,7 +234,7 @@ default zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 110%, 120%, 133%, 150%, 170%, 200%, 240%, 300%. The available zoom range can be changed by setting the \'zoom.minPercent' and -\'zoom.maxPercent' Firefox preferences. The zoom levels can be changed using +\'zoom.maxPercent' Songbird preferences. The zoom levels can be changed using the \'toolkit.ZoomManager.zoomLevels' preference. Note: \'toolkit.ZoomManager.zoomLevels' is specified as a list of values diff --git a/xulmus/locale/en-US/developer.txt b/xulmus/locale/en-US/developer.txt index cf875d82..7401a2f1 100755 --- a/xulmus/locale/en-US/developer.txt +++ b/xulmus/locale/en-US/developer.txt @@ -60,7 +60,7 @@ Some notes about the code above: automatically marked up as an argument. There are also some additional asciidoc commands specifically for writing -Vimperator documentation: +Xulmus documentation: - *$$section:Writing{nbsp}documentation[writing-docs,documentation]$$* Creates a new section like _Writing Documentation_ in this help file with 2 tags. diff --git a/xulmus/locale/en-US/eval.txt b/xulmus/locale/en-US/eval.txt index 17c71dda..accb6fce 100755 --- a/xulmus/locale/en-US/eval.txt +++ b/xulmus/locale/en-US/eval.txt @@ -53,10 +53,10 @@ passing the argument to `eval()`. is found, and interpret them with the JavaScript _eval()_ function. The special version [c]:javascript![c] opens the JavaScript console of -Firefox. +Songbird. [m][m] completion is available for [c]:javascript {cmd}[c] (but not -yet for the [c]:js <Sidebar menu. Add-ons, Preferences and Downloads are -also available in the sidebar. -________________________________________________________________________________ - // vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/hints.txt b/xulmus/locale/en-US/hints.txt index ef3200bb..aba281d5 100755 --- a/xulmus/locale/en-US/hints.txt +++ b/xulmus/locale/en-US/hints.txt @@ -25,7 +25,7 @@ ________________________________________________________________________________ Start QuickHint mode, but open link in a new tab. Like normal QuickHint mode (activated with [m]f[m]) but opens the link in a new tab. The new tab will be loaded in background according to the -\'browser.tabs.loadInBackground' Firefox preference. +\'browser.tabs.loadInBackground' Songbird preference. ________________________________________________________________________________ diff --git a/xulmus/locale/en-US/index.txt b/xulmus/locale/en-US/index.txt index 5a6a2fbb..ce56d602 100755 --- a/xulmus/locale/en-US/index.txt +++ b/xulmus/locale/en-US/index.txt @@ -4,6 +4,25 @@ HEADER This file contains a list of all available commands. +section:Player{nbsp}mode[player-index] + +||[m]x[m]|| Play the current track + +||[m]z[m]|| Play the previous track + +||[m]b[m]|| Play the next track + +||[m]c[m]|| Pause/unpause the current track + +||[m]v[m]|| Stop playing the current track + +||[m]t[m]|| Toggle shuffle mode + +||[m]r[m]|| Toggle repeat mode + +||[m]i[m]|| Select the currently playing track + +||[m]f[m]|| Filter and play tracks + +||[m]F[m]|| Filter and show the tracks as a view + +||[m]h[m]|| Seek -10s + +||[m]l[m]|| Seek +10s + +||[m]H[m]|| Seek -1m + +||[m]L[m]|| Seek +1m + +||[m]+[m]|| Increase volume by 10% + +||[m]-[m]|| Decrease volume by 10% + + section:Insert{nbsp}mode[insert-index] ||[m][m]|| Launch the external editor + @@ -24,7 +43,7 @@ section:Normal{nbsp}mode[normal-index] ||[m][m]|| Scroll window upwards in the buffer + ||[m][m]|| Pass through next key + ||[m][m]|| Decrement last number in URL + -||[m][m]|| Temporarily ignore all Vimperator key bindings + +||[m][m]|| Temporarily ignore all Xulmus key bindings + ||[m][m]|| Focus content + @@ -141,6 +160,18 @@ section:Command-line{nbsp}editing[ex-edit-index] section:Ex{nbsp}commands[ex-cmd-index,:index] +||[c]:playerplay[c]|| Play the current track + +||[c]:playerprev[c]|| Play the previous track + +||[c]:playernext[c]|| Play the next track + +||[c]:playerpause[c]|| Pause/unpause the current track + +||[c]:playerstop[c]|| Stop playing the current track + +||[c]:filter[c]|| Filter and play tracks + +||[c]:Filter[c]|| Filter and show the tracks as a view + +||[c]:seek[c]|| Seek to an absolute or relative position in a track + +||[c]:volume[c]|| Set the player volume + +||[c]:load[c]|| Load a playlist + +||[c]:mediaview[c]|| Change the media view + + ||[c]:![c]|| Run a command + ||[c]:abbreviate[c]|| Abbreviate a key sequence + ||[c]:abclear[c]|| Remove all abbreviations + @@ -184,7 +215,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:forward[c]|| Go forward in the browser history + ||[c]:hardcopy[c]|| Print current document + ||[c]:help[c]|| Display help + -||[c]:highlight[c]|| Style Vimperator + +||[c]:highlight[c]|| Style Xulmus + ||[c]:history[c]|| Show recently visited URLs + ||[c]:iabbrev[c]|| Abbreviate a key sequence in Insert mode + ||[c]:iabclear[c]|| Remove all abbreviations in Insert mode + @@ -203,7 +234,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:mark[c]|| Mark current location within the web page + ||[c]:marks[c]|| Show all location marks of current web page + ||[c]:messages[c]|| Display previously given messages + -||[c]:mkvimperatorrc[c]|| Write current key mappings and changed options to the config file + +||[c]:mkxulmusrc[c]|| Write current key mappings and changed options to the config file + ||[c]:nohlsearch[c]|| Remove the search highlighting + ||[c]:noremap[c]|| Map a key sequence without remapping keys + ||[c]:normal[c]|| Execute Normal mode commands + @@ -212,7 +243,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:pageinfo[c]|| Show various page information + ||[c]:pagestyle[c]|| Select the author style sheet to apply + ||[c]:play[c]|| Replay a recorded macro + -||[c]:preferences[c]|| Show Firefox preferences dialog + +||[c]:preferences[c]|| Show Songbird preferences dialog + ||[c]:pwd[c]|| Print the current directory name + ||[c]:qmark[c]|| Mark a URL with a letter for quick access + ||[c]:qmarks[c]|| Show all QuickMarks + @@ -230,7 +261,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:setglobal[c]|| Set global option + ||[c]:setlocal[c]|| Set local option + ||[c]:sidebar[c]|| Open the sidebar window + -||[c]:style[c]|| Style Vimperator and web sites + +||[c]:style[c]|| Style Xulmus and web sites + ||[c]:source[c]|| Read Ex commands from a file + ||[c]:stop[c]|| Stop loading + ||[c]:tab[c]|| Execute a command and tell it to output in a new tab + diff --git a/xulmus/locale/en-US/intro.txt b/xulmus/locale/en-US/intro.txt index 98c9a70d..4692276f 100755 --- a/xulmus/locale/en-US/intro.txt +++ b/xulmus/locale/en-US/intro.txt @@ -1,31 +1,25 @@ LOGO -+++
+++ -*First there was a Navigator, then there was an Explorer. -Later it was time for a Konqueror. Now it's time for an Imperator, the -VIMperator :)* -+++
+++ - section:Introduction[intro] -http://vimperator.org[Vimperator] is a free browser add-on for Firefox, -which makes it look and behave like the http://www.vim.org[Vim] -text editor. It has similar key bindings, and you could call it a modal -web browser, as key bindings differ according to which mode you are in. +http://vimperator.org/Xulmus[Xulmus] is a free media player add-on for +Songbird, which combines the best features of the +http://cmus.sourceforge.net[cmus] music player and the http://www.vim.org[Vim] +text editor. |warning| + Warning: -To provide the most authentic Vim experience, the Firefox menubar and toolbar -are hidden. + -If you really need them, type: [c]:set guioptions+=mT[c] to get them back. + -If you don't like Vimperator at all, you can uninstall it by typing +To provide the most authentic cmus/Vim experience, the Songbird toolbar +is hidden. + +If you really need it, type: [c]:set guioptions+=T[c] to get it back. + +If you don't like Xulmus at all, you can uninstall it by typing [c]:addons[c] and remove/disable it. + If you like it but can't remember the shortcuts, then press [m]F1[m] or [c]:help[c] to get this help window back. |author| |donation| + -Vimperator was written by mailto:stubenschrott@gmx.net[Martin Stubenschrott]. -If you appreciate my work on Vimperator and want to encourage me working on it +Xulmus was written by mailto:prathyushthota@gmail.com[Prathyush Thota]. +If you appreciate my work on Xulmus and want to encourage me working on it more, you can either send me greetings, patches or make a donation: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -38,14 +32,15 @@ more, you can either send me greetings, patches or make a donation: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Of course as a believer in free open source software, only make a donation -if you really like Vimperator and the money doesn't hurt -- otherwise just use +if you really like Xulmus and the money doesn't hurt -- otherwise just use it, recommend it and like it :) section:Help{nbsp}topics[overview] -- help:Tutorial[tutorial.html]: A quick-start tutorial for new users. -- help:Initialization[starting.html]: How Vimperator starts up, where it reads +//- help:Tutorial[tutorial.html]: A quick-start tutorial for new users. +- help:Initialization[starting.html]: How Xulmus starts up, where it reads the config file... +- help:Player[player.html]: Interacting with the media player. - help:Browsing[browsing.html]: Basic mappings and commands needed for a browsing session (how to open a web page or go back in history). - help:Buffer{nbsp}commands[buffer.html]: Operations on the current document @@ -65,8 +60,8 @@ section:Help{nbsp}topics[overview] - help:Autocommands[autocommands.html]: Automatically executing code on certain events. - help:Print[print.html]: Printing pages. -- help:GUI[gui.html]: Accessing Firefox menus, dialogs and the sidebar. -- help:Styling[styling.html]: Changing the styling of content pages and Vimperator itself. +- help:GUI[gui.html]: Accessing Songbird menus, dialogs and the sidebar. +- help:Styling[styling.html]: Changing the styling of content pages and Xulmus itself. - help:Messages[message.html]: A description of messages and error messages. - help:Developer{nbsp}information[developer.html]: How to write docs or plugins. @@ -87,11 +82,11 @@ section:Features[features] * Advanced completion of bookmark and history URLs (searching also in title, not only URL) * Vim-like statusline with a wget-like progress bar * Minimal GUI (easily hide useless menubar and toolbar with [c]:set guioptions=[c]) -* Ability to [c]:source[c] JavaScript files, and to use a [a]~/.vimperatorrc[a] file - with syntax highlighting if you install scripts/vimperator.vim +* Ability to [c]:source[c] JavaScript files, and to use a [a]~/.xulmusrc[a] file + with syntax highlighting if you install scripts/xulmus.vim * Easy quick searches ([c]:open foo[c] will search for "foo" in google, [c]:open ebay terminator[c] will search for "terminator" on ebay) - with support for Firefox keyword bookmarks and search engines + with support for Songbird keyword bookmarks and search engines * Count supported for many commands ([m]3[m] will go back 3 pages) * Beep on errors * Marks support ([m]ma[m] to set mark a on a web page, [m]'a[m] to go there) diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt index 4e9af03a..1fd2621c 100755 --- a/xulmus/locale/en-US/map.txt +++ b/xulmus/locale/en-US/map.txt @@ -172,7 +172,7 @@ ________________________________________________________________________________ section:Abbreviations[abbreviations] -Vimperator can automatically replace words identified as abbreviations, +Xulmus can automatically replace words identified as abbreviations, which may be used to save typing or to correct commonly misspelled words. An abbreviation can be one of three types that are defined by the types of constituent characters. Whitespace and quotes are non-keyword @@ -319,7 +319,7 @@ Completion can be enabled by specifying one of the following arguments to the *buffer* buffers *color* color schemes *command* Ex commands -*dialog* Firefox dialogs +*dialog* Songbird dialogs *dir* directories *environment* environment variables *event* autocommand events @@ -330,8 +330,8 @@ Completion can be enabled by specifying one of the following arguments to the *macro* named macros *mapping* user mappings *menu* menu items -*option* Vimperator options -*preference* Firefox preferences +*option* Xulmus options +*preference* Songbird preferences *search* search engines and keywords *shellcmd* shell commands *sidebar* sidebar panels diff --git a/xulmus/locale/en-US/marks.txt b/xulmus/locale/en-US/marks.txt index 837268be..d1a7a5b5 100755 --- a/xulmus/locale/en-US/marks.txt +++ b/xulmus/locale/en-US/marks.txt @@ -2,14 +2,14 @@ HEADER |different-marks| |marks| + -Vimperator supports a number of different marks: +Xulmus supports a number of different marks: - Bookmarks which allow you to mark a web page as one of your favorites for easy access. - QuickMarks allow you to define up to 62 (a-zA-Z0-9) web sites (or groups of web sites) which you visit most often. - Local marks to store the position within a web page. -- History is also a special type of marks, as Vimperator automatically +- History is also a special type of marks, as Xulmus automatically remembers sites which you have visited in the past. section:Bookmarks[bookmarks] diff --git a/xulmus/locale/en-US/message.txt b/xulmus/locale/en-US/message.txt index 99c1d723..04270207 100755 --- a/xulmus/locale/en-US/message.txt +++ b/xulmus/locale/en-US/message.txt @@ -2,7 +2,7 @@ HEADER |message-history| + -Vimperator stores all info and error messages in a message history. The type of +Xulmus stores all info and error messages in a message history. The type of info messages output can be controlled by the 'verbose' option. |:mes| |:messages| + diff --git a/xulmus/locale/en-US/pattern.txt b/xulmus/locale/en-US/pattern.txt index 6462a897..0009d6ff 100755 --- a/xulmus/locale/en-US/pattern.txt +++ b/xulmus/locale/en-US/pattern.txt @@ -2,9 +2,9 @@ HEADER |text-search-commands| + -Vimperator provides a Vim-like interface to Firefox's standard text search +Xulmus provides a Vim-like interface to Songbird's standard text search functionality. There is no support for using regular expressions in search -commands as Firefox does not provide native regexp support. It is unlikely that +commands as Songbird does not provide native regexp support. It is unlikely that this will ever be available. |/| + diff --git a/xulmus/locale/en-US/print.txt b/xulmus/locale/en-US/print.txt index 8cf3d180..9002f9b9 100755 --- a/xulmus/locale/en-US/print.txt +++ b/xulmus/locale/en-US/print.txt @@ -18,7 +18,7 @@ As above, but write the output to {filename}. Note: Not available on Windows. ________________________________________________________________________________ -section:Firefox{nbsp}printing{nbsp}dialogs[firefox-print-dialogs] +section:Songbird{nbsp}printing{nbsp}dialogs[songbird-print-dialogs] The "Print Preview" and "Page Setup" dialogs can be opened via the [c]:dialog[c] command diff --git a/xulmus/locale/en-US/repeat.txt b/xulmus/locale/en-US/repeat.txt index 2817c980..493d6b26 100755 --- a/xulmus/locale/en-US/repeat.txt +++ b/xulmus/locale/en-US/repeat.txt @@ -2,7 +2,7 @@ HEADER |repeat| + -Vimperator can repeat a number of commands and record macros. +Xulmus can repeat a number of commands and record macros. section:Macros[macros,complex-repeat] @@ -52,7 +52,7 @@ ____________________________________________________________________________ ||[count].|| ____________________________________________________________________________ Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this -does not apply solely to editing commands, mainly because Vimperator doesn't +does not apply solely to editing commands, mainly because Xulmus doesn't have them. ____________________________________________________________________________ @@ -99,7 +99,7 @@ Load all unloaded plugins immediately. Because plugins are automatically loaded after vimperatorrc is sourced, this command must be placed early in the vimperatorrc file if vimperatorrc also includes commands that are implemented by plugins. Additionally, this command allows for sourcing -new plugins without restarting Vimperator. +new plugins without restarting Xulmus. ________________________________________________________________________________ @@ -123,7 +123,7 @@ ________________________________________________________________________________ |:fini| |:finish| ||:fini[sh]|| + ________________________________________________________________________________ -Stop sourcing a script file. This can only be called from within a Vimperator +Stop sourcing a script file. This can only be called from within a Xulmus script file. ________________________________________________________________________________ @@ -136,7 +136,7 @@ Profile a piece of code or a command. Run {code} [count] times (default 1) and returns the elapsed time. {code} is always passed to JavaScript's eval(), which might be slow, so take the results with a grain of salt. -If {code} starts with a [c]:[c], it is executed as a Vimperator command. +If {code} starts with a [c]:[c], it is executed as a Xulmus command. Use the special version with [!] if you just want to run any command multiple times without showing profiling statistics. diff --git a/xulmus/locale/en-US/starting.txt b/xulmus/locale/en-US/starting.txt index df384fd0..552c6ce2 100755 --- a/xulmus/locale/en-US/starting.txt +++ b/xulmus/locale/en-US/starting.txt @@ -1,13 +1,13 @@ HEADER -Vimperator does not yet read any command-line options. When it does, they will +Xulmus does not yet read any command-line options. When it does, they will be documented here. section:Initialization[initialization,startup] -At startup, Vimperator completes the following tasks in order. +At startup, Xulmus completes the following tasks in order. -1. Vimperator can perform user initialization commands. When +1. Xulmus can perform user initialization commands. When one of the following is successfully located, it is executed, and no further locations are tried. @@ -31,7 +31,7 @@ command). The user's ~ (i.e., "home") directory is determined as follows: * On Unix and Mac, the environment variable _$HOME_ is used. -* On Windows, Vimperator checks for the existence of _%HOME%_, then +* On Windows, Xulmus checks for the existence of _%HOME%_, then _%USERPROFILE%_, and then _%HOMEDRIVE%%HOMEPATH%_. It uses the first one it finds. @@ -54,7 +54,7 @@ section:Restarting[restarting] |:res| |:restart| + ||:res[tart]|| ________________________________________________________________________________ -Force the browser to restart. Useful when installing extensions. +Force Xulmus to restart. Useful when installing extensions. ________________________________________________________________________________ // vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/styling.txt b/xulmus/locale/en-US/styling.txt index a4ba91a2..213ec61c 100755 --- a/xulmus/locale/en-US/styling.txt +++ b/xulmus/locale/en-US/styling.txt @@ -2,7 +2,7 @@ HEADER |styling| + -Vimperator allows you to style both the browser and any web pages you view. All +Vimperator allows you to style both the player and any web pages you view. All styling is specified via CSS. Although you may style any user interface element via the [c]:style[c] command, most Vimperator elements can be styled with the [c]:highlight[c] command, for convenience. @@ -102,7 +102,7 @@ ________________________________________________________________________________ |:sty| |:style| + ||:sty[le][!] [-name={name}] [-append] {filter} [{css}]|| + ________________________________________________________________________________ -Add CSS styles to the browser or to web pages. {filter} is a comma +Add CSS styles to the player or to web pages. {filter} is a comma separated list of URLs to match. URLs ending with *\** are matched as prefixes, URLs not containing any *:* or */* characters are matched as domains. If {name} (short option: [c]-n[c]) is provided, any diff --git a/xulmus/locale/en-US/tabs.txt b/xulmus/locale/en-US/tabs.txt index 9ccded72..6b267edb 100755 --- a/xulmus/locale/en-US/tabs.txt +++ b/xulmus/locale/en-US/tabs.txt @@ -199,20 +199,21 @@ Like [m]d[m] but selects the tab to the left of the deleted tab. ________________________________________________________________________________ -|u| |:u| |:undo| -||:[count]u[ndo] [a][url][a]|| + -||[count]u|| -________________________________________________________________________________ -Undo closing of a tab. If a count is given, don't undo the last but the -[count]th last closed tab. With [a][url][a] restores the tab matching the URL. -________________________________________________________________________________ - - -|:undoa| |:undoall| + -||:undoa[ll]|| -________________________________________________________________________________ -Undo closing of all closed tabs. Firefox stores up to 10 closed tabs, even -after a browser restart. -________________________________________________________________________________ +// FIXME: No undo in Songbird for now. +//|u| |:u| |:undo| +//||:[count]u[ndo] [a][url][a]|| + +//||[count]u|| +//________________________________________________________________________________ +//Undo closing of a tab. If a count is given, don't undo the last but the +//[count]th last closed tab. With [a][url][a] restores the tab matching the URL. +//________________________________________________________________________________ +// +// +//|:undoa| |:undoall| + +//||:undoa[ll]|| +//________________________________________________________________________________ +//Undo closing of all closed tabs. Songbird stores up to 10 closed tabs, even +//after a browser restart. +//________________________________________________________________________________ // vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/various.txt b/xulmus/locale/en-US/various.txt index 79d485dc..65e315b9 100755 --- a/xulmus/locale/en-US/various.txt +++ b/xulmus/locale/en-US/various.txt @@ -34,14 +34,14 @@ Run a command. Runs {cmd} through system() and displays its output. Any \'!' in backslash before the \'!', then that backslash is removed. Warning: Input redirection (< foo) not done, also do not run commands which -require stdin or it will hang Firefox! +require stdin or it will hang Songbird! ________________________________________________________________________________ |:ve| |:version| + ||:ve[rsion][!]|| ________________________________________________________________________________ -Show version information. You can show the Firefox version page with +Show version information. You can show the Songbird version page with [c]:version![c]. ________________________________________________________________________________ From 6c598b757452f6194a85afa9ff9479e9967fec7b Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 02:16:10 +1100 Subject: [PATCH 72/87] Add TODO regarding missing multi-window functionality. --- xulmus/TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/xulmus/TODO b/xulmus/TODO index 16d91ee8..f07206ab 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -10,6 +10,7 @@ BUGS: Is this workable anyway? --djk - is off by one when alternating with the media tab - numbered tabs + - :winopen FEATURES: 9 '?' - Reusing '/'. From 887855ed01e69fffb5250e7a587c64c3f7f3e46f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 12:18:28 +1100 Subject: [PATCH 73/87] Fix typo in "/" help text. --- xulmus/locale/en-US/player.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 0a807c64..415c61bb 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -178,7 +178,7 @@ section:Search{nbsp}commands[search] |/| ||/{pattern}|| + ________________________________________________________________________________ -Search for the first occurence of {pattern} in the visible media view. +Search for the first occurrence of {pattern} in the visible media view. ________________________________________________________________________________ |n| From 0f311e09e3837de341a07b31c17e5f84bdf62b09 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 12:23:22 +1100 Subject: [PATCH 74/87] Whitespace fixes. --- xulmus/content/player.js | 44 +++++++++++++++------------------- xulmus/locale/en-US/player.txt | 4 ++-- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 2d8b3c0d..a65e644b 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -1,7 +1,5 @@ // Import Artist List as this can be huge - - function Player() // {{{ { //////////////////////////////////////////////////////////////////////////////// @@ -11,11 +9,10 @@ function Player() // {{{ let lastSearchString = ""; let lastSearchIndex = 0; let lastSearchView = _SBGetCurrentView(); - + // Get the focus to the visible playlist first //window._SBShowMainLibrary(); - - + function getArtistsArray() { var list = LibraryUtils.mainLibrary; @@ -49,7 +46,7 @@ function Player() // {{{ artistCounts[artist] = listener.count; i++; } - + //liberator.dump("Count : "+artistCounts.toSource()); return artistArray; } @@ -57,7 +54,7 @@ function Player() // {{{ // Get the artist names before hand. let artists = getArtistsArray(); - + const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"] .getService(Components.interfaces.sbIMediaPageManager); // Register Callbacks for searching. @@ -202,7 +199,7 @@ function Player() // {{{ mappings.add([modes.PLAYER], ["n"], "Find Next", function () { player.searchViewAgain(false);}); - + mappings.add([modes.PLAYER], ["N"], "Find Previous", function () { player.searchViewAgain(true);}); @@ -211,7 +208,7 @@ function Player() // {{{ mappings.add([modes.PLAYER], [""], "Rate the current media item 0", function () { player.rateMediaItem(0); }); - + mappings.add([modes.PLAYER], [""], "Rate the current media item 1", function () { player.rateMediaItem(1); }); @@ -231,8 +228,7 @@ function Player() // {{{ mappings.add([modes.PLAYER], [""], "Rate the current media item 5", function () { player.rateMediaItem(5); }); - - + ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -326,7 +322,7 @@ function Player() // {{{ }, { argCount: "?", - completer: function(context, args) completion.playlist(context, args), + completer: function (context, args) completion.playlist(context, args), literal: 0 }); @@ -598,11 +594,11 @@ function Player() // {{{ searchString = args + " " + search; else searchString = args; - + lastSearchString = searchString; - + let mySearchView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); - + if (mySearchView.length) { lastSearchView = mySearchView; @@ -614,7 +610,7 @@ function Player() // {{{ liberator.echoerr("E486 Pattern not found: "+searchString, commandline.FORCE_SINGLELINE); } }, - + //FIXME: commandline.echo should work --ken searchViewAgain: function searchViewAgain(reverse) { @@ -644,17 +640,17 @@ function Player() // {{{ //FIXME: Implement for "?" --ken commandline.echo("/" + lastSearchString, null, commandline.FORCE_SINGLELINE); focusTrack(lastSearchView.getItemByIndex(lastSearchIndex)); - - }, + + }, getPlaylists: function getPlaylists() { let mainLibrary = LibraryUtils.mainLibrary; let playlists = [mainLibrary]; let listener = { - onEnumerationBegin: function() { }, - onEnumerationEnd: function() { }, - onEnumeratedItem: function(list, item) + onEnumerationBegin: function () { }, + onEnumerationEnd: function () { }, + onEnumeratedItem: function (list, item) { // FIXME: why are there null items and duplicates? if (!playlists.some(function (list) list.name == item.name) && item.name != null) @@ -692,7 +688,7 @@ function Player() // {{{ rateMediaItem: function rateMediaItem(rating) { if (gMM.sequencer.currentItem) - gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); + gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); }, getArtists: function getArtists() @@ -707,7 +703,6 @@ function Player() // {{{ var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); var i = 0, j = 0; - while (items.hasMoreElements()) { album = items.getNext().getProperty(SBProperties.albumName); @@ -750,10 +745,9 @@ function Player() // {{{ return tracksArray; } - + }; //}}} } // }}} - // vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 415c61bb..f12fafe6 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -184,14 +184,14 @@ ________________________________________________________________________________ |n| ||n|| + ________________________________________________________________________________ -Find next. Repeats the last search. If the search hits BOTTOM of the view, it +Find next. Repeats the last search. If the search hits BOTTOM of the view, it continues from TOP. ________________________________________________________________________________ |N| ||N|| + ________________________________________________________________________________ -Find previous. Repeats the last search in the opposite direction. If the search +Find previous. Repeats the last search in the opposite direction. If the search hits TOP of the view, it continues from BOTTTOM. ________________________________________________________________________________ From 0863ef897e597f1ee7328d656e902f83fb363bbb Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 16:49:26 +1100 Subject: [PATCH 75/87] Document mappings which change the track rating. --- xulmus/content/player.js | 40 ++++++++++------------------------ xulmus/locale/en-US/index.txt | 13 +++++++++++ xulmus/locale/en-US/player.txt | 29 +++++++++++++++++++----- 3 files changed, 49 insertions(+), 33 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index a65e644b..52656a4c 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -193,41 +193,25 @@ function Player() // {{{ function () { player.decreaseVolume(); }); mappings.add([modes.PLAYER], - ["/"], "Search View", + ["/"], "Search forward for a track", function (args) { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); }); mappings.add([modes.PLAYER], - ["n"], "Find Next", + ["n"], "Find the next track", function () { player.searchViewAgain(false);}); mappings.add([modes.PLAYER], - ["N"], "Find Previous", + ["N"], "Find the previous track", function () { player.searchViewAgain(true);}); - //FIXME: Better way to do this ? --ken - mappings.add([modes.PLAYER], - [""], "Rate the current media item 0", - function () { player.rateMediaItem(0); }); - - mappings.add([modes.PLAYER], - [""], "Rate the current media item 1", - function () { player.rateMediaItem(1); }); - - mappings.add([modes.PLAYER], - [""], "Rate the current media item 2", - function () { player.rateMediaItem(2); }); - - mappings.add([modes.PLAYER], - [""], "Rate the current media item 3", - function () { player.rateMediaItem(3); }); - - mappings.add([modes.PLAYER], - [""], "Rate the current media item 4", - function () { player.rateMediaItem(4); }); - - mappings.add([modes.PLAYER], - [""], "Rate the current media item 5", - function () { player.rateMediaItem(5); }); + for (let i in util.range(0, 6)) + { + let (rating = i) { + mappings.add([modes.PLAYER], + [""], "Rate the current media item " + rating, + function () { player.rateMediaItem(rating); }); + } + } ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// @@ -627,7 +611,7 @@ function Player() // {{{ } else { - if (lastSearchIndex == (lastSearchView.length -1)) + if (lastSearchIndex == (lastSearchView.length - 1)) { //commandline.echo("Search hit BOTTOM, continuing at TOP", // commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES | commandline.FORCE_SINGLELINE); diff --git a/xulmus/locale/en-US/index.txt b/xulmus/locale/en-US/index.txt index ce56d602..c7fabf5b 100755 --- a/xulmus/locale/en-US/index.txt +++ b/xulmus/locale/en-US/index.txt @@ -23,6 +23,19 @@ section:Player{nbsp}mode[player-index] ||[m]+[m]|| Increase volume by 10% + ||[m]-[m]|| Decrease volume by 10% + +||[m]/[m]|| Search forward for a track + +//||[m]?[m]|| Search backward for a track + +||[m]n[m]|| Find the next track + +||[m]N[m]|| Find the previous track + + +// TODO: better formatting +|||| Rate the current track with 0 stars + +|||| Rate the current track with 1 stars + +|||| Rate the current track with 2 stars + +|||| Rate the current track with 3 stars + +|||| Rate the current track with 4 stars + +|||| Rate the current track with 5 stars + + section:Insert{nbsp}mode[insert-index] ||[m][m]|| Launch the external editor + diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index f12fafe6..55a8039e 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -178,21 +178,40 @@ section:Search{nbsp}commands[search] |/| ||/{pattern}|| + ________________________________________________________________________________ -Search for the first occurrence of {pattern} in the visible media view. +Search forward for a track matching {pattern} in the visible media view. ________________________________________________________________________________ +//|?| +//||?{pattern}|| + +//________________________________________________________________________________ +//Search backwards for a track matching {pattern} in the visible media view. +//________________________________________________________________________________ + |n| ||n|| + ________________________________________________________________________________ -Find next. Repeats the last search. If the search hits BOTTOM of the view, it -continues from TOP. +Find the next track. Repeats the last search. If the search hits BOTTOM of the +view, it continues from TOP. ________________________________________________________________________________ |N| ||N|| + ________________________________________________________________________________ -Find previous. Repeats the last search in the opposite direction. If the search -hits TOP of the view, it continues from BOTTTOM. +Find the previous track. Repeats the last search in the opposite direction. If +the search hits TOP of the view, it continues from BOTTTOM. +________________________________________________________________________________ + +section:Rating{nbsp}track[rating] + +|| || || || || || +|||| + +|||| + +|||| + +|||| + +|||| + +|||| + +________________________________________________________________________________ +Rate the current track with N stars. ________________________________________________________________________________ // vim: set filetype=asciidoc: From 4fc5a26888ab47c1c2ebcd197b9021e2cdb9ac95 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 20:30:40 +1100 Subject: [PATCH 76/87] Fix typo. --- xulmus/locale/en-US/player.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt index 55a8039e..ab9d5a0f 100644 --- a/xulmus/locale/en-US/player.txt +++ b/xulmus/locale/en-US/player.txt @@ -201,7 +201,7 @@ Find the previous track. Repeats the last search in the opposite direction. If the search hits TOP of the view, it continues from BOTTTOM. ________________________________________________________________________________ -section:Rating{nbsp}track[rating] +section:Rating{nbsp}tracks[rating] || || || || || || |||| + From de38813fce7d53d663e0a7609803bf6dd9d179f9 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 20:34:24 +1100 Subject: [PATCH 77/87] cmus -> CMus in help references. --- xulmus/locale/en-US/intro.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xulmus/locale/en-US/intro.txt b/xulmus/locale/en-US/intro.txt index 4692276f..490f00c9 100755 --- a/xulmus/locale/en-US/intro.txt +++ b/xulmus/locale/en-US/intro.txt @@ -4,12 +4,12 @@ section:Introduction[intro] http://vimperator.org/Xulmus[Xulmus] is a free media player add-on for Songbird, which combines the best features of the -http://cmus.sourceforge.net[cmus] music player and the http://www.vim.org[Vim] +http://cmus.sourceforge.net[CMus] music player and the http://www.vim.org[Vim] text editor. |warning| + Warning: -To provide the most authentic cmus/Vim experience, the Songbird toolbar +To provide the most authentic CMus/Vim experience, the Songbird toolbar is hidden. + If you really need it, type: [c]:set guioptions+=T[c] to get it back. + If you don't like Xulmus at all, you can uninstall it by typing From 58dd4c2e77c017de66c19f536932385b631c32b9 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 16:27:18 +0530 Subject: [PATCH 78/87] Fixed Initialization section in Help --- xulmus/locale/en-US/starting.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xulmus/locale/en-US/starting.txt b/xulmus/locale/en-US/starting.txt index 552c6ce2..b32bddbd 100755 --- a/xulmus/locale/en-US/starting.txt +++ b/xulmus/locale/en-US/starting.txt @@ -11,12 +11,12 @@ At startup, Xulmus completes the following tasks in order. one of the following is successfully located, it is executed, and no further locations are tried. - a. |$VIMPERATOR_INIT| - _$VIMPERATOR_INIT_ -- May contain a single Ex command (e.g., + a. |$XULMUS_INIT| + _$XULMUS_INIT_ -- May contain a single Ex command (e.g., "[c]:source {file}[c]"). - b. [a]\~/_vimperatorrc[a] -- Windows only. If this file exists, its contents + b. [a]\~/_xulmusrc[a] -- Windows only. If this file exists, its contents are executed. - c. [a]\~/.vimperatorrc[a] -- If this file exists, its contents are executed. + c. [a]\~/.xulmusrc[a] -- If this file exists, its contents are executed. 2. If 'exrc' is set, then any RC file in the current directory is also sourced. @@ -37,12 +37,12 @@ it finds. section:Saving{nbsp}settings[save-settings] -|:mkv| |:mkvimperatorrc| -||:mkv[imperatorrc][!] [a][file][a]|| + +|:mkx| |:mkxulmusrc| +||:mkx[ulmusrc][!] [a][file][a]|| + ________________________________________________________________________________ Write current key mappings and changed options to [a][file][a]. If no -[a][file][a] is specified then _~/.vimperatorrc_ is written unless this file -already exists. The special version [c]:mkvimperatorrc![c] will overwrite +[a][file][a] is specified then _~/.xulmusrc_ is written unless this file +already exists. The special version [c]:mkxulmusrc![c] will overwrite [a][file][a] if it exists. Warning: this differs from Vim's behavior which defaults to writing the file From d06e27ca57e8b262e27166c00f6527473f4cd35f Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 21:27:14 +0530 Subject: [PATCH 79/87] Version 0.1 & NEWS --- xulmus/Makefile | 2 +- xulmus/NEWS | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xulmus/Makefile b/xulmus/Makefile index b161489d..118bb65e 100755 --- a/xulmus/Makefile +++ b/xulmus/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 0.1pre +VERSION = 0.1 NAME = xulmus include ../common/Makefile.common diff --git a/xulmus/NEWS b/xulmus/NEWS index 9260c32d..2f613fd3 100755 --- a/xulmus/NEWS +++ b/xulmus/NEWS @@ -1,2 +1,3 @@ -2009-XX-XX: - * version 0.1 (probably) +2009-03-28: + * version 0.1 + * first public release From de46ff6c191d86caedeeca75d5aa104c49e0bdcb Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sun, 29 Mar 2009 01:52:09 +0200 Subject: [PATCH 80/87] Generate the version in install.rdf with 'make xpi' --- xulmus/install.rdf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/install.rdf b/xulmus/install.rdf index 3851c0af..b047adb7 100755 --- a/xulmus/install.rdf +++ b/xulmus/install.rdf @@ -5,7 +5,7 @@ {3703dcdb-6ba3-4331-8de8-c18373fb05d1} 2 xulmus@vimperator.org - 0.1 + ###VERSION### Prathyush Thota Makes Songbird behave like Vim and CMus. From dc9a3e894b33154c91ec4d037b0fb7271b4a8dc7 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Sun, 29 Mar 2009 01:54:04 +0200 Subject: [PATCH 81/87] Update version to 0.2pre --- xulmus/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xulmus/Makefile b/xulmus/Makefile index 118bb65e..ce4f6142 100755 --- a/xulmus/Makefile +++ b/xulmus/Makefile @@ -1,6 +1,6 @@ #### configuration -VERSION = 0.1 +VERSION = 0.2pre NAME = xulmus include ../common/Makefile.common From 44a87ec672bf569f078a664044376ce23e7db6be Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 22:40:27 +1100 Subject: [PATCH 82/87] Fix some missed references to Firefox and Vimperator in the help. --- xulmus/locale/en-US/gui.txt | 2 +- xulmus/locale/en-US/map.txt | 6 +++--- xulmus/locale/en-US/repeat.txt | 8 ++++---- xulmus/locale/en-US/styling.txt | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xulmus/locale/en-US/gui.txt b/xulmus/locale/en-US/gui.txt index 1f19a621..fbebef78 100755 --- a/xulmus/locale/en-US/gui.txt +++ b/xulmus/locale/en-US/gui.txt @@ -28,7 +28,7 @@ ________________________________________________________________________________ |:dia| |:dialog| -||:dia[log] [a][firefox-dialog][a]|| + +||:dia[log] [a][songbird-dialog][a]|| + ________________________________________________________________________________ Open a Songbird dialog. diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt index 1fd2621c..cec05288 100755 --- a/xulmus/locale/en-US/map.txt +++ b/xulmus/locale/en-US/map.txt @@ -58,7 +58,7 @@ Map the key sequence {lhs} to {rhs}. The {rhs} is remapped, allowing for nested and recursive mappings. Warning: Mappings are NOT saved between sessions, make sure you put them in your -vimperatorrc file! +xulmusrc file! ________________________________________________________________________________ @@ -71,7 +71,7 @@ Map the key sequence {lhs} to {rhs} (in Command-line mode). The {rhs} is remapped, allowing for nested and recursive mappings. Warning: Mappings are NOT saved between sessions, make sure you put them in your -vimperatorrc file! +xulmusrc file! ________________________________________________________________________________ @@ -84,7 +84,7 @@ Map the key sequence {lhs} to {rhs} (in Insert mode). The {rhs} is remapped, allowing for nested and recursive mappings. Warning: Mappings are NOT saved between sessions, make sure you put them in your -vimperatorrc file! +xulmusrc file! ________________________________________________________________________________ diff --git a/xulmus/locale/en-US/repeat.txt b/xulmus/locale/en-US/repeat.txt index 493d6b26..24c35754 100755 --- a/xulmus/locale/en-US/repeat.txt +++ b/xulmus/locale/en-US/repeat.txt @@ -85,8 +85,8 @@ function hello2() { -------------------------------------------------------------------------------- are only available within the scope of the script. -The _.vimperatorrc_ file in your home directory and any files in -_\~/.vimperator/plugin/_ are always sourced at startup. \~ is supported as a +The _.xulmusrc_ file in your home directory and any files in +_\~/.xulmus/plugin/_ are always sourced at startup. \~ is supported as a shortcut for the _$HOME_ directory. If [!] is specified, errors are not printed. ________________________________________________________________________________ @@ -96,8 +96,8 @@ ________________________________________________________________________________ ||:loadplugins|| + ________________________________________________________________________________ Load all unloaded plugins immediately. Because plugins are automatically -loaded after vimperatorrc is sourced, this command must be placed early -in the vimperatorrc file if vimperatorrc also includes commands that are +loaded after xulmusrc is sourced, this command must be placed early +in the xulmusrc file if xulmusrc also includes commands that are implemented by plugins. Additionally, this command allows for sourcing new plugins without restarting Xulmus. ________________________________________________________________________________ diff --git a/xulmus/locale/en-US/styling.txt b/xulmus/locale/en-US/styling.txt index 213ec61c..f3579ec8 100755 --- a/xulmus/locale/en-US/styling.txt +++ b/xulmus/locale/en-US/styling.txt @@ -2,9 +2,9 @@ HEADER |styling| + -Vimperator allows you to style both the player and any web pages you view. All +Xulmus allows you to style both the player and any web pages you view. All styling is specified via CSS. Although you may style any user interface element -via the [c]:style[c] command, most Vimperator elements can be styled with the +via the [c]:style[c] command, most Xulmus elements can be styled with the [c]:highlight[c] command, for convenience. |E185| |:colo| |:colorscheme| + @@ -22,13 +22,13 @@ ________________________________________________________________________________ ________________________________________________________________________________ Highlight {group} with {css}. Normally, {css} is checked for valid syntax before it's applied. Once you're certain it's -valid, [!] will override the check, to speed Vimperator startup. +valid, [!] will override the check, to speed Xulmus startup. {selector} can be any valid CSS selector, such as [c]:hover[c], and if provided will restrict the match to matching elements. Valid groups are: `--------------------`----------------------------------- -*Bell* Vimperator's visual bell +*Bell* Xulmus's visual bell *Boolean* A JavaScript Boolean object *CmdLine* The command line *CmdOutput* From 600d8b95b5571a1480ccf965046609907aab80bf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 22:56:49 +1100 Subject: [PATCH 83/87] Add TODO item regarding Player mode in the Mini Player. --- xulmus/TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/xulmus/TODO b/xulmus/TODO index f07206ab..9a5e1dcf 100644 --- a/xulmus/TODO +++ b/xulmus/TODO @@ -16,5 +16,6 @@ FEATURES: 9 '?' - Reusing '/'. 8 Playlist/SmartPlaylist operations & meta-data operations. 7 extended hint mode for opening links in FF. +5 make Player mode commands work in the Mini-Player. 5 Check for default extensions and add commands for them. Ex. Last.fm, Seeqpod e.t.c Wouldn't these be provided as Xulmus plugins like Vimperator does? --djk From 58a5b47f639f78261a05579050e1af281fe2768d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 28 Mar 2009 23:22:19 +1100 Subject: [PATCH 84/87] Add the subscription dialog to :dialog. --- xulmus/content/config.js | 4 +++- xulmus/locale/en-US/gui.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 248b6a6e..7471d034 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -133,7 +133,9 @@ const config = { //{{{ ["searchengines", "Manage installed search engines", function () { window.openDialog("chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen"); }], ["selectionsource", "View selection source", - function () { buffer.viewSelectionSource(); }] + function () { buffer.viewSelectionSource(); }], + ["subscribe", "Add a new subscription", + function () { SBSubscribe(); }] ], //TODO : Write intro.html and tutorial.html diff --git a/xulmus/locale/en-US/gui.txt b/xulmus/locale/en-US/gui.txt index fbebef78..4f2e8972 100755 --- a/xulmus/locale/en-US/gui.txt +++ b/xulmus/locale/en-US/gui.txt @@ -52,6 +52,7 @@ Available dialogs: *savepage* Save page to disk *searchengines* Manage installed search engines *selectionsource* View selection source +*subscribe* Add a new subscription ------------------------------------------------------- ________________________________________________________________________________ From a5c8ebcc5520a3c2ad1ccaf05df462e247917881 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 29 Mar 2009 01:06:38 +1100 Subject: [PATCH 85/87] Add rough :displaypane and :dpclose commands. --- xulmus/content/config.js | 85 +++++++++++++++++++++-------------- xulmus/locale/en-US/gui.txt | 15 +++++++ xulmus/locale/en-US/index.txt | 4 +- 3 files changed, 68 insertions(+), 36 deletions(-) diff --git a/xulmus/content/config.js b/xulmus/content/config.js index 7471d034..8d4b2134 100755 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -184,6 +184,31 @@ const config = { //{{{ liberator.open(pre + newNumberStr + post); } + function openDisplayPane(id) + { + let pane = document.getElementById(id); + let manager = Components.classes['@songbirdnest.com/Songbird/DisplayPane/Manager;1'] + .getService(Components.interfaces.sbIDisplayPaneManager); + let paneinfo = manager.getPaneInfo(pane._lastURL.stringValue); + + if (!paneinfo) + paneinfo = manager.defaultPaneInfo; + + pane.loadContent(paneinfo); + } + + // FIXME: best way to format these args? Hyphenated? One word like :dialog? + let displayPanes = { + "content pane bottom": "displaypane_contentpane_bottom", + "service pane bottom": "displaypane_servicepane_bottom", + "right sidebar": "displaypane_right_sidebar" + }; + + completion.displayPane = function (context) { + context.title = ["Display Pane"]; + context.completions = displayPanes; // FIXME: useful description etc + }; + // load Xulmus 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 @@ -402,50 +427,42 @@ const config = { //{{{ }, { argCount: "0" }); - // TODO: service/content pane and right sidebar manipulation commands? --djk - /* - // TODO: move sidebar commands to ui.js? - commands.add(["sbcl[ose]"], - "Close the sidebar window", - function () - { - if (!document.getElementById("sidebar-box").hidden) - toggleSidebar(); - }, - { argCount: "0" }); - - commands.add(["sideb[ar]", "sb[ar]", "sbope[n]"], - "Open the sidebar window", + commands.add(["dpcl[ose]"], + "Close a display pane", function (args) { let arg = args.literalArg; - // focus if the requested sidebar is already open - if (document.getElementById("sidebar-title").value == arg) - { - document.getElementById("sidebar-box").focus(); - return; - } + if (arg in displayPanes) + document.getElementById(displayPanes[arg]).hide(); + else + liberator.echoerr("E475: Invalid argument: " + arg); - let menu = document.getElementById("viewSidebarMenu"); - - for (let [,panel] in Iterator(menu.childNodes)) - { - if (panel.label == arg) - { - panel.doCommand(); - return; - } - } - - liberator.echoerr("No sidebar " + arg + " found"); }, { argCount: "1", - completer: function (context) completion.sidebar(context), + completer: function (context) completion.displayPane(context), + literal: 0 + }); + + // TODO: this should accept a second arg to specify content + commands.add(["displayp[ane]", "dp[ane]", "dpope[n]"], + "Open a display pane", + function (args) + { + let arg = args.literalArg; + + if (arg in displayPanes) + openDisplayPane(displayPanes[arg]) + // TODO: focus when we have better key handling of these extended modes + else + liberator.echoerr("E475: Invalid argument: " + arg); + }, + { + argCount: "1", + completer: function (context) completion.displayPane(context), literal: 0 }); - */ commands.add(["winc[lose]", "wc[lose]"], "Close window", diff --git a/xulmus/locale/en-US/gui.txt b/xulmus/locale/en-US/gui.txt index 4f2e8972..068994cd 100755 --- a/xulmus/locale/en-US/gui.txt +++ b/xulmus/locale/en-US/gui.txt @@ -65,4 +65,19 @@ Show progress of current downloads. Open the original Songbird download dialog in a new tab. Here, downloads can be paused, canceled and resumed. ________________________________________________________________________________ + +|:dpcl| |:dpclose| + +||:dpcl[ose] {pane}|| +________________________________________________________________________________ +Close the specified display pane. +________________________________________________________________________________ + + +|:dpope| |:dpopen| |:dp| |:dpane| |:dislplayp| |:dislplaypane| +||:displaypane {pane}|| + +________________________________________________________________________________ +Open the specified display pane. {pane} is any of "content pane bottom", +"service pane bottom" or "right sidebar". +________________________________________________________________________________ + // vim: set filetype=asciidoc: diff --git a/xulmus/locale/en-US/index.txt b/xulmus/locale/en-US/index.txt index c7fabf5b..bb8510bc 100755 --- a/xulmus/locale/en-US/index.txt +++ b/xulmus/locale/en-US/index.txt @@ -218,6 +218,8 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:doautoall[c]|| Apply the autocommands matching the specified URL to all buffers + ||[c]:doautocmd[c]|| Apply the autocommands matching the specified URL to the current buffer + ||[c]:downloads[c]|| Show progress of current downloads + +||[c]:displaypane[c]|| Open the specified display pane + +||[c]:dpclose[c]|| Close the specified display pane + ||[c]:echo[c]|| Echo the expression + ||[c]:echoerr[c]|| Echo the expression as an error message + ||[c]:echomsg[c]|| Echo the expression as an informational message + @@ -268,12 +270,10 @@ section:Ex{nbsp}commands[ex-cmd-index,:index] ||[c]:restart[c]|| Force undefined to restart + ||[c]:runtime[c]|| Source the specified file from each directory in 'runtimepath' + ||[c]:saveas[c]|| Save current document to disk + -||[c]:sbclose[c]|| Close the sidebar window + ||[c]:scriptnames[c]|| List all sourced script names + ||[c]:set[c]|| Set an option + ||[c]:setglobal[c]|| Set global option + ||[c]:setlocal[c]|| Set local option + -||[c]:sidebar[c]|| Open the sidebar window + ||[c]:style[c]|| Style Xulmus and web sites + ||[c]:source[c]|| Read Ex commands from a file + ||[c]:stop[c]|| Stop loading + From 897181a5c476307baa4847a6ec6a60573bfae38c Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 29 Mar 2009 13:50:18 +1100 Subject: [PATCH 86/87] Whitespace fixes. --- common/content/buffer.js | 1 - common/content/events.js | 6 +----- common/content/tabs.js | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 79dc31ec..478d0571 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -44,7 +44,6 @@ function Buffer() //{{{ // FIXME: This doesn't belong here. let mainWindowID = config.mainWindowID || "main-window"; - let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize; styles.registerSheet("chrome://liberator/skin/liberator.css"); diff --git a/common/content/events.js b/common/content/events.js index a50bfec4..341adcc3 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -687,7 +687,7 @@ function Events() //{{{ [""], "Advance keyboard focus", function () { document.commandDispatcher.advanceFocus(); }); - mappings.add([modes.NORMAL, modes.PLAYER,modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA], + mappings.add([modes.NORMAL, modes.PLAYER, modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA], [""], "Rewind keyboard focus", function () { document.commandDispatcher.rewindFocus(); }); @@ -1242,13 +1242,9 @@ function Events() //{{{ { // Switch to -- PLAYER -- mode for Songbird Media Player. if (config.isPlayerWindow) - { liberator.mode = modes.PLAYER; - } else - { liberator.mode = modes.NORMAL; - } return; } diff --git a/common/content/tabs.js b/common/content/tabs.js index 81d71fff..c3cfbd10 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -49,7 +49,7 @@ function Tabs() //{{{ tabmail.__defineGetter__("mTabs", function () this.tabContainer.childNodes); tabmail.__defineGetter__("mCurrentTab", function () this.tabContainer.selectedItem); tabmail.__defineGetter__("mStrip", function () this.tabStrip); - tabmail.__defineGetter__("browsers", function () [browser for (browser in Iterator(this.mTabs))] ); + tabmail.__defineGetter__("browsers", function () [browser for (browser in Iterator(this.mTabs))]); } return tabmail; }; @@ -151,7 +151,7 @@ function Tabs() //{{{ validator: Option.validateCompleter }); - if (config.name == "Vimperator" || config.name == "Xulmus" ) + if (config.name == "Vimperator" || config.name == "Xulmus") { options.add(["activate", "act"], "Define when tabs are automatically activated", From 0e28714ce66bd5c0f2989e23e2273b5d97eac5e4 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 29 Mar 2009 21:05:38 +1100 Subject: [PATCH 87/87] Revert some of PT's local changes to the build system. --- common/Makefile.common | 4 ++-- common/make_jar.sh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/Makefile.common b/common/Makefile.common index 89cb8d69..c1458a87 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -9,7 +9,7 @@ LOCALEDIR = locale DOC_SRC_FILES = $(wildcard $(LOCALEDIR)/*/*.txt) LOCALES = $(foreach locale,$(wildcard $(LOCALEDIR)/*),$(word 2,$(subst /, ,$(locale)))) -MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" bash $(BASE)/make_jar.sh +MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" sh $(BASE)/make_jar.sh # TODO: specify source files manually? JAR_BASES = $(TOP) $(BASE) @@ -45,7 +45,7 @@ TARGETS = all help info doc jar xpi install clean distclean $(JAR) $(TARGETS:%=\%.%): echo MAKE $* $(@:$*.%=%) $(MAKE) -C $* $(@:$*.%=%) - echo $$SHELL + .PHONY: $(TARGETS) all: help diff --git a/common/make_jar.sh b/common/make_jar.sh index 00064e23..7632d64d 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -51,8 +51,6 @@ do ) done -cd $stage -zip -r "$top/$jar" * -cd - +(cd $stage; zip -r "$top/$jar" *) rm -rf "$stage"