1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 18:37:58 +01:00

many help fixes

moved echo() -> vimperator.echo() and removed old XUL entries.
This commit is contained in:
Martin Stubenschrott
2007-05-22 09:13:32 +00:00
parent c023c78a35
commit 85e4265848
7 changed files with 70 additions and 105 deletions

View File

@@ -1,6 +1,7 @@
<pre> <pre>
2007-05-02: 2007-05-02:
* version ??? * version ???
* :hardcopy works now and shows the printing dialog
* changed "R" to reload without cache instead of reload all due to popular request * changed "R" to reload without cache instead of reload all due to popular request
* changed secure sites -> green, broken sites -> red in the statusbar * changed secure sites -> green, broken sites -> red in the statusbar
* Vimperator now sets the window title, so it's "vimperator.mozdev.org - * Vimperator now sets the window title, so it's "vimperator.mozdev.org -

20
TODO
View File

@@ -11,31 +11,35 @@ BUGS:
- reload/stop buttons don't update enabled state - reload/stop buttons don't update enabled state
- http://en.wikipedia.org/wiki/Portal:Current_events - 'f' shows more hints than 'F' (on left side of nav bar) - http://en.wikipedia.org/wiki/Portal:Current_events - 'f' shows more hints than 'F' (on left side of nav bar)
- gu and gU don't work on local files properly - gu and gU don't work on local files properly
- dpb| 09:09:56 dpb :: when I save a page with vimperator, it adds <hints
id="hah_hints"></hints> near the end of it.. kinda annoying
dpb| 09:11:50 dpb :: and this happens only when saving the complete
webpage, saving only the html works just fine..
FEATURES: FEATURES:
9 marks of a Location, [m a-zA-Z] to set it, [` a-zA-Z] to go there 9 marks of a Location, [m a-zA-Z] to set it, [` a-zA-Z] to go there
[m 0-9] marks a buffer instead [' 0-9] goes there [m 0-9] marks a buffer instead [' 0-9] goes there
also mark bookmarks (with M[a-zA-Z] maybe and use only lowercase marks for inbuffer marks?) also mark bookmarks (with M[a-zA-Z] maybe and use only lowercase marks for inbuffer marks?)
also support :mark and :marks also support :mark and :marks
8 downloading of links to filesystem (:save <filename>) 8 :map commands to keys
8 provide a buffer on the bottom where more than 1 line messages can be shown, preferrable 8 :command for new commands
with color support (for things like :echo line1\nline2)
8 middleclick in content == p, and if command line is open, paste there the clipboard buffer 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer
8 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist)
8 Use our own find-as-you-type mechanism (like conkeror does) 8 Use our own find-as-you-type mechanism (like conkeror does)
7 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist)
7 provide a buffer on the bottom where more than 1 line messages can be shown, preferrable
with color support (for things like :echo line1\nline2)
7 make hints smarter, not only with characters from from hintchars, but use "NE" or "NP" for 'new posts' e.g. (might be too slow) 7 make hints smarter, not only with characters from from hintchars, but use "NE" or "NP" for 'new posts' e.g. (might be too slow)
7 whereever possible: get rid of dialogs and ask console-like dialog questions or write error prompts directly on the webpage or with :echo() 7 whereever possible: get rid of dialogs and ask console-like dialog questions or write error prompts directly on the webpage or with :echo()
7 :hardcopy -> printing
7 Ctrl-6/Ctrl-^ -> jump to the previously active tab 7 Ctrl-6/Ctrl-^ -> jump to the previously active tab
7 3d should delete 3 tabs 7 3d should delete 3 tabs
6 :map commands to keys 6 downloading of links to filesystem (:save <filename>)
6 autocommands (BrowserStart, BrowserQuit, TabClose, TabOpen, TabChanged, PageLoaded, any more?) 6 autocommands (BrowserStart, BrowserQuit, TabClose, TabOpen, TabChanged, PageLoaded, any more?)
6 vim like mappings for caret mode and textboxes (i to start caret mode?) 6 vim like mappings for caret mode and textboxes (i to start caret mode?)
http://nigel.mcnie.name/gnawt/ has a somewhat working implementation http://nigel.mcnie.name/gnawt/ has a somewhat working implementation
6 pipe selected text/link/website to an external command 6 pipe selected text/link/website to an external command
6 it would be nice to have :(undo|back|forward) <url> w/ tab completion support 6 it would be nice to have :(undo|back|forward) <url> w/ tab completion support
6 macros (qq) 6 macros (qq)
6 support firefox search engines, or at least make our search enginges user configurable
6 gf = view source? 6 gf = view source?
6 make a real one-tab-mode, divert _all_ other targets, possible by setting a firefox option (set popup=0-3) 6 make a real one-tab-mode, divert _all_ other targets, possible by setting a firefox option (set popup=0-3)
6 Shift-Insert in textboxes pastes selection contents 6 Shift-Insert in textboxes pastes selection contents
@@ -43,7 +47,7 @@ FEATURES:
5 Use arrow keys in preview window, and ctrl-w+j/k to switch to from preview window 5 Use arrow keys in preview window, and ctrl-w+j/k to switch to from preview window
5 Sort :open completion by date? (use 'wildsort') 5 Sort :open completion by date? (use 'wildsort')
5 make use of the ] and [ keys to e.g. jump to the next heading ]], next image ]i, previous textbox [t and so on 5 make use of the ] and [ keys to e.g. jump to the next heading ]], next image ]i, previous textbox [t and so on
5 add tag support to adding/deleting bookmarks 5 add tag and keyword support to adding/deleting bookmarks
4 Support multiple top-level windows? 4 Support multiple top-level windows?
3 Splitting Windows with [:sp :vsp ctrl-w,s ctrl-w,v] and closing with [ctrl-w,q], moving with [ctrl-w,w or tab] 3 Splitting Windows with [:sp :vsp ctrl-w,s ctrl-w,v] and closing with [ctrl-w,q], moving with [ctrl-w,w or tab]
have a look into the split browser extension have a look into the split browser extension

View File

@@ -369,10 +369,7 @@ function QM()
{ {
//logObject(vimperator); //logObject(vimperator);
logMessage(vimperator.getpr("complete")); logMessage(vimperator.getpr("complete"));
// var command_widget = document.getElementById('new-vim-commandbar');
// logMessage(command_widget);
//setTimeout(function() {logObject(vimperator)}, 1000);
//Vimperator.echo("test");
this.add = function() { alert('add');}; this.add = function() { alert('add');};
this.rem = function() { vimperator.echo("rem"); logObject(vimperator)}; this.rem = function() { vimperator.echo("rem"); logObject(vimperator)};
this.zoom = function() { vimperator.zoom_to(200); logObject(vimperator)}; this.zoom = function() { vimperator.zoom_to(200); logObject(vimperator)};

View File

@@ -59,8 +59,8 @@ var g_commands = [/*{{{*/
["ba[ck]"], ["ba[ck]"],
["{count}ba[ck][!]"], ["{count}ba[ck][!]"],
"Go back in the browser history", "Go back in the browser history",
"Count is supported, <code>:3back</code> goes back 3 pages in the browser history.<br/>"+ "Count is supported, <code class=\"command\">:3back</code> goes back 3 pages in the browser history.<br/>"+
"The special version <code>:back!</code> goes to the beginning of the browser history.", "The special version <code class=\"command\">:back!</code> goes to the beginning of the browser history.",
function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); }, function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); },
null null
], ],
@@ -68,7 +68,7 @@ var g_commands = [/*{{{*/
["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"], ["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
["{count}bd[elete][!]"], ["{count}bd[elete][!]"],
"Delete current buffer (=tab)", "Delete current buffer (=tab)",
"Count WILL be supported in future releases, then <code class=\"command\">:2bd</code> removes two tabs and the one the right is selected.<br/>Do <code>:bdelete!</code> to select the tab to the left after removing the current tab.", "Count WILL be supported in future releases, then <code class=\"command\">:2bd</code> removes two tabs and the one the right is selected.<br/>Do <code class=\"command\">:bdelete!</code> to select the tab to the left after removing the current tab.",
function (args, special, count) { tab_remove (count, special, 0); }, function (args, special, count) { tab_remove (count, special, 0); },
null null
], ],
@@ -86,7 +86,7 @@ var g_commands = [/*{{{*/
"Add a bookmark", "Add a bookmark",
"If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.<br/>" + "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.<br/>" +
"Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.<br/>" + "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.<br/>" +
"You can omit the optional [url] field, so just do <code>:bmadd</code> to bookmark the currently loaded web page with a default title and without any tags.<br/>" + "You can omit the optional [url] field, so just do <code class=\"command\">:bmadd</code> to bookmark the currently loaded web page with a default title and without any tags.<br/>" +
" -t \"custom title\"<br/>" + " -t \"custom title\"<br/>" +
"The following options will be interpreted in the future:<br/>" + "The following options will be interpreted in the future:<br/>" +
" -T comma,separated,tag,list <br/>"+ " -T comma,separated,tag,list <br/>"+
@@ -109,7 +109,7 @@ var g_commands = [/*{{{*/
["bm[!] [-T] {regexp}"], ["bm[!] [-T] {regexp}"],
"Show bookmarks", "Show bookmarks",
"Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.<br/>" + "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.<br/>" +
"Close this window with <code>:pclose</code> or open entries with double click in the current tab or middle click in a new tab.<br/>" + "Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.<br/>" +
"The following options WILL be interpretted in the future:<br/>" + "The following options WILL be interpretted in the future:<br/>" +
" -T comma,separated,tag,list <br/>", " -T comma,separated,tag,list <br/>",
bmshow, bmshow,
@@ -160,7 +160,7 @@ var g_commands = [/*{{{*/
["exe[cute]"], ["exe[cute]"],
["exe[cute] {expr1} [ ... ]"], ["exe[cute] {expr1} [ ... ]"],
"Execute the string that results from the evaluation of {expr1} as an Ex command.", "Execute the string that results from the evaluation of {expr1} as an Ex command.",
"<code>:execute &#34;echo test&#34;</code> would show a message with the text &#34;test&#34;.<br/>", "<code class=\"command\">:execute &#34;echo test&#34;</code> would show a message with the text &#34;test&#34;.<br/>",
execute, execute,
null null
], ],
@@ -168,8 +168,8 @@ var g_commands = [/*{{{*/
["fo[rward]", "fw"], ["fo[rward]", "fw"],
["{count}fo[rward][!]"], ["{count}fo[rward][!]"],
"Go forward in the browser history", "Go forward in the browser history",
"Count is supported, <code>:3forward</code> goes forward 3 pages in the browser history.<br/>"+ "Count is supported, <code class=\"command\">:3forward</code> goes forward 3 pages in the browser history.<br/>"+
"The special version <code>:forward!</code> goes to the end of the browser history.", "The special version <code class=\"command\">:forward!</code> goes to the end of the browser history.",
function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); },
null null
], ],
@@ -201,7 +201,7 @@ var g_commands = [/*{{{*/
["hist[ory] {filter}"], ["hist[ory] {filter}"],
"Show recently visited URLs", "Show recently visited URLs",
"Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL."+ "Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL."+
"Close this window with <code>:pclose</code> or open entries with double click in the current tab or middle click in a new tab.", "Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.",
hsshow, hsshow,
function(filter) { return get_history_completions(filter); } function(filter) { return get_history_completions(filter); }
], ],
@@ -210,9 +210,9 @@ var g_commands = [/*{{{*/
["javas[cript] {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to <br/> in the help.js code ["javas[cript] {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to <br/> in the help.js code
"Run any javascript command through eval()", "Run any javascript command through eval()",
"Acts as a javascript interpreter by passing the argument to <code>eval()</code>.<br/>" + "Acts as a javascript interpreter by passing the argument to <code>eval()</code>.<br/>" +
"<code>:javascript alert('Hello world')</code> would show a dialog box with the text \"Hello world\".<br/>" + "<code class=\"command\">:javascript alert('Hello world')</code> would show a dialog box with the text \"Hello world\".<br/>" +
"<code>:javascript &lt;&lt;EOF</code> would read all the lines until a line starting with 'EOF' is found, and will <code>eval()</code> them.<br/>" + "<code class=\"command\">:javascript &lt;&lt;EOF</code> would read all the lines until a line starting with 'EOF' is found, and will <code>eval()</code> them.<br/>" +
"The special version <code>:javascript!</code> will open the javascript console of Firefox.", "The special version <code class=\"command\">:javascript!</code> will open the javascript console of Firefox.",
function(args, special) { function(args, special) {
if (special) // open javascript console if (special) // open javascript console
openURLsInNewTab("chrome://global/content/console.xul", true); openURLsInNewTab("chrome://global/content/console.xul", true);
@@ -256,13 +256,13 @@ var g_commands = [/*{{{*/
"and the first word of the token is the name of a search engine (<code class=\"command\">:open wikipedia linus torvalds</code> "+ "and the first word of the token is the name of a search engine (<code class=\"command\">:open wikipedia linus torvalds</code> "+
"will open the wikipedia entry for linux torvalds).</li>"+ "will open the wikipedia entry for linux torvalds).</li>"+
" <li>Opened with the default search engine or keyword (specified with the <code class=\"setting\">'defsearch'</code> setting) "+ " <li>Opened with the default search engine or keyword (specified with the <code class=\"setting\">'defsearch'</code> setting) "+
"if the first word is no search engine (<code>:open linus torvalds</code> will open a google search for linux torvalds).</li>"+ "if the first word is no search engine (<code class=\"command\">:open linus torvalds</code> will open a google search for linux torvalds).</li>"+
" <li>Passed directly to Firefox in all other cases (<code class=\"command\">:open www.osnews.com | www.slashdot.org</code> will "+ " <li>Passed directly to Firefox in all other cases (<code class=\"command\">:open www.osnews.com | www.slashdot.org</code> will "+
"open OSNews in the current, and Slashdot in a new background tab).</li>"+ "open OSNews in the current, and Slashdot in a new background tab).</li>"+
"</ol>"+ "</ol>"+
"You WILL be able to use <code class=\"command\">:open [-T \"linux\"] torvalds&lt;Tab&gt;</code> to complete bookmarks "+ "You WILL be able to use <code class=\"command\">:open [-T \"linux\"] torvalds&lt;Tab&gt;</code> to complete bookmarks "+
"with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<br/>"+ "with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<br/>"+
"The items which are completed on <code>&lt;Tab&gt;</code> are specified in the <code>'complete'</code> option.<br/>"+ "The items which are completed on <code>&lt;Tab&gt;</code> are specified in the <code class=\"setting\">'complete'</code> option.<br/>"+
"Without argument, reloads the current page.<br/>"+ "Without argument, reloads the current page.<br/>"+
"Without argument but with !, reloads the current page skipping the cache.", "Without argument but with !, reloads the current page skipping the cache.",
function(args, special) function(args, special)
@@ -343,12 +343,12 @@ var g_commands = [/*{{{*/
["se[t][!]", "se[t] {option}[?]", "se[t] {option}[+-]={value}"], ["se[t][!]", "se[t] {option}[?]", "se[t] {option}[+-]={value}"],
"Set an option", "Set an option",
"Permanently change an option. In contrast to Vim options are stored throughout sessions.<br/>"+ "Permanently change an option. In contrast to Vim options are stored throughout sessions.<br/>"+
"Boolean options must be set with <code>:set option</code> and <code>:set nooption</code>.<br/>"+ "Boolean options must be set with <code class=\"command\">:set option</code> and <code class=\"command\">:set nooption</code>.<br/>"+
"<code>:set</code> without an argument opens <code>about:config</code> in a new tab to change advanced Firefox options.<br/>"+ "<code class=\"command\">:set</code> without an argument opens <code>about:config</code> in a new tab to change advanced Firefox options.<br/>"+
"<code>:set!</code> opens the GUI preference panel from Firefox in a new tab.<br/>"+ "<code class=\"command\">:set!</code> opens the GUI preference panel from Firefox in a new tab.<br/>"+
"<code>:set option?</code> or <code>:set option</code> shows the current value of the option.<br/>"+ "<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code> shows the current value of the option.<br/>"+
"<code>:set option&amp;</code> resets 'option' to the default value.<br/>"+ "<code class=\"command\">:set option&amp;</code> resets 'option' to the default value.<br/>"+
"<code>:set option+=foo</code> and <code>:set option-=foo</code> WILL add/remove foo from list options.<br/>", "<code class=\"command\">:set option+=foo</code> and <code class=\"command\">:set option-=foo</code> WILL add/remove foo from list options.<br/>",
set, set,
function(filter) { return get_settings_completions(filter); } function(filter) { return get_settings_completions(filter); }
], ],
@@ -455,7 +455,7 @@ var g_commands = [/*{{{*/
[ [
["qmarkd[el]", "qmd[el]"], ["qmarkd[el]", "qmd[el]"],
["qmarkd[el] {a-zA-Z0-9}"], ["qmarkd[el] {a-zA-Z0-9}"],
"Remove a marked URL" + "Remove a marked URL",
"Not implemented yet.", "Not implemented yet.",
function(args) { set_url_mark("mark", "url"); }, // FIXME function(args) { set_url_mark("mark", "url"); }, // FIXME
function(filter) { return [["a", ""], ["b", ""]]; } function(filter) { return [["a", ""], ["b", ""]]; }
@@ -1176,7 +1176,7 @@ function execute_command(count, cmd, special, args, modifiers) // {{{
if (command[FUNCTION] === null) if (command[FUNCTION] === null)
{ {
echoerr("E666: Internal error: command[FUNCTION] === null"); vimperator.echoerr("E666: Internal error: command[FUNCTION] === null");
return; return;
} }
@@ -1240,37 +1240,6 @@ function execute(string)
return execute_command.apply(this, tokens); return execute_command.apply(this, tokens);
} }
////////////////////////////////////////////////////////////////////////
// statusbar/commandbar handling ////////////////////////////////// {{{1
////////////////////////////////////////////////////////////////////////
function echo(msg)
{
/* In Mozilla, the XUL textbox is implemented as a wrapper around an HTML
* input element. The read only property '.inputField' holds a reference to this inner
* input element. */
var bar = command_line.inputField;
var focused = document.commandDispatcher.focusedElement;
if (focused && focused == bar)
return;
bar.setAttribute("style","font-family: monospace;");
bar.value = msg;
}
function echoerr(msg)
{
/* In Mozilla, the XUL textbox is implemented as a wrapper around an HTML
* input element. The read only property '.inputField' holds a reference to this inner
* input element. */
var bar = command_line.inputField;
var focused = document.commandDispatcher.focusedElement;
if (focused && focused == bar)
return;
bar.setAttribute("style", "font-family: monospace; color:white; background-color:red; font-weight: bold");
bar.value = msg;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// navigation functions /////////////////////////////////////////// {{{1 // navigation functions /////////////////////////////////////////// {{{1
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@@ -1285,9 +1254,9 @@ function stepInHistory(steps)
{ {
beep(); beep();
if(index < 0) if(index < 0)
echo("Cannot go past beginning of history"); vimperator.echo("Cannot go past beginning of history");
else else
echo("Cannot go past end of history"); vimperator.echo("Cannot go past end of history");
} }
} }
function historyGoToBeginning() function historyGoToBeginning()
@@ -1295,7 +1264,7 @@ function historyGoToBeginning()
var index = getWebNavigation().sessionHistory.index; var index = getWebNavigation().sessionHistory.index;
if (index == 0) if (index == 0)
{ {
echo("Already at beginning of history"); vimperator.echo("Already at beginning of history");
return; return;
} }
getWebNavigation().gotoIndex(0); getWebNavigation().gotoIndex(0);
@@ -1306,7 +1275,7 @@ function historyGoToEnd()
var max = getWebNavigation().sessionHistory.count -1; var max = getWebNavigation().sessionHistory.count -1;
if (index == max) if (index == max)
{ {
echo("Already at end of history"); vimperator.echo("Already at end of history");
return; return;
} }
getWebNavigation().gotoIndex(max); getWebNavigation().gotoIndex(max);
@@ -1457,7 +1426,7 @@ function focusNextFrame(count)
var frames = window.content.frames; var frames = window.content.frames;
if (frames.length == 0) if (frames.length == 0)
{ {
echo("No frames found"); vimperator.echo("No frames found");
beep(); beep();
return; return;
} }
@@ -1530,7 +1499,7 @@ function yankCurrentLocation()
{ {
var loc = getCurrentLocation(); var loc = getCurrentLocation();
copyToClipboard(loc); copyToClipboard(loc);
echo("Yanked " + loc); vimperator.echo("Yanked " + loc);
} }
// return null, if no link with a href focused // return null, if no link with a href focused
@@ -1816,12 +1785,12 @@ function zoom_in(factor)
var zoomMgr = ZoomManager.prototype.getInstance(); var zoomMgr = ZoomManager.prototype.getInstance();
if (zoomMgr.textZoom == 25 && factor < 0) if (zoomMgr.textZoom == 25 && factor < 0)
{ {
echoerr("Minimum zoom level of 25% reached"); vimperator.echoerr("Minimum zoom level of 25% reached");
beep(); beep();
} }
else if (zoomMgr.textZoom == 500 && factor > 0) else if (zoomMgr.textZoom == 500 && factor > 0)
{ {
echoerr("Maximum zoom level of 500% reached"); vimperator.echoerr("Maximum zoom level of 500% reached");
beep(); beep();
} }
else else
@@ -1834,7 +1803,7 @@ function zoom_in(factor)
hah.reshowHints(); hah.reshowHints();
echo("Zoom value: " + value + "%"); vimperator.echo("Zoom value: " + value + "%");
} }
} }
@@ -1853,14 +1822,14 @@ Vimperator.prototype.zoom_to = function(value)
value = parseInt(oldval, 10); value = parseInt(oldval, 10);
if (isNaN(value)) if (isNaN(value))
{ {
echoerr("Cannot convert " + oldval + " to a number"); vimperator.echoerr("Cannot convert " + oldval + " to a number");
return; return;
} }
} }
if (value < 25 || value > 500) if (value < 25 || value > 500)
{ {
echoerr("Zoom value must be between 25% and 500%"); vimperator.echoerr("Zoom value must be between 25% and 500%");
beep(); beep();
return; return;
} }
@@ -1869,7 +1838,7 @@ Vimperator.prototype.zoom_to = function(value)
hah.reshowHints(); hah.reshowHints();
echo("Zoom value: " + value + "%"); vimperator.echo("Zoom value: " + value + "%");
} }
@@ -1895,7 +1864,7 @@ function beep()
if (gBeepService) if (gBeepService)
gBeepService.beep(); gBeepService.beep();
else else
echoerr('no beep service found'); vimperator.echoerr('no beep service found');
} }
// quit vimperator, no matter how many tabs/windows are open // quit vimperator, no matter how many tabs/windows are open
@@ -1969,7 +1938,7 @@ function set(args, special)
var matches = args.match(/^\s*(no)?([a-z]+)(\?|&)?(([+-])?=(.*))?/); var matches = args.match(/^\s*(no)?([a-z]+)(\?|&)?(([+-])?=(.*))?/);
if (!matches) if (!matches)
{ {
echoerr("E518: Unknown option: " + args); vimperator.echoerr("E518: Unknown option: " + args);
return; return;
} }
@@ -1978,7 +1947,7 @@ function set(args, special)
var setting = get_setting(opt); var setting = get_setting(opt);
if (!setting) if (!setting)
{ {
echoerr("E518: Unknown option: " + opt); vimperator.echoerr("E518: Unknown option: " + opt);
return; return;
} }
@@ -1998,7 +1967,7 @@ function set(args, special)
else if (get) else if (get)
{ {
var cur_val = setting[GETFUNC].call(this); var cur_val = setting[GETFUNC].call(this);
echo(" " + setting[COMMANDS][0] + "=" + cur_val); vimperator.echo(" " + setting[COMMANDS][0] + "=" + cur_val);
} }
// write access // write access
else else
@@ -2012,14 +1981,14 @@ function set(args, special)
{ {
var num = parseInt(val, 10); var num = parseInt(val, 10);
if (isNaN(num)) if (isNaN(num))
echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number"); vimperator.echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number");
else else
{ {
var cur_val = setting[GETFUNC].call(this); var cur_val = setting[GETFUNC].call(this);
if (oper == '+') num = cur_val + num; if (oper == '+') num = cur_val + num;
if (oper == '-') num = cur_val - num; if (oper == '-') num = cur_val - num;
if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, num) == false) if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, num) == false)
echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
else // all checks passed, execute option handler else // all checks passed, execute option handler
setting[SETFUNC].call(this, num); setting[SETFUNC].call(this, num);
} }
@@ -2044,12 +2013,12 @@ function set(args, special)
} }
} }
if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, val) == false) if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, val) == false)
echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details"); vimperator.echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
else // all checks passed, execute option handler else // all checks passed, execute option handler
setting[SETFUNC].call(this, val); setting[SETFUNC].call(this, val);
} }
else else
echoerr("Internal error, option format `" + type + "' not supported"); vimperator.echoerr("Internal error, option format `" + type + "' not supported");
} }
} }
} }
@@ -2078,7 +2047,7 @@ function source(filename, silent)
catch(e) catch(e)
{ {
if(!silent) if(!silent)
echoerr(e); vimperator.echoerr(e);
} }
} }

