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

Fix some general brokenness.

--HG--
branch : testing
This commit is contained in:
Kris Maglione
2010-05-11 06:01:02 -04:00
parent bf5fb6d44e
commit 7a3d35991c
4 changed files with 17 additions and 10 deletions

View File

@@ -366,7 +366,6 @@ const Bookmarks = Module("bookmarks", {
// ripped from Firefox
function getShortcutOrURI(url) {
var shortcutURL = null;
var keyword = url;
var param = "";
var offset = url.indexOf(" ");
@@ -381,7 +380,7 @@ const Bookmarks = Module("bookmarks", {
return [submission.uri.spec, submission.postData];
}
[shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
let [shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword);
if (!shortcutURL)
return [url, null];

View File

@@ -19,9 +19,10 @@ const Point = Struct("x", "y");
* @instance buffer
*/
const Buffer = Module("buffer", {
requires: ["config"],
requires: ["config", "util"],
init: function () {
this.evaluateXPath = util.evaluateXPath;
this.pageInfo = {};
this.addPageInfoSection("f", "Feeds", function (verbose) {
@@ -1470,16 +1471,19 @@ const Buffer = Module("buffer", {
if (count < 1 && buffer.lastInputField)
buffer.focusElement(buffer.lastInputField);
else {
let xpath = ["input[not(@type) or @type='text' or @type='password' or @type='file']",
"textarea[not(@disabled) and not(@readonly)]"];
let xpath = ["input", "textarea[not(@disabled) and not(@readonly)]"];
let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (match) {
let computedStyle = util.computedStyle(match);
let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (elem) {
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";
});
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 });
@@ -1599,7 +1603,7 @@ const Buffer = Module("buffer", {
"Desired info in the :pageinfo output",
"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"],

View File

@@ -1109,7 +1109,7 @@ const CommandLine = Module("commandline", {
*/
Completions: Class("Completions", {
init: function (input) {
this.context = CompletionContext(input.editor);
this.context = CompletionContext(input.QueryInterface(Ci.nsIDOMNSEditableElement).editor);
this.context.onUpdate = this.closure._reset;
this.editor = input.editor;
this.selected = null;

View File

@@ -1,4 +1,5 @@
@namespace liberator url("http://vimperator.org/namespaces/liberator");
@namespace html url("http://www.w3.org/1999/xhtml");
/* Applied to all content */
[liberator|activeframe] {
@@ -122,6 +123,9 @@ statusbarpanel {
color: inherit;
margin: 0px;
}
#liberator-commandline-command html|*:focus {
outline-width: 0px !important
}
#liberator-message {
margin: 0px;
}