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

experimental new help design

This commit is contained in:
Martin Stubenschrott
2007-04-29 01:48:03 +00:00
parent 92c863442d
commit 3a72a70bcb
2 changed files with 37 additions and 35 deletions

View File

@@ -371,7 +371,7 @@ var g_commands = [/*{{{*/
],
[
["tabopen", "t", "to", "topen", "tabnew", "tabedit", "tabe"],
["tabopen [url] [| [url]]"],
["tabopen [url] [| url]"],
"Open one or more URLs in a new tab",
"Like <code class=command>:open</code> but open URLs in a new tab.<br/>"+
"If used with !, the 'tabopen' value of the 'activate' setting is negated.",
@@ -428,7 +428,7 @@ var g_commands = [/*{{{*/
],
[
["winopen", "w", "wo", "wopen", "winedit", "wine"],
["win[open] [url] [| [url]]"],
["win[open] [url] [| url]"],
"Open an URL in a new window",
"Not implemented yet",
function () { echo("winopen not yet implemented"); },
@@ -481,8 +481,8 @@ var g_mappings = [/*{{{*/
[
["B"],
["B"],
"Toggle the buffer list with all currently opened tabs.",
null,
"Toggle buffer list",
"Toggles the display of the buffer list which shows all opened tabs,",
buffer_preview_toggle
],
[
@@ -561,14 +561,14 @@ var g_mappings = [/*{{{*/
[
["p", "<MiddleMouse>"],
["p", "<MiddleMouse>"],
"Open (put) an URL based on the current Clipboard contents in the current buffer",
"Open (put) an URL based on the current clipboard contents in the current buffer",
"You can also just select some non-URL text, and search for it with the default search engine with <code class=mapping>p</code>",
function(count) { openURLs(readFromClipboard()); }
],
[
["P"],
["P"],
"Open (put) an URL based on the current Clipboard contents in a new buffer",
"Open (put) an URL based on the current clipboard contents in a new buffer",
"Works like <code class=mapping>p</code>, but opens a new tab.<br/>"+
"Whether the new buffer is activated, depends on the <code class=setting>'activate'</code> setting.",
function(count) { openURLsInNewTab(readFromClipboard(), true); }
@@ -576,15 +576,15 @@ var g_mappings = [/*{{{*/
[
["r"],
["r"],
"Reload",
"Forces reloading of the current page.",
null,
function(count) { reload(false); }
],
[
["R"],
["R"],
"Reload all",
"Forces reloading of all open pages.",
null,
function(count) { reload(true); }
],
[
@@ -612,35 +612,35 @@ var g_mappings = [/*{{{*/
[
["y"],
["y"],
"Yank current location to the Clipboard",
"Yank current location to the clipboard",
"Under UNIX the location is also put into the selection, which can be pasted with the middle mouse button.",
yankCurrentLocation
],
[
["zi", "+"],
["zi", "+"],
"Zoom in current web page by 25%.",
"Zoom in current web page by 25%",
"Currently no count supported.",
function(count) { zoom_in(1); }
],
[
["zI"],
["zI"],
"Zoom in current web page by 100%.",
"Zoom in current web page by 100%",
"Currently no count supported.",
function(count) { zoom_in(4); }
],
[
["zo", "-"],
["zo", "-"],
"Zoom out current web page by 25%.",
"Zoom out current web page by 25%",
"Currently no count supported.",
function(count) { zoom_in(-1); }
],
[
["zO"],
["zO"],
"Zoom out current web page by 100%.",
"Zoom out current web page by 100%",
"Currently no count supported.",
function(count) { zoom_in(-4); }
],
@@ -730,16 +730,16 @@ var g_mappings = [/*{{{*/
],
[
["<C-b>", "<C-u>", "<PageUp>", "<S-Space>"],
["<C-b>", "<C-u>", "<PageUp>", "<S-Space>"],
"Scroll up a full page of the current document. No count support for now.",
null,
["<C-b>"],
"Scroll up a full page of the current document",
"No count support for now,",
function(count) { goDoCommand('cmd_scrollPageUp'); }
],
[
["<C-f>", "<C-d>", "<PageDown>", "<Space>"],
["<C-f>", "<C-d>", "<PageDown>", "<Space>"],
"Scroll down a full page of the current document. No count support for now.",
null,
["<C-f>"],
"Scroll down a full page of the current document",
"No count support for now,",
function(count) { goDoCommand('cmd_scrollPageDown'); }
],
@@ -775,15 +775,16 @@ var g_mappings = [/*{{{*/
[
["gu", "<BackSpace>"],
["{count}gu", "{count}<BackSpace>"],
"Go up one directory component",
"Go to parent directory",
"Count is supported, <code class=mapping>2gu</code> on <code>http://www.example.com/dir1/dir2/file.htm</code> would open <code>http://www.example.com/dir1/</code>",
goUp
],
[
["gU", "<C-BackSpace>"],
["gU", "<C-BackSpace>"],
"Go up one directory component",
"<code class=mapping>gU</code> on <code>http://www.example.com/dir1/dir2/file.htm</code> opens <code>http://www.example.com/</code>",
"Go to the root of the website",
"<code class=mapping>gU</code> on <code>http://www.example.com/dir1/dir2/file.htm</code> opens <code>http://www.example.com/</code>.<br/>"+
"When browsing a local directory, it goes to the root document.",
function(count) { openURLs("..."); }
],

View File

@@ -80,16 +80,6 @@ function help(section, easter)
var ret = "";
for (var i=0; i < commands.length; i++)
{
// the tags which are printed on the top right
ret += '<tr class="tag"><td colspan="2">';
for (var j=0; j < commands[i][COMMANDS].length; j++)
{
var cmd_name = commands[i][COMMANDS][j];
cmd_name = cmd_name.replace(/</g, "&lt;");
cmd_name = cmd_name.replace(/>/g, "&gt;");
ret += "<code id='" + commands[i][COMMANDS][j] + "'>" +beg+ cmd_name +end+ '</code>';
}
// the usage information for the command
ret += '</td></tr><tr class="description"><td class="usage" valign="top">';
for (var j=0; j < commands[i][USAGE].length; j++)
@@ -100,10 +90,11 @@ function help(section, easter)
usage = usage.replace(/[^b][^r][^\/]>/g, "&gt;");
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=argument>$2</span>");
//usage = usage.replace(/(\s)({|\[)(.*)(\]|})(.*)/g, "<span class=argument>$1$2$3$4$5</span>");
// and the 'setting' in a different color
usage = usage.replace(/^'(\w+)'/gm, "'<span class=setting>$1</span>'");
ret += "<code>" +beg+ usage +end+ '</code><br/>';
}
ret += '</td><td>';
ret += '</td><td valign="top">';
// the actual help text with the first line in bold
if (commands[i][SHORTHELP])
@@ -121,11 +112,21 @@ function help(section, easter)
}
else
ret += "Sorry, no help available";
// the tags which are printed on the top right
//ret += '<tr class="tag"><td colspan="1">====================================';
ret += '<td class="tag" valign="top">';
for (var j=0; j < commands[i][COMMANDS].length; j++)
{
var cmd_name = commands[i][COMMANDS][j];
cmd_name = cmd_name.replace(/</g, "&lt;");
cmd_name = cmd_name.replace(/>/g, "&gt;");
ret += "<code id='" + commands[i][COMMANDS][j] + "'>" +beg+ cmd_name +end+ '</code><br/>';
}
ret += '</td></tr>';
// add more space between entries
if (i < commands.length-1)
ret += '<tr class="seperator"></tr>';
ret += '<tr class="separator"><td colspan=3><hr></td></tr>';
}
return ret;
}