diff --git a/common/content/editor.js b/common/content/editor.js index 852b464a..234162c5 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -1,3 +1,4 @@ +// Copyright (c) 2008-2011 Kris Maglione // Copyright (c) 2006-2009 by Martin Stubenschrott // // This work is licensed for reuse under an MIT license. Details are @@ -303,8 +304,14 @@ var Editor = Module("editor", { lastUpdate = Date.now(); let val = tmpfile.read(); - if (textBox) + if (textBox) { 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 { while (editor_.rootElement.firstChild) editor_.rootElement.removeChild(editor_.rootElement.firstChild); diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 75b0cb6e..89df265d 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -431,14 +431,11 @@ var File = Class("File", { ofstream.init(this, mode, perms, 0); try { - if (callable(buf)) - buf(ofstream.QueryInterface(Ci.nsIOutputStream)); - else { - var ocstream = getStream(0); - ocstream.writeString(buf); - } + 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.writeString(buf); return false; diff --git a/common/skin/dactyl.css b/common/skin/dactyl.css index 42377000..f4db095c 100644 --- a/common/skin/dactyl.css +++ b/common/skin/dactyl.css @@ -7,6 +7,10 @@ -moz-binding: url(resource://dactyl-content/bindings.xml#frame) !important; } +[dactyl|modifiable][dactyl|modifiable] { + -moz-user-input: enabled !important; +} + [dactyl|highlight~=hints] { -moz-binding: url(resource://dactyl-content/bindings.xml#hints) !important; position: static !important;