// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2013 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.
*/
get all() iter(this._localMarks.get(this.localURI) || {},
this._urlMarks
- ).sort(function (a, b) String.localeCompare(a[0], b[0])),
+ ).sort((a, b) => String.localeCompare(a[0], b[0])),
get localURI() buffer.focusedFrame.document.documentURI.replace(/#.*/, ""),
- Mark: function Mark(params) {
+ Mark: function Mark(params = {}) {
let win = buffer.focusedFrame;
let doc = win.document;
- params = params || {};
-
params.location = doc.documentURI.replace(/#.*/, ""),
params.offset = buffer.scrollPosition;
params.path = DOM(buffer.findScrollable(0, false)).xpath;
let store = buffer.localStore;
return {
index: store.jumpsIndex,
- locations: store.jumps.map(function (j) j.mark)
+ locations: store.jumps.map(j => j.mark)
};
},
if (filter.length > 0) {
let pattern = util.charListToRegexp(filter, "a-zA-Z");
- marks = marks.filter(function ([k, ]) pattern.test(k));
+ marks = marks.filter(([k]) => (pattern.test(k)));
dactyl.assert(marks.length > 0, _("mark.noMatching", filter.quote()));
}
function percent(i) Math.round(i * 100);
context.title = ["Mark", "HPos VPos File"];
- context.keys.description = function ([, m]) (m.offset ? Math.round(m.offset.x) + " " + Math.round(m.offset.y)
- : percent(m.position.x) + "% " + percent(m.position.y) + "%"
- ) + " " + m.location;
+ context.keys.description = ([, m]) => (m.offset ? Math.round(m.offset.x) + " " + Math.round(m.offset.y)
+ : percent(m.position.x) + "% " + percent(m.position.y) + "%"
+ ) + " " + m.location;
context.completions = marks.all;
};
},