mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 22:22:27 +01:00
Dispatch input event after external editing.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
// Copyright (c) 2008-2011 Kris Maglione <maglione.k at Gmail>
|
||||||
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
@@ -303,8 +304,14 @@ var Editor = Module("editor", {
|
|||||||
lastUpdate = Date.now();
|
lastUpdate = Date.now();
|
||||||
|
|
||||||
let val = tmpfile.read();
|
let val = tmpfile.read();
|
||||||
if (textBox)
|
if (textBox) {
|
||||||
textBox.value = val;
|
textBox.value = val;
|
||||||
|
|
||||||
|
textBox.setAttributeNS(NS, "modifiable", true);
|
||||||
|
util.computedStyle(textBox).MozUserInput;
|
||||||
|
events.dispatch(textBox, events.create(textBox.ownerDocument, "input", {}));
|
||||||
|
textBox.removeAttributeNS(NS, "modifiable");
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
while (editor_.rootElement.firstChild)
|
while (editor_.rootElement.firstChild)
|
||||||
editor_.rootElement.removeChild(editor_.rootElement.firstChild);
|
editor_.rootElement.removeChild(editor_.rootElement.firstChild);
|
||||||
|
|||||||
@@ -431,14 +431,11 @@ var File = Class("File", {
|
|||||||
|
|
||||||
ofstream.init(this, mode, perms, 0);
|
ofstream.init(this, mode, perms, 0);
|
||||||
try {
|
try {
|
||||||
if (callable(buf))
|
var ocstream = getStream(0);
|
||||||
buf(ofstream.QueryInterface(Ci.nsIOutputStream));
|
ocstream.writeString(buf);
|
||||||
else {
|
|
||||||
var ocstream = getStream(0);
|
|
||||||
ocstream.writeString(buf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e if callable(buf) && e.result == Cr.NS_ERROR_LOSS_OF_SIGNIFICANT_DATA) {
|
catch (e if e.result == Cr.NS_ERROR_LOSS_OF_SIGNIFICANT_DATA) {
|
||||||
|
ocstream.close();
|
||||||
ocstream = getStream("?".charCodeAt(0));
|
ocstream = getStream("?".charCodeAt(0));
|
||||||
ocstream.writeString(buf);
|
ocstream.writeString(buf);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
-moz-binding: url(resource://dactyl-content/bindings.xml#frame) !important;
|
-moz-binding: url(resource://dactyl-content/bindings.xml#frame) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[dactyl|modifiable][dactyl|modifiable] {
|
||||||
|
-moz-user-input: enabled !important;
|
||||||
|
}
|
||||||
|
|
||||||
[dactyl|highlight~=hints] {
|
[dactyl|highlight~=hints] {
|
||||||
-moz-binding: url(resource://dactyl-content/bindings.xml#hints) !important;
|
-moz-binding: url(resource://dactyl-content/bindings.xml#hints) !important;
|
||||||
position: static !important;
|
position: static !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user