View File

@@ -56,7 +56,7 @@ function CommandLine ()
const UNINITIALIZED = -2; // notifies us, if we need to start history/tab-completion from the beginning const UNINITIALIZED = -2; // notifies us, if we need to start history/tab-completion from the beginning
const HISTORY_SIZE = 500; const HISTORY_SIZE = 500;
var completionlist = new InformationList("vim-completion", { min_items: 2, max_items: 10 }); var completionlist = new InformationList("vimperator-completion", { min_items: 2, max_items: 10 });
var completions = new Array(); var completions = new Array();
var history = new Array(); var history = new Array();
@@ -72,9 +72,9 @@ function CommandLine ()
var completion_index = UNINITIALIZED; var completion_index = UNINITIALIZED;
// The prompt for the current command, for example : or /. Can be blank // The prompt for the current command, for example : or /. Can be blank
var prompt_widget = document.getElementById('new-vim-commandbar-prompt'); var prompt_widget = document.getElementById('vimperator-commandline-prompt');
// The command bar which contains the current command // The command bar which contains the current command
var command_widget = document.getElementById('new-vim-commandbar'); var command_widget = document.getElementById('vimperator-commandline-command');
// load the history // load the history
var hist = get_pref("commandline_history", ""); var hist = get_pref("commandline_history", "");

