mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 08:34:12 +01:00
add a visual bell and replace 'beep' with 'visualbell'
This commit is contained in:
@@ -165,6 +165,11 @@ fieldset.paypal {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#vimperator-visualbell {
|
||||
background-color: blue;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.status_insecure, .status_insecure * {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -280,8 +280,22 @@ const vimperator = (function() //{{{
|
||||
|
||||
beep: function()
|
||||
{
|
||||
if (vimperator.options["beep"])
|
||||
if (!vimperator.options["visualbell"])
|
||||
{
|
||||
sound_service.beep();
|
||||
return;
|
||||
}
|
||||
|
||||
// flash the visual bell
|
||||
var popup = document.getElementById("vimperator-visualbell");
|
||||
var win = document.getElementById("main-window");
|
||||
var box = document.getBoxObjectFor(win);
|
||||
|
||||
popup.height = box.height;
|
||||
popup.width = box.width;
|
||||
popup.showPopup(win, box.screenX, box.screenY, "popup");
|
||||
|
||||
setTimeout(function() { popup.hidePopup(); }, 375);
|
||||
},
|
||||
|
||||
copyToClipboard: function(str)
|
||||
|
||||
@@ -116,6 +116,11 @@ 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>
|
||||
|
||||
<popupset id="vimperator-popupset">
|
||||
<popup id="vimperator-visualbell"/>
|
||||
</popupset>
|
||||
|
||||
</window>
|
||||
</overlay>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user