mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-23 05:15:46 +01:00
Minor cleanup and dead code removal.
This commit is contained in:
@@ -879,16 +879,7 @@ var Events = Module("events", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasHTMLDocument(win))
|
if (hasHTMLDocument(win))
|
||||||
buffer.lastInputField = elem;
|
buffer.lastInputField = elem || win;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (elem && Events.isInputElement(elem)) {
|
|
||||||
if (!haveInput)
|
|
||||||
modes.push(modes.INSERT);
|
|
||||||
|
|
||||||
if (hasHTMLDocument(win))
|
|
||||||
buffer.lastInputField = elem;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,28 +7,36 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var History = Module("history", {
|
var History = Module("history", {
|
||||||
|
SORT_DEFAULT: "-date",
|
||||||
|
|
||||||
get format() bookmarks.format,
|
get format() bookmarks.format,
|
||||||
|
|
||||||
get service() services.history,
|
get service() services.history,
|
||||||
|
|
||||||
get: function get(filter, maxItems, order) {
|
get: function get(filter, maxItems, sort) {
|
||||||
|
sort = sort || this.SORT_DEFAULT;
|
||||||
|
|
||||||
|
if (isString(filter))
|
||||||
|
filter = { searchTerms: filter };
|
||||||
|
|
||||||
// no query parameters will get all history
|
// no query parameters will get all history
|
||||||
let query = services.history.getNewQuery();
|
let query = services.history.getNewQuery();
|
||||||
let options = services.history.getNewQueryOptions();
|
let options = services.history.getNewQueryOptions();
|
||||||
|
|
||||||
if (typeof filter == "string")
|
|
||||||
filter = { searchTerms: filter };
|
|
||||||
for (let [k, v] in Iterator(filter))
|
for (let [k, v] in Iterator(filter))
|
||||||
query[k] = v;
|
query[k] = v;
|
||||||
|
|
||||||
let _order = /^([+-])(.+)/.exec(order || "+date");
|
let res = /^([+-])(.+)/.exec(sort);
|
||||||
dactyl.assert(_order, _("error.invalidSort", order));
|
dactyl.assert(res, _("error.invalidSort", sort));
|
||||||
|
|
||||||
_order = "SORT_BY_" + _order[2].toUpperCase() + "_" +
|
let [, dir, field] = res;
|
||||||
(_order[1] == "+" ? "ASCENDING" : "DESCENDING");
|
let _sort = "SORT_BY_" + field.toUpperCase() + "_" +
|
||||||
dactyl.assert(_order in options, _("error.invalidSort", order));
|
{ "+": "ASCENDING", "-": "DESCENDING" }[dir];
|
||||||
|
|
||||||
options.sortingMode = options[_order];
|
dactyl.assert(_sort in options,
|
||||||
|
_("error.invalidSort", sort));
|
||||||
|
|
||||||
|
options.sortingMode = options[_sort];
|
||||||
options.resultType = options.RESULTS_AS_URI;
|
options.resultType = options.RESULTS_AS_URI;
|
||||||
if (maxItems > 0)
|
if (maxItems > 0)
|
||||||
options.maxResults = maxItems;
|
options.maxResults = maxItems;
|
||||||
|
|||||||
@@ -95,11 +95,11 @@
|
|||||||
|
|
||||||
<p>Enable <em>Pass Through</em> mode on <em>some</em> Google sites:</p>
|
<p>Enable <em>Pass Through</em> mode on <em>some</em> Google sites:</p>
|
||||||
|
|
||||||
<code><ex>:autocmd LocationChange</ex> <str delim="'">^https?://(www|mail)\.google\.com/</str> <ex>:normal!</ex> <k name="C-z"/></code>
|
<code><ex>:autocmd LocationChange</ex> <str delim="">www.google.com</str>,<str delim="">mail.google.com</str> <ex>:normal!</ex> <k name="C-z"/></code>
|
||||||
|
|
||||||
<p>or</p>
|
<p>or</p>
|
||||||
|
|
||||||
<code><ex>:autocmd LocationChange</ex> <str delim="">www.google.com</str>,<str delim="">mail.google.com</str> <ex>:normal!</ex> <k name="C-z"/></code>
|
<code><ex>:autocmd LocationChange</ex> <str delim="'">^https?://(www|mail)\.google\.com/</str> <ex>:normal!</ex> <k name="C-z"/></code>
|
||||||
|
|
||||||
<p>Set the filetype to mail when editing email at Gmail:</p>
|
<p>Set the filetype to mail when editing email at Gmail:</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user