diff --git a/common/content/events.js b/common/content/events.js index 66d93d66..05f62183 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -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; } diff --git a/common/content/history.js b/common/content/history.js index d87f4471..6670b3ac 100644 --- a/common/content/history.js +++ b/common/content/history.js @@ -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; diff --git a/common/locale/en-US/autocommands.xml b/common/locale/en-US/autocommands.xml index b2719c05..6cb779be 100644 --- a/common/locale/en-US/autocommands.xml +++ b/common/locale/en-US/autocommands.xml @@ -95,11 +95,11 @@

Enable Pass Through mode on some Google sites:

-:autocmd LocationChange ^https?://(www|mail)\.google\.com/ :normal! +:autocmd LocationChange www.google.com,mail.google.com :normal!

or

-:autocmd LocationChange www.google.com,mail.google.com :normal! +:autocmd LocationChange ^https?://(www|mail)\.google\.com/ :normal!

Set the filetype to mail when editing email at Gmail: