1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 20:07:59 +01:00

Messily tag NEWS page with more explicit version info.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-26 12:15:54 -05:00
parent cbc6a985e6
commit 140a4822fa
5 changed files with 150 additions and 112 deletions

View File

@@ -305,14 +305,6 @@ var CommandMode = Class("CommandMode", {
if (this.complete) if (this.complete)
this.completions = CommandLine.Completions(commandline.widgets.active.command.inputField, this); this.completions = CommandLine.Completions(commandline.widgets.active.command.inputField, this);
this.autocompleteTimer = Timer(200, 500, function autocompleteTell(tabPressed) {
if (!events.feedingKeys && this.completions && options["autocomplete"].length) {
this.completions.complete(true, false);
if (this.completions)
this.completions.itemList.visible = true;
}
}, this);
}, },
open: function (command) { open: function (command) {
@@ -335,17 +327,14 @@ var CommandMode = Class("CommandMode", {
commandline.commandSession = this; commandline.commandSession = this;
if (this.command || stack.pop && commandline.command) { if (this.command || stack.pop && commandline.command) {
this.onChange(commandline.command); this.onChange(commandline.command);
this.autocompleteTimer.flush(true); if (this.completions)
this.completions.autocompleteTimer.flush(true);
} }
}, },
leave: function (stack) { leave: function (stack) {
this.autocompleteTimer.reset(); if (this.completions)
this.completions.cleanup();
if (this.completions) {
this.completions.previewClear();
this.completions.tabTimer.reset();
}
if (this.history) if (this.history)
this.history.save(); this.history.save();
@@ -368,9 +357,9 @@ var CommandMode = Class("CommandMode", {
if (this.completions) { if (this.completions) {
this.resetCompletions(); this.resetCompletions();
this.autocompleteTimer.tell(false); this.completions.autocompleteTimer.tell(false);
if (!this.completions.itemList.visible) if (!this.completions.itemList.visible)
this.autocompleteTimer.flush(); this.completions.autocompleteTimer.flush();
} }
this.onChange(commandline.command); this.onChange(commandline.command);
}, },
@@ -614,8 +603,10 @@ var CommandLine = Module("commandline", {
if (this.widgets.message && this.widgets.message[1] === this._lastClearable) if (this.widgets.message && this.widgets.message[1] === this._lastClearable)
this.widgets.message = null; this.widgets.message = null;
if (!this.commandSession) if (!this.commandSession) {
this.widgets.command = null; this.widgets.command = null;
this.hideCompletions();
}
if (modes.main == modes.OUTPUT_MULTILINE && !mow.isScrollable(1)) if (modes.main == modes.OUTPUT_MULTILINE && !mow.isScrollable(1))
modes.pop(); modes.pop();
@@ -990,11 +981,24 @@ var CommandLine = Module("commandline", {
this.itemList = commandline.completionList; this.itemList = commandline.completionList;
this.itemList.setItems(this.context); this.itemList.setItems(this.context);
this.autocompleteTimer = Timer(200, 500, function autocompleteTell(tabPressed) {
if (!events.feedingKeys && this.completions && options["autocomplete"].length) {
this.complete(true, false);
this.itemList.visible = true;
}
}, this);
this.tabTimer = Timer(0, 0, function tabTell(event) { this.tabTimer = Timer(0, 0, function tabTell(event) {
this.tab(event.shiftKey, event.altKey && options["altwildmode"]); this.tab(event.shiftKey, event.altKey && options["altwildmode"]);
}, this); }, this);
}, },
cleanup: function () {
this.previewClear();
this.tabTimer.reset();
this.autocompleteTimer.reset();
this.itemList.visible = false;
},
UP: {}, UP: {},
DOWN: {}, DOWN: {},
PAGE_UP: {}, PAGE_UP: {},
@@ -1207,7 +1211,7 @@ var CommandLine = Module("commandline", {
tabs: [], tabs: [],
tab: function tab(reverse, wildmode) { tab: function tab(reverse, wildmode) {
this.session.autocompleteTimer.flush(); this.autocompleteTimer.flush();
if (this._caret != this.caret) if (this._caret != this.caret)
this.reset(); this.reset();

View File

@@ -560,10 +560,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* @private * @private
*/ */
initDocument: function initDocument(doc) { initDocument: function initDocument(doc) {
try {
if (doc.location.protocol === "dactyl:") { if (doc.location.protocol === "dactyl:") {
dactyl.initHelp(); dactyl.initHelp();
config.styleHelp(); config.styleHelp();
} }
}
catch (e) {
util.reportError(e);
}
}, },
/** /**
@@ -662,9 +667,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let re = util.regexp(<![CDATA[ let re = util.regexp(<![CDATA[
^ (?P<space> \s*) ^ (?P<space> \s*)
(?P<char> [-*+]) \x20 (?P<char> [-*+]) \ //
(?P<content> .*\n (?P<content> .*\n
(?: \1\x20\x20.*\n | \s*\n)* ) (?: \1\ \ .*\n | \s*\n)* )
| |
(?P<par> (?P<par>
(?: ^ [^\S\n]* (?: ^ [^\S\n]*
@@ -676,30 +681,55 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
(?: ^ [^\S\n]* \n) + (?: ^ [^\S\n]* \n) +
]]>, "gmy"); ]]>, "gmy");
let betas = util.regexp(/\[(b\d)\]/, "g");
let beta = array(betas.iterate(NEWS))
.map(function (m) m[1]).uniq().slice(-1)[0];
default xml namespace = NS; default xml namespace = NS;
function rec(text, level) { function rec(text, level, li) {
let res = <></>; let res = <></>;
let list, space; let list, space, i = 0;
for (let match in re.iterate(text)) { for (let match in re.iterate(text)) {
if (match.char) { if (match.char) {
if (!list) if (!list)
res += list = <ul/>; res += list = <ul/>;
list.* += <li>{rec(match.content.replace(RegExp("^" + match.space, "gm"), ""), level + 1)}</li>; let li = <li/>;
li.* += rec(match.content.replace(RegExp("^" + match.space, "gm"), ""), level + 1, li)
list.* += li;
} }
else if (match.par) { else if (match.par) {
let [, par, tags] = /([^]*?)\s*((?:\[[^\]]+\])*)\n*$/.exec(match.par);
let t = tags;
tags = array(betas.iterate(tags)).map(function (m) m[1]);
let group = tags.length && !tags.some(function (t) t == beta) ? "HelpNewsOld" : "";
if (i === 0 && li) {
li.@highlight = group;
group = "";
}
list = null; list = null;
if (level == 0 && /^.*:\n$/.test(match.par)) if (level == 0 && /^.*:\n$/.test())
res += <h2>{template.linkifyHelp(match.par.slice(0, -1), true)}</h2>; var elem = <h2>{template.linkifyHelp(par.slice(0, -1), true)}</h2>;
else { else {
let [, a, b] = /^(IMPORTANT:?)?([^]*)/.exec(match.par); let [, a, b] = /^(IMPORTANT:?)?([^]*)/.exec(par);
res += <p>{ res += <p highlight={group + " HelpNews"}>{
!tags.length ? "" :
<hl key="HelpNewsTag">{tags.join(" ")}</hl>
}{
a ? <hl key="HelpWarning">{a}</hl> : "" a ? <hl key="HelpWarning">{a}</hl> : ""
}{ }{
template.linkifyHelp(b, true) template.linkifyHelp(b, true)
}</p>; }</p>;
} }
} }
i++;
}
for each (let attr in res..@highlight) {
attr.parent().@NS::highlight = attr;
delete attr.parent().@highlight;
} }
return res; return res;
} }
@@ -710,7 +740,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
'<?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>\n' + '<?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>\n' +
'<!DOCTYPE document SYSTEM "resource://dactyl-content/dactyl.dtd">\n' + '<!DOCTYPE document SYSTEM "resource://dactyl-content/dactyl.dtd">\n' +
unescape(encodeURI( // UTF-8 handling hack. unescape(encodeURI( // UTF-8 handling hack.
<document xmlns={NS} <document xmlns={NS} xmlns:dactyl={NS}
name="versions" title={config.appName + " Versions"}> name="versions" title={config.appName + " Versions"}>
<h1 tag="versions news">{config.appName} Versions</h1> <h1 tag="versions news">{config.appName} Versions</h1>
<toc start="2"/> <toc start="2"/>

View File

@@ -613,6 +613,9 @@ var ConfigBase = Class("ConfigBase", {
HelpString[delim]::before content: attr(delim); HelpString[delim]::before content: attr(delim);
HelpString[delim]::after content: attr(delim); HelpString[delim]::after content: attr(delim);
HelpNews position: relative;
HelpNewsOld opacity: .7;
HelpNewsTag position: absolute; left: 100%; padding-left: 1em; color: #527BBD; opacity: .6;
HelpHead;html|h1,html|h2,html|h3,html|h4;dactyl://help/* { HelpHead;html|h1,html|h2,html|h3,html|h4;dactyl://help/* {
font-weight: bold; font-weight: bold;

View File

@@ -1270,8 +1270,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (tokens) if (tokens)
expr = String.replace(expr, /(\(?P)?<(\w+)>/g, function (m, n1, n2) !n1 && set.has(tokens, n2) ? tokens[n2].dactylSource || tokens[n2].source || tokens[n2] : m); expr = String.replace(expr, /(\(?P)?<(\w+)>/g, function (m, n1, n2) !n1 && set.has(tokens, n2) ? tokens[n2].dactylSource || tokens[n2].source || tokens[n2] : m);
expr = String.replace(expr, /\/\/[^\n]*|\/\*[^]*?\*\//gm, "") expr = String.replace(expr, /(\\.)|\/\/[^\n]*|\/\*[^]*?\*\/|\s+/gm, function (m, m1) m1 || "");
.replace(/\s+/g, "");
if (/\(\?P</.test(expr)) { if (/\(\?P</.test(expr)) {
var source = expr; var source = expr;

View File

@@ -2,23 +2,24 @@
* Extensive Firefox 4 support, including: * Extensive Firefox 4 support, including:
- Fully restartless. Can now be installed, uninstalled, - Fully restartless. Can now be installed, uninstalled,
enabled, disabled, and upgraded without restarting Firefox. enabled, disabled, and upgraded without restarting Firefox.
[b4]
- Tabs in :buffer completions and listings are grouped - Tabs in :buffer completions and listings are grouped
by panorama groups. by panorama groups. [b1]
- Only visible tabs are considered in tab numbering, - Only visible tabs are considered in tab numbering,
gt/gn/gN, etc. gt/gn/gN, etc. [b1]
* Improved startup time by a factor of 7. * Improved startup time by a factor of 7. [b1]
* Significant completion speed improvements, especially for * Significant completion speed improvements, especially for
JavaScript. JavaScript. [b1]
* Greatly improved private mode support and :sanitize command. * Greatly improved private mode support and :sanitize command.
- Full integration with Firefox data clearing dialogs. - Full integration with Firefox data clearing dialogs. [b3]
- Support for sanitizing items at shutdown. - Support for sanitizing items at shutdown. [b3]
- Fine-grained control over what data is sanitized and for - Fine-grained control over what data is sanitized and for
what timespan. what timespan. [b1]
- Support for sanitizing reference to particular hosts, - Support for sanitizing reference to particular hosts,
everywhere from command-line and message history to option everywhere from command-line and message history to option
values and cookies. values and cookies. [b1]
* New and much more powerful incremental search implementation. * New and much more powerful incremental search implementation.
Improvements over the standard Firefox find include: Improvements over the standard Firefox find include: [b1]
- Starts at the cursor position in the currently selected - Starts at the cursor position in the currently selected
frame, unlike Firefox, which always starts at the start of frame, unlike Firefox, which always starts at the start of
the first frame. the first frame.
@@ -28,62 +29,70 @@
backspace. backspace.
- Supports reverse incremental search. - Supports reverse incremental search.
- Input boxes are not focused when matches are highlighted. - Input boxes are not focused when matches are highlighted.
* It's now possible to map keys in many more modes, including
Hint, Multi-line Output, and Menu.
* Ex command parsing improvements, including: * Ex command parsing improvements, including:
- Multiple Ex commands may now be separated by | - Multiple Ex commands may now be separated by | [b1]
- Commands can continue over multiple lines in RC files by - Commands can continue over multiple lines in RC files by
prefixing the continuation lines with a \ prefixing the continuation lines with a \ [b3]
- The \ character is no longer treated specially within single - The \ character is no longer treated specially within single
quotes, i.e., 'fo\o''bar' ⇒ fo\o'bar quotes, i.e., 'fo\o''bar' ⇒ fo\o'bar [b1]
* Command line is now hidden by default. Added c, C, and M to * Command line is now hidden by default. Added c, C, and M to
'guioptions'. 'guioptions'. [b4]
* Hint mode improvements, including: * Hint mode improvements, including:
- Added g; continued extended hint mode, which allows - Added g; continued extended hint mode, which allows
selecting multiple hints. Removed ;F. selecting multiple hints. Removed ;F. [b1]
- Hints are now updated after scrolling and window resizing. - Hints are now updated after scrolling and window resizing. [b3]
- ;s now prompts for a filename on the command-line rather - ;s now prompts for a filename on the command-line rather
than in a dialog. than in a dialog. [b5]
- Added ;a and ;S modes for creating bookmarks and search keywords. - Added ;a and ;S modes for creating bookmarks and search keywords. [b4][b3]
- Added 'hintkeys' option. - Added 'hintkeys' option. [b2]
- Added "transliterated" option to 'hintmatching'. - Added "transliterated" option to 'hintmatching'. [b1]
* JavaScript completion improvements, including: * JavaScript completion improvements, including: [b2]
- The prototype of the function whose arguments are currently - The prototype of the function whose arguments are currently
being typed is displayed during completion. being typed is displayed during completion.
- Non-enumerable global properties are now completed for the - Non-enumerable global properties are now completed for the
global object, including XMLHttpRequest and encodeURI. global object, including XMLHttpRequest and encodeURI.
* The concept of completion contexts is now exposed to the user * The concept of completion contexts is now exposed to the user
(see :h :contexts), allowing for powerful and fine-grained (see :h :contexts), allowing for powerful and fine-grained
completion system customization. completion system customization. [b1]
* The external editor can now be configured to open to a given * The external editor can now be configured to open to a given
line number and column, used for opening source links and line number and column, used for opening source links and
editing input fields with i_<C-i>. See :h 'editor'. editing input fields with i_<C-i>. See :h 'editor'. [b4]
* Mapping changes:
- It's now possible to map keys in many more modes, including
Hint, Multi-line Output, and Menu. [b4]
- Added site-specific mapping groups and related command
changes. [b6]
- Added <A-m>l and <A-m>s to aid in the construction of
macros. [b6]
- Removed the implicit page load delays during macro playback. [b6]
- Added the base modes Base, Main, and Command which other
modes inherit key bindings from. [b6]
* Command changes: * Command changes:
- :viusage, :optionusage and :exusage were replaced with :listkeys, - :viusage, :optionusage and :exusage were replaced with :listkeys,
:listoptions and :listcommands, providing more powerful and :listoptions and :listcommands, providing more powerful and
consistent interactive help facility (improvements include consistent interactive help facility (improvements include
listing keys for modes other than Normal, filtering the output listing keys for modes other than Normal, filtering the output
and linking to source code locations). and linking to source code locations). [b4]
- :downloads now opens a download list in the multi-line output - :downloads now opens a download list in the multi-line output
buffer. buffer.
- Added :mapgroup command and -group flag to :map, :unmap, and - Added :mapgroup command and -group flag to :map, :unmap, and
:mapclear. :mapclear. [b6]
- :extensions has been replaced with a more powerful :addons. - :extensions has been replaced with a more powerful :addons.
- Added :cookies command. - Added :cookies command. [b3]
- :extadd now supports remote URLs as well as local files on Firefox 4. - :extadd now supports remote URLs as well as local files on Firefox 4.
- Added :if/:elseif/:else/:endif conditionals. - Added :if/:elseif/:else/:endif conditionals. [b3]
- Added -charset and -post to :bmark. - Added -charset and -post to :bmark.
- Added -keyword, -tags, -title to :delbmarks. - Added -keyword, -tags, -title to :delbmarks. [b2]
- Added :extrehash, :exttoggle, :extupdate, and :rehash commands. - Added :extrehash, :exttoggle, :extupdate, and :rehash commands.
- Added :feedkeys command. - Added :feedkeys command. [b4]
- Added -sort option to :history. - Added -sort option to :history. [b4]
- Added several new options, including -javascript, to :abbreviate and - Added several new options, including -javascript, to :abbreviate and
:map. :map. [b2]
- Added :mksyntax command to auto-generate Vim syntax files. - Added :mksyntax command to auto-generate Vim syntax files. [b4]
- :open now only opens files beginning with /, ./, ../, or ~/ - :open now only opens files beginning with /, ./, ../, or ~/
- :saveas now provides completions for default file names, and - :saveas now provides completions for default file names, and
automatically chooses a filename when the save target is a automatically chooses a filename when the save target is a
directory. directory. [b4]
- :sidebar now accepts a ! flag to toggle the sidebar rather - :sidebar now accepts a ! flag to toggle the sidebar rather
than open it unconditionally. than open it unconditionally.
- Added :write !cmd and :write >>file. - Added :write !cmd and :write >>file.
@@ -93,80 +102,73 @@
- :command now accepts comma-separated alternative command names. - :command now accepts comma-separated alternative command names.
- :command -complete custom now also accepts a completions array, see - :command -complete custom now also accepts a completions array, see
:h :command-completion-custom. :h :command-completion-custom.
* Mapping changes:
- Added site-specific mapping groups and related command
changes.
- Added named aliases for many mappings
- Added <A-m>l and <A-m>s to aid in the construction of macros.
- Removed the implicit page load delays during macro playback.
- Added the base modes Base, Main, and Command which other
modes inherit key bindings from.
* Improvements to :style and :highlight: * Improvements to :style and :highlight:
- Added -agent flag to :style. - Added -link flag to :highlight. [b4]
- Added -agent flag to :style. [b2]
- The -append flag now updates existing properties rather than - The -append flag now updates existing properties rather than
simply appending its arguments to the previous value. simply appending its arguments to the previous value. [b4]
- Active filters are now highlighted in :style listings. - Active filters are now highlighted in :style listings. [b4]
- :style-related commands now divide their completions between - :style-related commands now divide their completions between
those active and inactive for the current site. those active and inactive for the current site. [b4]
- CSS property name completion is now available. - CSS property name completion is now available. [b4]
* IMPORTANT option changes: * IMPORTANT option changes:
- Boolean options no longer accept an argument. - Boolean options no longer accept an argument. [b4]
- 'cdpath' and 'runtimepath' no longer treat ",," - 'cdpath' and 'runtimepath' no longer treat ",,"
specially. Use "." instead. specially. Use "." instead.
- 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have - 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have
been replaced with 'incfind', 'hlfind', and 'findcase'. been replaced with 'incfind', 'hlfind', and 'findcase'. [b4]
- 'extendedhinttags' is now a regexpmap rather than a - 'extendedhinttags' is now a regexpmap rather than a
string. string. [b2]
- 'guioptions' default value has changed. - 'guioptions' default value has changed.
- 'laststatus' has been replaced with the "s" flag in - 'laststatus' has been replaced with the "s" flag in
'guioptions'. 'guioptions'. [b4]
- 'linksearch' has been removed. The \l search modifier can - 'linksearch' has been removed. The \l search modifier can
still be used for this purpose. still be used for this purpose. [b4]
- 'loadplugins' is now a regexplist option rather than - 'loadplugins' is now a regexplist option rather than
a boolean. a boolean. [b2]
- 'mapleader' is now an option rather than a :let - 'mapleader' is now an option rather than a :let
variable. variable.
- 'showstatuslinks' and 'showtabline' are now string options. - 'showstatuslinks' and 'showtabline' are now string options. [b4]
* IMPORTANT: Command script files now use the *.penta file extension. * IMPORTANT: Command script files now use the *.penta file extension.
* IMPORTANT: Plugins are now loaded from the 'plugins/' * IMPORTANT: Plugins are now loaded from the 'plugins/'
directory in 'runtimepath' rather than 'plugin/'. directory in 'runtimepath' rather than 'plugin/'.
* IMPORTANT: Option value quoting has changed. List options will * Option changes:
- IMPORTANT: Option value quoting has changed. List options will
no longer be split at quoted commas and the option name, no longer be split at quoted commas and the option name,
operators, and = sign may no longer be quoted. This will break operators, and = sign may no longer be quoted. This will break
certain automatically-generated configuration files. certain automatically-generated configuration files.
See :help stringlist. See :help stringlist. [b2]
* Option changes:
- Added "bookmarks", "diverted", and "links" to 'activate' - Added "bookmarks", "diverted", and "links" to 'activate'
option. option.
- Added 'altwildmode' and c_<A-Tab> command-line key binding. - Added 'altwildmode' and c_<A-Tab> command-line key binding. [b2]
- Added 'autocomplete' option for specifying which completion - Added 'autocomplete' option for specifying which completion
groups should be auto-completed. groups should be auto-completed. [b2]
- Added 'banghist' option. - Added 'banghist' option. [b1]
- Replaced 'focuscontent' with 'strictfocus'. - Replaced 'focuscontent' with 'strictfocus'. [b1]
- 'complete' now defaults to "slf" but file completion only - 'complete' now defaults to "slf" but file completion only
triggers when the URL begins as above. triggers when the URL begins as above.
- Added 'passkeys' option. - Added 'passkeys' option.
- Changed 'urlseparator' default value to "|". - Changed 'urlseparator' default value to "|".
- Added "passwords" and "venkman" dialogs to :dialog. - Added "passwords" and "venkman" dialogs to :dialog. [b2]
- Added 'wildanchor' option. - Added 'wildanchor' option. [b2]
- Added 'cookies', 'cookieaccept', and 'cookielifetime' options. - Added 'cookies', 'cookieaccept', and 'cookielifetime' options. [b3]
* Added BookmarkChange, BookmarkRemove autocommands. * Added BookmarkChange, BookmarkRemove autocommands. [b2]
* Removed the :source line at the end of files generated by * Removed the :source line at the end of files generated by
:mkpentadactylrc. :mkpentadactylrc. [b2]
* gf now toggles between source and content view. * gf now toggles between source and content view.
The | key binding has been removed. The | key binding has been removed. [b1]
* Page zoom information is now shown in the status bar, and * Page zoom information is now shown in the status bar, and
change in zoom status no longer appears in :messages. change in zoom status no longer appears in :messages. [b1]
* Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR. * Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR. [b1]
* Completion list now behaves better when the multi-line output * Completion list now behaves better when the multi-line output
window is displayed. window is displayed. [b1]
* Major help system improvements: * Major help system improvements:
- Plugins may now provide full-fledged :help documentation. - Plugins may now provide full-fledged :help documentation.
- Add basic plugin authorship documentation. - Add basic plugin authorship documentation. [b1]
- The help system is newly modularized and features significant - The help system is newly modularized and features significant
updates, rewrites, and formatting improvements. updates, rewrites, and formatting improvements. [b1]
- Added <A-F1> to open the single unchunked help page. - Added <A-F1> to open the single unchunked help page. [b5]
* Removed :beep. * Removed :beep. [b2]
* Removed :edit, :tabedit, and :winedit aliases. * Removed :edit, :tabedit, and :winedit aliases. [b2]
* Removed :play. * Removed :play. [b2]