View File

@@ -179,8 +179,8 @@ function init()
Vimperator.prototype.qm = new QM; Vimperator.prototype.qm = new QM;
// Vimperator.prototype.commandline = new CommandLine; // Vimperator.prototype.commandline = new CommandLine;
Vimperator.prototype.search = new Search; Vimperator.prototype.search = new Search;
Vimperator.prototype.previewwindow = new InformationList("vimperator-preview-window", { incremental_fill: false, max_items: 10 }); Vimperator.prototype.previewwindow = new InformationList("vimperator-previewwindow", { incremental_fill: false, max_items: 10 });
Vimperator.prototype.bufferwindow = new InformationList("vimperator-buffer-window", { incremental_fill: false, max_items: 10 }); Vimperator.prototype.bufferwindow = new InformationList("vimperator-bufferwindow", { incremental_fill: false, max_items: 10 });
Vimperator.prototype.statusline = new StatusLine(); Vimperator.prototype.statusline = new StatusLine();
Vimperator.prototype.tabs = new Tabs(); Vimperator.prototype.tabs = new Tabs();
@@ -190,7 +190,7 @@ function init()
//vimperator.registerCallback("complete", vimperator.modes.EX, function(str) { return moo();; } ); //vimperator.registerCallback("complete", vimperator.modes.EX, function(str) { return moo();; } );
//status_line = document.getElementById("vim-statusbar"); //status_line = document.getElementById("vim-statusbar");
command_line = document.getElementById("vim-commandbar"); command_line = document.getElementById("vimperator-commandline");
// Setup our main status handler - from browser.js // Setup our main status handler - from browser.js
// this function reacts to status bar and url changes which are sent from the mozilla core // this function reacts to status bar and url changes which are sent from the mozilla core

