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

add a visual bell and replace 'beep' with 'visualbell'

This commit is contained in:
Doug Kearns
2007-09-05 18:49:26 +00:00
parent 517dea72e1
commit 908124ce22
7 changed files with 38 additions and 13 deletions

1
NEWS
View File

@@ -1,6 +1,7 @@
<pre>
2007-xx-xx:
* version 0.6
* added a visual bell and replaced 'beep' with 'visualbell'
* added vimperator logo (can be seen in the addons manager)
* added 'hlsearch','incsearch', 'ignorecase' and 'smartcase' options

View File

@@ -165,6 +165,11 @@ fieldset.paypal {
overflow: hidden;
}
#vimperator-visualbell {
background-color: blue;
opacity: 0.5;
}
.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,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)

View File

@@ -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>

View File

@@ -29,11 +29,11 @@ syn keyword vimperatorCommand addo[ns] ba[ck] bd[elete] bw[ipeout] bun[load] tab
syn match vimperatorCommandWrapper "\<\h\w*\>" contains=vimperatorCommand
syn region vimperatorSet matchgroup=vimperatorCommand start="\<set\=\>" end="$" keepend oneline contains=vimperatorOption
syn keyword vimperatorOption activate beep nobeep beep complete cpt defsearch ds extendedhinttags eht focusedhintstyle fhs
\ fullscreen fs nofullscreen nofs guioptions go hintchars hc hintstyle hs hinttags incsearch is noincsearch nois
\ ignorecase ic noignorecase noic maxhints mh preload nopreload previewheight pvh showmode smd noshowmode nosmd
\ showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs titlestring usermode um nousermode noum verbose
\ vbs wildmode wim wildoptions wop
syn keyword vimperatorOption activate act complete cpt defsearch ds extendedhinttags eht focusedhintstyle fhs fullscreen fs
\ nofullscreen nofs guioptions go hintchars hc hintstyle hs hinttags incsearch is noincsearch nois ignorecase ic
\ noignorecase noic maxhints mh preload nopreload previewheight pvh showmode smd noshowmode nosmd showstatuslinks ssli
\ showtabline stal smartcase scs nosmartcase noscs titlestring usermode um nousermode noum verbose vbs visualbell vb
\ wildmode wim wildoptions wop
\ contained
syn region vimperatorJavascript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline