mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 06:58:00 +01:00
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml" id="dactyl-buffer">
|
||||||
<head>
|
<head>
|
||||||
<title/>
|
<title/>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
|
|
||||||
let elem = this.multilineOutput;
|
let elem = this.multilineOutput;
|
||||||
elem.contentWindow.addEventListener("unload", function (event) { event.preventDefault(); }, true);
|
elem.contentWindow.addEventListener("unload", function (event) { event.preventDefault(); }, true);
|
||||||
|
elem.contentDocument.documentElement.id = "dactyl-multiline-output-top";
|
||||||
elem.contentDocument.body.id = "dactyl-multiline-output-content";
|
elem.contentDocument.body.id = "dactyl-multiline-output-content";
|
||||||
elem.__defineGetter__("atEnd", function ()
|
elem.__defineGetter__("atEnd", function ()
|
||||||
!Buffer.isScrollable(elem.contentDocument.documentElement, 1));
|
!Buffer.isScrollable(elem.contentDocument.documentElement, 1));
|
||||||
@@ -1858,6 +1859,7 @@ var ItemList = Class("ItemList", {
|
|||||||
this._win = iframe.contentWindow;
|
this._win = iframe.contentWindow;
|
||||||
this._container = iframe.parentNode;
|
this._container = iframe.parentNode;
|
||||||
|
|
||||||
|
this._doc.documentElement.id = id + "-top";
|
||||||
this._doc.body.id = id + "-content";
|
this._doc.body.id = id + "-content";
|
||||||
this._doc.body.className = iframe.className + "-content";
|
this._doc.body.className = iframe.className + "-content";
|
||||||
this._doc.body.appendChild(this._doc.createTextNode(""));
|
this._doc.body.appendChild(this._doc.createTextNode(""));
|
||||||
|
|||||||
@@ -398,13 +398,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
},
|
},
|
||||||
|
|
||||||
focus: function focus(elem, flags) {
|
focus: function focus(elem, flags) {
|
||||||
util.dump("focus(" + (elem instanceof Element ? util.objectToString(elem) : elem) + ")");
|
|
||||||
flags = flags || services.focus.FLAG_BYMOUSE;
|
flags = flags || services.focus.FLAG_BYMOUSE;
|
||||||
try {
|
try {
|
||||||
if (elem instanceof Document)
|
if (elem instanceof Document)
|
||||||
elem = elem.defaultView;
|
elem = elem.defaultView;
|
||||||
if (elem instanceof Window)
|
if (elem instanceof Window)
|
||||||
elem.focus();
|
services.focus.focusedWindow = elem;
|
||||||
else
|
else
|
||||||
services.focus.setFocus(elem, flags);
|
services.focus.setFocus(elem, flags);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -445,13 +444,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
catch (e) {}
|
catch (e) {}
|
||||||
|
|
||||||
if (clearFocusedElement) {
|
if (clearFocusedElement) {
|
||||||
util.dump("blur(" + (dactyl.focusedElement instanceof Element ? util.objectToString(dactyl.focusedElement)
|
|
||||||
: dactyl.focusedElement) +
|
|
||||||
")");
|
|
||||||
if (dactyl.focusedElement)
|
if (dactyl.focusedElement)
|
||||||
dactyl.focusedElement.blur();
|
dactyl.focusedElement.blur();
|
||||||
if (win && Editor.getEditor(win)) {
|
if (win && Editor.getEditor(win)) {
|
||||||
util.dump("blur(" + win + ")");
|
|
||||||
win.blur();
|
win.blur();
|
||||||
if (win.frameElement)
|
if (win.frameElement)
|
||||||
util.dump("blur(" + util.objectToString(win.frameElement) + ")");
|
util.dump("blur(" + util.objectToString(win.frameElement) + ")");
|
||||||
@@ -465,8 +460,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
|
|
||||||
if (elem && elem != dactyl.focusedElement)
|
if (elem && elem != dactyl.focusedElement)
|
||||||
dactyl.focus(elem);
|
dactyl.focus(elem);
|
||||||
if (services.focus.focusedWindow == null)
|
|
||||||
util.dumpStack("focusedWindow == null");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @property {Element} The currently focused element. */
|
/** @property {Element} The currently focused element. */
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ var Modes = Module("modes", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addMode("COMMAND_LINE", { char: "c", input: true,
|
this.addMode("COMMAND_LINE", { char: "c", input: true });
|
||||||
display: function () modes.extended & modes.OUTPUT_MULTILINE ? null : this.disp });
|
|
||||||
|
|
||||||
this.addMode("CARET", {}, {
|
this.addMode("CARET", {}, {
|
||||||
get pref() prefs.get("accessibility.browsewithcaret"),
|
get pref() prefs.get("accessibility.browsewithcaret"),
|
||||||
@@ -82,7 +81,7 @@ var Modes = Module("modes", {
|
|||||||
postExecute: function (map) { if (modes.main == modes.QUOTE && map.name === "<C-v>") modes.pop() },
|
postExecute: function (map) { if (modes.main == modes.QUOTE && map.name === "<C-v>") modes.pop() },
|
||||||
onEvent: function () { if (modes.main == modes.QUOTE) modes.pop() }
|
onEvent: function () { if (modes.main == modes.QUOTE) modes.pop() }
|
||||||
});
|
});
|
||||||
this.addMode("OUTPUT_MULTILINE");
|
this.addMode("OUTPUT_MULTILINE", { ownsFocus: true });
|
||||||
|
|
||||||
// this._extended modes, can include multiple modes, and even main modes
|
// this._extended modes, can include multiple modes, and even main modes
|
||||||
this.addMode("EX", true);
|
this.addMode("EX", true);
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
*/
|
*/
|
||||||
dumpStack: function dumpStack(msg, frames) {
|
dumpStack: function dumpStack(msg, frames) {
|
||||||
let stack = util.stackLines(Error().stack);
|
let stack = util.stackLines(Error().stack);
|
||||||
stack = stack.slice(2, 2 + (frames || stack.length)).join("\n");
|
stack = stack.slice(2, 2 + (frames || stack.length)).join("\n").replace(/^/gm, " ");
|
||||||
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
|
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user