diff --git a/chrome/content/vimperator/options.js b/chrome/content/vimperator/options.js index c79d17a0..d53a1cc4 100644 --- a/chrome/content/vimperator/options.js +++ b/chrome/content/vimperator/options.js @@ -224,7 +224,20 @@ function Options() //{{{ function setTitleString(value) { document.getElementById("main-window").setAttribute("titlemodifier", value); - document.title = window.content.document.title + " - " + value; // not perfect fix, but good enough + if (window.content.document.title.length > 0) + document.title = window.content.document.title + " - " + value; + else + document.title = value; + } + + function setPopups(value) + { + var values = [ [0, 1], // always in current tab + [0, 3], // in a new tab + [2, 3], // in a new window if it has specified sizes + [1, 2]];// always in new window + storePreference("browser.link.open_newwindow.restriction", values[value][0]); + storePreference("browser.link.open_newwindow", values[value][1]); } // @@ -447,6 +460,21 @@ function Options() //{{{ validator: function (value) { if (value >= 1 && value <= 1000) return true; else return false; } } )); + addOption(new Option(["popups", "pps"], "number", + { + short_help: "Where to show requested popup windows", + help: "Define where to show requested popup windows. Does not apply to windows which are opened by middle clicking a link, they always open in a new tab. " + + "Possible values:
" + + "NOTE: This option does not change the popup blocker of Firefox in any way.", + default_value: 1, + setter: function(value) { Options.setPref("popups", value); setPopups(value); }, + validator: function (value) { if (value >= 0 && value <= 3) return true; else return false; } + } + )); addOption(new Option(["preload"], "boolean", { short_help: "Speed up first time history/bookmark completion", @@ -591,6 +619,7 @@ function Options() //{{{ setShowTabline(this.showtabline); setGuiOptions(this.guioptions); setTitleString(this.titlestring); + setPopups(this.popups); } //}}} // vim: set fdm=marker sw=4 ts=4 et: diff --git a/vimperator.vim b/vimperator.vim index 8a6a92c4..2c96f70f 100644 --- a/vimperator.vim +++ b/vimperator.vim @@ -31,7 +31,7 @@ syn match vimperatorCommandWrapper "\<\h\w*\>" contains=vimperatorCommand syn region vimperatorSet matchgroup=vimperatorCommand start="\" end="$" keepend oneline contains=vimperatorOption syn keyword vimperatorOption activate act complete cpt defsearch ds extendedhinttags eht focusedhintstyle fhs fullscreen fs \ nofullscreen nofs guioptions go hintchars hc hintstyle hs hinttags incsearch is noincsearch nois ignorecase ic - \ noignorecase noic maxhints mh preload nopreload previewheight pvh showmode smd noshowmode nosmd showstatuslinks ssli + \ noignorecase noic maxhints mh popups pps preload nopreload previewheight pvh showmode smd noshowmode nosmd showstatuslinks ssli \ showtabline stal smartcase scs nosmartcase noscs titlestring usermode um nousermode noum verbose vbs visualbell vb \ wildmode wim wildoptions wop \ contained