mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 09:25:45 +01:00
Work around some Google Reader key processing issues.
This commit is contained in:
@@ -909,7 +909,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
for (let [file, ] in Iterator(services["dactyl:"].FILE_MAP)) {
|
for (let [file, ] in Iterator(services["dactyl:"].FILE_MAP)) {
|
||||||
let url = "dactyl://help/" + file;
|
let url = "dactyl://help/" + file;
|
||||||
dactyl.open(url);
|
dactyl.open(url);
|
||||||
util.waitFor(function () content.location.href == url, 5000);
|
util.waitFor(function () content.location.href == url && buffer.loaded
|
||||||
|
&& content.document.documentElement instanceof HTMLHtmlElement,
|
||||||
|
15000);
|
||||||
events.waitForPageLoad();
|
events.waitForPageLoad();
|
||||||
var data = [
|
var data = [
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>\n',
|
'<?xml version="1.0" encoding="UTF-8"?>\n',
|
||||||
|
|||||||
@@ -111,8 +111,10 @@ var ProcessorStack = Class("ProcessorStack", {
|
|||||||
if (result !== Events.PASS || this.events.length > 1)
|
if (result !== Events.PASS || this.events.length > 1)
|
||||||
Events.kill(this.events[this.events.length - 1]);
|
Events.kill(this.events[this.events.length - 1]);
|
||||||
|
|
||||||
if (result === Events.PASS_THROUGH)
|
if (result === Events.PASS_THROUGH) {
|
||||||
|
events.passing = true;
|
||||||
events.feedevents(null, this.keyEvents, { skipmap: true, isMacro: true, isReplay: true });
|
events.feedevents(null, this.keyEvents, { skipmap: true, isMacro: true, isReplay: true });
|
||||||
|
}
|
||||||
else if (result === Events.PASS || result === Events.ABORT) {
|
else if (result === Events.PASS || result === Events.ABORT) {
|
||||||
let list = this.events.filter(function (e) e.getPreventDefault() && !e.dactylDefaultPrevented);
|
let list = this.events.filter(function (e) e.getPreventDefault() && !e.dactylDefaultPrevented);
|
||||||
if (list.length)
|
if (list.length)
|
||||||
@@ -1288,7 +1290,8 @@ var Events = Module("events", {
|
|||||||
keyup: function onKeyUp(event) {
|
keyup: function onKeyUp(event) {
|
||||||
this.keyEvents.push(event);
|
this.keyEvents.push(event);
|
||||||
|
|
||||||
let pass = this.feedingEvent && this.feedingEvent.isReplay ||
|
let pass = this.passing && !event.isMacro ||
|
||||||
|
this.feedingEvent && this.feedingEvent.isReplay ||
|
||||||
event.isReplay ||
|
event.isReplay ||
|
||||||
modes.main == modes.PASS_THROUGH ||
|
modes.main == modes.PASS_THROUGH ||
|
||||||
modes.main == modes.QUOTE
|
modes.main == modes.QUOTE
|
||||||
@@ -1296,7 +1299,10 @@ var Events = Module("events", {
|
|||||||
&& !this.shouldPass(event) ||
|
&& !this.shouldPass(event) ||
|
||||||
!modes.passThrough && this.shouldPass(event);
|
!modes.passThrough && this.shouldPass(event);
|
||||||
|
|
||||||
events.dbg("ON " + event.type.toUpperCase() + " " + this.toString(event) + " pass: " + pass);
|
if (event.type === "keydown")
|
||||||
|
this.passing = pass;
|
||||||
|
|
||||||
|
events.dbg("ON " + event.type.toUpperCase() + " " + this.toString(event) + " pass: " + pass + " replay: " + event.isReplay + " macro: " + event.isMacro);
|
||||||
|
|
||||||
// Prevents certain sites from transferring focus to an input box
|
// Prevents certain sites from transferring focus to an input box
|
||||||
// before we get a chance to process our key bindings on the
|
// before we get a chance to process our key bindings on the
|
||||||
@@ -1305,6 +1311,8 @@ var Events = Module("events", {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
},
|
},
|
||||||
keydown: function onKeyDown(event) {
|
keydown: function onKeyDown(event) {
|
||||||
|
if (!event.isMacro)
|
||||||
|
this.passing = false;
|
||||||
this.events.keyup.call(this, event);
|
this.events.keyup.call(this, event);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user