// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-/* use strict */
+"use strict";
var History = Module("history", {
SORT_DEFAULT: "-date",
},
get session() {
- let webNav = window.getWebNavigation()
+ let webNav = window.getWebNavigation();
let sh = webNav.sessionHistory;
let obj = [];
obj.__defineGetter__("index", function () sh.index);
- obj.__defineSetter__("index", function (val) { webNav.gotoIndex(val) });
+ obj.__defineSetter__("index", function (val) { webNav.gotoIndex(val); });
obj.__iterator__ = function () array.iterItems(this);
for (let item in iter(sh.SHistoryEnumerator, Ci.nsIHistoryEntry))
}
}, {
}, {
- commands: function () {
+ commands: function initCommands() {
commands.add(["ba[ck]"],
"Go back in the browser history",
function (args) {
{ argCount: "0" });
},
- completion: function () {
+ completion: function initCompletion() {
completion.domain = function (context) {
context.anchored = false;
context.compare = function (a, b) String.localeCompare(a.key, b.key);
completion.addUrlCompleter("history", "History", completion.history);
},
- mappings: function () {
- function bind() mappings.add.apply(mappings, [config.browserModes].concat(Array.slice(arguments)));
+ mappings: function initMappings() {
+ function bind(...args) mappings.add.apply(mappings, [config.browserModes].concat(args));
bind(["<C-o>"], "Go to an older position in the jump list",
function ({ count }) { history.stepTo(-Math.max(count, 1), true); },
{ count: true });
bind(["[d"], "Go back to the previous domain in the browser history",
- function ({ count }) { history.search("domain", -Math.max(count, 1)) },
+ function ({ count }) { history.search("domain", -Math.max(count, 1)); },
{ count: true });
bind(["]d"], "Go forward to the next domain in the browser history",
- function ({ count }) { history.search("domain", Math.max(count, 1)) },
+ function ({ count }) { history.search("domain", Math.max(count, 1)); },
{ count: true });
}
});
-// vim: set fdm=marker sw=4 ts=4 et:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et: