diff options
author | matthewsotoudeh <matthewsot@outlook.com> | 2016-05-15 01:04:20 -0700 |
---|---|---|
committer | matthewsotoudeh <matthewsot@outlook.com> | 2016-05-15 01:04:20 -0700 |
commit | f506db8795d98a82778d215881d79802d85f14e0 (patch) | |
tree | af3bee89c4f934488dc3fa434fd3e9a4dbf5f3cd | |
parent | f834fb071919b228ef647e9ec7c2e117a4611a0b (diff) |
working with ctrl+a too!
-rw-r--r-- | speechless.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/speechless.js b/speechless.js index c1f0df0..f8569be 100644 --- a/speechless.js +++ b/speechless.js @@ -1,7 +1,6 @@ var wordsPerMinute = 120; -$("body").on("mouseup", ".kix-appview-editor", function (e) { - if (e.which !== 1) return; +function refresh() { if (docs.hasSelection()) { docs.getSelection(function (textEl) { var text = ""; @@ -21,4 +20,16 @@ $("body").on("mouseup", ".kix-appview-editor", function (e) { } else { $("#docs-notice").text(""); } +} + +$("body").on("mouseup", ".kix-appview-editor", function (e) { + if (e.which !== 1) return; + + refresh(); +}); + +$(".docs-texteventtarget-iframe").contents().find("[contenteditable=\"true\"]").keydown(function (e) { + if (e.keyCode !== 65 || e.ctrlKey != true) return; + + setTimeout(refresh, 100); });
\ No newline at end of file |