mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 10:07:59 +01:00
Fix some general brokenness.
--HG-- branch : testing
This commit is contained in:
@@ -366,7 +366,6 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
|
|
||||||
// ripped from Firefox
|
// ripped from Firefox
|
||||||
function getShortcutOrURI(url) {
|
function getShortcutOrURI(url) {
|
||||||
var shortcutURL = null;
|
|
||||||
var keyword = url;
|
var keyword = url;
|
||||||
var param = "";
|
var param = "";
|
||||||
var offset = url.indexOf(" ");
|
var offset = url.indexOf(" ");
|
||||||
@@ -381,7 +380,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
return [submission.uri.spec, submission.postData];
|
return [submission.uri.spec, submission.postData];
|
||||||
}
|
}
|
||||||
|
|
||||||
[shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
|
let [shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
|
||||||
if (!shortcutURL)
|
if (!shortcutURL)
|
||||||
return [url, null];
|
return [url, null];
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ const Point = Struct("x", "y");
|
|||||||
* @instance buffer
|
* @instance buffer
|
||||||
*/
|
*/
|
||||||
const Buffer = Module("buffer", {
|
const Buffer = Module("buffer", {
|
||||||
requires: ["config"],
|
requires: ["config", "util"],
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
|
this.evaluateXPath = util.evaluateXPath;
|
||||||
this.pageInfo = {};
|
this.pageInfo = {};
|
||||||
|
|
||||||
this.addPageInfoSection("f", "Feeds", function (verbose) {
|
this.addPageInfoSection("f", "Feeds", function (verbose) {
|
||||||
@@ -1470,16 +1471,19 @@ const Buffer = Module("buffer", {
|
|||||||
if (count < 1 && buffer.lastInputField)
|
if (count < 1 && buffer.lastInputField)
|
||||||
buffer.focusElement(buffer.lastInputField);
|
buffer.focusElement(buffer.lastInputField);
|
||||||
else {
|
else {
|
||||||
let xpath = ["input[not(@type) or @type='text' or @type='password' or @type='file']",
|
let xpath = ["input", "textarea[not(@disabled) and not(@readonly)]"];
|
||||||
"textarea[not(@disabled) and not(@readonly)]"];
|
|
||||||
|
|
||||||
let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (match) {
|
let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (elem) {
|
||||||
let computedStyle = util.computedStyle(match);
|
if (elem.readOnly || elem instanceof HTMLInputElement && ["text", "password", "file"].indexOf(elem.type) < 0)
|
||||||
|
return false;
|
||||||
|
let computedStyle = util.computedStyle(elem);
|
||||||
return computedStyle.visibility != "hidden" && computedStyle.display != "none";
|
return computedStyle.visibility != "hidden" && computedStyle.display != "none";
|
||||||
});
|
});
|
||||||
|
|
||||||
liberator.assert(elements.length > 0);
|
liberator.assert(elements.length > 0);
|
||||||
buffer.focusElement(elements[util.Math.constrain(count, 1, elements.length) - 1]);
|
let elem = elements[util.Math.constrain(count, 1, elements.length) - 1];
|
||||||
|
elem.scrollIntoView();
|
||||||
|
buffer.focusElement(elem);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
@@ -1599,7 +1603,7 @@ const Buffer = Module("buffer", {
|
|||||||
"Desired info in the :pageinfo output",
|
"Desired info in the :pageinfo output",
|
||||||
"charlist", "gfm",
|
"charlist", "gfm",
|
||||||
{
|
{
|
||||||
completer: function (context) [[k, v[1]] for ([k, v] in Iterator(this.pageInfo))]
|
completer: function (context) [[k, v[1]] for ([k, v] in Iterator(buffer.pageInfo))]
|
||||||
});
|
});
|
||||||
|
|
||||||
options.add(["scroll", "scr"],
|
options.add(["scroll", "scr"],
|
||||||
|
|||||||
@@ -1109,7 +1109,7 @@ const CommandLine = Module("commandline", {
|
|||||||
*/
|
*/
|
||||||
Completions: Class("Completions", {
|
Completions: Class("Completions", {
|
||||||
init: function (input) {
|
init: function (input) {
|
||||||
this.context = CompletionContext(input.editor);
|
this.context = CompletionContext(input.QueryInterface(Ci.nsIDOMNSEditableElement).editor);
|
||||||
this.context.onUpdate = this.closure._reset;
|
this.context.onUpdate = this.closure._reset;
|
||||||
this.editor = input.editor;
|
this.editor = input.editor;
|
||||||
this.selected = null;
|
this.selected = null;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@namespace liberator url("http://vimperator.org/namespaces/liberator");
|
@namespace liberator url("http://vimperator.org/namespaces/liberator");
|
||||||
|
@namespace html url("http://www.w3.org/1999/xhtml");
|
||||||
|
|
||||||
/* Applied to all content */
|
/* Applied to all content */
|
||||||
[liberator|activeframe] {
|
[liberator|activeframe] {
|
||||||
@@ -122,6 +123,9 @@ statusbarpanel {
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
#liberator-commandline-command html|*:focus {
|
||||||
|
outline-width: 0px !important
|
||||||
|
}
|
||||||
#liberator-message {
|
#liberator-message {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user