mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 23:57:59 +01:00
move global beep() command to a vimperator slot
This commit is contained in:
@@ -268,7 +268,7 @@ function Commands() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["beep"],
|
addDefaultCommand(new Command(["beep"],
|
||||||
/*vimperator.*/beep,
|
function() { vimperator.beep(); },
|
||||||
{
|
{
|
||||||
usage: ["beep"],
|
usage: ["beep"],
|
||||||
short_help: "Play a system beep"
|
short_help: "Play a system beep"
|
||||||
@@ -930,7 +930,7 @@ function stepInHistory(steps)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
beep();
|
vimperator.beep();
|
||||||
if(index < 0)
|
if(index < 0)
|
||||||
vimperator.echo("Cannot go past beginning of history");
|
vimperator.echo("Cannot go past beginning of history");
|
||||||
else
|
else
|
||||||
@@ -1402,20 +1402,20 @@ function scrollBufferRelative(right, down)
|
|||||||
// beep if we can't go there
|
// beep if we can't go there
|
||||||
if (down > 0)
|
if (down > 0)
|
||||||
{
|
{
|
||||||
if (win.scrollY == win.scrollMaxY) beep();
|
if (win.scrollY == win.scrollMaxY) vimperator.beep();
|
||||||
}
|
}
|
||||||
else if (down < 0)
|
else if (down < 0)
|
||||||
{
|
{
|
||||||
if (win.scrollY == 0) beep();
|
if (win.scrollY == 0) vimperator.beep();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right > 0)
|
if (right > 0)
|
||||||
{
|
{
|
||||||
if (win.scrollX == win.scrollMaxX) beep();
|
if (win.scrollX == win.scrollMaxX) vimperator.beep();
|
||||||
}
|
}
|
||||||
else if (right < 0)
|
else if (right < 0)
|
||||||
{
|
{
|
||||||
if (win.scrollX == 0) beep();
|
if (win.scrollX == 0) vimperator.beep();
|
||||||
}
|
}
|
||||||
|
|
||||||
win.scrollBy(vimperator.input.count * right * 20, vimperator.input.count * down * 20);
|
win.scrollBy(vimperator.input.count * right * 20, vimperator.input.count * down * 20);
|
||||||
@@ -1455,12 +1455,12 @@ function zoom_in(factor)
|
|||||||
if (zoomMgr.textZoom == 25 && factor < 0)
|
if (zoomMgr.textZoom == 25 && factor < 0)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("Minimum zoom level of 25% reached");
|
vimperator.echoerr("Minimum zoom level of 25% reached");
|
||||||
beep();
|
vimperator.beep();
|
||||||
}
|
}
|
||||||
else if (zoomMgr.textZoom == 500 && factor > 0)
|
else if (zoomMgr.textZoom == 500 && factor > 0)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("Maximum zoom level of 500% reached");
|
vimperator.echoerr("Maximum zoom level of 500% reached");
|
||||||
beep();
|
vimperator.beep();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1499,7 +1499,7 @@ function zoom_to(value)
|
|||||||
if (value < 25 || value > 500)
|
if (value < 25 || value > 500)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("Zoom value must be between 25% and 500%");
|
vimperator.echoerr("Zoom value must be between 25% and 500%");
|
||||||
beep();
|
vimperator.beep();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1521,7 +1521,7 @@ function copyToClipboard(str)
|
|||||||
clipboardHelper.copyString(str);
|
clipboardHelper.copyString(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
function beep()
|
Vimperator.prototype.beep = function()
|
||||||
{
|
{
|
||||||
if (!vimperator.options["beep"])
|
if (!vimperator.options["beep"])
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ function Hints() //{{{
|
|||||||
//if (linkCount == 0 && hintmode != HINT_MODE_ALWAYS)
|
//if (linkCount == 0 && hintmode != HINT_MODE_ALWAYS)
|
||||||
if (linkCount == 0 && !vimperator.hasMode(vimperator.modes.ALWAYS_HINT))
|
if (linkCount == 0 && !vimperator.hasMode(vimperator.modes.ALWAYS_HINT))
|
||||||
{
|
{
|
||||||
beep();
|
vimperator.beep();
|
||||||
//alert('h');
|
//alert('h');
|
||||||
this.disableHahMode(win);
|
this.disableHahMode(win);
|
||||||
//alert('g');
|
//alert('g');
|
||||||
|
|||||||
@@ -361,13 +361,13 @@ function CommandLine() //{{{
|
|||||||
if (history_index <= -1)
|
if (history_index <= -1)
|
||||||
{
|
{
|
||||||
history_index = 0;
|
history_index = 0;
|
||||||
beep();
|
vimperator.beep();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (history_index >= history.length + 1)
|
if (history_index >= history.length + 1)
|
||||||
{
|
{
|
||||||
history_index = history.length;
|
history_index = history.length;
|
||||||
beep();
|
vimperator.beep();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ function CommandLine() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
beep();
|
vimperator.beep();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* user pressed TAB to get completions of a command */
|
/* user pressed TAB to get completions of a command */
|
||||||
@@ -416,7 +416,7 @@ function CommandLine() //{{{
|
|||||||
|
|
||||||
if (completions.length == 0)
|
if (completions.length == 0)
|
||||||
{
|
{
|
||||||
beep();
|
vimperator.beep();
|
||||||
// prevent tab from moving to the next field
|
// prevent tab from moving to the next field
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ function Events() //{{{
|
|||||||
// no mapping found, beep()
|
// no mapping found, beep()
|
||||||
if (vimperator.hints.currentState() == 1)
|
if (vimperator.hints.currentState() == 1)
|
||||||
{
|
{
|
||||||
beep();
|
vimperator.beep();
|
||||||
vimperator.hints.disableHahMode();
|
vimperator.hints.disableHahMode();
|
||||||
vimperator.input.buffer = "";
|
vimperator.input.buffer = "";
|
||||||
vimperator.statusline.updateInputBuffer(vimperator.input.buffer);
|
vimperator.statusline.updateInputBuffer(vimperator.input.buffer);
|
||||||
@@ -570,7 +570,7 @@ function Events() //{{{
|
|||||||
var res = vimperator.hints.processEvent(event);
|
var res = vimperator.hints.processEvent(event);
|
||||||
if (res < 0) // error occured processing this key
|
if (res < 0) // error occured processing this key
|
||||||
{
|
{
|
||||||
beep();
|
vimperator.beep();
|
||||||
//if(vimperator.hints.currentMode() == HINT_MODE_QUICK)
|
//if(vimperator.hints.currentMode() == HINT_MODE_QUICK)
|
||||||
if(vimperator.hasMode(vimperator.modes.QUICK_HINT))
|
if(vimperator.hasMode(vimperator.modes.QUICK_HINT))
|
||||||
vimperator.hints.disableHahMode();
|
vimperator.hints.disableHahMode();
|
||||||
@@ -656,7 +656,7 @@ function Events() //{{{
|
|||||||
{
|
{
|
||||||
vimperator.input.buffer = "";
|
vimperator.input.buffer = "";
|
||||||
vimperator.input.pendingMap = null;
|
vimperator.input.pendingMap = null;
|
||||||
beep();
|
vimperator.beep();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vimperator.statusline.updateInputBuffer(vimperator.input.buffer);
|
vimperator.statusline.updateInputBuffer(vimperator.input.buffer);
|
||||||
@@ -1003,7 +1003,7 @@ function Tabs() //{{{
|
|||||||
var index = indexFromSpec(spec, wrap);
|
var index = indexFromSpec(spec, wrap);
|
||||||
if (index === false)
|
if (index === false)
|
||||||
{
|
{
|
||||||
beep(); // XXX: move to ex-handling?
|
vimperator.beep(); // XXX: move to ex-handling?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
getBrowser().mTabContainer.selectedIndex = index;
|
getBrowser().mTabContainer.selectedIndex = index;
|
||||||
|
|||||||
Reference in New Issue
Block a user