mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 22:12:25 +01:00
Fix the visual bell
This commit is contained in:
@@ -864,7 +864,7 @@ liberator.Completion = function () //{{{
|
|||||||
{
|
{
|
||||||
if (h[0].indexOf(begin) == 0 && (!end.length || h[0].substr(-end.length) == end))
|
if (h[0].indexOf(begin) == 0 && (!end.length || h[0].substr(-end.length) == end))
|
||||||
{
|
{
|
||||||
let query = h[0].substr(begin.length, h[0].length - end.length);
|
let query = h[0].substring(begin.length, h[0].length - end.length);
|
||||||
searches.push([decodeURIComponent(query),
|
searches.push([decodeURIComponent(query),
|
||||||
<>{begin}<span class="hl-Filter">{query}</span>{end}</>,
|
<>{begin}<span class="hl-Filter">{query}</span>{end}</>,
|
||||||
k[2]]);
|
k[2]]);
|
||||||
|
|||||||
@@ -603,18 +603,17 @@ const liberator = (function () //{{{
|
|||||||
if (liberator.options["visualbell"])
|
if (liberator.options["visualbell"])
|
||||||
{
|
{
|
||||||
// flash the visual bell
|
// flash the visual bell
|
||||||
var popup = document.getElementById("liberator-visualbell");
|
let popup = document.getElementById("liberator-visualbell");
|
||||||
var win = liberator.config.visualbellWindow;
|
let win = liberator.config.visualbellWindow;
|
||||||
var box = document.getBoxObjectFor(win);
|
let box = document.getBoxObjectFor(win);
|
||||||
|
|
||||||
popup.height = box.height;
|
|
||||||
popup.width = box.width;
|
|
||||||
popup.openPopup(win, "overlap", 0, 0, false, false);
|
popup.openPopup(win, "overlap", 0, 0, false, false);
|
||||||
setTimeout(function () { popup.hidePopup(); }, 50);
|
popup.sizeTo(box.width - 2, box.height - 2);
|
||||||
|
setTimeout(function () { popup.hidePopup(); }, 20);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var soundService = Components.classes["@mozilla.org/sound;1"]
|
let soundService = Components.classes["@mozilla.org/sound;1"]
|
||||||
.getService(Components.interfaces.nsISound);
|
.getService(Components.interfaces.nsISound);
|
||||||
soundService.beep();
|
soundService.beep();
|
||||||
}
|
}
|
||||||
@@ -1131,8 +1130,8 @@ const liberator = (function () //{{{
|
|||||||
// set before by any rc file
|
// set before by any rc file
|
||||||
for (let option in liberator.options)
|
for (let option in liberator.options)
|
||||||
{
|
{
|
||||||
if (option.setter && !option.hasChanged)
|
if (option.setter)
|
||||||
option.reset();
|
option.value = option.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
liberator.triggerObserver("enter", null);
|
liberator.triggerObserver("enter", null);
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
|||||||
<!-- other keys are handled inside the event loop in events.js -->
|
<!-- other keys are handled inside the event loop in events.js -->
|
||||||
</keyset>
|
</keyset>
|
||||||
|
|
||||||
<panel id="liberator-visualbell"/>
|
<popupset>
|
||||||
|
<panel id="liberator-visualbell"/>
|
||||||
|
</popupset>
|
||||||
|
|
||||||
<!--this notifies us also of focus events in the XUL
|
<!--this notifies us also of focus events in the XUL
|
||||||
from: http://developer.mozilla.org/en/docs/XUL_Tutorial:Updating_Commands !-->
|
from: http://developer.mozilla.org/en/docs/XUL_Tutorial:Updating_Commands !-->
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ liberator.Option = function (names, description, type, defaultValue, extraInfo)
|
|||||||
|
|
||||||
if (liberator.has("tabs") && (scope & liberator.options.OPTION_SCOPE_LOCAL))
|
if (liberator.has("tabs") && (scope & liberator.options.OPTION_SCOPE_LOCAL))
|
||||||
liberator.tabs.options[this.name] = newValue;
|
liberator.tabs.options[this.name] = newValue;
|
||||||
if (scope & liberator.options.OPTION_SCOPE_GLOBAL && newValue != this.globalValue)
|
if ((scope & liberator.options.OPTION_SCOPE_GLOBAL) && newValue != this.globalValue)
|
||||||
this.globalvalue = newValue;
|
this.globalvalue = newValue;
|
||||||
|
|
||||||
this.hasChanged = true;
|
this.hasChanged = true;
|
||||||
@@ -437,7 +437,6 @@ liberator.Options = function () //{{{
|
|||||||
if (!matches)
|
if (!matches)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
||||||
ret.scope = modifiers && modifiers.scope;
|
ret.scope = modifiers && modifiers.scope;
|
||||||
ret.option = liberator.options.get(ret.name, ret.scope);
|
ret.option = liberator.options.get(ret.name, ret.scope);
|
||||||
|
|
||||||
@@ -524,6 +523,9 @@ liberator.Options = function () //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
let opt = parseOpt(args, modifiers);
|
let opt = parseOpt(args, modifiers);
|
||||||
|
if (!opt)
|
||||||
|
return;
|
||||||
|
|
||||||
let option = opt.option;
|
let option = opt.option;
|
||||||
|
|
||||||
// reset a variable to its default value
|
// reset a variable to its default value
|
||||||
|
|||||||
Reference in New Issue
Block a user