1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 18:12:27 +01:00

Minor cleanup and dead code removal.

This commit is contained in:
Kris Maglione
2011-10-06 23:03:05 -04:00
parent ddf4d02244
commit 95dd94f5e4
3 changed files with 20 additions and 21 deletions

View File

@@ -879,16 +879,7 @@ var Events = Module("events", {
}
if (hasHTMLDocument(win))
buffer.lastInputField = elem;
return;
}
if (elem && Events.isInputElement(elem)) {
if (!haveInput)
modes.push(modes.INSERT);
if (hasHTMLDocument(win))
buffer.lastInputField = elem;
buffer.lastInputField = elem || win;
return;
}

View File

@@ -7,28 +7,36 @@
"use strict";
var History = Module("history", {
SORT_DEFAULT: "-date",
get format() bookmarks.format,
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
let query = services.history.getNewQuery();
let options = services.history.getNewQueryOptions();
if (typeof filter == "string")
filter = { searchTerms: filter };
for (let [k, v] in Iterator(filter))
query[k] = v;
let _order = /^([+-])(.+)/.exec(order || "+date");
dactyl.assert(_order, _("error.invalidSort", order));
let res = /^([+-])(.+)/.exec(sort);
dactyl.assert(res, _("error.invalidSort", sort));
_order = "SORT_BY_" + _order[2].toUpperCase() + "_" +
(_order[1] == "+" ? "ASCENDING" : "DESCENDING");
dactyl.assert(_order in options, _("error.invalidSort", order));
let [, dir, field] = res;
let _sort = "SORT_BY_" + field.toUpperCase() + "_" +
{ "+": "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;
if (maxItems > 0)
options.maxResults = maxItems;

View File

@@ -95,11 +95,11 @@
<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>
<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>