1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 06:14:12 +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: