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

added a visual bell and replaced the 'beep' option with 'visualbell'

This commit is contained in:
Doug Kearns
2007-09-08 09:50:33 +00:00
parent 635b6258c1
commit eb26d2cdc3
6 changed files with 36 additions and 9 deletions

View File

@@ -163,6 +163,10 @@ fieldset.paypal {
overflow: hidden;
}
#vimperator-visualbell {
background-color: black;
}
.status_insecure, .status_insecure * {
background-color: transparent;
}

View File

@@ -80,7 +80,7 @@ function Events() //{{{
function enterPopupMode(event)
{
if (event.originalTarget.localName == "tooltip")
if (event.originalTarget.localName == "tooltip" || event.originalTarget.id == "vimperator-visualbell")
return;
vimperator.addMode(null, vimperator.modes.MENU);

View File

@@ -343,12 +343,6 @@ function Options() //{{{
default_value: "homepage,quickmark,tabopen,paste"
}
));
addOption(new Option(["beep"], "boolean",
{
short_help: "Emit a pc speaker beep on certain errors",
default_value: true
}
));
addOption(new Option(["complete", "cpt"], "charlist",
{
short_help: "Items which are completed at the :[tab]open prompt",
@@ -547,6 +541,12 @@ function Options() //{{{
validator: function (value) { if (value >= 0 && value <= 9) return true; else return false; }
}
));
addOption(new Option(["visualbell", "vb"], "boolean",
{
short_help: "Use visual bell instead of beeping on errors",
default_value: false
}
));
addOption(new Option(["wildmode", "wim"], "stringlist",
{
short_help: "Define how command line completion works",

View File

@@ -280,8 +280,26 @@ const vimperator = (function() //{{{
beep: function()
{
if (vimperator.options["beep"])
if (vimperator.options["visualbell"])
{
// flash the visual bell
var vbell = document.getElementById("vimperator-visualbell");
var box = getBrowser().mPanelContainer.boxObject;
vbell.style.position = "fixed";
vbell.style.height = box.height + "px";
vbell.style.width = box.width + "px";
vbell.style.left = box.x + "px";
vbell.style.top = box.y + "px";
vbell.hidden = false
setTimeout(function() { vbell.hidden = true; }, 50); // may as well be 0 ;-)
}
else
{
sound_service.beep();
}
},
copyToClipboard: function(str)

View File

@@ -102,7 +102,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
</hbox>
<iframe id="vimperator-multiline-output" src="about:blank" flex="1" height="10px" hidden="false" collapsed="true"
onkeypress="vimperator.commandline.onMultilineOutputEvent(event)"/>
onkeypress="vimperator.commandline.onMultilineOutputEvent(event)"/>
<textbox id="vimperator-multiline-input" class="plain" flex="1" rows="10" hidden="false" collapsed="true" multiline="true"
onkeypress="vimperator.commandline.onMultilineInputEvent(event);"
@@ -116,6 +116,10 @@ the terms of any one of the MPL, the GPL or the LGPL.
<key id="key_stop" keycode="VK_ESCAPE" oncommand="vimperator.events.onEscape();"/>
<!-- other keys are handled inside vimperator.js event loop -->
</keyset>
<!-- TODO: move to browser-stack? -->
<box id="vimperator-visualbell" hidden="true"/>
</window>
</overlay>