1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-14 06:23:31 +02:00

Replace asciidoc with native XSLT transforms.

--HG--
branch : xslt
rename : common/Makefile.common => common/Makefile
rename : vimperator/components/about-handler.js => common/components/about-handler.js
rename : vimperator/components/chrome-data.js => common/components/chrome-data.js
rename : vimperator/components/commandline-handler.js => common/components/commandline-handler.js
This commit is contained in:
Kris Maglione
2009-10-21 04:46:29 -04:00
parent 2add32c3f2
commit 0d44d919bc
75 changed files with 7363 additions and 5466 deletions

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="chrome://liberator/content/help.xsl"?>
<!DOCTYPE document SYSTEM "chrome://liberator/locale/liberator.dtd">
<document
name="autocommands"
title="&appname; Autocommands"
xmlns="http://vimperator.org/namespaces/liberator"
xmlns:html="http://www.w3.org/1999/xhtml">
<h2 tag="autocommands">Automatic commands</h2>
<p>
Autocommands are a way to automatically execute code when
certain events happen.
</p>
<item>
<tags>:au :autocmd</tags>
<spec>:au[tocmd]</spec>
<description>
<p>Execute commands automatically on events.</p>
<p><ex>:au[tocmd]</ex> <a>event</a> <a>pat</a> <a>cmd</a></p>
<p>
If the <em>-javascript</em> (short name <em>-js</em>)
option is specified, <a>cmd</a> is executed as JavaScript
code, with any supplied arguments available as
variables.
</p>
<p>Add <a>cmd</a> to the list of commands Vimperator will execute on <a>event</a> for a URL matching <a>pat</a>:</p>
<ul>
<li><ex>:autocmd[!]</ex> <a>events</a> <a>pat</a>: list/remove autocommands filtered by <a>events</a> and <a>pat</a></li>
<li><ex>:autocmd[!]</ex> <a>events</a>: list/remove autocommands matching <a>events</a></li>
<li><ex>:autocmd[!]</ex> <a>pat</a>: list/remove autocommands matching <a>pat</a></li>
<li><ex>:autocmd[!]</ex>: list/remove all autocommands</li>
</ul>
<p>Available <a>events</a>:</p>
<dl>
<dt>BookmarkAdd</dt> <dd>Triggered after a page is bookmarked</dd>
<dt>ColorScheme</dt> <dd>Triggered after a color scheme has been loaded</dd>
<dt>DOMLoad</dt> <dd>Triggered when a page's DOM content has fully loaded</dd>
<dt>DownloadPost</dt> <dd>Triggered when a download has completed</dd>
<dt>Fullscreen</dt> <dd>Triggered when the browser's fullscreen state changes</dd>
<dt>LocationChange</dt> <dd>Triggered when changing tabs or when navigating to a new location</dd>
<dt>PageLoadPre</dt> <dd>Triggered after a page load is initiated</dd>
<dt>PageLoad</dt> <dd>Triggered when a page gets (re)loaded/opened</dd>
<dt>PrivateMode</dt> <dd>Triggered when private mode is activated or deactivated</dd>
<dt>Sanitize</dt> <dd>Triggered when privata data are sanitized</dd>
<dt>ShellCmdPost</dt> <dd>Triggered after executing a shell command with <ex>:!</ex><a>cmd</a></dd>
<dt>VimperatorEnter</dt> <dd>Triggered after Firefox starts</dd>
<dt>VimperatorLeavePre</dt><dd>Triggered before exiting Firefox, just before destroying each module</dd>
<dt>VimperatorLeave</dt> <dd>Triggered before exiting Firefox</dd>
</dl>
<p><a>pat</a> is a regular expression, use .* if you want to match all URLs.</p>
<note>This differs from Vim which uses a glob rather than a regex for <a>pat</a>.</note>
<p>The following keywords are available where relevant:</p>
<dl>
<dt>&lt;url></dt> <dd>The URL against which the event was selected.</dd>
<dt>&lt;title></dt> <dd>The page, bookmark or download title.</dd>
<dt>&lt;doc></dt> <dd>The document for which the event occurred. Only for <em>DOMLoad</em>, <em>PageLoad</em> and <em>PageLoadPre</em>.</dd>
<dt>&lt;tab></dt> <dd>The tab in which the event occurred. Only for <em>DOMLoad</em>, <em>PageLoad</em> and <em>PageLoadPre</em>.</dd>
<dt>&lt;tags></dt> <dd>The tags applied to &lt;url>. Only for <em>BookmarkAdd</em>.</dd>
<dt>&lt;keyword></dt> <dd>The keywords applied to the bookmark. Only for <em>BookmarkAdd</em>.</dd>
<dt>&lt;icon></dt> <dd>The icon associated with &lt;url>. Only for <em>BookmarkAdd</em>.</dd>
<dt>&lt;size></dt> <dd>The size of a downloaded file. Only for <em>DownloadPost</em>.</dd>
<dt>&lt;file></dt> <dd>The target destination of a download. Only for <em>DownloadPost</em>.</dd>
<dt>&lt;state></dt> <dd>The new state. Only for "Fullscreen" and <em>PrivateMode</em>.</dd>
<dt>&lt;name></dt> <dd>The name of the item. Only for <em>ColorScheme</em> and <em>Sanitize</em>.</dd>
</dl>
</description>
</item>
<item>
<tags>:doautoa :doautoall</tags>
<spec>:doautoa[ll] <a>event</a> <oa>url</oa></spec>
<description>
<p>
Apply the autocommands matching the specified URL to all buffers. If no
<oa>url</oa> is specified use the current URL.
</p>
</description>
</item>
<item>
<tags>:do :doautocmd</tags>
<spec>:do[autocmd] <a>event</a> <oa>url</oa></spec>
<description>
<p>
Apply the autocommands matching the specified URL to the current buffer. If no
<oa>url</oa> is specified use the current URL.
</p>
</description>
</item>
<h2 tag="autocmd-examples">Examples</h2>
<p>Enable _passthrough_ mode on all Google sites:</p>
<p>
<ex>:autocmd LocationChange .* js modes.passAllKeys = /google\.com/.test(buffer.URL)</ex>
</p>
<p>Enable _passthrough_ mode on *some* Google sites:</p>
<p>
<ex>:autocmd LocationChange .* js modes.passAllKeys = /(www|mail)\.google\.com/.test(buffer.URL)</ex>
</p>
<p>
Set the filetype to mail when editing email at Gmail:
</p>
<p>
<ex>:autocmd LocationChange .* :set editor=<str>gvim -f</str></ex>
</p>
<p>
<ex>:autocmd LocationChange mail\.google\.com :set editor=<str>gvim -f -c 'set ft=mail'</str></ex>
</p>
</document>
<!-- vim:se sts=4 sw=4 et: -->