mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:27:59 +01:00
experimental new help design
This commit is contained in:
@@ -371,7 +371,7 @@ var g_commands = [/*{{{*/
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
["tabopen", "t", "to", "topen", "tabnew", "tabedit", "tabe"],
|
["tabopen", "t", "to", "topen", "tabnew", "tabedit", "tabe"],
|
||||||
["tabopen [url] [| [url]]"],
|
["tabopen [url] [| url]"],
|
||||||
"Open one or more URLs in a new tab",
|
"Open one or more URLs in a new tab",
|
||||||
"Like <code class=command>:open</code> but open URLs in a new tab.<br/>"+
|
"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.",
|
"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"],
|
["winopen", "w", "wo", "wopen", "winedit", "wine"],
|
||||||
["win[open] [url] [| [url]]"],
|
["win[open] [url] [| url]"],
|
||||||
"Open an URL in a new window",
|
"Open an URL in a new window",
|
||||||
"Not implemented yet",
|
"Not implemented yet",
|
||||||
function () { echo("winopen not yet implemented"); },
|
function () { echo("winopen not yet implemented"); },
|
||||||
@@ -481,8 +481,8 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["B"],
|
["B"],
|
||||||
["B"],
|
["B"],
|
||||||
"Toggle the buffer list with all currently opened tabs.",
|
"Toggle buffer list",
|
||||||
null,
|
"Toggles the display of the buffer list which shows all opened tabs,",
|
||||||
buffer_preview_toggle
|
buffer_preview_toggle
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -561,14 +561,14 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["p", "<MiddleMouse>"],
|
["p", "<MiddleMouse>"],
|
||||||
["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>",
|
"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()); }
|
function(count) { openURLs(readFromClipboard()); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["P"],
|
["P"],
|
||||||
["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/>"+
|
"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.",
|
"Whether the new buffer is activated, depends on the <code class=setting>'activate'</code> setting.",
|
||||||
function(count) { openURLsInNewTab(readFromClipboard(), true); }
|
function(count) { openURLsInNewTab(readFromClipboard(), true); }
|
||||||
@@ -576,15 +576,15 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["r"],
|
["r"],
|
||||||
["r"],
|
["r"],
|
||||||
|
"Reload",
|
||||||
"Forces reloading of the current page.",
|
"Forces reloading of the current page.",
|
||||||
null,
|
|
||||||
function(count) { reload(false); }
|
function(count) { reload(false); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["R"],
|
["R"],
|
||||||
["R"],
|
["R"],
|
||||||
|
"Reload all",
|
||||||
"Forces reloading of all open pages.",
|
"Forces reloading of all open pages.",
|
||||||
null,
|
|
||||||
function(count) { reload(true); }
|
function(count) { reload(true); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -612,35 +612,35 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["y"],
|
["y"],
|
||||||
["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.",
|
"Under UNIX the location is also put into the selection, which can be pasted with the middle mouse button.",
|
||||||
yankCurrentLocation
|
yankCurrentLocation
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["zi", "+"],
|
["zi", "+"],
|
||||||
["zi", "+"],
|
["zi", "+"],
|
||||||
"Zoom in current web page by 25%.",
|
"Zoom in current web page by 25%",
|
||||||
"Currently no count supported.",
|
"Currently no count supported.",
|
||||||
function(count) { zoom_in(1); }
|
function(count) { zoom_in(1); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["zI"],
|
["zI"],
|
||||||
["zI"],
|
["zI"],
|
||||||
"Zoom in current web page by 100%.",
|
"Zoom in current web page by 100%",
|
||||||
"Currently no count supported.",
|
"Currently no count supported.",
|
||||||
function(count) { zoom_in(4); }
|
function(count) { zoom_in(4); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["zo", "-"],
|
["zo", "-"],
|
||||||
["zo", "-"],
|
["zo", "-"],
|
||||||
"Zoom out current web page by 25%.",
|
"Zoom out current web page by 25%",
|
||||||
"Currently no count supported.",
|
"Currently no count supported.",
|
||||||
function(count) { zoom_in(-1); }
|
function(count) { zoom_in(-1); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["zO"],
|
["zO"],
|
||||||
["zO"],
|
["zO"],
|
||||||
"Zoom out current web page by 100%.",
|
"Zoom out current web page by 100%",
|
||||||
"Currently no count supported.",
|
"Currently no count supported.",
|
||||||
function(count) { zoom_in(-4); }
|
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>"],
|
||||||
["<C-b>", "<C-u>", "<PageUp>", "<S-Space>"],
|
["<C-b>"],
|
||||||
"Scroll up a full page of the current document. No count support for now.",
|
"Scroll up a full page of the current document",
|
||||||
null,
|
"No count support for now,",
|
||||||
function(count) { goDoCommand('cmd_scrollPageUp'); }
|
function(count) { goDoCommand('cmd_scrollPageUp'); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["<C-f>", "<C-d>", "<PageDown>", "<Space>"],
|
["<C-f>", "<C-d>", "<PageDown>", "<Space>"],
|
||||||
["<C-f>", "<C-d>", "<PageDown>", "<Space>"],
|
["<C-f>"],
|
||||||
"Scroll down a full page of the current document. No count support for now.",
|
"Scroll down a full page of the current document",
|
||||||
null,
|
"No count support for now,",
|
||||||
function(count) { goDoCommand('cmd_scrollPageDown'); }
|
function(count) { goDoCommand('cmd_scrollPageDown'); }
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -775,15 +775,16 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["gu", "<BackSpace>"],
|
["gu", "<BackSpace>"],
|
||||||
["{count}gu", "{count}<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>",
|
"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
|
goUp
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["gU", "<C-BackSpace>"],
|
["gU", "<C-BackSpace>"],
|
||||||
["gU", "<C-BackSpace>"],
|
["gU", "<C-BackSpace>"],
|
||||||
"Go up one directory component",
|
"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>",
|
"<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("..."); }
|
function(count) { openURLs("..."); }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -80,16 +80,6 @@ function help(section, easter)
|
|||||||
var ret = "";
|
var ret = "";
|
||||||
for (var i=0; i < commands.length; i++)
|
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, "<");
|
|
||||||
cmd_name = cmd_name.replace(/>/g, ">");
|
|
||||||
ret += "<code id='" + commands[i][COMMANDS][j] + "'>" +beg+ cmd_name +end+ '</code>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// the usage information for the command
|
// the usage information for the command
|
||||||
ret += '</td></tr><tr class="description"><td class="usage" valign="top">';
|
ret += '</td></tr><tr class="description"><td class="usage" valign="top">';
|
||||||
for (var j=0; j < commands[i][USAGE].length; j++)
|
for (var j=0; j < commands[i][USAGE].length; j++)
|
||||||
@@ -100,10 +90,11 @@ function help(section, easter)
|
|||||||
usage = usage.replace(/[^b][^r][^\/]>/g, ">");
|
usage = usage.replace(/[^b][^r][^\/]>/g, ">");
|
||||||
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
|
// 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(/(^|;|\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 += "<code>" +beg+ usage +end+ '</code><br/>';
|
||||||
}
|
}
|
||||||
ret += '</td><td>';
|
ret += '</td><td valign="top">';
|
||||||
|
|
||||||
// the actual help text with the first line in bold
|
// the actual help text with the first line in bold
|
||||||
if (commands[i][SHORTHELP])
|
if (commands[i][SHORTHELP])
|
||||||
@@ -121,11 +112,21 @@ function help(section, easter)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret += "Sorry, no help available";
|
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, "<");
|
||||||
|
cmd_name = cmd_name.replace(/>/g, ">");
|
||||||
|
ret += "<code id='" + commands[i][COMMANDS][j] + "'>" +beg+ cmd_name +end+ '</code><br/>';
|
||||||
|
}
|
||||||
ret += '</td></tr>';
|
ret += '</td></tr>';
|
||||||
|
|
||||||
// add more space between entries
|
// add more space between entries
|
||||||
if (i < commands.length-1)
|
if (i < commands.length-1)
|
||||||
ret += '<tr class="seperator"></tr>';
|
ret += '<tr class="separator"><td colspan=3><hr></td></tr>';
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user