summaryrefslogtreecommitdiff
path: root/common/content/editor.js
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2009-03-09 01:18:57 +1100
committerDoug Kearns <dougkearns@gmail.com>2009-03-09 01:18:57 +1100
commit52956a9aa1d49dc5c101c8fb5d91441f60a83d97 (patch)
tree8eea29db7c61033255a97b33a3c83df9ce8c30f5 /common/content/editor.js
parent8c2adfefb12657021ad0095af661f3f09ce23157 (diff)
downloadpentadactyl-52956a9aa1d49dc5c101c8fb5d91441f60a83d97.tar.gz
Replace use of editor.pasteClipboard with executeCommand("cmd_paste").
This fixes #93 (<s-insert> in the bottom of a long textarea bounces up) as well.
Diffstat (limited to 'common/content/editor.js')
-rw-r--r--common/content/editor.js21
1 files changed, 1 insertions, 20 deletions
diff --git a/common/content/editor.js b/common/content/editor.js
index b62aad98..9f75488c 100644
--- a/common/content/editor.js
+++ b/common/content/editor.js
@@ -339,7 +339,7 @@ function Editor() //{{{
mappings.add(myModes,
["<S-Insert>"], "Insert clipboard/selection",
- function () { editor.pasteClipboard(); });
+ function () { editor.executeCommand("cmd_paste"); });
mappings.add([modes.INSERT, modes.TEXTAREA, modes.COMPOSE],
["<C-i>"], "Edit text field with an external editor",
@@ -621,25 +621,6 @@ function Editor() //{{{
return text.substring(getEditor().selectionStart, getEditor().selectionEnd);
},
- pasteClipboard: function ()
- {
- let elem = window.document.commandDispatcher.focusedElement;
-
- if (elem.setSelectionRange && util.readFromClipboard())
- // readFromClipboard would return 'undefined' if not checked
- // dunno about .setSelectionRange
- {
- let rangeStart = elem.selectionStart; // caret position
- let rangeEnd = elem.selectionEnd;
- let tempStr1 = elem.value.substring(0, rangeStart);
- let tempStr2 = util.readFromClipboard();
- let tempStr3 = elem.value.substring(rangeEnd);
- elem.value = tempStr1 + tempStr2 + tempStr3;
- elem.selectionStart = rangeStart + tempStr2.length;
- elem.selectionEnd = elem.selectionStart;
- }
- },
-
// count is optional, defaults to 1
executeCommand: function (cmd, count)
{