diff --git a/AUTHORS b/AUTHORS index 2bf9eaf1..70d8c6c2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,4 +25,5 @@ Patches (in no special order): * Joseph Xu (supporting multiple top level windows better) * Raimon Grau Cuscó (document relationship navigation - ]], [[) * Ryan Zheng (ctrl-x/a support) + * Dan Boger (:set online support) diff --git a/NEWS b/NEWS index c41cbdb6..36701936 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ * version 1.2 * don't pass any ctrl- or alt- prefixed keys to firefox in insert mode * keywords in :open have higher priority than local files now + * add :set online to control the "work offline" menu item 2008-06-03: * version 1.1 diff --git a/content/vimperator.js b/content/vimperator.js index b9920b26..51e37784 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -327,6 +327,29 @@ liberator.config = { //{{{ { completer: function (filter) { return liberator.completion.url(filter); } }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// OPTIONS ///////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + liberator.options.add(["online"], "Set and reset the 'work offline' option", "boolean", true, + { + setter: function (value) + { + var ioService = Components.classes['@mozilla.org/network/io-service;1']. + getService(Components.interfaces.nsIIOService2); + + ioService.offline = !value; + gPrefService.setBoolPref("browser.offline", ioService.offline); + }, + + getter: function () + { + return Components.classes['@mozilla.org/network/io-service;1']. + getService(Components.interfaces.nsIIOService2).offline; + } + }); + } //}}} }; //}}} diff --git a/locale/en-US/options.txt b/locale/en-US/options.txt index f1757d59..7ba7bfc5 100644 --- a/locale/en-US/options.txt +++ b/locale/en-US/options.txt @@ -386,6 +386,12 @@ Each pattern, in order, is matched against all links in the page with the first The patterns are case insensitive regular expressions. ____ +|\'noonline'| |\'online'| +||'online'|| boolean (default on) +____ +Show and set the 'work offline' behavior. +____ + |\'pageinfo' \'pa'| ||'pageinfo' 'pa'|| charlist (default: gfm) diff --git a/vimperator.vim b/vimperator.vim index 752ed031..5683eaaf 100644 --- a/vimperator.vim +++ b/vimperator.vim @@ -43,7 +43,7 @@ syn keyword vimperatorOption activate act activelinkfgcolor alfc activelinkbgcol \ history hi hlsearch hls nohlsearch nohls hlsearchstyle hlss nohlsearchstyle nohlss incsearch is noincsearch nois ignorecase \ ic noignorecase noic insertmode im noinsertmode noim laststatus ls linkbgcolor lbc linkfgcolor lfc linksearch lks \ nolinksearch nolks more newtab nextpattern nomore pageinfo pa popups pps preload nopreload previewheight pvh previouspattern - \ scroll scr showmode smd noshowmode nosmd showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs + \ online noonline scroll scr showmode smd noshowmode nosmd showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs \ suggestengines titlestring usermode um nousermode noum verbose vbs visualbell vb novisualbell novb wildmode wim wildoptions \ wop wordseparators wsp \ contained