diff --git a/NEWS b/NEWS index 40b88a96..47a19f43 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@
2007-XX-XX:
* version 0.5.2
+ * added a visual bell and replaced 'beep' with 'visualbell'
* added 'hlsearch','incsearch', 'ignorecase' and 'smartcase' options
2007-09-03:
diff --git a/chrome/content/vimperator/default.css b/chrome/content/vimperator/default.css
index 458c1194..6e370cc0 100644
--- a/chrome/content/vimperator/default.css
+++ b/chrome/content/vimperator/default.css
@@ -163,6 +163,10 @@ fieldset.paypal {
overflow: hidden;
}
+#vimperator-visualbell {
+ background-color: black;
+}
+
.status_insecure, .status_insecure * {
background-color: transparent;
}
diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js
index 7a23fe11..2cba982a 100644
--- a/chrome/content/vimperator/events.js
+++ b/chrome/content/vimperator/events.js
@@ -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);
diff --git a/chrome/content/vimperator/options.js b/chrome/content/vimperator/options.js
index f52b370e..4894440d 100644
--- a/chrome/content/vimperator/options.js
+++ b/chrome/content/vimperator/options.js
@@ -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",
diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js
index 30e62fb0..811895df 100644
--- a/chrome/content/vimperator/vimperator.js
+++ b/chrome/content/vimperator/vimperator.js
@@ -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)
diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul
index 20463c1e..613fc9d4 100644
--- a/chrome/content/vimperator/vimperator.xul
+++ b/chrome/content/vimperator/vimperator.xul
@@ -102,7 +102,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
+ onkeypress="vimperator.commandline.onMultilineOutputEvent(event)"/>
+
+
+
+