1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 17:42:27 +01:00

add new 'loadplugins' option

This commit is contained in:
Doug Kearns
2008-08-29 12:46:25 +00:00
parent 7a86114f21
commit 0a10028910
5 changed files with 42 additions and 23 deletions

1
NEWS
View File

@@ -1,6 +1,7 @@
<pre> <pre>
2008-08-16: 2008-08-16:
* version 2.0 (probably) * version 2.0 (probably)
* add 'loadplugins' option
* add count support to C-^ (Kazuo) * add count support to C-^ (Kazuo)
* add 'eventignore' option * add 'eventignore' option
* add :tabdetach command * add :tabdetach command

View File

@@ -72,6 +72,10 @@ const liberator = (function () //{{{
} }
}); });
liberator.options.add(["loadplugins", "lpl"],
"Load plugin scripts when starting up",
"boolean", true);
liberator.options.add(["verbose", "vbs"], liberator.options.add(["verbose", "vbs"],
"Define which type of messages are logged", "Define which type of messages are logged",
"number", 0, "number", 0,
@@ -983,29 +987,32 @@ const liberator = (function () //{{{
else else
liberator.log("No user RC file found", 3); liberator.log("No user RC file found", 3);
// also source plugins in ~/.vimperator/plugin/ if (liberator.options["loadplugins"])
try
{ {
var pluginDir = liberator.io.getSpecialDirectory("plugin"); // also source plugins in ~/.vimperator/plugin/
if (pluginDir) try
{ {
var files = liberator.io.readDirectory(pluginDir.path); var pluginDir = liberator.io.getSpecialDirectory("plugin");
liberator.log("Sourcing plugin directory...", 3); if (pluginDir)
files.forEach(function (file) { {
if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path)) var files = liberator.io.readDirectory(pluginDir.path);
liberator.io.source(file.path, false); liberator.log("Sourcing plugin directory...", 3);
}); files.forEach(function (file) {
if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path))
liberator.io.source(file.path, false);
});
}
else
{
liberator.log("No user plugin directory found", 3);
}
} }
else catch (e)
{ {
liberator.log("No user plugin directory found", 3); // thrown if directory does not exist
//liberator.log("Error sourcing plugin directory: " + e);
} }
} }
catch (e)
{
// thrown if directory does not exist
//liberator.log("Error sourcing plugin directory: " + e);
}
// after sourcing the initialization files, this function will set // after sourcing the initialization files, this function will set
// all gui options to their default values, if they have not been // all gui options to their default values, if they have not been

View File

@@ -444,6 +444,13 @@ This includes (X)HTML elements with an "href" atrribute and XLink "simple" links
____ ____
|\'noloadplugins'| |\'loadplugins'|
||'loadplugins'|| boolean (default on)
____
Load plugin scripts when starting up.
____
|\'nomore'| |\'more'| |\'nomore'| |\'more'|
||'more'|| boolean (default: on) ||'more'|| boolean (default: on)
____ ____
@@ -485,6 +492,7 @@ ____
Show and set the \'work offline' behavior. Show and set the \'work offline' behavior.
____ ____
|\'pageinfo' \'pa'| |\'pageinfo' \'pa'|
||'pageinfo' 'pa'|| ||'pageinfo' 'pa'||
charlist (default: gfm) charlist (default: gfm)

View File

@@ -17,7 +17,9 @@ The plugin directory is named:
* Unix and Mac - [a]\~/.vimperator/plugin[a] * Unix and Mac - [a]\~/.vimperator/plugin[a]
* Windows - [a]\~/vimperator/plugin[a] * Windows - [a]\~/vimperator/plugin[a]
The user's '$HOME'(~) directory is determined as follows: Plugins will not be sourced if 'noloadplugins' is set.
The user's \'$HOME'(~) directory is determined as follows:
* Unix and Mac - _$HOME_ is used. * Unix and Mac - _$HOME_ is used.
* Windows - if _%HOME%_ is set then this is used, otherwise _%USERPROFILE%_ or finally * Windows - if _%HOME%_ is set then this is used, otherwise _%USERPROFILE%_ or finally

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: VIMperator configuration file " Language: VIMperator configuration file
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2008 Aug 28 " Last Change: 2008 Aug 29
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -43,10 +43,11 @@ syn keyword vimperatorOption activate act activelinkfgcolor alfc activelinkbgcol
\ extendedhinttags eht eventignore ei focuscontent fc nofocuscontent nofc fullscreen fs nofullscreen nofs guioptions go \ extendedhinttags eht eventignore ei focuscontent fc nofocuscontent nofc fullscreen fs nofullscreen nofs guioptions go
\ hintmatching hm hintstyle hs hinttags ht hinttimeout hto history hi hlsearch hls nohlsearch nohls hlsearchstyle hlss \ hintmatching hm hintstyle hs hinttags ht hinttimeout hto history hi hlsearch hls nohlsearch nohls hlsearchstyle hlss
\ incsearch is noincsearch nois ignorecase ic noignorecase noic insertmode im noinsertmode noim laststatus ls linkbgcolor lbc \ 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 \ linkfgcolor lfc linksearch lks nolinksearch nolks loadplugins noloadplugins lpl nolpl more newtab nextpattern nomore
\ previewheight pvh previouspattern online noonline scroll scr shell sh shellcmdflag shcf showmode smd noshowmode nosmd \ pageinfo pa popups pps preload nopreload previewheight pvh previouspattern online noonline scroll scr shell sh shellcmdflag
\ showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs suggestengines titlestring usermode um nousermode noum \ shcf showmode smd noshowmode nosmd showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs suggestengines
\ urlseparator verbose vbs visualbell vb novisualbell novb visualbellstyle wildmode wim wildoptions wop wordseparators wsp \ titlestring usermode um nousermode noum urlseparator verbose vbs visualbell vb novisualbell novb visualbellstyle wildmode
\ wim wildoptions wop wordseparators wsp
\ contained \ contained
syn region vimperatorJavascript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline syn region vimperatorJavascript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline