-
Notifications
You must be signed in to change notification settings - Fork 87
/
source.opml
5403 lines (5401 loc) · 272 KB
/
source.opml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- OPML generated by OPML Editor v10.1b19 on Mon, 15 Jan 2024 15:32:05 GMT -->
<!--
Hi this is Dave Winer. I write all my project code in an outliner, which
generates all the files that make up this GitHub project. You'll see a
source.opml file like this in each of my projects. It contains the outline
source that the repo files were generated from. This is the most logical place
to store them. You can read the code in any outliner that supports OPML, which
includes https://drummer.land. You can use the Open URL command in
Drummer's File menu to open the "raw" version of this file straight from the
GitHub repo.
-->
<opml version="2.0">
<head>
<title>nodeEditor: concord</title>
<dateCreated>Sun, 22 Jul 2018 21:53:02 GMT</dateCreated>
<dateModified>Mon, 15 Jan 2024 15:32:05 GMT</dateModified>
<ownerName>Dave Winer</ownerName>
<ownerId>http://davewiner.com/</ownerId>
<expansionState>1, 2, 24</expansionState>
<vertScrollState>1</vertScrollState>
<windowTop>165</windowTop>
<windowLeft>697</windowLeft>
<windowBottom>1110</windowBottom>
<windowRight>1934</windowRight>
</head>
<body>
<outline text="/scripting.com/code/concord/">
<outline text="worknotes.md" created="Mon, 15 Jan 2024 14:53:39 GMT">
<outline text="#### 1/15/24; 10:01:19 AM by DW" created="Mon, 15 Jan 2024 15:01:19 GMT">
<outline text="Fix problem in xmlToOutline where it can fail in certain circumstances relative to cursor placement." created="Mon, 15 Jan 2024 14:54:08 GMT">
<outline text="I honestly don't understand what it's doing, though it has something to do with cursor placement, and it's an edge condition, this code has been running without problems for 10 years. So what I do is just get the hell out of there when the problem comes up. It works. " created="Mon, 15 Jan 2024 15:28:33 GMT"/>
<outline text="Search the source for 1/15/24." created="Mon, 15 Jan 2024 15:29:32 GMT"/>
</outline>
<outline text="Previously we were saving concord changes to this path -- /scripting.com/code/concord/testing/3.0.6/" created="Mon, 15 Jan 2024 15:07:50 GMT">
<outline text="Now we're saving to /scripting.com/code/concord/. Rely on GitHub and our normal backup process to be able to revert." created="Mon, 15 Jan 2024 15:08:01 GMT"/>
<outline text="The kinds of changes we make to Concord are very arm's length." created="Mon, 15 Jan 2024 15:08:37 GMT"/>
</outline>
</outline>
<outline text="#### 1/15/24; 9:53:44 AM by DW" created="Mon, 15 Jan 2024 14:53:41 GMT">
<outline text="There was a separate project called concordNotes, it had just one file -- worknotes.mdo." created="Mon, 15 Jan 2024 14:53:45 GMT"/>
<outline text="I copied it here, in the earlier updates." created="Mon, 15 Jan 2024 15:01:02 GMT"/>
</outline>
<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 text="If the callback returns true, it means they handled the keystroke, you should return."/>
</outline>
</outline>
<outline text="#### 2/15/20; 11:22:30 AM by DW">
<outline text="<a href="http://scripting.com/2020/02/15.html#a161619">Released</a> version 3.0.3. Lots of cleanup work remains, for sure. ;-)"/>
</outline>
<outline text="#### 2/13/20; 11:49:36 AM by DW">
<outline text="Saved a <a href="https://s3.amazonaws.com/scripting.com/2020/02/13/concord-master.zip">snapshot</a> of the Concord repository before I made any changes. "/>
</outline>
<outline text="#### 2/12/20; 11:53:59 AM by DW">
<outline text="Merged concordkeyboard.js with concord.js. New routine ConcordUtil.getKeystroke. One less file to deal with. Wasn't present in the 2013 version of Concord. No need to introduce it. "/>
</outline>
<outline text="#### 1/31/20; 3:02:56 PM by DW">
<outline text="v3.0.2. Converted to the newest release of Font-Awesome for hard-coded icons, and icons for outline types. "/>
</outline>
<outline text="#### 1/29/20; 5:03:41 PM by DW">
<outline text="v3.0.1. Implemented cmd-backspace and cmd-return. Handles HTML text.">
<outline text="Here's the <a href="http://scripting.com/2020/01/29.html#a182110">writeup</a> on Scripting. "/>
</outline>
</outline>
<outline text="#### 1/25/20; 2:21:11 PM by DW">
<outline text="New version number sequence -- v3.0.0.">
<outline text="From here on out our changes will be registered in the GitHub project."/>
<outline text="Code is managed in nodeEditor along with all my other JavaScript code."/>
<outline text="Concord enters the modern age. Looking forward to working here. "/>
</outline>
<outline text="Let's just take the code we're using in both LO2 and EO and bring it into nodeEditor. ">
<outline text="We won't know what all the changes are from whatever versions we had here, but we can move forward.">
<outline text="nodeEditorSuite.utilities.researchConcordVersions"/>
</outline>
</outline>
</outline>
<outline text="#### 1/24/20; 4:00:15 PM by DW">
<outline text="Need to get the version of concord under control, so I can edit it as I would any other piece of code. "/>
<outline text="There's a project already in nodeEditor, with a note at the top saying it's only for reading. "/>
<outline text="The question is this -- what are the differences between this and the version of Concord that we're using in LO2 and EO."/>
<outline text="Here's the plan">
<outline text="Create a private project on GitHub."/>
<outline text="Upload the version of Concord that's under nodeEditor management.">
<outline text="I'm moving it under the LO2 menu, so it's part of this project."/>
</outline>
<outline text="Overlay that with the code we're using in LO2."/>
<outline text="See the differences. Where we go from there depends on how big the diffs are. "/>
</outline>
<outline text="Okay that didn't accomplish anything">
<outline text="GitHub said the whole file was a change. "/>
<outline text="This is weird because just eyeballing it, you can see that they're almost identical files.">
<outline text="https://github.com/scripting/concord2/commit/1b3b93523053445faf83d272eebe62f3f25e349f#diff-9d22eb2e0ebaa6cc17d83bbb672f3b08"/>
</outline>
</outline>
<outline text="Starting a new session, see above."/>
</outline>
<outline text="#### 7/22/18 by DW" isComment="true">
<outline text="this code is here just for reference. i am not using it in my outliners. "/>
</outline>
<outline text="#### 2/22/14 by DW" created="Sat, 22 Feb 2014 23:29:34 GMT" pgfnum="37867">
<outline text="v2.49 -- xmlToOutline takes a new optional param, flSetFocus. Defaults true. If false, we don't set the focus in the outline. This is useful when using the outliner to display text in a web page. If the outline is two screens down, you don't want the page to scroll down to it on reload. " created="Sat, 22 Feb 2014 23:29:35 GMT" pgfnum="37868"/>
<outline text="Thanks to <a href="http://k4shif.blogspot.com/">Kashif Khan</a> for finding this fix. ;-)" created="Sat, 22 Feb 2014 23:35:51 GMT" pgfnum="37869"/>
</outline>
<outline text="#### 9/20/13 by DW" created="Fri, 20 Sep 2013 13:18:15 GMT" pgfnum="30559">
<outline text="Example1 -- Hello Outliner" created="Fri, 20 Sep 2013 13:20:32 GMT" pgfnum="30563">
<outline text="Change the initial value of renderMode from false to true." created="Fri, 20 Sep 2013 13:18:15 GMT" pgfnum="30560"/>
<outline text="Added a separator before Concord Docs in the Source menu." created="Fri, 20 Sep 2013 13:20:01 GMT" pgfnum="30561"/>
<outline text="Changed version number to 0.52." created="Fri, 20 Sep 2013 13:20:20 GMT" pgfnum="30562"/>
</outline>
<outline text="Markdown renderer" created="Fri, 20 Sep 2013 13:43:38 GMT" pgfnum="30564">
<outline text="As part of the build process for turning my OPML files into flat files for the GitHub repo, I have a script that does a simple rendering of an outline in Markdown. Previously it only understood one level hierarchies, but I was already using more levels without realizing the text was not showing up. " created="Fri, 20 Sep 2013 13:43:41 GMT" pgfnum="30565"/>
<outline text="So I updated the renderer to handle multiple levels. It's a little tricky to get Markdown do indentation, but I ended up using with with &amp;nbsp; characters, which works since you can include HTML in Markdown. :-)" created="Fri, 20 Sep 2013 13:44:44 GMT" pgfnum="30566"/>
</outline>
</outline>
<outline text="#### 9/19/13 by DW" created="Thu, 19 Sep 2013 12:01:25 GMT" pgfnum="30467">
<outline text="Added worknotes section to readme.md." created="Thu, 19 Sep 2013 12:01:27 GMT" pgfnum="30468"/>
<outline text="Rendering worknotes as <a href="https://github.com/scripting/concord/blob/master/worknotes.md">worknotes.md</a> at the top level of the repo." created="Thu, 19 Sep 2013 12:01:47 GMT" pgfnum="30469"/>
</outline>
<outline text="#### 9/18/13 by DW">
<outline text="Created the worknotes outline (this file). " created="Wed, 18 Sep 2013 12:57:06 GMT" pgfnum="30391"/>
<outline text="Added a bunch of utility routines to concordUtils.js. " created="Wed, 18 Sep 2013 12:56:45 GMT" pgfnum="30390"/>
<outline text="Example 2, the Reader app is working. " created="Wed, 18 Sep 2013 12:57:22 GMT" pgfnum="30392">
<outline text="It works with any OPML file." created="Wed, 18 Sep 2013 14:48:27 GMT" pgfnum="30451"/>
<outline text="Handles includes. " created="Wed, 18 Sep 2013 14:48:34 GMT" pgfnum="30452"/>
<outline text="Anything Concord can display it can display, because it builds on Concord. ;-)" created="Wed, 18 Sep 2013 14:49:01 GMT" pgfnum="30454"/>
</outline>
<outline text="Added a call to console.log in opKeystrokeCallback in example1. " created="Wed, 18 Sep 2013 12:59:54 GMT" pgfnum="30393"/>
<outline text="Fixed opExpandCallback in Example 1, expanding <i>include</i> nodes was broken." created="Wed, 18 Sep 2013 14:47:42 GMT" pgfnum="30450"/>
<outline text="Added commands in Hello Outliner/Source menu to open the Worknotes outline and the source for Example 2." created="Wed, 18 Sep 2013 14:51:47 GMT" pgfnum="30456"/>
</outline>
</outline>
<outline text="concord.js">
<outline text="// Copyright 2020-2021, Dave Winer"/>
<outline text="// Copyright 2013, Small Picture, Inc."/>
<outline text=""/>
<outline text="$(function () {">
<outline text="if($.fn.tooltip !== undefined){">
<outline text="$("a[rel=tooltip]").tooltip({">
<outline text="live: true"/>
<outline text="})"/>
</outline>
<outline text="}"/>
</outline>
<outline text="})"/>
</outline>
<outline text="$(function () {">
<outline text="if($.fn.popover !== undefined){">
<outline text="$("a[rel=popover]").on("mouseenter mouseleave", function(){$(this).popover("toggle")})"/>
<outline text="}"/>
</outline>
<outline text="})"/>
</outline>
<outline text="if (!Array.prototype.indexOf) {">
<outline text="Array.prototype.indexOf = function(obj, start) {">
<outline text="for (var i = (start || 0), j = this.length; i < j; i++) {">
<outline text="if (this[i] === obj) { return i; }"/>
<outline text="}"/>
</outline>
<outline text="return -1;"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="var concord = {">
<outline text="version: "3.0.5","/>
<outline text="mobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),"/>
<outline text="ready: false,"/>
<outline text="handleEvents: true,"/>
<outline text="resumeCallbacks: [],"/>
<outline text="onResume: function(cb){">
<outline text="this.resumeCallbacks.push(cb);"/>
<outline text="},"/>
</outline>
<outline text="resumeListening: function(){">
<outline text="if(!this.handleEvents){">
<outline text="this.handleEvents=true;"/>
<outline text="var r = this.getFocusRoot();"/>
<outline text="if(r!=null){">
<outline text="var c = new ConcordOutline(r.parent());"/>
<outline text="if(c.op.inTextMode()){">
<outline text="c.op.focusCursor();"/>
<outline text="c.editor.restoreSelection();"/>
<outline text="}else{">
<outline text="c.pasteBinFocus();"/>
<outline text="}"/>
</outline>
</outline>
<outline text="for(var i in this.resumeCallbacks){">
<outline text="var cb = this.resumeCallbacks[i];"/>
<outline text="cb();"/>
<outline text="}"/>
</outline>
<outline text="this.resumeCallbacks=[];"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="},"/>
</outline>
<outline text="stopListening: function(){">
<outline text="if(this.handleEvents){">
<outline text="this.handleEvents=false;"/>
<outline text="var r = this.getFocusRoot();"/>
<outline text="if(r!=null){">
<outline text="var c = new ConcordOutline(r.parent());"/>
<outline text="if(c.op.inTextMode()){">
<outline text="c.editor.saveSelection();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="},"/>
</outline>
<outline text="focusRoot: null,"/>
<outline text="getFocusRoot: function(){">
<outline text="if($(".concord-root:visible").length==1){">
<outline text="return this.setFocusRoot($(".concord-root:visible:first"));"/>
<outline text="}"/>
</outline>
<outline text="if($(".modal").is(":visible")){">
<outline text="if($(".modal").find(".concord-root:visible:first").length==1){">
<outline text="return this.setFocusRoot($(".modal").find(".concord-root:visible:first"));"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="if(this.focusRoot==null){">
<outline text="if($(".concord-root:visible").length>0){">
<outline text="return this.setFocusRoot($(".concord-root:visible:first"));"/>
<outline text="}else{">
<outline text="return null;"/>
<outline text="}"/>
</outline>
</outline>
<outline text="}"/>
</outline>
<outline text="if(!this.focusRoot.is(":visible")){">
<outline text="return this.setFocusRoot($(".concord-root:visible:first"));"/>
<outline text="}"/>
</outline>
<outline text="return this.focusRoot;"/>
<outline text="},"/>
</outline>
<outline text="setFocusRoot: function(root){">
<outline text="var origRoot = this.focusRoot;"/>
<outline text="var concordInstance = new ConcordOutline(root.parent());"/>
<outline text="if((origRoot!=null) && !(origRoot[0]===root[0])){">
<outline text="var origConcordInstance = new ConcordOutline(origRoot.parent());"/>
<outline text="origConcordInstance.editor.hideContextMenu();"/>
<outline text="origConcordInstance.editor.dragModeExit();"/>
<outline text="if(concordInstance.op.inTextMode()){">
<outline text="concordInstance.op.focusCursor();"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="concordInstance.pasteBinFocus();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="this.focusRoot = root;"/>
<outline text="return this.focusRoot;"/>
<outline text="},"/>
</outline>
<outline text="updateFocusRootEvent: function(event){">
<outline text="var root = $(event.target).parents(".concord-root:first");"/>
<outline text="if(root.length==1){">
<outline text="concord.setFocusRoot(root);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="var concordEnvironment = {">
<outline text=""version" : concord.version"/>
<outline text="};"/>
</outline>
<outline text="var concordClipboard = undefined;"/>
<outline text="var flConcordScrollEnabled = true; //6/24/14 by DW"/>
<outline text="var ctPixelsAboveOutlineArea = 0; //6/24/14 by DW"/>
<outline text=""/>
<outline text="jQuery.fn.reverse = [].reverse;"/>
<outline text=""/>
<outline text="//Constants">
<outline text="var nil = null;"/>
<outline text="var infinity = Number.MAX_VALUE;"/>
<outline text="var down = "down";"/>
<outline text="var left = "left";"/>
<outline text="var right = "right";"/>
<outline text="var up = "up";"/>
<outline text="var flatup = "flatup";"/>
<outline text="var flatdown = "flatdown";"/>
<outline text="var nodirection = "nodirection";"/>
</outline>
<outline text="var XML_CHAR_MAP = {">
<outline text="'<': '&lt;',"/>
<outline text="'\'': '&apos;', //8/11/21 by DW" isComment="true" created="Wed, 11 Aug 2021 15:10:12 GMT"/>
<outline text="'>': '&gt;',"/>
<outline text="'&': '&amp;',"/>
<outline text="'"': '&'+'quot;'"/>
<outline text="};"/>
</outline>
<outline text="var ConcordUtil = {">
<outline text="escapeXml: function(s) {">
<outline text="s = s.toString();"/>
<outline text="s = s.replace(/\u00A0/g, " ");"/>
<outline text="var escaped = s.replace(/[<>&"]/g, function(ch) {">
<outline text="return XML_CHAR_MAP[ch];"/>
<outline text="});"/>
</outline>
<outline text="return escaped;"/>
<outline text="},"/>
</outline>
<outline text="stringMid: function (s, ix, len) { //1/27/20 by DW">
<outline text="return (s.substr (ix-1, len));"/>
<outline text="},"/>
</outline>
<outline text="stringDelete: function (s, ix, ct) { //1/27/20 by DW">
<outline text="var start = ix - 1;"/>
<outline text="var end = (ix + ct) - 1;"/>
<outline text="var s1 = s.substr (0, start);"/>
<outline text="var s2 = s.substr (end);"/>
<outline text="return (s1 + s2);"/>
<outline text="},"/>
</outline>
<outline text="endsWith: function (s, possibleEnding, flUnicase) { //1/27/20 by DW">
<outline text="function stringLower (s) {">
<outline text="return (s.toLowerCase ());"/>
<outline text="}"/>
</outline>
<outline text="if ((s === undefined) || (s.length == 0)) { " created="Wed, 01 Jan 2014 23:29:44 GMT" pgfnum="35184">
<outline text="return (false);" created="Wed, 01 Jan 2014 23:29:49 GMT" pgfnum="35185"/>
<outline text="}" created="Wed, 01 Jan 2014 23:29:52 GMT" pgfnum="35186"/>
</outline>
<outline text="var ixstring = s.length - 1;" created="Wed, 27 Nov 2013 22:09:56 GMT" pgfnum="32496"/>
<outline text="if (flUnicase === undefined) {" created="Wed, 27 Nov 2013 21:59:59 GMT" pgfnum="32482">
<outline text="flUnicase = true;" created="Wed, 27 Nov 2013 22:00:10 GMT" pgfnum="32483"/>
<outline text="}" created="Wed, 27 Nov 2013 22:00:14 GMT" pgfnum="32484"/>
</outline>
<outline text="if (flUnicase) {" created="Wed, 27 Nov 2013 22:00:49 GMT" pgfnum="32485">
<outline text="for (var i = possibleEnding.length - 1; i >= 0; i--) {" created="Wed, 27 Nov 2013 21:58:48 GMT" pgfnum="32476">
<outline text="if (stringLower (s [ixstring--]) != stringLower (possibleEnding [i])) {" created="Wed, 27 Nov 2013 21:59:05 GMT" pgfnum="32478">
<outline text="return (false);" created="Wed, 27 Nov 2013 21:59:34 GMT" pgfnum="32479"/>
<outline text="}" created="Wed, 27 Nov 2013 21:59:38 GMT" pgfnum="32480"/>
</outline>
<outline text="}" created="Wed, 27 Nov 2013 21:59:01 GMT" pgfnum="32477"/>
</outline>
<outline text="}" created="Wed, 27 Nov 2013 22:00:58 GMT" pgfnum="32486"/>
</outline>
<outline text="else {" created="Wed, 27 Nov 2013 22:01:08 GMT" pgfnum="32487">
<outline text="for (var i = possibleEnding.length - 1; i >= 0; i--) {" created="Wed, 27 Nov 2013 21:58:48 GMT" pgfnum="32476">
<outline text="if (s [ixstring--] != possibleEnding [i]) {" created="Wed, 27 Nov 2013 21:59:05 GMT" pgfnum="32478">
<outline text="return (false);" created="Wed, 27 Nov 2013 21:59:34 GMT" pgfnum="32479"/>
<outline text="}" created="Wed, 27 Nov 2013 21:59:38 GMT" pgfnum="32480"/>
</outline>
<outline text="}" created="Wed, 27 Nov 2013 21:59:01 GMT" pgfnum="32477"/>
</outline>
<outline text="}" created="Wed, 27 Nov 2013 22:01:15 GMT" pgfnum="32488"/>
</outline>
<outline text="return (true);" created="Wed, 27 Nov 2013 21:59:44 GMT" pgfnum="32481"/>
<outline text="},"/>
</outline>
<outline text="speakerBeep: function () { //1/27/20 by DW">
<outline text="try {">
<outline text="speakerBeep ();"/>
<outline text="}"/>
</outline>
<outline text="catch (err) {">
<outline text="console.log ("beep");"/>
<outline text="}"/>
</outline>
<outline text="},"/>
</outline>
<outline text="getIconHtml: function (iconName) { //1/30/20 by DW ">
<outline text="var faClass = "far";"/>
<outline text="if (iconName == "caret-right") {">
<outline text="faClass = "fas";"/>
<outline text="}"/>
</outline>
<outline text="if (iconName == "twitter") {">
<outline text="faClass = "fab";"/>
<outline text="}"/>
</outline>
<outline text="if (iconName == "markdown") {">
<outline text="faClass = "fab";"/>
<outline text="}"/>
</outline>
<outline text="if (iconName == "rss") { //3/11/22 by DW">
<outline text="faClass = "fas";"/>
<outline text="}"/>
</outline>
<outline text="return ("<i class=\"node-icon " + faClass + " fa-"+ iconName +"\"></i>");"/>
<outline text="return ("<i class=\"node-icon far fa-"+ iconName +"\"></i>");" isComment="true"/>
<outline text="},"/>
</outline>
<outline text="getKeystroke: function (event) { //2/12/20 by DW">
<outline text="var concordKeystrokes = {">
<outline text=""backspace": "backspace", "/>
<outline text=""tab": "tab","/>
<outline text=""return": "return","/>
<outline text=""delete": "delete","/>
<outline text=""uparrow": "cursor-up","/>
<outline text=""downarrow": "cursor-down","/>
<outline text=""leftarrow": "cursor-left","/>
<outline text=""rightarrow": "cursor-right","/>
<outline text=""/>
<outline text=""meta-A": "select-all","/>
<outline text=""meta-B": "bolden","/>
<outline text=""meta-C": "copy","/>
<outline text=""meta-D": "reorg-down","/>
<outline text=""meta-F": "find", //9/19/13 by DW"/>
<outline text=""meta-I": "italicize","/>
<outline text=""meta-L": "reorg-left","/>
<outline text=""meta-R": "reorg-right","/>
<outline text=""meta-U": "reorg-up","/>
<outline text=""meta-V": "paste","/>
<outline text=""meta-X": "cut","/>
<outline text=""meta-Z": "undo","/>
<outline text=""/>
<outline text=""meta-[": "promote","/>
<outline text=""meta-]": "demote","/>
<outline text=""/>
<outline text=""meta-\\": "toggle-comment","/>
<outline text=""meta-/": "run-selection","/>
<outline text=""meta-`": "toggle-render","/>
<outline text=""meta-,": "toggle-expand""/>
<outline text="}"/>
</outline>
<outline text="function concordMetaizeKeystroke (event) { //9/17/13 by DW">
<outline text="Changes" isComment="true">
<outline text="2/17/20; 12:30:26 PM by DW">
<outline text="Added cases for pageup, pagedown, home and end. "/>
</outline>
<outline text="2/6/20; 2:01:26 PM by DW">
<outline text="Add "meta-" if the meta key is down, in all cases. previously we'd only add them for A through Z"/>
</outline>
</outline>
<outline text="var flmeta = event.metaKey || event.ctrlKey;"/>
<outline text="function checkspecials (ch) {">
<outline text="switch (ch) {">
<outline text="case 8:">
<outline text="return ("backspace");"/>
</outline>
<outline text="case 9:">
<outline text="return ("tab");"/>
</outline>
<outline text="case 13:">
<outline text="return ("return");"/>
</outline>
<outline text="case 33: ">
<outline text="return ("pageup");"/>
</outline>
<outline text="case 34: ">
<outline text="return ("pagedown");"/>
</outline>
<outline text="case 35: ">
<outline text="return ("end");"/>
</outline>
<outline text="case 36: ">
<outline text="return ("home");"/>
</outline>
<outline text="case 37:">
<outline text="return ("leftarrow");"/>
</outline>
<outline text="case 38:">
<outline text="return ("uparrow");"/>
</outline>
<outline text="case 39:">
<outline text="return ("rightarrow");"/>
</outline>
<outline text="case 40:">
<outline text="return ("downarrow");"/>
</outline>
<outline text="case 46:">
<outline text="return ("delete");"/>
</outline>
<outline text="case 188:">
<outline text="return (",");"/>
</outline>
<outline text="case 190:">
<outline text="return (".");"/>
</outline>
<outline text="case 191:">
<outline text="return ("/");"/>
</outline>
<outline text="case 192:">
<outline text="return ("`");"/>
</outline>
<outline text="case 219:">
<outline text="return ("[");"/>
</outline>
<outline text="case 220:">
<outline text="return ("\\");"/>
</outline>
<outline text="case 221:">
<outline text="return ("]");"/>
</outline>
<outline text="}"/>
</outline>
<outline text="switch (ch) {" isComment="true">
<outline text="case 8:">
<outline text="return ("backspace");"/>
</outline>
<outline text="case 9:">
<outline text="return ("tab");"/>
</outline>
<outline text="case 13:">
<outline text="return ("return");"/>
</outline>
<outline text="case 33: //2/17/20 by DW">
<outline text="return ("pageup");"/>
</outline>
<outline text="case 34: //2/17/20 by DW">
<outline text="return ("pagedown");"/>
</outline>
<outline text="case 35: //2/17/20 by DW">
<outline text="return ("end");"/>
</outline>
<outline text="case 36: //2/17/20 by DW">
<outline text="return ("home");"/>
</outline>
<outline text="case 37:">
<outline text="return ("leftarrow");"/>
</outline>
<outline text="case 38:">
<outline text="return ("uparrow");"/>
</outline>
<outline text="case 39:">
<outline text="return ("rightarrow");"/>
</outline>
<outline text="case 40:">
<outline text="return ("downarrow");"/>
</outline>
<outline text="case 46:">
<outline text="return ("delete");"/>
</outline>
<outline text="case 188:">
<outline text="if (flmeta) {">
<outline text="return ("meta-,");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 190:">
<outline text="if (flmeta) {">
<outline text="return ("meta-.");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 191:">
<outline text="if (flmeta) {">
<outline text="return ("meta-/");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 192:">
<outline text="if (flmeta) {">
<outline text="return ("meta-`");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 219:">
<outline text="if (flmeta) {">
<outline text="return ("meta-[");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 220:">
<outline text="if (flmeta) {">
<outline text="return ("meta-\\");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="case 221:">
<outline text="if (flmeta) {">
<outline text="return ("meta-]");"/>
<outline text="}"/>
</outline>
</outline>
<outline text="}"/>
</outline>
<outline text="return (ch);"/>
<outline text="}"/>
</outline>
<outline text="var ch = event.which;"/>
<outline text="if ((ch >= 65) && (ch <= 90)) { //meta-A through meta-Z" created="Tue, 17 Sep 2013 22:10:20 GMT" pgfnum="30346">
<outline text="if (flmeta) {" created="Tue, 17 Sep 2013 22:12:11 GMT" pgfnum="30350">
<outline text="return ("meta-" + String.fromCharCode (ch));" created="Tue, 17 Sep 2013 22:12:22 GMT" pgfnum="30352"/>
<outline text="}" created="Tue, 17 Sep 2013 22:12:18 GMT" pgfnum="30351"/>
</outline>
<outline text="}" created="Tue, 17 Sep 2013 22:10:45 GMT" pgfnum="30349"/>
</outline>
<outline text="else {" created="Tue, 20 Apr 2021 16:51:30 GMT">
<outline text="if ((ch >= 48) && (ch <= 57)) { //meta-0 through meta-9 -- 4/20/21 by DW" created="Tue, 17 Sep 2013 22:10:20 GMT" pgfnum="30346">
<outline text="if (flmeta) {" created="Tue, 17 Sep 2013 22:12:11 GMT" pgfnum="30350">
<outline text="return ("meta-" + String.fromCharCode (ch));" created="Tue, 17 Sep 2013 22:12:22 GMT" pgfnum="30352"/>
<outline text="}" created="Tue, 17 Sep 2013 22:12:18 GMT" pgfnum="30351"/>
</outline>
<outline text="}" created="Tue, 17 Sep 2013 22:10:45 GMT" pgfnum="30349"/>
</outline>
<outline text="}" created="Tue, 20 Apr 2021 16:51:32 GMT"/>
</outline>
<outline text="var s = checkspecials (ch);"/>
<outline text="if (flmeta) {">
<outline text="return ("meta-" + s);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="return (s);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="var s = concordMetaizeKeystroke (event);"/>
<outline text="if (concordKeystrokes [s] !== undefined) {">
<outline text="var val = concordKeystrokes [s];"/>
<outline text="if (val.length > 0) { //2/23/14 by DW">
<outline text="return (val);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="return (s);"/>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="function ConcordOutline(container, options) {">
<outline text="this.container = container;"/>
<outline text="this.options = options;"/>
<outline text="this.id = null;"/>
<outline text="this.root = null;"/>
<outline text="this.editor = null;"/>
<outline text="this.op = null;"/>
<outline text="this.script = null;"/>
<outline text="this.pasteBin = null;"/>
<outline text="this.pasteBinFocus = function(){">
<outline text="if(!concord.ready){">
<outline text="return;"/>
<outline text="}"/>
</outline>
<outline text="if(concord.mobile){">
<outline text="return;"/>
<outline text="}"/>
</outline>
<outline text="if(this.root.is(":visible")){">
<outline text="var node = this.op.getCursor();"/>
<outline text="var nodeOffset = node.offset();"/>
<outline text="this.pasteBin.offset(nodeOffset);"/>
<outline text="this.pasteBin.css("z-index","1000");"/>
<outline text="if((this.pasteBin.text()=="")||(this.pasteBin.text()=="\n")){">
<outline text="this.pasteBin.text("...");"/>
<outline text="}"/>
</outline>
<outline text="this.op.focusCursor();"/>
<outline text="this.pasteBin.focus();"/>
<outline text="if(this.pasteBin[0] === document.activeElement){">
<outline text="document.execCommand("selectAll");"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this.callbacks = function(callbacks) {">
<outline text="if(callbacks) {">
<outline text="this.root.data("callbacks", callbacks);"/>
<outline text="return callbacks;"/>
</outline>
<outline text="} else {">
<outline text="if(this.root.data("callbacks")) {">
<outline text="return this.root.data("callbacks");"/>
<outline text="} else {">
<outline text="return {};"/>
<outline text="}"/>
</outline>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this.fireCallback = function(name, value) {">
<outline text="var cb = this.callbacks()[name]"/>
<outline text="if(cb) {">
<outline text="cb(value);"/>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this.prefs = function(newprefs) {">
<outline text="var prefs = this.root.data("prefs");"/>
<outline text="if(prefs == undefined){">
<outline text="prefs = {};"/>
<outline text="}"/>
</outline>
<outline text="if(newprefs) {">
<outline text="for(var key in newprefs){">
<outline text="prefs[key] = newprefs[key];"/>
<outline text="}"/>
</outline>
<outline text="this.root.data("prefs", prefs);"/>
<outline text="if(prefs.readonly){">
<outline text="this.root.addClass("readonly");"/>
<outline text="}"/>
</outline>
<outline text="if(prefs.renderMode!==undefined){">
<outline text="this.root.data("renderMode", prefs.renderMode);"/>
<outline text="}"/>
</outline>
<outline text="if(prefs.contextMenu){">
<outline text="$(prefs.contextMenu).hide();"/>
<outline text="}"/>
</outline>
<outline text="var style = {};"/>
<outline text="if(prefs.outlineFont) {">
<outline text="style["font-family"] = prefs.outlineFont;"/>
<outline text="}"/>
</outline>
<outline text="if(prefs.outlineFontSize) {">
<outline text="prefs.outlineFontSize = parseInt(prefs.outlineFontSize);"/>
<outline text="style["font-size"] = prefs.outlineFontSize + "px";"/>
<outline text="style["min-height"] = (prefs.outlineFontSize + 6) + "px";"/>
<outline text="style["line-height"] = (prefs.outlineFontSize + 6) + "px";"/>
<outline text="}"/>
</outline>
<outline text="if(prefs.outlineLineHeight) {">
<outline text="prefs.outlineLineHeight = parseInt(prefs.outlineLineHeight);"/>
<outline text="style["min-height"] = prefs.outlineLineHeight + "px";"/>
<outline text="style["line-height"] = prefs.outlineLineHeight + "px";"/>
<outline text="}"/>
</outline>
<outline text="this.root.parent().find("style.prefsStyle").remove();"/>
<outline text="var css = '<style type="text/css" class="prefsStyle">\n';"/>
<outline text="var cssId="";"/>
<outline text="if(this.root.parent().attr("id")){">
<outline text="cssId="#"+this.root.parent().attr("id");"/>
<outline text="}"/>
</outline>
<outline text="css += cssId + ' .concord .concord-node .concord-wrapper .concord-text {';"/>
<outline text="for(var attribute in style) {">
<outline text="css += attribute + ': ' + style[attribute] + ';';"/>
<outline text="}"/>
</outline>
<outline text="css += '}\n';"/>
<outline text="css += cssId + ' .concord .concord-node .concord-wrapper .node-icon {';"/>
<outline text="for(var attribute in style) {">
<outline text="if(attribute!="font-family"){">
<outline text="css += attribute + ': ' + style[attribute] + ';';"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="css += '}\n'"/>
<outline text="var wrapperPaddingLeft = prefs.outlineLineHeight;"/>
<outline text="if(wrapperPaddingLeft===undefined){">
<outline text="wrapperPaddingLeft = prefs.outlineFontSize;"/>
<outline text="}"/>
</outline>
<outline text="if(wrapperPaddingLeft!== undefined){">
<outline text="css += cssId + ' .concord .concord-node .concord-wrapper {';"/>
<outline text="css += "padding-left: " + wrapperPaddingLeft + "px";"/>
<outline text="css += "}\n";"/>
<outline text="css += cssId + ' .concord ol {';"/>
<outline text="css += "padding-left: " + wrapperPaddingLeft + "px";"/>
<outline text="css += "}\n";"/>
<outline text="}"/>
</outline>
<outline text="css += '</style>\n';"/>
<outline text="this.root.before(css);"/>
<outline text="if(newprefs.css){">
<outline text="this.op.setStyle(newprefs.css);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="return prefs;"/>
<outline text="};"/>
</outline>
<outline text="this.afterInit = function() {">
<outline text="this.editor = new ConcordEditor(this.root, this);"/>
<outline text="this.op = new ConcordOp(this.root, this);"/>
<outline text="this.script = new ConcordScript(this.root, this);"/>
<outline text="if(options) {">
<outline text="if(options.prefs) {">
<outline text="this.prefs(options.prefs);"/>
<outline text="}"/>
</outline>
<outline text="if(options.open) {">
<outline text="this.root.data("open", options.open);"/>
<outline text="}"/>
</outline>
<outline text="if(options.save) {">
<outline text="this.root.data("save", options.save);"/>
<outline text="}"/>
</outline>
<outline text="if(options.callbacks) {">
<outline text="this.callbacks(options.callbacks);"/>
<outline text="}"/>
</outline>
<outline text="if(options.id) {">
<outline text="this.root.data("id", options.id);"/>
<outline text="this.open();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this.init = function() {">
<outline text="if($(container).find(".concord-root:first").length > 0) {">
<outline text="this.root = $(container).find(".concord-root:first");"/>
<outline text="this.pasteBin = $(container).find(".pasteBin:first");"/>
<outline text="this.afterInit();"/>
<outline text="return;"/>
<outline text="}"/>
</outline>
<outline text="var root = $("<ol></ol>");"/>
<outline text="root.addClass("concord concord-root");"/>
<outline text="root.appendTo(container);"/>
<outline text="this.root = root;"/>
<outline text="var pasteBin = $('<div class="pasteBin" contenteditable="true" style="position: absolute; height: 1px; width:1px; outline:none; overflow:hidden;"></div>');"/>
<outline text="pasteBin.appendTo(container);"/>
<outline text="this.pasteBin = pasteBin;"/>
<outline text="this.afterInit();"/>
<outline text="this.events = new ConcordEvents(this.root, this.editor, this.op, this);"/>
<outline text="};"/>
</outline>
<outline text="this["new"] = function() {">
<outline text="this.op.wipe();"/>
<outline text="};"/>
</outline>
<outline text="this.open = function(cb) {">
<outline text="var opmlId = this.root.data("id");"/>
<outline text="if(!opmlId) {">
<outline text="return;"/>
<outline text="}"/>
</outline>
<outline text="var root = this.root;"/>
<outline text="var editor = this.editor;"/>
<outline text="var op = this.op;"/>
<outline text="var openUrl = "http://concord.smallpicture.com/open";"/>
<outline text="if(root.data("open")) {">
<outline text="openUrl = root.data("open");"/>
<outline text="}"/>
</outline>
<outline text="params = {}"/>
<outline text="if(opmlId.match(/^http.+$/)) {">
<outline text="params["url"] = opmlId"/>
<outline text="} else {">
<outline text="params["id"] = opmlId"/>
<outline text="}"/>
</outline>
</outline>
<outline text="$.ajax({">
<outline text="type: 'POST',"/>
<outline text="url: openUrl,"/>
<outline text="data: params,"/>
<outline text="dataType: "xml","/>
<outline text="success: function(opml) {">
<outline text="if(opml) {">
<outline text="op.xmlToOutline(opml);"/>
<outline text="if(cb) {">
<outline text="cb();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="},"/>
</outline>
<outline text="error: function() {">
<outline text="if(root.find(".concord-node").length == 0) {">
<outline text="op.wipe();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this.save = function(cb) {">
<outline text="var opmlId = this.root.data("id");"/>
<outline text="if(opmlId && this.op.changed()) {">
<outline text="var saveUrl = "http://concord.smallpicture.com/save";"/>
<outline text="if(this.root.data("save")) {">
<outline text="saveUrl = this.root.data("save");"/>
<outline text="}"/>
</outline>
<outline text="var concordInstance = this;"/>
<outline text="var opml = this.op.outlineToXml();"/>
<outline text="$.ajax({">
<outline text="type: 'POST',"/>
<outline text="url: saveUrl,"/>
<outline text="data: {">
<outline text=""opml": opml,"/>
<outline text=""id": opmlId"/>
<outline text="},"/>
</outline>
<outline text="dataType: "json","/>
<outline text="success: function(json) {">
<outline text="concordInstance.op.clearChanged();"/>
<outline text="if(cb) {">
<outline text="cb(json);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this["import"] = function(opmlId, cb) {">
<outline text="var openUrl = "http://concordold.smallpicture.com/open";"/>
<outline text="var root = this.root;"/>
<outline text="var concordInstance = this;"/>
<outline text="if(root.data("open")) {">
<outline text="openUrl = root.data("open");"/>
<outline text="}"/>
</outline>
<outline text="params = {}"/>
<outline text="if(opmlId.match(/^http.+$/)) {">
<outline text="params["url"] = opmlId;"/>
<outline text="} else {">
<outline text="params["id"] = opmlId;"/>
<outline text="}"/>
</outline>
</outline>
<outline text="$.ajax({">
<outline text="type: 'POST',"/>
<outline text="url: openUrl,"/>
<outline text="data: params,"/>
<outline text="dataType: "xml","/>
<outline text="success: function(opml) {">
<outline text="if(opml) {">
<outline text="var cursor = root.find(".concord-cursor:first");"/>
<outline text="$(opml).find("body").children("outline").each(function() {">
<outline text="var node = concordInstance.editor.build($(this));"/>
<outline text="cursor.after(node);"/>
<outline text="cursor = node;"/>
<outline text="});"/>
</outline>
<outline text="concordInstance.op.markChanged();"/>
<outline text="if(cb) {">
<outline text="cb();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="},"/>
</outline>
<outline text="error: function() {">
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="};"/>
</outline>
<outline text="this["export"] = function() {">
<outline text="var context = this.root.find(".concord-cursor:first");"/>
<outline text="if(context.length == 0) {">
<outline text="context = this.root.find(".concord-root:first");"/>
<outline text="}"/>
</outline>
<outline text="return this.editor.opml(context);"/>
<outline text="};"/>
</outline>
<outline text="this.init();"/>
<outline text="}"/>
</outline>
<outline text="function ConcordEditor(root, concordInstance) {">
<outline text="this.makeNode = function(){">
<outline text="var node = $("<li></li>");"/>
<outline text="node.addClass("concord-node");"/>
<outline text="var wrapper = $("<div class='concord-wrapper'></div>");"/>
<outline text="var iconName="caret-right";"/>
<outline text="var icon = ConcordUtil.getIconHtml (iconName);"/>
<outline text="wrapper.append(icon);"/>
<outline text="wrapper.addClass("type-icon");"/>
<outline text="var text = $("<div class='concord-text' contenteditable='true'></div>");"/>
<outline text="var outline = $("<ol></ol>");"/>
<outline text="text.appendTo(wrapper);"/>
<outline text="wrapper.appendTo(node);"/>
<outline text="outline.appendTo(node);"/>
<outline text="return node;"/>
<outline text="};"/>
</outline>
<outline text="this.dragMode = function() {">
<outline text="root.data("draggingChange", root.children().clone(true, true));"/>
<outline text="root.addClass("dragging");"/>
<outline text="root.data("dragging", true);"/>
<outline text="};"/>
</outline>