1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 15:52:29 +01:00

made guioptions handling generic. Updated minimum requirement to Firefox3 beta3

This commit is contained in:
Martin Stubenschrott
2008-02-06 18:17:32 +00:00
parent 7479699004
commit 1985fc2853
4 changed files with 19 additions and 18 deletions

View File

@@ -33,7 +33,8 @@ vimperator.config = {
// this widget is focused when focusContent() is called
get mainWidget() { return GetThreadTree(); },
dialogs: [],
features: ["mail", "hints"]
features: ["mail", "hints"],
guioptions: { m: ["mail-toolbar-menubar2"], T: ["mail-bar2"], f: ["folderPaneBox", "folderpane_splitter"], F: ["folderPaneHeader"] }
}
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -200,22 +200,14 @@ vimperator.Options = function () //{{{
// show/hide the menubar, toolbar and bookmarks toolbar
function setGuiOptions(value)
{
// FIXME: when we release a vimperator with a Firefox3 requirement (no beta), remove the old ids
var guioptions = vimperator.config.guioptions || {};
try
{
document.getElementById("toolbar-menubar").collapsed = !/m/.test(value);
// these the new ids for Firefox > 20080130
document.getElementById("navigation-toolbar").collapsed = !/T/.test(value);
document.getElementById("personal-toolbar"). collapsed = !/b/.test(value);
}
catch (e)
{
// these two ids are for Firefox <= 20080130
document.getElementById("nav-bar"). collapsed = !/T/.test(value);
document.getElementById("PersonalToolbar").collapsed = !/b/.test(value);
// vimperator.log("setGuiOptions raised an exception");
for (let option in guioptions)
guioptions[option].forEach( function(elem) {
document.getElementById(elem).collapsed = (value.indexOf(option.toString()) < 0); });
}
catch (e) { }
guioptionsDone = true;
}
@@ -516,7 +508,14 @@ vimperator.Options = function () //{{{
shortHelp: "Show or hide the menu, toolbar and scrollbars",
setter: function (value) { setGuiOptions(value); },
defaultValue: "",
validator: function (value) { return !/[^mTb]/.test(value); }
validator: function (value)
{
var regex = "[^";
for (let option in vimperator.config.guioptions)
regex += option.toString();
return !(new RegExp(regex + "]").test(value));
}
}
));
optionManager.add(new vimperator.Option(["hinttimeout", "hto"], "number",

View File

@@ -30,7 +30,8 @@ vimperator.config = {
name: "Vimperator",
hostApplication: "Firefox",
dialogs: [],
features: ["bookmarks", "history", "marks", "quickmarks", "hints", "tabs"]
features: ["bookmarks", "history", "marks", "quickmarks", "hints", "tabs"],
guioptions: { m: ["toolbar-menubar"], T: ["nav-bar"], b: ["PersonalToolbar"] }
}
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -4,7 +4,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>vimperator@mozdev.org</em:id>
<em:name>Vimperator2</em:name>
<em:name>Vimperator</em:name>
<em:version>###VERSION###</em:version>
<em:description>Make Firefox behave like Vim</em:description>
<em:creator>Martin Stubenschrott</em:creator>
@@ -20,7 +20,7 @@
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0b1</em:minVersion>
<em:minVersion>3.0b3</em:minVersion>
<em:maxVersion>3.0.0.*</em:maxVersion>
</Description>
</em:targetApplication>