diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-08-14 23:30:05 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-08-14 23:30:05 -0400 |
commit | 681af3e618eed5d24c581c3ea5dee1907e404e7d (patch) | |
tree | 88f49f14cb4fc76484eec56e4684f444c98c5e15 /common/content/editor.js | |
parent | 236a894c8913d8da6e2297dca1cacf363bca8a51 (diff) | |
download | pentadactyl-681af3e618eed5d24c581c3ea5dee1907e404e7d.tar.gz |
Move DOM and config properties from the util namespace to the DOM and config namespaces, respectively.
Diffstat (limited to 'common/content/editor.js')
-rw-r--r-- | common/content/editor.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/common/content/editor.js b/common/content/editor.js index 1c50dac9..cc60c721 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -209,7 +209,7 @@ var Editor = Module("editor", { var editor_ = window.GetCurrentEditor ? GetCurrentEditor() : Editor.getEditor(document.commandDispatcher.focusedWindow); dactyl.assert(editor_); - text = Array.map(editor_.rootElement.childNodes, function (e) util.domToString(e, true)).join(""); + text = Array.map(editor_.rootElement.childNodes, function (e) DOM.stringify(e, true)).join(""); } let origGroup = textBox && textBox.getAttributeNS(NS, "highlight") || ""; @@ -348,16 +348,7 @@ var Editor = Module("editor", { elem = dactyl.focusedElement || document.commandDispatcher.focusedWindow; dactyl.assert(elem); - try { - if (elem instanceof Element) - return elem.QueryInterface(Ci.nsIDOMNSEditableElement).editor; - return elem.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIEditingSession) - .getEditorForWindow(elem); - } - catch (e) { - return null; - } + return DOM(elem).editor; }, getController: function (cmd) { @@ -582,7 +573,7 @@ var Editor = Module("editor", { addMotionMap("d", "Delete motion", true, function (editor) { editor.cut(); }); addMotionMap("c", "Change motion", true, function (editor) { editor.cut(); }, modes.INSERT); - addMotionMap("y", "Yank motion", false, function (editor, range) { dactyl.clipboardWrite(util.domToString(range)) }); + addMotionMap("y", "Yank motion", false, function (editor, range) { dactyl.clipboardWrite(DOM.stringify(range)) }); let bind = function bind(names, description, action, params) mappings.add([modes.INPUT], names, description, |