1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 17:05:47 +01:00

Vimperator 1.0! Horray!

This commit is contained in:
Martin Stubenschrott
2008-05-14 18:42:12 +00:00
parent c23a942dc8
commit de50bb4397
5 changed files with 12 additions and 22 deletions

View File

@@ -77,8 +77,6 @@ liberator.Hints = function () //{{{
function generate(win)
{
var startDate = Date.now();
if (!win)
win = window.content;
@@ -94,7 +92,6 @@ liberator.Hints = function () //{{{
var elem, tagname, text, span, rect;
var res = liberator.buffer.evaluateXPath(liberator.options["hinttags"], doc, null, true);
liberator.log("evaluated XPath after: " + (Date.now() - startDate) + "ms");
var fragment = doc.createDocumentFragment();
var start = hints.length;
@@ -138,7 +135,6 @@ liberator.Hints = function () //{{{
for (var i = 0; i < win.frames.length; i++)
generate(win.frames[i]);
liberator.log("hints.generate() completed after: " + (Date.now() - startDate) + "ms for " + hints.length + " hints.");
return true;
}
@@ -156,13 +152,10 @@ liberator.Hints = function () //{{{
function showHints()
{
var startDate = Date.now();
var win = window.content;
var height = win.innerHeight;
var width = win.innerWidth;
liberator.log("Show hints matching: \"" + hintString + "\"", 7);
var linkfgcolor = liberator.options["linkfgcolor"];
var linkbgcolor = liberator.options["linkbgcolor"];
var activelinkfgcolor = liberator.options["activelinkfgcolor"];
@@ -235,7 +228,6 @@ liberator.Hints = function () //{{{
}
}
liberator.log("showHints() completed after: " + (Date.now() - startDate) + "ms");
return true;
}
@@ -305,7 +297,6 @@ liberator.Hints = function () //{{{
}
}
liberator.log("removeHints() done");
reset();
}
@@ -335,7 +326,6 @@ liberator.Hints = function () //{{{
var loc = elem.href || "";
switch (submode)
{
// TODO: move/rename those helper functions to a better place
case ";": liberator.buffer.focusElement(elem); break;
case "?": liberator.buffer.showElementInfo(elem); break;
case "a": liberator.buffer.saveLink(elem, false); break;
@@ -579,7 +569,6 @@ liberator.Hints = function () //{{{
return {
// TODO: implement framesets
show: function (mode, minor, filter)
{
if (mode == liberator.modes.EXTENDED_HINT && !/^[;?asoOtTvVwWyY]$/.test(minor))

View File

@@ -64,6 +64,7 @@ const liberator = (function () //{{{
return !(new RegExp(regex + "]").test(value));
}
});
liberator.options.add(["titlestring"], // TODO: broken for Thunderbird
"Change the title of the window",
"string", "Vimperator",
@@ -85,12 +86,14 @@ const liberator = (function () //{{{
}
},
});
liberator.options.add(["verbose", "vbs"],
"Define which type of messages are logged",
"number", 0,
{
validator: function (value) { return (value >= 0 && value <= 9); }
});
liberator.options.add(["visualbell", "vb"],
"Use visual bell instead of beeping on errors",
"boolean", false,
@@ -384,9 +387,6 @@ const liberator = (function () //{{{
catch (e) { }
});
}
// if (liberator.has("tabs"))
}
/////////////////////////////////////////////////////////////////////////////}}}
@@ -617,7 +617,7 @@ const liberator = (function () //{{{
window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context
else
dump('no element: ' + '@class="tag" and text()="' + tag + '"\n' );
}, 200);
}, 500);
}
if (!topic)
@@ -781,6 +781,7 @@ const liberator = (function () //{{{
.quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit);
},
// TODO: probably move to {muttator,vimperator,...}.js
// this function is called, when the chrome is ready
startup: function ()
{