Skip to content

Commit

Permalink
v3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
scripting committed Feb 21, 2020
1 parent bc6aa15 commit 9027123
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 39 deletions.
52 changes: 23 additions & 29 deletions concord.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down
94 changes: 84 additions & 10 deletions opml/concord.opml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<outline text="}"></outline>
</outline>
<outline text="var concord = {">
<outline text="version: &quot;3.0.3&quot;,"></outline>
<outline text="version: &quot;3.0.4&quot;,"></outline>
<outline text="mobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),"></outline>
<outline text="ready: false,"></outline>
<outline text="handleEvents: true,"></outline>
Expand Down Expand Up @@ -160,15 +160,11 @@
<outline text="};"></outline>
</outline>
<outline text="var concordClipboard = undefined;"></outline>
<outline text=""></outline>
<outline text=""></outline>
<outline text="var flConcordScrollEnabled = true; //6/24/14 by DW"></outline>
<outline text="var ctPixelsAboveOutlineArea = 0; //6/24/14 by DW"></outline>
<outline text=""></outline>
<outline text=""></outline>
<outline isComment="true" text="document.write('&lt;link rel=&quot;stylesheet&quot; href=&quot;http://static.smallpicture.com/concord-assets/fontawesome/4.1.0/css/font-awesome.min.css&quot;/&gt;');"></outline>
<outline isComment="true" text="document.write('&lt;link rel=&quot;stylesheet&quot; href=&quot;http://fargo.io/code/concord.css&quot;/&gt;');"></outline>
<outline text="jQuery.fn.reverse = [].reverse;"></outline>
<outline text=""></outline>
<outline text="//Constants">
<outline text="var nil = null;"></outline>
<outline text="var infinity = Number.MAX_VALUE;"></outline>
Expand Down Expand Up @@ -307,6 +303,9 @@
</outline>
<outline text="function concordMetaizeKeystroke (event) { //9/17/13 by DW">
<outline isComment="true" text="Changes">
<outline text="2/17/20; 12:30:26 PM by DW">
<outline text="Added cases for pageup, pagedown, home and end. "></outline>
</outline>
<outline text="2/6/20; 2:01:26 PM by DW">
<outline text="Add &quot;meta-&quot; if the meta key is down, in all cases. previously we'd only add them for A through Z"></outline>
</outline>
Expand All @@ -323,6 +322,78 @@
<outline text="case 13:">
<outline text="return (&quot;return&quot;);"></outline>
</outline>
<outline text="case 33: ">
<outline text="return (&quot;pageup&quot;);"></outline>
</outline>
<outline text="case 34: ">
<outline text="return (&quot;pagedown&quot;);"></outline>
</outline>
<outline text="case 35: ">
<outline text="return (&quot;end&quot;);"></outline>
</outline>
<outline text="case 36: ">
<outline text="return (&quot;home&quot;);"></outline>
</outline>
<outline text="case 37:">
<outline text="return (&quot;leftarrow&quot;);"></outline>
</outline>
<outline text="case 38:">
<outline text="return (&quot;uparrow&quot;);"></outline>
</outline>
<outline text="case 39:">
<outline text="return (&quot;rightarrow&quot;);"></outline>
</outline>
<outline text="case 40:">
<outline text="return (&quot;downarrow&quot;);"></outline>
</outline>
<outline text="case 46:">
<outline text="return (&quot;delete&quot;);"></outline>
</outline>
<outline text="case 188:">
<outline text="return (&quot;,&quot;);"></outline>
</outline>
<outline text="case 190:">
<outline text="return (&quot;.&quot;);"></outline>
</outline>
<outline text="case 191:">
<outline text="return (&quot;/&quot;);"></outline>
</outline>
<outline text="case 192:">
<outline text="return (&quot;`&quot;);"></outline>
</outline>
<outline text="case 219:">
<outline text="return (&quot;[&quot;);"></outline>
</outline>
<outline text="case 220:">
<outline text="return (&quot;\\&quot;);"></outline>
</outline>
<outline text="case 221:">
<outline text="return (&quot;]&quot;);"></outline>
</outline>
<outline text="}"></outline>
</outline>
<outline isComment="true" text="switch (ch) {">
<outline text="case 8:">
<outline text="return (&quot;backspace&quot;);"></outline>
</outline>
<outline text="case 9:">
<outline text="return (&quot;tab&quot;);"></outline>
</outline>
<outline text="case 13:">
<outline text="return (&quot;return&quot;);"></outline>
</outline>
<outline text="case 33: //2/17/20 by DW">
<outline text="return (&quot;pageup&quot;);"></outline>
</outline>
<outline text="case 34: //2/17/20 by DW">
<outline text="return (&quot;pagedown&quot;);"></outline>
</outline>
<outline text="case 35: //2/17/20 by DW">
<outline text="return (&quot;end&quot;);"></outline>
</outline>
<outline text="case 36: //2/17/20 by DW">
<outline text="return (&quot;home&quot;);"></outline>
</outline>
<outline text="case 37:">
<outline text="return (&quot;leftarrow&quot;);"></outline>
</outline>
Expand Down Expand Up @@ -3848,10 +3919,15 @@
<outline text="}"></outline>
</outline>
<outline text="if(!readonly){">
<outline text="var keystrokeString = ConcordUtil.getKeystroke (event);"></outline>
<outline text="event.concord = { //2/17/20 by DW">
<outline text="keystrokeString, "></outline>
<outline text="flKeyCaptured: false"></outline>
<outline text="};"></outline>
</outline>
<outline text="concordInstance.fireCallback(&quot;opKeystroke&quot;, event);"></outline>
<outline text="var keyCaptured = false;"></outline>
<outline text="var keyCaptured = event.concord.flKeyCaptured;"></outline>
<outline text="var commandKey = event.metaKey || event.ctrlKey;"></outline>
<outline text="var keystrokeString = ConcordUtil.getKeystroke (event);"></outline>
<outline isComment="true" text="console.log (&quot;keydown: keystrokeString == &quot; + keystrokeString + &quot;, event.metaKey == &quot; + event.metaKey)"></outline>
<outline text="switch (keystrokeString) {">
<outline text="case &quot;backspace&quot;:">
Expand Down Expand Up @@ -4276,8 +4352,6 @@
</outline>
<outline text="}"></outline>
</outline>
<outline text=""></outline>
<outline text=""></outline>
<outline text="if(!keyCaptured) {">
<outline text="if((event.which &gt;= 32) &amp;&amp; ((event.which &lt; 112) || (event.which &gt; 123)) &amp;&amp; (event.which &lt; 1000) &amp;&amp; !commandKey) {">
<outline text="var node = concordInstance.op.getCursor();"></outline>
Expand Down
6 changes: 6 additions & 0 deletions opml/worknotes.opml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<windowRight>1500</windowRight>
</head>
<body text="worknotes.mdo">
<outline text="2/17/20; 11:37:30 AM by DW">
<outline text="Change the way we call back for keystrokes.">
<outline text="A new second parameter contains a keystrokeString, we do all the parsing."></outline>
<outline text="If the callback returns true, it means they handled the keystroke, you should return."></outline>
</outline>
</outline>
<outline text="2/15/20; 11:22:30 AM by DW">
<outline text="&lt;a href=&quot;http://scripting.com/2020/02/15.html#a161619&quot;&gt;Released&lt;/a&gt; version 3.0.3. Lots of cleanup work remains, for sure. ;-)"></outline>
</outline>
Expand Down
4 changes: 4 additions & 0 deletions worknotes.md
Original file line number Diff line number Diff line change
@@ -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
* <a href="http://scripting.com/2020/02/15.html#a161619">Released</a> version 3.0.3. Lots of cleanup work remains, for sure. ;-)
* 2/13/20; 11:49:36 AM by DW
Expand Down

0 comments on commit 9027123

Please sign in to comment.