From 902712371cb1c7348943bc49c58aacc06e0c561b Mon Sep 17 00:00:00 2001 From: Dave Winer Date: Fri, 21 Feb 2020 14:21:22 -0500 Subject: [PATCH] v3.0.4 --- concord.js | 52 +++++++++++-------------- opml/concord.opml | 94 ++++++++++++++++++++++++++++++++++++++++----- opml/worknotes.opml | 6 +++ worknotes.md | 4 ++ 4 files changed, 117 insertions(+), 39 deletions(-) diff --git a/concord.js b/concord.js index 95867af..45d38f8 100644 --- a/concord.js +++ b/concord.js @@ -22,7 +22,7 @@ if (!Array.prototype.indexOf) { } } var concord = { - version: "3.0.3", + version: "3.0.4", mobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent), ready: false, handleEvents: true, @@ -112,13 +112,11 @@ var concordEnvironment = { "version" : concord.version }; var concordClipboard = undefined; - - var flConcordScrollEnabled = true; //6/24/14 by DW var ctPixelsAboveOutlineArea = 0; //6/24/14 by DW - jQuery.fn.reverse = [].reverse; + //Constants var nil = null; var infinity = Number.MAX_VALUE; @@ -241,6 +239,14 @@ var ConcordUtil = { return ("tab"); case 13: return ("return"); + case 33: + return ("pageup"); + case 34: + return ("pagedown"); + case 35: + return ("end"); + case 36: + return ("home"); case 37: return ("leftarrow"); case 38: @@ -252,33 +258,19 @@ var ConcordUtil = { case 46: return ("delete"); case 188: - if (flmeta) { - return ("meta-,"); - } + return (","); case 190: - if (flmeta) { - return ("meta-."); - } + return ("."); case 191: - if (flmeta) { - return ("meta-/"); - } + return ("/"); case 192: - if (flmeta) { - return ("meta-`"); - } + return ("`"); case 219: - if (flmeta) { - return ("meta-["); - } + return ("["); case 220: - if (flmeta) { - return ("meta-\\"); - } + return ("\\"); case 221: - if (flmeta) { - return ("meta-]"); - } + return ("]"); } return (ch); } @@ -2991,10 +2983,14 @@ function Op(opmltext){ } } if(!readonly){ + var keystrokeString = ConcordUtil.getKeystroke (event); + event.concord = { //2/17/20 by DW + keystrokeString, + flKeyCaptured: false + }; concordInstance.fireCallback("opKeystroke", event); - var keyCaptured = false; + var keyCaptured = event.concord.flKeyCaptured; var commandKey = event.metaKey || event.ctrlKey; - var keystrokeString = ConcordUtil.getKeystroke (event); switch (keystrokeString) { case "backspace": if (concord.mobile) { @@ -3325,8 +3321,6 @@ function Op(opmltext){ default: keyCaptured = false; } - - if(!keyCaptured) { if((event.which >= 32) && ((event.which < 112) || (event.which > 123)) && (event.which < 1000) && !commandKey) { var node = concordInstance.op.getCursor(); diff --git a/opml/concord.opml b/opml/concord.opml index b664ccd..70e4ce9 100644 --- a/opml/concord.opml +++ b/opml/concord.opml @@ -43,7 +43,7 @@ - + @@ -160,15 +160,11 @@ - - - - - + @@ -307,6 +303,9 @@ + + + @@ -323,6 +322,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3848,10 +3919,15 @@ + + + + + + - + - @@ -4276,8 +4352,6 @@ - - diff --git a/opml/worknotes.opml b/opml/worknotes.opml index c0edf77..619f678 100644 --- a/opml/worknotes.opml +++ b/opml/worknotes.opml @@ -11,6 +11,12 @@ 1500 + + + + + + diff --git a/worknotes.md b/worknotes.md index 64c3001..f6c05a4 100644 --- a/worknotes.md +++ b/worknotes.md @@ -1,3 +1,7 @@ +* 2/17/20; 11:37:30 AM by DW + * Change the way we call back for keystrokes. + * A new second parameter contains a keystrokeString, we do all the parsing. + * If the callback returns true, it means they handled the keystroke, you should return. * 2/15/20; 11:22:30 AM by DW * Released version 3.0.3. Lots of cleanup work remains, for sure. ;-) * 2/13/20; 11:49:36 AM by DW