diff --git a/content/muttator.js b/content/muttator.js index 2f470bc6..8bd867ca 100644 --- a/content/muttator.js +++ b/content/muttator.js @@ -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: diff --git a/content/options.js b/content/options.js index a8efde72..1ef174d9 100644 --- a/content/options.js +++ b/content/options.js @@ -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", diff --git a/content/vimperator.js b/content/vimperator.js index fe538845..553aec50 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -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: diff --git a/install.rdf b/install.rdf index 3657fa6c..8d16cd8c 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ vimperator@mozdev.org - Vimperator2 + Vimperator ###VERSION### Make Firefox behave like Vim Martin Stubenschrott @@ -20,7 +20,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 3.0b1 + 3.0b3 3.0.0.*