View File

@@ -51,8 +51,8 @@ the terms of any one of the MPL, the GPL or the LGPL.
<window id="main-window"> <window id="main-window">
<toolbar id="vimperator-toolbar" hidden="false" align="center" fullscreentoolbar="true"> <toolbar id="vimperator-toolbar" hidden="false" align="center" fullscreentoolbar="true">
<vbox id="vim-container" flex="1" hidden="false"> <vbox id="vimperator-container" flex="1" hidden="false">
<listbox id="vimperator-buffer-window" class="plain" rows="10" flex="1" hidden="true" <listbox id="vimperator-bufferwindow" class="plain" rows="10" flex="1" hidden="true"
onclick= "vimperator.bufferwindow.onEvent(event);" onclick= "vimperator.bufferwindow.onEvent(event);"
ondblclick="vimperator.bufferwindow.onEvent(event);" ondblclick="vimperator.bufferwindow.onEvent(event);"
onkeydown= "vimperator.bufferwindow.onEvent(event);" onkeydown= "vimperator.bufferwindow.onEvent(event);"
@@ -63,7 +63,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
</listcols> </listcols>
</listbox> </listbox>
<listbox id="vimperator-preview-window" class="plain" rows="10" flex="1" hidden="true" <listbox id="vimperator-previewwindow" class="plain" rows="10" flex="1" hidden="true"
onclick= "vimperator.previewwindow.onEvent(event);" onclick= "vimperator.previewwindow.onEvent(event);"
ondblclick="vimperator.previewwindow.onEvent(event);" ondblclick="vimperator.previewwindow.onEvent(event);"
onkeydown= "vimperator.previewwindow.onEvent(event);" onkeydown= "vimperator.previewwindow.onEvent(event);"
@@ -82,7 +82,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
<label class="plain" id="vimperator-statusline-field-bufferposition" flex="0" style="font-family: monospace; padding: 0px 0px 0px 8px"/> <label class="plain" id="vimperator-statusline-field-bufferposition" flex="0" style="font-family: monospace; padding: 0px 0px 0px 8px"/>
</hbox> </hbox>
<listbox id="vim-completion" class="plain" rows="1" flex="1" hidden="true" <listbox id="vimperator-completion" class="plain" rows="1" flex="1" hidden="true"
style="font-family: monospace; -moz-user-focus:ignore; -moz-user-select:ignore; overflow:-moz-scrollbars-none;"> style="font-family: monospace; -moz-user-focus:ignore; -moz-user-select:ignore; overflow:-moz-scrollbars-none;">
<listcols> <listcols>
<listcol flex="1" width="50%"/> <listcol flex="1" width="50%"/>
@@ -90,16 +90,10 @@ the terms of any one of the MPL, the GPL or the LGPL.
</listcols> </listcols>
</listbox> </listbox>
<hbox id="vim-commandbar-container" flex="1" hidden="true" style="-moz-user-focus:ignore;"> <hbox id="vimperator-commandline" flex="1" hidden="false" style="-moz-user-focus:ignore;">
<textbox class="plain" id="vim-commandbar-prompt" flex="0" crop="right" value="" collapsed="true" size="1" <textbox class="plain" id="vimperator-commandline-prompt" flex="0" crop="right" value="" collapsed="true"
readonly="true" style="font-family: monospace; background-color: transparent; -moz-user-focus:ignore;"/>
<textbox class="plain" id="vim-commandbar" flex="1" hidden="false" type="timed" timeout="100"
style="font-family: monospace"/>
</hbox>
<hbox id="new-vim-commandbar-container" flex="1" hidden="false" style="-moz-user-focus:ignore;">
<textbox class="plain" id="new-vim-commandbar-prompt" flex="0" crop="right" value="" collapsed="true"
readonly="true" style="font-family: monospace; background-color:white; -moz-user-focus:ignore;"/> readonly="true" style="font-family: monospace; background-color:white; -moz-user-focus:ignore;"/>
<textbox class="plain" id="new-vim-commandbar" flex="1" hidden="false" type="timed" timeout="100" <textbox class="plain" id="vimperator-commandline-command" flex="1" hidden="false" type="timed" timeout="100"
onkeypress="vimperator.commandline.onEvent(event);" onkeypress="vimperator.commandline.onEvent(event);"
oninput="vimperator.commandline.onEvent(event);" oninput="vimperator.commandline.onEvent(event);"
onblur="vimperator.commandline.onEvent(event);" style="font-family: monospace"/> onblur="vimperator.commandline.onEvent(event);" style="font-family: monospace"/>