Fossil SCM

Replace /pikchrshow with a WASM-based version and rename the prior version to /pikchrshowcs (cs=client/server). There are still a couple layout/style quirks to resolve, and a feature or two to port from the legacy app, but it more or less works.

stephan 2022-06-06 18:02 trunk merge
Commit 321f01a86e835d37d4e9c4952f4eac2dc791b18b58aa8ef78468377e665b8f04
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
1
+) {
2
+ r initPikchrModuDi
3
+var initPikchrMod || {};e["ready"] = new Promise(fhis by
4
+// setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
5
+ throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
6
+
7
+function locateFile(path) {
8
+ if (Module["locaeFile"]) {
9
+ retut they can
10
+// refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
11
+
12
+fnse = awaitirectory + path;
13
+}
14
+
15
+
16
+
17
+/aitirectory + path;
18
+}
19
+
20
+
21
+
22
+// Ho);nt runtime environments.}
23
+var initPikchrModule = (() => {
24
+ vchrModule var initPikchrModule =, setWindowTitle;
25
+ed in the code, and you
26
+//d in the code, and yORKER) {
27
+iseResvar readomiseResolve = resolveft());
28
+ }
29
+ }
30
+ // = reject;
31
+});
32
+
33
+// Determine nvironment we are in}
34
+ if (_scriptDir) {
35
+iseResvar readyPromi_scriptDir;
36
+ }
37
+Throw) => {
38
+ throw tindexOf("blob:") !== 0) {
39
+iseResvar readyPromiscriptDirectory.substr(0, ) => {
40
+ thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRO) {
41
+ r initPikchrModuDi
42
+var initPikchrMod || {};e["ready"] = new Promise(fhis by
43
+// setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
44
+ throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
45
+
46
+function locateFile(path) {
47
+ if (Module["locaeFile"]) {
48
+ retut they can
49
+// refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
50
+
51
+fnse = awaitirectory + path;
52
+}
53
+
54
+
55
+
56
+/aitirectory + path;
57
+}
58
+
59
+
60
+
61
+// Ho);nt runtime environments.}
62
+var initPikchrModule = (() => {
63
+ vchrModule var initPikchrModule =, setWindowTitle;
64
+ed in the code, and you
65
+//d in the code, and yORKER) {
66
+iseResvar readomiseResolve = resolveft());
67
+ }
68
+ }
69
+ // = reject;
70
+});
71
+
72
+// Determine nvironment we are in}
73
+ if (_scriptDir) {
74
+iseResvar readyPromi_scriptDir;
75
+ }
76
+Throw) => {
77
+ throw tindexOf("blob:") !== 0) {
78
+iseResvar readyPromiscriptDirectory.substr(0, ) => {
79
+ thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRONME.src : undefined;
80
+ nresponse =>b() =>var function(str)function(arr)function(type) {
81
+ r()())PikchrMod || {};e["read) {
82
+ r initPikchrModuDi
83
+vtPikchrM
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
1 ) {
2 r initPikchrModuDi
3 var initPikchrMod || {};e["ready"] = new Promise(fhis by
4 // setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
5 throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
6
7 function locateFile(path) {
8 if (Module["locaeFile"]) {
9 retut they can
10 // refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
11
12 fnse = awaitirectory + path;
13 }
14
15
16
17 /aitirectory + path;
18 }
19
20
21
22 // Ho);nt runtime environments.}
23 var initPikchrModule = (() => {
24 vchrModule var initPikchrModule =, setWindowTitle;
25 ed in the code, and you
26 //d in the code, and yORKER) {
27 iseResvar readomiseResolve = resolveft());
28 }
29 }
30 // = reject;
31 });
32
33 // Determine nvironment we are in}
34 if (_scriptDir) {
35 iseResvar readyPromi_scriptDir;
36 }
37 Throw) => {
38 throw tindexOf("blob:") !== 0) {
39 iseResvar readyPromiscriptDirectory.substr(0, ) => {
40 thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRO) {
41 r initPikchrModuDi
42 var initPikchrMod || {};e["ready"] = new Promise(fhis by
43 // setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
44 throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
45
46 function locateFile(path) {
47 if (Module["locaeFile"]) {
48 retut they can
49 // refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
50
51 fnse = awaitirectory + path;
52 }
53
54
55
56 /aitirectory + path;
57 }
58
59
60
61 // Ho);nt runtime environments.}
62 var initPikchrModule = (() => {
63 vchrModule var initPikchrModule =, setWindowTitle;
64 ed in the code, and you
65 //d in the code, and yORKER) {
66 iseResvar readomiseResolve = resolveft());
67 }
68 }
69 // = reject;
70 });
71
72 // Determine nvironment we are in}
73 if (_scriptDir) {
74 iseResvar readyPromi_scriptDir;
75 }
76 Throw) => {
77 throw tindexOf("blob:") !== 0) {
78 iseResvar readyPromiscriptDirectory.substr(0, ) => {
79 thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRONME.src : undefined;
80 nresponse =>b() =>var function(str)function(arr)function(type) {
81 r()())PikchrMod || {};e["read) {
82 r initPikchrModuDi
83 vtPikchrM
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
1
+) {
2
+ r initPikchrModuDi
3
+var initPikchrMod || {};e["ready"] = new Promise(fhis by
4
+// setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
5
+ throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
6
+
7
+function locateFile(path) {
8
+ if (Module["locaeFile"]) {
9
+ retut they can
10
+// refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
11
+
12
+fnse = awaitirectory + path;
13
+}
14
+
15
+
16
+
17
+/aitirectory + path;
18
+}
19
+
20
+
21
+
22
+// Ho);nt runtime environments.}
23
+var initPikchrModule = (() => {
24
+ vchrModule var initPikchrModule =, setWindowTitle;
25
+ed in the code, and you
26
+//d in the code, and yORKER) {
27
+iseResvar readomiseResolve = resolveft());
28
+ }
29
+ }
30
+ // = reject;
31
+});
32
+
33
+// Determine nvironment we are in}
34
+ if (_scriptDir) {
35
+iseResvar readyPromi_scriptDir;
36
+ }
37
+Throw) => {
38
+ throw tindexOf("blob:") !== 0) {
39
+iseResvar readyPromiscriptDirectory.substr(0, ) => {
40
+ thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRO) {
41
+ r initPikchrModuDi
42
+var initPikchrMod || {};e["ready"] = new Promise(fhis by
43
+// setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
44
+ throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
45
+
46
+function locateFile(path) {
47
+ if (Module["locaeFile"]) {
48
+ retut they can
49
+// refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
50
+
51
+fnse = awaitirectory + path;
52
+}
53
+
54
+
55
+
56
+/aitirectory + path;
57
+}
58
+
59
+
60
+
61
+// Ho);nt runtime environments.}
62
+var initPikchrModule = (() => {
63
+ vchrModule var initPikchrModule =, setWindowTitle;
64
+ed in the code, and you
65
+//d in the code, and yORKER) {
66
+iseResvar readomiseResolve = resolveft());
67
+ }
68
+ }
69
+ // = reject;
70
+});
71
+
72
+// Determine nvironment we are in}
73
+ if (_scriptDir) {
74
+iseResvar readyPromi_scriptDir;
75
+ }
76
+Throw) => {
77
+ throw tindexOf("blob:") !== 0) {
78
+iseResvar readyPromiscriptDirectory.substr(0, ) => {
79
+ thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRONME.src : undefined;
80
+ nresponse =>b() =>var function(str)function(arr)function(type) {
81
+ r()())PikchrMod || {};e["read) {
82
+ r initPikchrModuDi
83
+vtPikchrM
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/pikchr-module.js
+++ b/extsrc/pikchr-module.js
@@ -0,0 +1,83 @@
1 ) {
2 r initPikchrModuDi
3 var initPikchrMod || {};e["ready"] = new Promise(fhis by
4 // setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
5 throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
6
7 function locateFile(path) {
8 if (Module["locaeFile"]) {
9 retut they can
10 // refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
11
12 fnse = awaitirectory + path;
13 }
14
15
16
17 /aitirectory + path;
18 }
19
20
21
22 // Ho);nt runtime environments.}
23 var initPikchrModule = (() => {
24 vchrModule var initPikchrModule =, setWindowTitle;
25 ed in the code, and you
26 //d in the code, and yORKER) {
27 iseResvar readomiseResolve = resolveft());
28 }
29 }
30 // = reject;
31 });
32
33 // Determine nvironment we are in}
34 if (_scriptDir) {
35 iseResvar readyPromi_scriptDir;
36 }
37 Throw) => {
38 throw tindexOf("blob:") !== 0) {
39 iseResvar readyPromiscriptDirectory.substr(0, ) => {
40 thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRO) {
41 r initPikchrModuDi
42 var initPikchrMod || {};e["ready"] = new Promise(fhis by
43 // setting the ENVIRONMENT// setting the ENVIRONMENT settingow) => {
44 throw toT(resolve, reject) =>e present at the end iffunction(resolve, reject) end if `scriptDirectory` is lice"";
45
46 function locateFile(path) {
47 if (Module["locaeFile"]) {
48 retut they can
49 // refer to Module (if they choose; th// Sometimes an exivartory` is lice"";
50
51 fnse = awaitirectory + path;
52 }
53
54
55
56 /aitirectory + path;
57 }
58
59
60
61 // Ho);nt runtime environments.}
62 var initPikchrModule = (() => {
63 vchrModule var initPikchrModule =, setWindowTitle;
64 ed in the code, and you
65 //d in the code, and yORKER) {
66 iseResvar readomiseResolve = resolveft());
67 }
68 }
69 // = reject;
70 });
71
72 // Determine nvironment we are in}
73 if (_scriptDir) {
74 iseResvar readyPromi_scriptDir;
75 }
76 Throw) => {
77 throw tindexOf("blob:") !== 0) {
78 iseResvar readyPromiscriptDirectory.substr(0, ) => {
79 thrvar runtimeKeepavar buffer,aliveCounter = 0 || runtimeKeepaliveCounter > 0binaryFilevar initPikchrModuDir = typGlobalBufferAn ENVIRONME.src : undefined;
80 nresponse =>b() =>var function(str)function(arr)function(type) {
81 r()())PikchrMod || {};e["read) {
82 r initPikchrModuDi
83 vtPikchrM
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
1
+/*
2
+ 2022-05-20
3
+
4
+ The author disresult like with DOM elements,
5
+ we have to define a lower-level message API. Messages abstractly
6
+ look like:
7
+
8
+ { type: string, data: type-specific value }
9
+
10
+ Where 'type' is used for dispatching and 'data' is a
11
+ 'type'-dependent value.
12
+
13
+ The 'type' values expected by each side of the main/worker
14
+ connecthe JS Worker file for the pikchr any time as this experiment evolves.
15
+
16
+ Main-to-Worker message types:
17
+
18
+ - pikchr: data=pikchr-format text to render or an object:
19
+
20
+ {
21
+ pikchr: source code for the pikchr,
22
+ darkMode: boolean true to adjust colors for a dark color scheme,
23
+ cssClass: CSS class name to add to the typeshe author disclaims copyright to this source code. In place of a
24
+ legal notice, here is a blessing:
25
+
26
+ * May you do good and not evil.
27
+ * May you find forgiveness for yourself and forgive others.
28
+ * May you share freely, never taking more than you give.
29
+
30
+ ***********************************************************************
31
+
32
+ This is a JS Worker file for use wi data:{
33
+ type:'status',
34
+ data: {text:string|null, step:1-based-integer}
35
+ }
36
+
37
+ with an incrementing step value for each subsequent message. When
38
+ the module loading is complete, a message with a text value of
39
+ n ull is posted.
40
+
41
+ - pikchr:
42
+
43
+ {type: 'pikchr',
44
+ data:{
45
+ pikchr: input text,
46
+ result: rendered result (SVG on success, HTML on error),
47
+ isError: bool, true if .pikchr holds an error report,
48
+ flags: integer: flags used to configure the pikchr rendering,
49
+ width: if !isError, width (integer pixels) of the SVG,
50
+ height: if !isError, height (integer pixels) of the SVG
51
+ }
52
+ }
53
+
54
+*/
55
+
56
+"use strict";
57
+(function(){
58
+ /**
59
+ Posts a message in the form {type,data} unless passed more than
60
+ 2 args, in which case it posts {type, data:[arg1...argN]}.
61
+ */
62
+ const wMsg = function(type,data){
63
+ postMessage({
64
+ type,
65
+ data: arguments.length<3
66
+ ? data
67
+ {
68
+ text: input text,
69
+ pikchrq@Z_,p@_T,4:
70
+ }1G@GJ,1:.HC@dB,F:with the result8@1my,V: {type:'pikchr', data:{
71
+L@1DW,C:input text,
72
+L@1Dz,E:result text,
73
+ C@1BO,r:isError: true if result holds an error
74
+ }}4f@u~,k@zr,C:'string']);
75
+Q@1MU,6:start'a@13h,U@1DN,7:ev.dataG@10l,Z:result: (f._(ev.data) || "").trim()1c@1Fi,s@1L3,1M@1Md,8:fiddle-wI@GW,OF@1OO,p:/console.error("initPikchrModule =",initPikchrModule46@1lX,OgTFP;
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
1 /*
2 2022-05-20
3
4 The author disresult like with DOM elements,
5 we have to define a lower-level message API. Messages abstractly
6 look like:
7
8 { type: string, data: type-specific value }
9
10 Where 'type' is used for dispatching and 'data' is a
11 'type'-dependent value.
12
13 The 'type' values expected by each side of the main/worker
14 connecthe JS Worker file for the pikchr any time as this experiment evolves.
15
16 Main-to-Worker message types:
17
18 - pikchr: data=pikchr-format text to render or an object:
19
20 {
21 pikchr: source code for the pikchr,
22 darkMode: boolean true to adjust colors for a dark color scheme,
23 cssClass: CSS class name to add to the typeshe author disclaims copyright to this source code. In place of a
24 legal notice, here is a blessing:
25
26 * May you do good and not evil.
27 * May you find forgiveness for yourself and forgive others.
28 * May you share freely, never taking more than you give.
29
30 ***********************************************************************
31
32 This is a JS Worker file for use wi data:{
33 type:'status',
34 data: {text:string|null, step:1-based-integer}
35 }
36
37 with an incrementing step value for each subsequent message. When
38 the module loading is complete, a message with a text value of
39 n ull is posted.
40
41 - pikchr:
42
43 {type: 'pikchr',
44 data:{
45 pikchr: input text,
46 result: rendered result (SVG on success, HTML on error),
47 isError: bool, true if .pikchr holds an error report,
48 flags: integer: flags used to configure the pikchr rendering,
49 width: if !isError, width (integer pixels) of the SVG,
50 height: if !isError, height (integer pixels) of the SVG
51 }
52 }
53
54 */
55
56 "use strict";
57 (function(){
58 /**
59 Posts a message in the form {type,data} unless passed more than
60 2 args, in which case it posts {type, data:[arg1...argN]}.
61 */
62 const wMsg = function(type,data){
63 postMessage({
64 type,
65 data: arguments.length<3
66 ? data
67 {
68 text: input text,
69 pikchrq@Z_,p@_T,4:
70 }1G@GJ,1:.HC@dB,F:with the result8@1my,V: {type:'pikchr', data:{
71 L@1DW,C:input text,
72 L@1Dz,E:result text,
73 C@1BO,r:isError: true if result holds an error
74 }}4f@u~,k@zr,C:'string']);
75 Q@1MU,6:start'a@13h,U@1DN,7:ev.dataG@10l,Z:result: (f._(ev.data) || "").trim()1c@1Fi,s@1L3,1M@1Md,8:fiddle-wI@GW,OF@1OO,p:/console.error("initPikchrModule =",initPikchrModule46@1lX,OgTFP;
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
1
+/*
2
+ 2022-05-20
3
+
4
+ The author disresult like with DOM elements,
5
+ we have to define a lower-level message API. Messages abstractly
6
+ look like:
7
+
8
+ { type: string, data: type-specific value }
9
+
10
+ Where 'type' is used for dispatching and 'data' is a
11
+ 'type'-dependent value.
12
+
13
+ The 'type' values expected by each side of the main/worker
14
+ connecthe JS Worker file for the pikchr any time as this experiment evolves.
15
+
16
+ Main-to-Worker message types:
17
+
18
+ - pikchr: data=pikchr-format text to render or an object:
19
+
20
+ {
21
+ pikchr: source code for the pikchr,
22
+ darkMode: boolean true to adjust colors for a dark color scheme,
23
+ cssClass: CSS class name to add to the typeshe author disclaims copyright to this source code. In place of a
24
+ legal notice, here is a blessing:
25
+
26
+ * May you do good and not evil.
27
+ * May you find forgiveness for yourself and forgive others.
28
+ * May you share freely, never taking more than you give.
29
+
30
+ ***********************************************************************
31
+
32
+ This is a JS Worker file for use wi data:{
33
+ type:'status',
34
+ data: {text:string|null, step:1-based-integer}
35
+ }
36
+
37
+ with an incrementing step value for each subsequent message. When
38
+ the module loading is complete, a message with a text value of
39
+ n ull is posted.
40
+
41
+ - pikchr:
42
+
43
+ {type: 'pikchr',
44
+ data:{
45
+ pikchr: input text,
46
+ result: rendered result (SVG on success, HTML on error),
47
+ isError: bool, true if .pikchr holds an error report,
48
+ flags: integer: flags used to configure the pikchr rendering,
49
+ width: if !isError, width (integer pixels) of the SVG,
50
+ height: if !isError, height (integer pixels) of the SVG
51
+ }
52
+ }
53
+
54
+*/
55
+
56
+"use strict";
57
+(function(){
58
+ /**
59
+ Posts a message in the form {type,data} unless passed more than
60
+ 2 args, in which case it posts {type, data:[arg1...argN]}.
61
+ */
62
+ const wMsg = function(type,data){
63
+ postMessage({
64
+ type,
65
+ data: arguments.length<3
66
+ ? data
67
+ {
68
+ text: input text,
69
+ pikchrq@Z_,p@_T,4:
70
+ }1G@GJ,1:.HC@dB,F:with the result8@1my,V: {type:'pikchr', data:{
71
+L@1DW,C:input text,
72
+L@1Dz,E:result text,
73
+ C@1BO,r:isError: true if result holds an error
74
+ }}4f@u~,k@zr,C:'string']);
75
+Q@1MU,6:start'a@13h,U@1DN,7:ev.dataG@10l,Z:result: (f._(ev.data) || "").trim()1c@1Fi,s@1L3,1M@1Md,8:fiddle-wI@GW,OF@1OO,p:/console.error("initPikchrModule =",initPikchrModule46@1lX,OgTFP;
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/pikchr-worker.js
+++ b/extsrc/pikchr-worker.js
@@ -0,0 +1,75 @@
1 /*
2 2022-05-20
3
4 The author disresult like with DOM elements,
5 we have to define a lower-level message API. Messages abstractly
6 look like:
7
8 { type: string, data: type-specific value }
9
10 Where 'type' is used for dispatching and 'data' is a
11 'type'-dependent value.
12
13 The 'type' values expected by each side of the main/worker
14 connecthe JS Worker file for the pikchr any time as this experiment evolves.
15
16 Main-to-Worker message types:
17
18 - pikchr: data=pikchr-format text to render or an object:
19
20 {
21 pikchr: source code for the pikchr,
22 darkMode: boolean true to adjust colors for a dark color scheme,
23 cssClass: CSS class name to add to the typeshe author disclaims copyright to this source code. In place of a
24 legal notice, here is a blessing:
25
26 * May you do good and not evil.
27 * May you find forgiveness for yourself and forgive others.
28 * May you share freely, never taking more than you give.
29
30 ***********************************************************************
31
32 This is a JS Worker file for use wi data:{
33 type:'status',
34 data: {text:string|null, step:1-based-integer}
35 }
36
37 with an incrementing step value for each subsequent message. When
38 the module loading is complete, a message with a text value of
39 n ull is posted.
40
41 - pikchr:
42
43 {type: 'pikchr',
44 data:{
45 pikchr: input text,
46 result: rendered result (SVG on success, HTML on error),
47 isError: bool, true if .pikchr holds an error report,
48 flags: integer: flags used to configure the pikchr rendering,
49 width: if !isError, width (integer pixels) of the SVG,
50 height: if !isError, height (integer pixels) of the SVG
51 }
52 }
53
54 */
55
56 "use strict";
57 (function(){
58 /**
59 Posts a message in the form {type,data} unless passed more than
60 2 args, in which case it posts {type, data:[arg1...argN]}.
61 */
62 const wMsg = function(type,data){
63 postMessage({
64 type,
65 data: arguments.length<3
66 ? data
67 {
68 text: input text,
69 pikchrq@Z_,p@_T,4:
70 }1G@GJ,1:.HC@dB,F:with the result8@1my,V: {type:'pikchr', data:{
71 L@1DW,C:input text,
72 L@1Dz,E:result text,
73 C@1BO,r:isError: true if result holds an error
74 }}4f@u~,k@zr,C:'string']);
75 Q@1MU,6:start'a@13h,U@1DN,7:ev.dataG@10l,Z:result: (f._(ev.data) || "").trim()1c@1Fi,s@1L3,1M@1Md,8:fiddle-wI@GW,OF@1OO,p:/console.error("initPikchrModule =",initPikchrModule46@1lX,OgTFP;

Binary file

Binary file

+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493493
494494
/* Content intended for logged in users should only be cached in
495495
** the browser, not some shared location.
496496
*/
497497
if( iReplyStatus!=304 ) {
498
- blob_appendf(&hdr, "Content-Type: %s; charset=utf-8\r\n", zContentType);
498
+ blob_appendf(&hdr, "Content-Type: %s\r\n", zContentType);
499499
if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500500
cgi_combine_header_and_body();
501501
blob_compress(&cgiContent[0], &cgiContent[0]);
502502
}
503503
504504
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493
494 /* Content intended for logged in users should only be cached in
495 ** the browser, not some shared location.
496 */
497 if( iReplyStatus!=304 ) {
498 blob_appendf(&hdr, "Content-Type: %s; charset=utf-8\r\n", zContentType);
499 if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500 cgi_combine_header_and_body();
501 blob_compress(&cgiContent[0], &cgiContent[0]);
502 }
503
504
--- src/cgi.c
+++ src/cgi.c
@@ -493,11 +493,11 @@
493
494 /* Content intended for logged in users should only be cached in
495 ** the browser, not some shared location.
496 */
497 if( iReplyStatus!=304 ) {
498 blob_appendf(&hdr, "Content-Type: %s\r\n", zContentType);
499 if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
500 cgi_combine_header_and_body();
501 blob_compress(&cgiContent[0], &cgiContent[0]);
502 }
503
504
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
11
(function(F/*the fossil object*/){
22
"use strict";
33
/**
4
- Client-side implementation of the /pikchrshow app. Requires that
4
+ Client-side implementation of the /pikchrshowcs app. Requires that
55
the fossil JS bootstrapping is complete and that these fossil JS
66
APIs have been installed: fossil.fetch, fossil.dom,
77
fossil.copybutton, fossil.popupwidget, fossil.storage
8
+
9
+ Maintenance funkiness note: this file is for the legacy
10
+ /pikchrshowcs app, which was formerly named /pikchrshow. This
11
+ file and its replacement were not renamed because the replacement
12
+ impl would end up getting this file's name and cause confusion in
13
+ the file history. Whether that confusion would be less than this
14
+ file's name matching the _other_ /pikchrshow impl will cause more
15
+ or less confusion than that remains to be seen.
816
*/
917
const E = (s)=>document.querySelector(s),
1018
D = F.dom,
1119
P = F.page;
1220
1321
1422
ADDED src/fossil.page.pikchrshowasm.js
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
1 (function(F/*the fossil object*/){
2 "use strict";
3 /**
4 Client-side implementation of the /pikchrshow app. Requires that
5 the fossil JS bootstrapping is complete and that these fossil JS
6 APIs have been installed: fossil.fetch, fossil.dom,
7 fossil.copybutton, fossil.popupwidget, fossil.storage
 
 
 
 
 
 
 
 
8 */
9 const E = (s)=>document.querySelector(s),
10 D = F.dom,
11 P = F.page;
12
13
14 DDED src/fossil.page.pikchrshowasm.js
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
1 (function(F/*the fossil object*/){
2 "use strict";
3 /**
4 Client-side implementation of the /pikchrshowcs app. Requires that
5 the fossil JS bootstrapping is complete and that these fossil JS
6 APIs have been installed: fossil.fetch, fossil.dom,
7 fossil.copybutton, fossil.popupwidget, fossil.storage
8
9 Maintenance funkiness note: this file is for the legacy
10 /pikchrshowcs app, which was formerly named /pikchrshow. This
11 file and its replacement were not renamed because the replacement
12 impl would end up getting this file's name and cause confusion in
13 the file history. Whether that confusion would be less than this
14 file's name matching the _other_ /pikchrshow impl will cause more
15 or less confusion than that remains to be seen.
16 */
17 const E = (s)=>document.querySelector(s),
18 D = F.dom,
19 P = F.page;
20
21
22 DDED src/fossil.page.pikchrshowasm.js
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
11
(function(F/*the fossil object*/){
22
"use strict";
33
/**
4
- Client-side implementation of the /pikchrshow app. Requires that
4
+ Client-side implementation of the /pikchrshowcs app. Requires that
55
the fossil JS bootstrapping is complete and that these fossil JS
66
APIs have been installed: fossil.fetch, fossil.dom,
77
fossil.copybutton, fossil.popupwidget, fossil.storage
8
+
9
+ Maintenance funkiness note: this file is for the legacy
10
+ /pikchrshowcs app, which was formerly named /pikchrshow. This
11
+ file and its replacement were not renamed because the replacement
12
+ impl would end up getting this file's name and cause confusion in
13
+ the file history. Whether that confusion would be less than this
14
+ file's name matching the _other_ /pikchrshow impl will cause more
15
+ or less confusion than that remains to be seen.
816
*/
917
const E = (s)=>document.querySelector(s),
1018
D = F.dom,
1119
P = F.page;
1220
1321
1422
ADDED src/fossil.page.pikchrshowasm.js
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
1 (function(F/*the fossil object*/){
2 "use strict";
3 /**
4 Client-side implementation of the /pikchrshow app. Requires that
5 the fossil JS bootstrapping is complete and that these fossil JS
6 APIs have been installed: fossil.fetch, fossil.dom,
7 fossil.copybutton, fossil.popupwidget, fossil.storage
 
 
 
 
 
 
 
 
8 */
9 const E = (s)=>document.querySelector(s),
10 D = F.dom,
11 P = F.page;
12
13
14 DDED src/fossil.page.pikchrshowasm.js
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -1,12 +1,20 @@
1 (function(F/*the fossil object*/){
2 "use strict";
3 /**
4 Client-side implementation of the /pikchrshowcs app. Requires that
5 the fossil JS bootstrapping is complete and that these fossil JS
6 APIs have been installed: fossil.fetch, fossil.dom,
7 fossil.copybutton, fossil.popupwidget, fossil.storage
8
9 Maintenance funkiness note: this file is for the legacy
10 /pikchrshowcs app, which was formerly named /pikchrshow. This
11 file and its replacement were not renamed because the replacement
12 impl would end up getting this file's name and cause confusion in
13 the file history. Whether that confusion would be less than this
14 file's name matching the _other_ /pikchrshow impl will cause more
15 or less confusion than that remains to be seen.
16 */
17 const E = (s)=>document.querySelector(s),
18 D = F.dom,
19 P = F.page;
20
21
22 DDED src/fossil.page.pikchrshowasm.js
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
1
+/*
2
+ 2022-05-20
3
+
4
+ ? vw/*
5
+ 2022-05-20
6
+
7
+ ? vw+'px' : null;
8
+.style.height = vh ? vh+'px' : null/*
9
+ 2022-05-20
10
+
11
+ Render = E('#btn-render'/*
12
+ 2022-05-20
13
+
14
+ ? vw+'px' : null;
15
+.style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
16
+const body = [m.result];
17
+ .unshift('```pikchr body.push('```}else if('wiki'===mode){
18
+.unshift();
19
+.push('</verbatim>}
20
+ PS.join('\PSPSPSPSPSPSPSPSPS
21
+ 2022-05-20
22
+
23
+ ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
24
+ *
25
+ The PikchrFiddle object is intended to be the primary app-level
26
+ object for of the fiddle application. It
27
+ uses a worker thread to load the WASM module and communicate
28
+ with it.
29
+ */
30
+ const PS/*local convenience alias*/ = F.PScalerenderMode: 'htm 'text','html'*/KT@cK,AO@xK,1: H@HF,6K@F5,JD@16j,[email protected] = E('#pikchr-output');
31
+ const eOutWrapper =S@ZN,4:;
32
+ K@17W,r@2cn,1:ex@2dl,1:ea@2ep,s:let content;
33
+ let sz;
34
+ switch(PS.renderMode){G@4FW,7:'text':N@3w0,q:'<textarea>'+m.result+'</textarea>';
35
+ eOut_@2pD,1:e~@2p3,8:default:N@3w0,M@2tT,1:eM@2rW,K@2pT,1:em@2sK,j:break;
36
+ }
37
+ eOut.innerHTML = content;f@2w6,L@2x0,q:Scale
38
+ && !m.isError && 'html'===PS.renderModI@3IG,Q:svg = E(eOut,':scope > svgI@21z,1P:vb = svg ? svg.ge('viewBox').split(' ') : false;
39
+ if(vb && 4===vb.lengthB@3RU,T: vw = (+vb[tru+vb[3] + 10)+'px';
40
+ }else parentg viewBox attribu
41
+ fit the rendered SVG0W,2B:['text','html'];
42
+ let ndx = modes.indexOf(mode) + 1;
43
+ if(ndx>=modes.length)
44
+ if(ndx>=modes.length) ndx = 0;
45
+ PS.renderMode = modes[ndx];
46
+ if(ec@3aT,1:eJ@3aT,I@3bV,3:
47
+ K@17W,QR@38B,7:scale')K@1bl,P@3hl,S:/* PS.config.renderAutoScale10@3Zn,Q:'html'==PS.renderMode && ec@3aT,1:eJ@3aT,16B@3bV,2Fjkh4;.legend = E(fs,'span.legendlegend txtup',eight = vh ? vh+'px'/*
48
+ 2022-05-20
49
+
50
+ ? vw/*
51
+ 2022-05-20
52
+
53
+ ? vw+'px' : null;
54
+.style.height = vh ? vh+'px' : null/*
55
+ 2022-05-20
56
+
57
+ Render = E('#btn-render'/*
58
+ 2022-05-20
59
+
60
+ ? vw+'px' : null;
61
+.style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
62
+const body = [m.result];
63
+ .unshift('```pikchr body.push('```}else if('wiki'===mode){
64
+.unshift();
65
+.push('</verbatim>}
66
+ PS.join('\PSPSPSPSPSPSPSPSPS
67
+ 2022-05-20
68
+
69
+ ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
70
+ *
71
+ The PikchrFiddle object is intended to be the primary app-level
72
+ object for the main-thread side of the fiddle application. It
73
+ uses a worker thread to load the WASM module and communicate
74
+ with it.
75
+ */
76
+ const PS/*local convenience alias*/ = F.PScalerenderMode: 'h Given a DOM element, this routine measures its "effective
77
+ height", which is the bounding top/bottom range of this element
78
+ and all of its children, recursively. For some DOM structure
79
+ cases, a parent may have a reported height of 0 even though
80
+ children have non-0 sizes.
81
+
82
+ Returns 0 if !e or if the element really has no height.
83
+ */
84
+ const effectiveHeight = function f(e){
85
+ if(!e) return 0;
86
+ if(!f.measure){
87
+ f.measure = function callee(e, depth){
88
+ if(!e const m = e if(0===depth){
89
+ callee.top = m.top;
90
+ callee.bottom = m.bottom;
91
+ callee.top = m.top ? Math.min(callee.top, m.top) : callee.top;
92
+ callee.bottom = Math.max(callee.bottom, m.bottom);
93
+ }
94
+ Array.prototype.forEach.call(e.children,(e)=>callee(e,depth+1) if(0===depth){
95
+//console.debug("measure() height:",e.className, callee.top, callee.bottom, (callee.bottom - callee.top));
96
+ f.extra += callee.bottom - callee.top;
97
+ }
98
+ return f.extra;
99
+ };
100
+ }
101
+ f.extra = 0;
102
+ f.measure(e,0);
103
+ return f.extra;
104
+ }
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
1 /*
2 2022-05-20
3
4 ? vw/*
5 2022-05-20
6
7 ? vw+'px' : null;
8 .style.height = vh ? vh+'px' : null/*
9 2022-05-20
10
11 Render = E('#btn-render'/*
12 2022-05-20
13
14 ? vw+'px' : null;
15 .style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
16 const body = [m.result];
17 .unshift('```pikchr body.push('```}else if('wiki'===mode){
18 .unshift();
19 .push('</verbatim>}
20 PS.join('\PSPSPSPSPSPSPSPSPS
21 2022-05-20
22
23 ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
24 *
25 The PikchrFiddle object is intended to be the primary app-level
26 object for of the fiddle application. It
27 uses a worker thread to load the WASM module and communicate
28 with it.
29 */
30 const PS/*local convenience alias*/ = F.PScalerenderMode: 'htm 'text','html'*/KT@cK,AO@xK,1: H@HF,6K@F5,JD@16j,[email protected] = E('#pikchr-output');
31 const eOutWrapper =S@ZN,4:;
32 K@17W,r@2cn,1:ex@2dl,1:ea@2ep,s:let content;
33 let sz;
34 switch(PS.renderMode){G@4FW,7:'text':N@3w0,q:'<textarea>'+m.result+'</textarea>';
35 eOut_@2pD,1:e~@2p3,8:default:N@3w0,M@2tT,1:eM@2rW,K@2pT,1:em@2sK,j:break;
36 }
37 eOut.innerHTML = content;f@2w6,L@2x0,q:Scale
38 && !m.isError && 'html'===PS.renderModI@3IG,Q:svg = E(eOut,':scope > svgI@21z,1P:vb = svg ? svg.ge('viewBox').split(' ') : false;
39 if(vb && 4===vb.lengthB@3RU,T: vw = (+vb[tru+vb[3] + 10)+'px';
40 }else parentg viewBox attribu
41 fit the rendered SVG0W,2B:['text','html'];
42 let ndx = modes.indexOf(mode) + 1;
43 if(ndx>=modes.length)
44 if(ndx>=modes.length) ndx = 0;
45 PS.renderMode = modes[ndx];
46 if(ec@3aT,1:eJ@3aT,I@3bV,3:
47 K@17W,QR@38B,7:scale')K@1bl,P@3hl,S:/* PS.config.renderAutoScale10@3Zn,Q:'html'==PS.renderMode && ec@3aT,1:eJ@3aT,16B@3bV,2Fjkh4;.legend = E(fs,'span.legendlegend txtup',eight = vh ? vh+'px'/*
48 2022-05-20
49
50 ? vw/*
51 2022-05-20
52
53 ? vw+'px' : null;
54 .style.height = vh ? vh+'px' : null/*
55 2022-05-20
56
57 Render = E('#btn-render'/*
58 2022-05-20
59
60 ? vw+'px' : null;
61 .style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
62 const body = [m.result];
63 .unshift('```pikchr body.push('```}else if('wiki'===mode){
64 .unshift();
65 .push('</verbatim>}
66 PS.join('\PSPSPSPSPSPSPSPSPS
67 2022-05-20
68
69 ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
70 *
71 The PikchrFiddle object is intended to be the primary app-level
72 object for the main-thread side of the fiddle application. It
73 uses a worker thread to load the WASM module and communicate
74 with it.
75 */
76 const PS/*local convenience alias*/ = F.PScalerenderMode: 'h Given a DOM element, this routine measures its "effective
77 height", which is the bounding top/bottom range of this element
78 and all of its children, recursively. For some DOM structure
79 cases, a parent may have a reported height of 0 even though
80 children have non-0 sizes.
81
82 Returns 0 if !e or if the element really has no height.
83 */
84 const effectiveHeight = function f(e){
85 if(!e) return 0;
86 if(!f.measure){
87 f.measure = function callee(e, depth){
88 if(!e const m = e if(0===depth){
89 callee.top = m.top;
90 callee.bottom = m.bottom;
91 callee.top = m.top ? Math.min(callee.top, m.top) : callee.top;
92 callee.bottom = Math.max(callee.bottom, m.bottom);
93 }
94 Array.prototype.forEach.call(e.children,(e)=>callee(e,depth+1) if(0===depth){
95 //console.debug("measure() height:",e.className, callee.top, callee.bottom, (callee.bottom - callee.top));
96 f.extra += callee.bottom - callee.top;
97 }
98 return f.extra;
99 };
100 }
101 f.extra = 0;
102 f.measure(e,0);
103 return f.extra;
104 }
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
1
+/*
2
+ 2022-05-20
3
+
4
+ ? vw/*
5
+ 2022-05-20
6
+
7
+ ? vw+'px' : null;
8
+.style.height = vh ? vh+'px' : null/*
9
+ 2022-05-20
10
+
11
+ Render = E('#btn-render'/*
12
+ 2022-05-20
13
+
14
+ ? vw+'px' : null;
15
+.style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
16
+const body = [m.result];
17
+ .unshift('```pikchr body.push('```}else if('wiki'===mode){
18
+.unshift();
19
+.push('</verbatim>}
20
+ PS.join('\PSPSPSPSPSPSPSPSPS
21
+ 2022-05-20
22
+
23
+ ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
24
+ *
25
+ The PikchrFiddle object is intended to be the primary app-level
26
+ object for of the fiddle application. It
27
+ uses a worker thread to load the WASM module and communicate
28
+ with it.
29
+ */
30
+ const PS/*local convenience alias*/ = F.PScalerenderMode: 'htm 'text','html'*/KT@cK,AO@xK,1: H@HF,6K@F5,JD@16j,[email protected] = E('#pikchr-output');
31
+ const eOutWrapper =S@ZN,4:;
32
+ K@17W,r@2cn,1:ex@2dl,1:ea@2ep,s:let content;
33
+ let sz;
34
+ switch(PS.renderMode){G@4FW,7:'text':N@3w0,q:'<textarea>'+m.result+'</textarea>';
35
+ eOut_@2pD,1:e~@2p3,8:default:N@3w0,M@2tT,1:eM@2rW,K@2pT,1:em@2sK,j:break;
36
+ }
37
+ eOut.innerHTML = content;f@2w6,L@2x0,q:Scale
38
+ && !m.isError && 'html'===PS.renderModI@3IG,Q:svg = E(eOut,':scope > svgI@21z,1P:vb = svg ? svg.ge('viewBox').split(' ') : false;
39
+ if(vb && 4===vb.lengthB@3RU,T: vw = (+vb[tru+vb[3] + 10)+'px';
40
+ }else parentg viewBox attribu
41
+ fit the rendered SVG0W,2B:['text','html'];
42
+ let ndx = modes.indexOf(mode) + 1;
43
+ if(ndx>=modes.length)
44
+ if(ndx>=modes.length) ndx = 0;
45
+ PS.renderMode = modes[ndx];
46
+ if(ec@3aT,1:eJ@3aT,I@3bV,3:
47
+ K@17W,QR@38B,7:scale')K@1bl,P@3hl,S:/* PS.config.renderAutoScale10@3Zn,Q:'html'==PS.renderMode && ec@3aT,1:eJ@3aT,16B@3bV,2Fjkh4;.legend = E(fs,'span.legendlegend txtup',eight = vh ? vh+'px'/*
48
+ 2022-05-20
49
+
50
+ ? vw/*
51
+ 2022-05-20
52
+
53
+ ? vw+'px' : null;
54
+.style.height = vh ? vh+'px' : null/*
55
+ 2022-05-20
56
+
57
+ Render = E('#btn-render'/*
58
+ 2022-05-20
59
+
60
+ ? vw+'px' : null;
61
+.style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
62
+const body = [m.result];
63
+ .unshift('```pikchr body.push('```}else if('wiki'===mode){
64
+.unshift();
65
+.push('</verbatim>}
66
+ PS.join('\PSPSPSPSPSPSPSPSPS
67
+ 2022-05-20
68
+
69
+ ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
70
+ *
71
+ The PikchrFiddle object is intended to be the primary app-level
72
+ object for the main-thread side of the fiddle application. It
73
+ uses a worker thread to load the WASM module and communicate
74
+ with it.
75
+ */
76
+ const PS/*local convenience alias*/ = F.PScalerenderMode: 'h Given a DOM element, this routine measures its "effective
77
+ height", which is the bounding top/bottom range of this element
78
+ and all of its children, recursively. For some DOM structure
79
+ cases, a parent may have a reported height of 0 even though
80
+ children have non-0 sizes.
81
+
82
+ Returns 0 if !e or if the element really has no height.
83
+ */
84
+ const effectiveHeight = function f(e){
85
+ if(!e) return 0;
86
+ if(!f.measure){
87
+ f.measure = function callee(e, depth){
88
+ if(!e const m = e if(0===depth){
89
+ callee.top = m.top;
90
+ callee.bottom = m.bottom;
91
+ callee.top = m.top ? Math.min(callee.top, m.top) : callee.top;
92
+ callee.bottom = Math.max(callee.bottom, m.bottom);
93
+ }
94
+ Array.prototype.forEach.call(e.children,(e)=>callee(e,depth+1) if(0===depth){
95
+//console.debug("measure() height:",e.className, callee.top, callee.bottom, (callee.bottom - callee.top));
96
+ f.extra += callee.bottom - callee.top;
97
+ }
98
+ return f.extra;
99
+ };
100
+ }
101
+ f.extra = 0;
102
+ f.measure(e,0);
103
+ return f.extra;
104
+ }
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/fossil.page.pikchrshowasm.js
+++ b/src/fossil.page.pikchrshowasm.js
@@ -0,0 +1,104 @@
1 /*
2 2022-05-20
3
4 ? vw/*
5 2022-05-20
6
7 ? vw+'px' : null;
8 .style.height = vh ? vh+'px' : null/*
9 2022-05-20
10
11 Render = E('#btn-render'/*
12 2022-05-20
13
14 ? vw+'px' : null;
15 .style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
16 const body = [m.result];
17 .unshift('```pikchr body.push('```}else if('wiki'===mode){
18 .unshift();
19 .push('</verbatim>}
20 PS.join('\PSPSPSPSPSPSPSPSPS
21 2022-05-20
22
23 ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
24 *
25 The PikchrFiddle object is intended to be the primary app-level
26 object for of the fiddle application. It
27 uses a worker thread to load the WASM module and communicate
28 with it.
29 */
30 const PS/*local convenience alias*/ = F.PScalerenderMode: 'htm 'text','html'*/KT@cK,AO@xK,1: H@HF,6K@F5,JD@16j,[email protected] = E('#pikchr-output');
31 const eOutWrapper =S@ZN,4:;
32 K@17W,r@2cn,1:ex@2dl,1:ea@2ep,s:let content;
33 let sz;
34 switch(PS.renderMode){G@4FW,7:'text':N@3w0,q:'<textarea>'+m.result+'</textarea>';
35 eOut_@2pD,1:e~@2p3,8:default:N@3w0,M@2tT,1:eM@2rW,K@2pT,1:em@2sK,j:break;
36 }
37 eOut.innerHTML = content;f@2w6,L@2x0,q:Scale
38 && !m.isError && 'html'===PS.renderModI@3IG,Q:svg = E(eOut,':scope > svgI@21z,1P:vb = svg ? svg.ge('viewBox').split(' ') : false;
39 if(vb && 4===vb.lengthB@3RU,T: vw = (+vb[tru+vb[3] + 10)+'px';
40 }else parentg viewBox attribu
41 fit the rendered SVG0W,2B:['text','html'];
42 let ndx = modes.indexOf(mode) + 1;
43 if(ndx>=modes.length)
44 if(ndx>=modes.length) ndx = 0;
45 PS.renderMode = modes[ndx];
46 if(ec@3aT,1:eJ@3aT,I@3bV,3:
47 K@17W,QR@38B,7:scale')K@1bl,P@3hl,S:/* PS.config.renderAutoScale10@3Zn,Q:'html'==PS.renderMode && ec@3aT,1:eJ@3aT,16B@3bV,2Fjkh4;.legend = E(fs,'span.legendlegend txtup',eight = vh ? vh+'px'/*
48 2022-05-20
49
50 ? vw/*
51 2022-05-20
52
53 ? vw+'px' : null;
54 .style.height = vh ? vh+'px' : null/*
55 2022-05-20
56
57 Render = E('#btn-render'/*
58 2022-05-20
59
60 ? vw+'px' : null;
61 .style.height = vh ? vh+'px' : nullbtnRenderbtnLabel: btnRender.innerTextPSPS
62 const body = [m.result];
63 .unshift('```pikchr body.push('```}else if('wiki'===mode){
64 .unshift();
65 .push('</verbatim>}
66 PS.join('\PSPSPSPSPSPSPSPSPS
67 2022-05-20
68
69 ? vw+'px? PSinnerText = PSPSF.copyButton(btnRenderbtnLabel;
70 *
71 The PikchrFiddle object is intended to be the primary app-level
72 object for the main-thread side of the fiddle application. It
73 uses a worker thread to load the WASM module and communicate
74 with it.
75 */
76 const PS/*local convenience alias*/ = F.PScalerenderMode: 'h Given a DOM element, this routine measures its "effective
77 height", which is the bounding top/bottom range of this element
78 and all of its children, recursively. For some DOM structure
79 cases, a parent may have a reported height of 0 even though
80 children have non-0 sizes.
81
82 Returns 0 if !e or if the element really has no height.
83 */
84 const effectiveHeight = function f(e){
85 if(!e) return 0;
86 if(!f.measure){
87 f.measure = function callee(e, depth){
88 if(!e const m = e if(0===depth){
89 callee.top = m.top;
90 callee.bottom = m.bottom;
91 callee.top = m.top ? Math.min(callee.top, m.top) : callee.top;
92 callee.bottom = Math.max(callee.bottom, m.bottom);
93 }
94 Array.prototype.forEach.call(e.children,(e)=>callee(e,depth+1) if(0===depth){
95 //console.debug("measure() height:",e.className, callee.top, callee.bottom, (callee.bottom - callee.top));
96 f.extra += callee.bottom - callee.top;
97 }
98 return f.extra;
99 };
100 }
101 f.extra = 0;
102 f.measure(e,0);
103 return f.extra;
104 }
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163163
$(SRCDIR)/xfer.c \
164164
$(SRCDIR)/xfersetup.c \
165165
$(SRCDIR)/zip.c
166166
167167
EXTRA_FILES = \
168
+ $(SRCDIR)/../extsrc/pikchr-module.js \
169
+ $(SRCDIR)/../extsrc/pikchr-worker.js \
170
+ $(SRCDIR)/../extsrc/pikchr.wasm \
168171
$(SRCDIR)/../skins/ardoise/css.txt \
169172
$(SRCDIR)/../skins/ardoise/details.txt \
170173
$(SRCDIR)/../skins/ardoise/footer.txt \
171174
$(SRCDIR)/../skins/ardoise/header.txt \
172175
$(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
231234
$(SRCDIR)/fossil.page.brlist.js \
232235
$(SRCDIR)/fossil.page.chat.js \
233236
$(SRCDIR)/fossil.page.fileedit.js \
234237
$(SRCDIR)/fossil.page.forumpost.js \
235238
$(SRCDIR)/fossil.page.pikchrshow.js \
239
+ $(SRCDIR)/fossil.page.pikchrshowasm.js \
236240
$(SRCDIR)/fossil.page.whistory.js \
237241
$(SRCDIR)/fossil.page.wikiedit.js \
238242
$(SRCDIR)/fossil.pikchr.js \
239243
$(SRCDIR)/fossil.popupwidget.js \
240244
$(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
266270
$(SRCDIR)/sounds/e.wav \
267271
$(SRCDIR)/sounds/f.wav \
268272
$(SRCDIR)/style.admin_log.css \
269273
$(SRCDIR)/style.chat.css \
270274
$(SRCDIR)/style.fileedit.css \
275
+ $(SRCDIR)/style.pikchrshow.css \
271276
$(SRCDIR)/style.wikiedit.css \
272277
$(SRCDIR)/tree.js \
273278
$(SRCDIR)/useredit.js \
274279
$(SRCDIR)/wiki.wiki
275280
276281
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163 $(SRCDIR)/xfer.c \
164 $(SRCDIR)/xfersetup.c \
165 $(SRCDIR)/zip.c
166
167 EXTRA_FILES = \
 
 
 
168 $(SRCDIR)/../skins/ardoise/css.txt \
169 $(SRCDIR)/../skins/ardoise/details.txt \
170 $(SRCDIR)/../skins/ardoise/footer.txt \
171 $(SRCDIR)/../skins/ardoise/header.txt \
172 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
231 $(SRCDIR)/fossil.page.brlist.js \
232 $(SRCDIR)/fossil.page.chat.js \
233 $(SRCDIR)/fossil.page.fileedit.js \
234 $(SRCDIR)/fossil.page.forumpost.js \
235 $(SRCDIR)/fossil.page.pikchrshow.js \
 
236 $(SRCDIR)/fossil.page.whistory.js \
237 $(SRCDIR)/fossil.page.wikiedit.js \
238 $(SRCDIR)/fossil.pikchr.js \
239 $(SRCDIR)/fossil.popupwidget.js \
240 $(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
266 $(SRCDIR)/sounds/e.wav \
267 $(SRCDIR)/sounds/f.wav \
268 $(SRCDIR)/style.admin_log.css \
269 $(SRCDIR)/style.chat.css \
270 $(SRCDIR)/style.fileedit.css \
 
271 $(SRCDIR)/style.wikiedit.css \
272 $(SRCDIR)/tree.js \
273 $(SRCDIR)/useredit.js \
274 $(SRCDIR)/wiki.wiki
275
276
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163 $(SRCDIR)/xfer.c \
164 $(SRCDIR)/xfersetup.c \
165 $(SRCDIR)/zip.c
166
167 EXTRA_FILES = \
168 $(SRCDIR)/../extsrc/pikchr-module.js \
169 $(SRCDIR)/../extsrc/pikchr-worker.js \
170 $(SRCDIR)/../extsrc/pikchr.wasm \
171 $(SRCDIR)/../skins/ardoise/css.txt \
172 $(SRCDIR)/../skins/ardoise/details.txt \
173 $(SRCDIR)/../skins/ardoise/footer.txt \
174 $(SRCDIR)/../skins/ardoise/header.txt \
175 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
234 $(SRCDIR)/fossil.page.brlist.js \
235 $(SRCDIR)/fossil.page.chat.js \
236 $(SRCDIR)/fossil.page.fileedit.js \
237 $(SRCDIR)/fossil.page.forumpost.js \
238 $(SRCDIR)/fossil.page.pikchrshow.js \
239 $(SRCDIR)/fossil.page.pikchrshowasm.js \
240 $(SRCDIR)/fossil.page.whistory.js \
241 $(SRCDIR)/fossil.page.wikiedit.js \
242 $(SRCDIR)/fossil.pikchr.js \
243 $(SRCDIR)/fossil.popupwidget.js \
244 $(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
270 $(SRCDIR)/sounds/e.wav \
271 $(SRCDIR)/sounds/f.wav \
272 $(SRCDIR)/style.admin_log.css \
273 $(SRCDIR)/style.chat.css \
274 $(SRCDIR)/style.fileedit.css \
275 $(SRCDIR)/style.pikchrshow.css \
276 $(SRCDIR)/style.wikiedit.css \
277 $(SRCDIR)/tree.js \
278 $(SRCDIR)/useredit.js \
279 $(SRCDIR)/wiki.wiki
280
281
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163163
$(SRCDIR)/xfer.c \
164164
$(SRCDIR)/xfersetup.c \
165165
$(SRCDIR)/zip.c
166166
167167
EXTRA_FILES = \
168
+ $(SRCDIR)/../extsrc/pikchr-module.js \
169
+ $(SRCDIR)/../extsrc/pikchr-worker.js \
170
+ $(SRCDIR)/../extsrc/pikchr.wasm \
168171
$(SRCDIR)/../skins/ardoise/css.txt \
169172
$(SRCDIR)/../skins/ardoise/details.txt \
170173
$(SRCDIR)/../skins/ardoise/footer.txt \
171174
$(SRCDIR)/../skins/ardoise/header.txt \
172175
$(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
231234
$(SRCDIR)/fossil.page.brlist.js \
232235
$(SRCDIR)/fossil.page.chat.js \
233236
$(SRCDIR)/fossil.page.fileedit.js \
234237
$(SRCDIR)/fossil.page.forumpost.js \
235238
$(SRCDIR)/fossil.page.pikchrshow.js \
239
+ $(SRCDIR)/fossil.page.pikchrshowasm.js \
236240
$(SRCDIR)/fossil.page.whistory.js \
237241
$(SRCDIR)/fossil.page.wikiedit.js \
238242
$(SRCDIR)/fossil.pikchr.js \
239243
$(SRCDIR)/fossil.popupwidget.js \
240244
$(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
266270
$(SRCDIR)/sounds/e.wav \
267271
$(SRCDIR)/sounds/f.wav \
268272
$(SRCDIR)/style.admin_log.css \
269273
$(SRCDIR)/style.chat.css \
270274
$(SRCDIR)/style.fileedit.css \
275
+ $(SRCDIR)/style.pikchrshow.css \
271276
$(SRCDIR)/style.wikiedit.css \
272277
$(SRCDIR)/tree.js \
273278
$(SRCDIR)/useredit.js \
274279
$(SRCDIR)/wiki.wiki
275280
276281
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163 $(SRCDIR)/xfer.c \
164 $(SRCDIR)/xfersetup.c \
165 $(SRCDIR)/zip.c
166
167 EXTRA_FILES = \
 
 
 
168 $(SRCDIR)/../skins/ardoise/css.txt \
169 $(SRCDIR)/../skins/ardoise/details.txt \
170 $(SRCDIR)/../skins/ardoise/footer.txt \
171 $(SRCDIR)/../skins/ardoise/header.txt \
172 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
231 $(SRCDIR)/fossil.page.brlist.js \
232 $(SRCDIR)/fossil.page.chat.js \
233 $(SRCDIR)/fossil.page.fileedit.js \
234 $(SRCDIR)/fossil.page.forumpost.js \
235 $(SRCDIR)/fossil.page.pikchrshow.js \
 
236 $(SRCDIR)/fossil.page.whistory.js \
237 $(SRCDIR)/fossil.page.wikiedit.js \
238 $(SRCDIR)/fossil.pikchr.js \
239 $(SRCDIR)/fossil.popupwidget.js \
240 $(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
266 $(SRCDIR)/sounds/e.wav \
267 $(SRCDIR)/sounds/f.wav \
268 $(SRCDIR)/style.admin_log.css \
269 $(SRCDIR)/style.chat.css \
270 $(SRCDIR)/style.fileedit.css \
 
271 $(SRCDIR)/style.wikiedit.css \
272 $(SRCDIR)/tree.js \
273 $(SRCDIR)/useredit.js \
274 $(SRCDIR)/wiki.wiki
275
276
--- src/main.mk
+++ src/main.mk
@@ -163,10 +163,13 @@
163 $(SRCDIR)/xfer.c \
164 $(SRCDIR)/xfersetup.c \
165 $(SRCDIR)/zip.c
166
167 EXTRA_FILES = \
168 $(SRCDIR)/../extsrc/pikchr-module.js \
169 $(SRCDIR)/../extsrc/pikchr-worker.js \
170 $(SRCDIR)/../extsrc/pikchr.wasm \
171 $(SRCDIR)/../skins/ardoise/css.txt \
172 $(SRCDIR)/../skins/ardoise/details.txt \
173 $(SRCDIR)/../skins/ardoise/footer.txt \
174 $(SRCDIR)/../skins/ardoise/header.txt \
175 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -231,10 +234,11 @@
234 $(SRCDIR)/fossil.page.brlist.js \
235 $(SRCDIR)/fossil.page.chat.js \
236 $(SRCDIR)/fossil.page.fileedit.js \
237 $(SRCDIR)/fossil.page.forumpost.js \
238 $(SRCDIR)/fossil.page.pikchrshow.js \
239 $(SRCDIR)/fossil.page.pikchrshowasm.js \
240 $(SRCDIR)/fossil.page.whistory.js \
241 $(SRCDIR)/fossil.page.wikiedit.js \
242 $(SRCDIR)/fossil.pikchr.js \
243 $(SRCDIR)/fossil.popupwidget.js \
244 $(SRCDIR)/fossil.storage.js \
@@ -266,10 +270,11 @@
270 $(SRCDIR)/sounds/e.wav \
271 $(SRCDIR)/sounds/f.wav \
272 $(SRCDIR)/style.admin_log.css \
273 $(SRCDIR)/style.chat.css \
274 $(SRCDIR)/style.fileedit.css \
275 $(SRCDIR)/style.pikchrshow.css \
276 $(SRCDIR)/style.wikiedit.css \
277 $(SRCDIR)/tree.js \
278 $(SRCDIR)/useredit.js \
279 $(SRCDIR)/wiki.wiki
280
281
+124 -5
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230230
blob_reset(&bIn);
231231
return isErr;
232232
}
233233
234234
/*
235
-** WEBPAGE: pikchrshow
235
+** WEBPAGE: pikchrshowcs*
236236
**
237237
** A pikchr code editor and previewer, allowing users to experiment
238238
** with pikchr code or prototype it for use in copy/pasting into forum
239
-** posts, wiki pages, or embedded docs.
239
+** posts, wiki pages, or embedded docs. This version of pikchrshow
240
+** uses JavaScript to send pikchr code to the server for
241
+** processing. The newer /pikchrshow applications runs pikchr on the
242
+** client machine, without the need for back-and-forth network
243
+** traffic.
240244
**
241245
** It optionally accepts a p=pikchr-script-code URL parameter or POST
242246
** value to pre-populate the editor with that code.
243247
*/
244
-void pikchrshow_page(void){
248
+void pikchrshowcs_page(void){
245249
const char *zContent = 0;
246250
int isDark; /* true if the current skin is "dark" */
247251
int pikFlags =
248252
PIKCHR_PROCESS_DIV
249253
| PIKCHR_PROCESS_SRC
250254
| PIKCHR_PROCESS_ERR_PRE;
251255
252256
login_check_credentials();
253257
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
254
- cgi_redirectf("%R/login?g=pikchrshow");
258
+ cgi_redirectf("%R/login?g=pikchrshowcs");
259
+ }
260
+ if(P("wasm")){
261
+ pikchrshow_page();
262
+ return;
255263
}
256264
zContent = PD("content",P("p"));
257265
if(P("ajax")!=0){
258266
/* Called from the JS-side preview updater.
259267
TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
279287
"box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
280288
"arrow right 200% \"HTML+SVG\" \"Output\"\n"
281289
"arrow <-> down from last box.s\n"
282290
"box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
283291
}
284
- style_header("PikchrShow");
292
+ style_header("PikchrShow Client/Server");
285293
CX("<style>"); {
286294
CX("div.content { padding-top: 0.5em }\n");
287295
CX("#sbs-wrapper {"
288296
"display: flex; flex-direction: column;"
289297
"}\n");
@@ -376,10 +384,121 @@
376384
"storage", "pikchr", NULL);
377385
builtin_request_js("fossil.page.pikchrshow.js");
378386
builtin_fulfill_js_requests();
379387
style_finish_page();
380388
}
389
+
390
+/*
391
+** WEBPAGE: pikchrshow
392
+**
393
+** A pikchr code editor and previewer, allowing users to experiment
394
+** with pikchr code or prototype it for use in copy/pasting into forum
395
+** posts, wiki pages, or embedded docs. This version of pikchrshow
396
+** uses WebAssembly to run entirely in the client browser, without a
397
+** need for back-and-forth client/server traffic to perform the
398
+** rendering. The "legacy" version of this application can be found at
399
+** /pikchrshowcs.
400
+*/
401
+void pikchrshow_page(void){
402
+ const char *zContent = 0;
403
+
404
+ login_check_credentials();
405
+ if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
406
+ cgi_redirectf("%R/login?g=pikchrshow");
407
+ }
408
+ if(P("legacy")){
409
+ pikchrshowcs_page();
410
+ return;
411
+ }
412
+ style_emit_noscript_for_js_page();
413
+ style_header("PikchrShow");
414
+ zContent = PD("content",P("p"));
415
+ if(!zContent){
416
+ zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
417
+ "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
418
+ "arrow right 200% \"HTML+SVG\" \"Output\"\n"
419
+ "arrow <-> down from last box.s\n"
420
+ "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
421
+ }
422
+ CX("<div class='emscripten'>"); {
423
+ CX("<figure id='module-spinner'>");
424
+ CX("<div class='spinner'></div>");
425
+ CX("<div class='center'><strong>Initializing app...</strong></div>");
426
+ CX("<div class='center'>");
427
+ CX("On a slow internet connection this may take a moment. If this ");
428
+ CX("message displays for \"a long time\", intialization may have ");
429
+ CX("failed and the JavaScript console may contain clues as to why. ");
430
+ CX("</div>");
431
+ CX("<div><a href='?legacy'>Switch to legacy mode</a></div>");
432
+ CX("</figure>");
433
+ CX("<div class='emscripten' id='module-status'>Downloading...</div>");
434
+ CX("<progress value='0' max='100' id='module-progress' hidden='1'>"
435
+ "</progress>");
436
+ } CX("</div><!-- .emscripten -->");
437
+ CX("<div id='view-split' class='app-view initially-hidden'>"); {
438
+ CX("<div class='fieldset options collapsible'>"); {
439
+ CX("<span class='legend'><span>Options</span></span>");
440
+ CX("<div>");
441
+ CX("<span class='labeled-input'>");
442
+ CX("<input type='checkbox' id='opt-cb-sbs'");
443
+ CX("data-csstgt='#main-wrapper'");
444
+ CX("data-cssclass='side-by-side'");
445
+ CX("data-config='sideBySide'>");
446
+ CX("<label for='opt-cb-sbs'>Side-by-side</label>");
447
+ CX("</span>");
448
+ CX("<span class='labeled-input'>");
449
+ CX("<input type='checkbox' id='opt-cb-swapio'");
450
+ CX("data-csstgt='#main-wrapper'");
451
+ CX("data-cssclass='swapio'");
452
+ CX("data-config='swapInOut'>");
453
+ CX("<label for='opt-cb-swapio'>Swap in/out</label>");
454
+ CX("</span>");
455
+ CX("<span class='labeled-input'>");
456
+ CX("<input type='checkbox' id='opt-cb-autoscale'");
457
+ CX("data-config='renderAutoScale'>");
458
+ CX("<label for='opt-cb-autoscale'>Auto-scale SVG</label>");
459
+ CX("</span>");
460
+ CX("<span class='labeled-input'>");
461
+ CX("<input type='checkbox' id='opt-cb-autorender'");
462
+ CX("data-config='renderWhileTyping'>");
463
+ CX("<label for='opt-cb-autorender'>Render while typing</label>");
464
+ CX("</span>");
465
+ CX("<span class='labeled-input'>");
466
+ CX("<a href='?legacy'>Legacy mode</a>");
467
+ CX("</span>");
468
+ CX("</div><!-- options wrapper -->");
469
+ } CX("</div><!-- .fieldset -->");
470
+ CX("<div id='main-wrapper' class=''>"); {
471
+ CX("<div class='zone-wrapper input'>"); {
472
+ CX("<textarea id='input'");
473
+ CX("placeholder='Shell input. Ctrl-enter/shift-enter runs it.'>");
474
+ CX("/**\n");
475
+ CX(" Use ctrl-enter or shift-enter to execute\n");
476
+ CX(" pikchr code. If only a subset is currently\n");
477
+ CX(" selected, only that part is evaluated.\n*/\n");
478
+ CX("%s</textarea>",zContent/*safe-for-%s*/);
479
+ CX("<div class='button-bar'>");
480
+ CX("<button id='btn-render'>Render</button>");
481
+ CX("<button id='btn-clear'>Clear Input</button>");
482
+ CX("</div><!-- .button-bar -->");
483
+ } CX("</div><!-- .zone-wrapper.input -->");
484
+ CX("<div class='zone-wrapper output'>"); {
485
+ CX("<div id='pikchr-output-wrapper'>");
486
+ CX("<div id='pikchr-output'></div>");
487
+ CX("</div>");
488
+ CX("<div class='button-bar'>");
489
+ CX("<button id='btn-render-mode'>Toggle Render Mode</button>");
490
+ CX("</div><!-- .button-bar -->");
491
+ } CX("</div> <!-- .zone-wrapper.output -->");
492
+ } CX("</div><!-- #main-wrapper -->");
493
+ } CX("</div><!-- #view-split -->");
494
+ builtin_fossil_js_bundle_or("storage", NULL);
495
+ builtin_request_js("fossil.page.pikchrshowasm.js");
496
+ builtin_fulfill_js_requests();
497
+ style_finish_page();
498
+}
499
+
381500
382501
/*
383502
** COMMAND: pikchr*
384503
**
385504
** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
386505
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230 blob_reset(&bIn);
231 return isErr;
232 }
233
234 /*
235 ** WEBPAGE: pikchrshow
236 **
237 ** A pikchr code editor and previewer, allowing users to experiment
238 ** with pikchr code or prototype it for use in copy/pasting into forum
239 ** posts, wiki pages, or embedded docs.
 
 
 
 
240 **
241 ** It optionally accepts a p=pikchr-script-code URL parameter or POST
242 ** value to pre-populate the editor with that code.
243 */
244 void pikchrshow_page(void){
245 const char *zContent = 0;
246 int isDark; /* true if the current skin is "dark" */
247 int pikFlags =
248 PIKCHR_PROCESS_DIV
249 | PIKCHR_PROCESS_SRC
250 | PIKCHR_PROCESS_ERR_PRE;
251
252 login_check_credentials();
253 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
254 cgi_redirectf("%R/login?g=pikchrshow");
 
 
 
 
255 }
256 zContent = PD("content",P("p"));
257 if(P("ajax")!=0){
258 /* Called from the JS-side preview updater.
259 TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
279 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
280 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
281 "arrow <-> down from last box.s\n"
282 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
283 }
284 style_header("PikchrShow");
285 CX("<style>"); {
286 CX("div.content { padding-top: 0.5em }\n");
287 CX("#sbs-wrapper {"
288 "display: flex; flex-direction: column;"
289 "}\n");
@@ -376,10 +384,121 @@
376 "storage", "pikchr", NULL);
377 builtin_request_js("fossil.page.pikchrshow.js");
378 builtin_fulfill_js_requests();
379 style_finish_page();
380 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
382 /*
383 ** COMMAND: pikchr*
384 **
385 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
386
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230 blob_reset(&bIn);
231 return isErr;
232 }
233
234 /*
235 ** WEBPAGE: pikchrshowcs*
236 **
237 ** A pikchr code editor and previewer, allowing users to experiment
238 ** with pikchr code or prototype it for use in copy/pasting into forum
239 ** posts, wiki pages, or embedded docs. This version of pikchrshow
240 ** uses JavaScript to send pikchr code to the server for
241 ** processing. The newer /pikchrshow applications runs pikchr on the
242 ** client machine, without the need for back-and-forth network
243 ** traffic.
244 **
245 ** It optionally accepts a p=pikchr-script-code URL parameter or POST
246 ** value to pre-populate the editor with that code.
247 */
248 void pikchrshowcs_page(void){
249 const char *zContent = 0;
250 int isDark; /* true if the current skin is "dark" */
251 int pikFlags =
252 PIKCHR_PROCESS_DIV
253 | PIKCHR_PROCESS_SRC
254 | PIKCHR_PROCESS_ERR_PRE;
255
256 login_check_credentials();
257 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
258 cgi_redirectf("%R/login?g=pikchrshowcs");
259 }
260 if(P("wasm")){
261 pikchrshow_page();
262 return;
263 }
264 zContent = PD("content",P("p"));
265 if(P("ajax")!=0){
266 /* Called from the JS-side preview updater.
267 TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
287 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
288 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
289 "arrow <-> down from last box.s\n"
290 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
291 }
292 style_header("PikchrShow Client/Server");
293 CX("<style>"); {
294 CX("div.content { padding-top: 0.5em }\n");
295 CX("#sbs-wrapper {"
296 "display: flex; flex-direction: column;"
297 "}\n");
@@ -376,10 +384,121 @@
384 "storage", "pikchr", NULL);
385 builtin_request_js("fossil.page.pikchrshow.js");
386 builtin_fulfill_js_requests();
387 style_finish_page();
388 }
389
390 /*
391 ** WEBPAGE: pikchrshow
392 **
393 ** A pikchr code editor and previewer, allowing users to experiment
394 ** with pikchr code or prototype it for use in copy/pasting into forum
395 ** posts, wiki pages, or embedded docs. This version of pikchrshow
396 ** uses WebAssembly to run entirely in the client browser, without a
397 ** need for back-and-forth client/server traffic to perform the
398 ** rendering. The "legacy" version of this application can be found at
399 ** /pikchrshowcs.
400 */
401 void pikchrshow_page(void){
402 const char *zContent = 0;
403
404 login_check_credentials();
405 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
406 cgi_redirectf("%R/login?g=pikchrshow");
407 }
408 if(P("legacy")){
409 pikchrshowcs_page();
410 return;
411 }
412 style_emit_noscript_for_js_page();
413 style_header("PikchrShow");
414 zContent = PD("content",P("p"));
415 if(!zContent){
416 zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
417 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
418 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
419 "arrow <-> down from last box.s\n"
420 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
421 }
422 CX("<div class='emscripten'>"); {
423 CX("<figure id='module-spinner'>");
424 CX("<div class='spinner'></div>");
425 CX("<div class='center'><strong>Initializing app...</strong></div>");
426 CX("<div class='center'>");
427 CX("On a slow internet connection this may take a moment. If this ");
428 CX("message displays for \"a long time\", intialization may have ");
429 CX("failed and the JavaScript console may contain clues as to why. ");
430 CX("</div>");
431 CX("<div><a href='?legacy'>Switch to legacy mode</a></div>");
432 CX("</figure>");
433 CX("<div class='emscripten' id='module-status'>Downloading...</div>");
434 CX("<progress value='0' max='100' id='module-progress' hidden='1'>"
435 "</progress>");
436 } CX("</div><!-- .emscripten -->");
437 CX("<div id='view-split' class='app-view initially-hidden'>"); {
438 CX("<div class='fieldset options collapsible'>"); {
439 CX("<span class='legend'><span>Options</span></span>");
440 CX("<div>");
441 CX("<span class='labeled-input'>");
442 CX("<input type='checkbox' id='opt-cb-sbs'");
443 CX("data-csstgt='#main-wrapper'");
444 CX("data-cssclass='side-by-side'");
445 CX("data-config='sideBySide'>");
446 CX("<label for='opt-cb-sbs'>Side-by-side</label>");
447 CX("</span>");
448 CX("<span class='labeled-input'>");
449 CX("<input type='checkbox' id='opt-cb-swapio'");
450 CX("data-csstgt='#main-wrapper'");
451 CX("data-cssclass='swapio'");
452 CX("data-config='swapInOut'>");
453 CX("<label for='opt-cb-swapio'>Swap in/out</label>");
454 CX("</span>");
455 CX("<span class='labeled-input'>");
456 CX("<input type='checkbox' id='opt-cb-autoscale'");
457 CX("data-config='renderAutoScale'>");
458 CX("<label for='opt-cb-autoscale'>Auto-scale SVG</label>");
459 CX("</span>");
460 CX("<span class='labeled-input'>");
461 CX("<input type='checkbox' id='opt-cb-autorender'");
462 CX("data-config='renderWhileTyping'>");
463 CX("<label for='opt-cb-autorender'>Render while typing</label>");
464 CX("</span>");
465 CX("<span class='labeled-input'>");
466 CX("<a href='?legacy'>Legacy mode</a>");
467 CX("</span>");
468 CX("</div><!-- options wrapper -->");
469 } CX("</div><!-- .fieldset -->");
470 CX("<div id='main-wrapper' class=''>"); {
471 CX("<div class='zone-wrapper input'>"); {
472 CX("<textarea id='input'");
473 CX("placeholder='Shell input. Ctrl-enter/shift-enter runs it.'>");
474 CX("/**\n");
475 CX(" Use ctrl-enter or shift-enter to execute\n");
476 CX(" pikchr code. If only a subset is currently\n");
477 CX(" selected, only that part is evaluated.\n*/\n");
478 CX("%s</textarea>",zContent/*safe-for-%s*/);
479 CX("<div class='button-bar'>");
480 CX("<button id='btn-render'>Render</button>");
481 CX("<button id='btn-clear'>Clear Input</button>");
482 CX("</div><!-- .button-bar -->");
483 } CX("</div><!-- .zone-wrapper.input -->");
484 CX("<div class='zone-wrapper output'>"); {
485 CX("<div id='pikchr-output-wrapper'>");
486 CX("<div id='pikchr-output'></div>");
487 CX("</div>");
488 CX("<div class='button-bar'>");
489 CX("<button id='btn-render-mode'>Toggle Render Mode</button>");
490 CX("</div><!-- .button-bar -->");
491 } CX("</div> <!-- .zone-wrapper.output -->");
492 } CX("</div><!-- #main-wrapper -->");
493 } CX("</div><!-- #view-split -->");
494 builtin_fossil_js_bundle_or("storage", NULL);
495 builtin_request_js("fossil.page.pikchrshowasm.js");
496 builtin_fulfill_js_requests();
497 style_finish_page();
498 }
499
500
501 /*
502 ** COMMAND: pikchr*
503 **
504 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
505
+124 -5
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230230
blob_reset(&bIn);
231231
return isErr;
232232
}
233233
234234
/*
235
-** WEBPAGE: pikchrshow
235
+** WEBPAGE: pikchrshowcs*
236236
**
237237
** A pikchr code editor and previewer, allowing users to experiment
238238
** with pikchr code or prototype it for use in copy/pasting into forum
239
-** posts, wiki pages, or embedded docs.
239
+** posts, wiki pages, or embedded docs. This version of pikchrshow
240
+** uses JavaScript to send pikchr code to the server for
241
+** processing. The newer /pikchrshow applications runs pikchr on the
242
+** client machine, without the need for back-and-forth network
243
+** traffic.
240244
**
241245
** It optionally accepts a p=pikchr-script-code URL parameter or POST
242246
** value to pre-populate the editor with that code.
243247
*/
244
-void pikchrshow_page(void){
248
+void pikchrshowcs_page(void){
245249
const char *zContent = 0;
246250
int isDark; /* true if the current skin is "dark" */
247251
int pikFlags =
248252
PIKCHR_PROCESS_DIV
249253
| PIKCHR_PROCESS_SRC
250254
| PIKCHR_PROCESS_ERR_PRE;
251255
252256
login_check_credentials();
253257
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
254
- cgi_redirectf("%R/login?g=pikchrshow");
258
+ cgi_redirectf("%R/login?g=pikchrshowcs");
259
+ }
260
+ if(P("wasm")){
261
+ pikchrshow_page();
262
+ return;
255263
}
256264
zContent = PD("content",P("p"));
257265
if(P("ajax")!=0){
258266
/* Called from the JS-side preview updater.
259267
TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
279287
"box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
280288
"arrow right 200% \"HTML+SVG\" \"Output\"\n"
281289
"arrow <-> down from last box.s\n"
282290
"box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
283291
}
284
- style_header("PikchrShow");
292
+ style_header("PikchrShow Client/Server");
285293
CX("<style>"); {
286294
CX("div.content { padding-top: 0.5em }\n");
287295
CX("#sbs-wrapper {"
288296
"display: flex; flex-direction: column;"
289297
"}\n");
@@ -376,10 +384,121 @@
376384
"storage", "pikchr", NULL);
377385
builtin_request_js("fossil.page.pikchrshow.js");
378386
builtin_fulfill_js_requests();
379387
style_finish_page();
380388
}
389
+
390
+/*
391
+** WEBPAGE: pikchrshow
392
+**
393
+** A pikchr code editor and previewer, allowing users to experiment
394
+** with pikchr code or prototype it for use in copy/pasting into forum
395
+** posts, wiki pages, or embedded docs. This version of pikchrshow
396
+** uses WebAssembly to run entirely in the client browser, without a
397
+** need for back-and-forth client/server traffic to perform the
398
+** rendering. The "legacy" version of this application can be found at
399
+** /pikchrshowcs.
400
+*/
401
+void pikchrshow_page(void){
402
+ const char *zContent = 0;
403
+
404
+ login_check_credentials();
405
+ if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
406
+ cgi_redirectf("%R/login?g=pikchrshow");
407
+ }
408
+ if(P("legacy")){
409
+ pikchrshowcs_page();
410
+ return;
411
+ }
412
+ style_emit_noscript_for_js_page();
413
+ style_header("PikchrShow");
414
+ zContent = PD("content",P("p"));
415
+ if(!zContent){
416
+ zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
417
+ "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
418
+ "arrow right 200% \"HTML+SVG\" \"Output\"\n"
419
+ "arrow <-> down from last box.s\n"
420
+ "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
421
+ }
422
+ CX("<div class='emscripten'>"); {
423
+ CX("<figure id='module-spinner'>");
424
+ CX("<div class='spinner'></div>");
425
+ CX("<div class='center'><strong>Initializing app...</strong></div>");
426
+ CX("<div class='center'>");
427
+ CX("On a slow internet connection this may take a moment. If this ");
428
+ CX("message displays for \"a long time\", intialization may have ");
429
+ CX("failed and the JavaScript console may contain clues as to why. ");
430
+ CX("</div>");
431
+ CX("<div><a href='?legacy'>Switch to legacy mode</a></div>");
432
+ CX("</figure>");
433
+ CX("<div class='emscripten' id='module-status'>Downloading...</div>");
434
+ CX("<progress value='0' max='100' id='module-progress' hidden='1'>"
435
+ "</progress>");
436
+ } CX("</div><!-- .emscripten -->");
437
+ CX("<div id='view-split' class='app-view initially-hidden'>"); {
438
+ CX("<div class='fieldset options collapsible'>"); {
439
+ CX("<span class='legend'><span>Options</span></span>");
440
+ CX("<div>");
441
+ CX("<span class='labeled-input'>");
442
+ CX("<input type='checkbox' id='opt-cb-sbs'");
443
+ CX("data-csstgt='#main-wrapper'");
444
+ CX("data-cssclass='side-by-side'");
445
+ CX("data-config='sideBySide'>");
446
+ CX("<label for='opt-cb-sbs'>Side-by-side</label>");
447
+ CX("</span>");
448
+ CX("<span class='labeled-input'>");
449
+ CX("<input type='checkbox' id='opt-cb-swapio'");
450
+ CX("data-csstgt='#main-wrapper'");
451
+ CX("data-cssclass='swapio'");
452
+ CX("data-config='swapInOut'>");
453
+ CX("<label for='opt-cb-swapio'>Swap in/out</label>");
454
+ CX("</span>");
455
+ CX("<span class='labeled-input'>");
456
+ CX("<input type='checkbox' id='opt-cb-autoscale'");
457
+ CX("data-config='renderAutoScale'>");
458
+ CX("<label for='opt-cb-autoscale'>Auto-scale SVG</label>");
459
+ CX("</span>");
460
+ CX("<span class='labeled-input'>");
461
+ CX("<input type='checkbox' id='opt-cb-autorender'");
462
+ CX("data-config='renderWhileTyping'>");
463
+ CX("<label for='opt-cb-autorender'>Render while typing</label>");
464
+ CX("</span>");
465
+ CX("<span class='labeled-input'>");
466
+ CX("<a href='?legacy'>Legacy mode</a>");
467
+ CX("</span>");
468
+ CX("</div><!-- options wrapper -->");
469
+ } CX("</div><!-- .fieldset -->");
470
+ CX("<div id='main-wrapper' class=''>"); {
471
+ CX("<div class='zone-wrapper input'>"); {
472
+ CX("<textarea id='input'");
473
+ CX("placeholder='Shell input. Ctrl-enter/shift-enter runs it.'>");
474
+ CX("/**\n");
475
+ CX(" Use ctrl-enter or shift-enter to execute\n");
476
+ CX(" pikchr code. If only a subset is currently\n");
477
+ CX(" selected, only that part is evaluated.\n*/\n");
478
+ CX("%s</textarea>",zContent/*safe-for-%s*/);
479
+ CX("<div class='button-bar'>");
480
+ CX("<button id='btn-render'>Render</button>");
481
+ CX("<button id='btn-clear'>Clear Input</button>");
482
+ CX("</div><!-- .button-bar -->");
483
+ } CX("</div><!-- .zone-wrapper.input -->");
484
+ CX("<div class='zone-wrapper output'>"); {
485
+ CX("<div id='pikchr-output-wrapper'>");
486
+ CX("<div id='pikchr-output'></div>");
487
+ CX("</div>");
488
+ CX("<div class='button-bar'>");
489
+ CX("<button id='btn-render-mode'>Toggle Render Mode</button>");
490
+ CX("</div><!-- .button-bar -->");
491
+ } CX("</div> <!-- .zone-wrapper.output -->");
492
+ } CX("</div><!-- #main-wrapper -->");
493
+ } CX("</div><!-- #view-split -->");
494
+ builtin_fossil_js_bundle_or("storage", NULL);
495
+ builtin_request_js("fossil.page.pikchrshowasm.js");
496
+ builtin_fulfill_js_requests();
497
+ style_finish_page();
498
+}
499
+
381500
382501
/*
383502
** COMMAND: pikchr*
384503
**
385504
** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
386505
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230 blob_reset(&bIn);
231 return isErr;
232 }
233
234 /*
235 ** WEBPAGE: pikchrshow
236 **
237 ** A pikchr code editor and previewer, allowing users to experiment
238 ** with pikchr code or prototype it for use in copy/pasting into forum
239 ** posts, wiki pages, or embedded docs.
 
 
 
 
240 **
241 ** It optionally accepts a p=pikchr-script-code URL parameter or POST
242 ** value to pre-populate the editor with that code.
243 */
244 void pikchrshow_page(void){
245 const char *zContent = 0;
246 int isDark; /* true if the current skin is "dark" */
247 int pikFlags =
248 PIKCHR_PROCESS_DIV
249 | PIKCHR_PROCESS_SRC
250 | PIKCHR_PROCESS_ERR_PRE;
251
252 login_check_credentials();
253 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
254 cgi_redirectf("%R/login?g=pikchrshow");
 
 
 
 
255 }
256 zContent = PD("content",P("p"));
257 if(P("ajax")!=0){
258 /* Called from the JS-side preview updater.
259 TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
279 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
280 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
281 "arrow <-> down from last box.s\n"
282 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
283 }
284 style_header("PikchrShow");
285 CX("<style>"); {
286 CX("div.content { padding-top: 0.5em }\n");
287 CX("#sbs-wrapper {"
288 "display: flex; flex-direction: column;"
289 "}\n");
@@ -376,10 +384,121 @@
376 "storage", "pikchr", NULL);
377 builtin_request_js("fossil.page.pikchrshow.js");
378 builtin_fulfill_js_requests();
379 style_finish_page();
380 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
382 /*
383 ** COMMAND: pikchr*
384 **
385 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
386
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -230,30 +230,38 @@
230 blob_reset(&bIn);
231 return isErr;
232 }
233
234 /*
235 ** WEBPAGE: pikchrshowcs*
236 **
237 ** A pikchr code editor and previewer, allowing users to experiment
238 ** with pikchr code or prototype it for use in copy/pasting into forum
239 ** posts, wiki pages, or embedded docs. This version of pikchrshow
240 ** uses JavaScript to send pikchr code to the server for
241 ** processing. The newer /pikchrshow applications runs pikchr on the
242 ** client machine, without the need for back-and-forth network
243 ** traffic.
244 **
245 ** It optionally accepts a p=pikchr-script-code URL parameter or POST
246 ** value to pre-populate the editor with that code.
247 */
248 void pikchrshowcs_page(void){
249 const char *zContent = 0;
250 int isDark; /* true if the current skin is "dark" */
251 int pikFlags =
252 PIKCHR_PROCESS_DIV
253 | PIKCHR_PROCESS_SRC
254 | PIKCHR_PROCESS_ERR_PRE;
255
256 login_check_credentials();
257 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
258 cgi_redirectf("%R/login?g=pikchrshowcs");
259 }
260 if(P("wasm")){
261 pikchrshow_page();
262 return;
263 }
264 zContent = PD("content",P("p"));
265 if(P("ajax")!=0){
266 /* Called from the JS-side preview updater.
267 TODO: respond with JSON instead.*/
@@ -279,11 +287,11 @@
287 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
288 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
289 "arrow <-> down from last box.s\n"
290 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
291 }
292 style_header("PikchrShow Client/Server");
293 CX("<style>"); {
294 CX("div.content { padding-top: 0.5em }\n");
295 CX("#sbs-wrapper {"
296 "display: flex; flex-direction: column;"
297 "}\n");
@@ -376,10 +384,121 @@
384 "storage", "pikchr", NULL);
385 builtin_request_js("fossil.page.pikchrshow.js");
386 builtin_fulfill_js_requests();
387 style_finish_page();
388 }
389
390 /*
391 ** WEBPAGE: pikchrshow
392 **
393 ** A pikchr code editor and previewer, allowing users to experiment
394 ** with pikchr code or prototype it for use in copy/pasting into forum
395 ** posts, wiki pages, or embedded docs. This version of pikchrshow
396 ** uses WebAssembly to run entirely in the client browser, without a
397 ** need for back-and-forth client/server traffic to perform the
398 ** rendering. The "legacy" version of this application can be found at
399 ** /pikchrshowcs.
400 */
401 void pikchrshow_page(void){
402 const char *zContent = 0;
403
404 login_check_credentials();
405 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
406 cgi_redirectf("%R/login?g=pikchrshow");
407 }
408 if(P("legacy")){
409 pikchrshowcs_page();
410 return;
411 }
412 style_emit_noscript_for_js_page();
413 style_header("PikchrShow");
414 zContent = PD("content",P("p"));
415 if(!zContent){
416 zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
417 "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
418 "arrow right 200% \"HTML+SVG\" \"Output\"\n"
419 "arrow <-> down from last box.s\n"
420 "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
421 }
422 CX("<div class='emscripten'>"); {
423 CX("<figure id='module-spinner'>");
424 CX("<div class='spinner'></div>");
425 CX("<div class='center'><strong>Initializing app...</strong></div>");
426 CX("<div class='center'>");
427 CX("On a slow internet connection this may take a moment. If this ");
428 CX("message displays for \"a long time\", intialization may have ");
429 CX("failed and the JavaScript console may contain clues as to why. ");
430 CX("</div>");
431 CX("<div><a href='?legacy'>Switch to legacy mode</a></div>");
432 CX("</figure>");
433 CX("<div class='emscripten' id='module-status'>Downloading...</div>");
434 CX("<progress value='0' max='100' id='module-progress' hidden='1'>"
435 "</progress>");
436 } CX("</div><!-- .emscripten -->");
437 CX("<div id='view-split' class='app-view initially-hidden'>"); {
438 CX("<div class='fieldset options collapsible'>"); {
439 CX("<span class='legend'><span>Options</span></span>");
440 CX("<div>");
441 CX("<span class='labeled-input'>");
442 CX("<input type='checkbox' id='opt-cb-sbs'");
443 CX("data-csstgt='#main-wrapper'");
444 CX("data-cssclass='side-by-side'");
445 CX("data-config='sideBySide'>");
446 CX("<label for='opt-cb-sbs'>Side-by-side</label>");
447 CX("</span>");
448 CX("<span class='labeled-input'>");
449 CX("<input type='checkbox' id='opt-cb-swapio'");
450 CX("data-csstgt='#main-wrapper'");
451 CX("data-cssclass='swapio'");
452 CX("data-config='swapInOut'>");
453 CX("<label for='opt-cb-swapio'>Swap in/out</label>");
454 CX("</span>");
455 CX("<span class='labeled-input'>");
456 CX("<input type='checkbox' id='opt-cb-autoscale'");
457 CX("data-config='renderAutoScale'>");
458 CX("<label for='opt-cb-autoscale'>Auto-scale SVG</label>");
459 CX("</span>");
460 CX("<span class='labeled-input'>");
461 CX("<input type='checkbox' id='opt-cb-autorender'");
462 CX("data-config='renderWhileTyping'>");
463 CX("<label for='opt-cb-autorender'>Render while typing</label>");
464 CX("</span>");
465 CX("<span class='labeled-input'>");
466 CX("<a href='?legacy'>Legacy mode</a>");
467 CX("</span>");
468 CX("</div><!-- options wrapper -->");
469 } CX("</div><!-- .fieldset -->");
470 CX("<div id='main-wrapper' class=''>"); {
471 CX("<div class='zone-wrapper input'>"); {
472 CX("<textarea id='input'");
473 CX("placeholder='Shell input. Ctrl-enter/shift-enter runs it.'>");
474 CX("/**\n");
475 CX(" Use ctrl-enter or shift-enter to execute\n");
476 CX(" pikchr code. If only a subset is currently\n");
477 CX(" selected, only that part is evaluated.\n*/\n");
478 CX("%s</textarea>",zContent/*safe-for-%s*/);
479 CX("<div class='button-bar'>");
480 CX("<button id='btn-render'>Render</button>");
481 CX("<button id='btn-clear'>Clear Input</button>");
482 CX("</div><!-- .button-bar -->");
483 } CX("</div><!-- .zone-wrapper.input -->");
484 CX("<div class='zone-wrapper output'>"); {
485 CX("<div id='pikchr-output-wrapper'>");
486 CX("<div id='pikchr-output'></div>");
487 CX("</div>");
488 CX("<div class='button-bar'>");
489 CX("<button id='btn-render-mode'>Toggle Render Mode</button>");
490 CX("</div><!-- .button-bar -->");
491 } CX("</div> <!-- .zone-wrapper.output -->");
492 } CX("</div><!-- #main-wrapper -->");
493 } CX("</div><!-- #view-split -->");
494 builtin_fossil_js_bundle_or("storage", NULL);
495 builtin_request_js("fossil.page.pikchrshowasm.js");
496 builtin_fulfill_js_requests();
497 style_finish_page();
498 }
499
500
501 /*
502 ** COMMAND: pikchr*
503 **
504 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
505
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217217
default.css
218218
style.*.css
219219
../skins/*/*.txt
220220
sounds/*.wav
221221
alerts/*.wav
222
+ ../extsrc/pikchr.wasm
223
+ ../extsrc/pikchr-*.js
222224
}
223225
224226
# Options used to compile the included SQLite library.
225227
#
226228
set SQLITE_OPTIONS {
227229
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217 default.css
218 style.*.css
219 ../skins/*/*.txt
220 sounds/*.wav
221 alerts/*.wav
 
 
222 }
223
224 # Options used to compile the included SQLite library.
225 #
226 set SQLITE_OPTIONS {
227
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217 default.css
218 style.*.css
219 ../skins/*/*.txt
220 sounds/*.wav
221 alerts/*.wav
222 ../extsrc/pikchr.wasm
223 ../extsrc/pikchr-*.js
224 }
225
226 # Options used to compile the included SQLite library.
227 #
228 set SQLITE_OPTIONS {
229
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217217
default.css
218218
style.*.css
219219
../skins/*/*.txt
220220
sounds/*.wav
221221
alerts/*.wav
222
+ ../extsrc/pikchr.wasm
223
+ ../extsrc/pikchr-*.js
222224
}
223225
224226
# Options used to compile the included SQLite library.
225227
#
226228
set SQLITE_OPTIONS {
227229
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217 default.css
218 style.*.css
219 ../skins/*/*.txt
220 sounds/*.wav
221 alerts/*.wav
 
 
222 }
223
224 # Options used to compile the included SQLite library.
225 #
226 set SQLITE_OPTIONS {
227
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -217,10 +217,12 @@
217 default.css
218 style.*.css
219 ../skins/*/*.txt
220 sounds/*.wav
221 alerts/*.wav
222 ../extsrc/pikchr.wasm
223 ../extsrc/pikchr-*.js
224 }
225
226 # Options used to compile the included SQLite library.
227 #
228 set SQLITE_OPTIONS {
229
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354354
while( pData[nSkip]=='#' ){
355355
while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356356
if( pData[nSkip]=='\n' ) nSkip++;
357357
}
358358
359
+#if 1
360
+ /* 2022-06-06: temporarily disabled for the sake of the pikchr
361
+ ** wasm build, as "something" in this compression is breaking the
362
+ ** module loader. */
359363
#ifndef FOSSIL_DEBUG
360364
/* Compress javascript source files */
361365
nName = (int)strlen(aRes[i].zName);
362366
if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
363367
|| (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
364368
){
365369
int x = sz-nSkip;
366370
compressJavascript(pData+nSkip, &x);
367371
sz = x + nSkip;
368372
}
373
+#endif
369374
#endif
370375
371376
aRes[i].nByte = sz - nSkip;
372377
aRes[i].idx = i;
373378
printf("/* Content of file %s */\n", aRes[i].zName);
374379
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354 while( pData[nSkip]=='#' ){
355 while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356 if( pData[nSkip]=='\n' ) nSkip++;
357 }
358
 
 
 
 
359 #ifndef FOSSIL_DEBUG
360 /* Compress javascript source files */
361 nName = (int)strlen(aRes[i].zName);
362 if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
363 || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
364 ){
365 int x = sz-nSkip;
366 compressJavascript(pData+nSkip, &x);
367 sz = x + nSkip;
368 }
 
369 #endif
370
371 aRes[i].nByte = sz - nSkip;
372 aRes[i].idx = i;
373 printf("/* Content of file %s */\n", aRes[i].zName);
374
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354 while( pData[nSkip]=='#' ){
355 while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356 if( pData[nSkip]=='\n' ) nSkip++;
357 }
358
359 #if 1
360 /* 2022-06-06: temporarily disabled for the sake of the pikchr
361 ** wasm build, as "something" in this compression is breaking the
362 ** module loader. */
363 #ifndef FOSSIL_DEBUG
364 /* Compress javascript source files */
365 nName = (int)strlen(aRes[i].zName);
366 if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
367 || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
368 ){
369 int x = sz-nSkip;
370 compressJavascript(pData+nSkip, &x);
371 sz = x + nSkip;
372 }
373 #endif
374 #endif
375
376 aRes[i].nByte = sz - nSkip;
377 aRes[i].idx = i;
378 printf("/* Content of file %s */\n", aRes[i].zName);
379
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354354
while( pData[nSkip]=='#' ){
355355
while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356356
if( pData[nSkip]=='\n' ) nSkip++;
357357
}
358358
359
+#if 1
360
+ /* 2022-06-06: temporarily disabled for the sake of the pikchr
361
+ ** wasm build, as "something" in this compression is breaking the
362
+ ** module loader. */
359363
#ifndef FOSSIL_DEBUG
360364
/* Compress javascript source files */
361365
nName = (int)strlen(aRes[i].zName);
362366
if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
363367
|| (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
364368
){
365369
int x = sz-nSkip;
366370
compressJavascript(pData+nSkip, &x);
367371
sz = x + nSkip;
368372
}
373
+#endif
369374
#endif
370375
371376
aRes[i].nByte = sz - nSkip;
372377
aRes[i].idx = i;
373378
printf("/* Content of file %s */\n", aRes[i].zName);
374379
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354 while( pData[nSkip]=='#' ){
355 while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356 if( pData[nSkip]=='\n' ) nSkip++;
357 }
358
 
 
 
 
359 #ifndef FOSSIL_DEBUG
360 /* Compress javascript source files */
361 nName = (int)strlen(aRes[i].zName);
362 if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
363 || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
364 ){
365 int x = sz-nSkip;
366 compressJavascript(pData+nSkip, &x);
367 sz = x + nSkip;
368 }
 
369 #endif
370
371 aRes[i].nByte = sz - nSkip;
372 aRes[i].idx = i;
373 printf("/* Content of file %s */\n", aRes[i].zName);
374
--- tools/mkbuiltin.c
+++ tools/mkbuiltin.c
@@ -354,10 +354,14 @@
354 while( pData[nSkip]=='#' ){
355 while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; }
356 if( pData[nSkip]=='\n' ) nSkip++;
357 }
358
359 #if 1
360 /* 2022-06-06: temporarily disabled for the sake of the pikchr
361 ** wasm build, as "something" in this compression is breaking the
362 ** module loader. */
363 #ifndef FOSSIL_DEBUG
364 /* Compress javascript source files */
365 nName = (int)strlen(aRes[i].zName);
366 if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0)
367 || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0)
@@ -364,10 +368,11 @@
368 ){
369 int x = sz-nSkip;
370 compressJavascript(pData+nSkip, &x);
371 sz = x + nSkip;
372 }
373 #endif
374 #endif
375
376 aRes[i].nByte = sz - nSkip;
377 aRes[i].idx = i;
378 printf("/* Content of file %s */\n", aRes[i].zName);
379
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549549
$(SRCDIR)/xfer.c \
550550
$(SRCDIR)/xfersetup.c \
551551
$(SRCDIR)/zip.c
552552
553553
EXTRA_FILES = \
554
+ $(SRCDIR)/../extsrc/pikchr-module.js \
555
+ $(SRCDIR)/../extsrc/pikchr-worker.js \
556
+ $(SRCDIR)/../extsrc/pikchr.wasm \
554557
$(SRCDIR)/../skins/ardoise/css.txt \
555558
$(SRCDIR)/../skins/ardoise/details.txt \
556559
$(SRCDIR)/../skins/ardoise/footer.txt \
557560
$(SRCDIR)/../skins/ardoise/header.txt \
558561
$(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
617620
$(SRCDIR)/fossil.page.brlist.js \
618621
$(SRCDIR)/fossil.page.chat.js \
619622
$(SRCDIR)/fossil.page.fileedit.js \
620623
$(SRCDIR)/fossil.page.forumpost.js \
621624
$(SRCDIR)/fossil.page.pikchrshow.js \
625
+ $(SRCDIR)/fossil.page.pikchrshowasm.js \
622626
$(SRCDIR)/fossil.page.whistory.js \
623627
$(SRCDIR)/fossil.page.wikiedit.js \
624628
$(SRCDIR)/fossil.pikchr.js \
625629
$(SRCDIR)/fossil.popupwidget.js \
626630
$(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
652656
$(SRCDIR)/sounds/e.wav \
653657
$(SRCDIR)/sounds/f.wav \
654658
$(SRCDIR)/style.admin_log.css \
655659
$(SRCDIR)/style.chat.css \
656660
$(SRCDIR)/style.fileedit.css \
661
+ $(SRCDIR)/style.pikchrshow.css \
657662
$(SRCDIR)/style.wikiedit.css \
658663
$(SRCDIR)/tree.js \
659664
$(SRCDIR)/useredit.js \
660665
$(SRCDIR)/wiki.wiki
661666
662667
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549 $(SRCDIR)/xfer.c \
550 $(SRCDIR)/xfersetup.c \
551 $(SRCDIR)/zip.c
552
553 EXTRA_FILES = \
 
 
 
554 $(SRCDIR)/../skins/ardoise/css.txt \
555 $(SRCDIR)/../skins/ardoise/details.txt \
556 $(SRCDIR)/../skins/ardoise/footer.txt \
557 $(SRCDIR)/../skins/ardoise/header.txt \
558 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
617 $(SRCDIR)/fossil.page.brlist.js \
618 $(SRCDIR)/fossil.page.chat.js \
619 $(SRCDIR)/fossil.page.fileedit.js \
620 $(SRCDIR)/fossil.page.forumpost.js \
621 $(SRCDIR)/fossil.page.pikchrshow.js \
 
622 $(SRCDIR)/fossil.page.whistory.js \
623 $(SRCDIR)/fossil.page.wikiedit.js \
624 $(SRCDIR)/fossil.pikchr.js \
625 $(SRCDIR)/fossil.popupwidget.js \
626 $(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
652 $(SRCDIR)/sounds/e.wav \
653 $(SRCDIR)/sounds/f.wav \
654 $(SRCDIR)/style.admin_log.css \
655 $(SRCDIR)/style.chat.css \
656 $(SRCDIR)/style.fileedit.css \
 
657 $(SRCDIR)/style.wikiedit.css \
658 $(SRCDIR)/tree.js \
659 $(SRCDIR)/useredit.js \
660 $(SRCDIR)/wiki.wiki
661
662
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549 $(SRCDIR)/xfer.c \
550 $(SRCDIR)/xfersetup.c \
551 $(SRCDIR)/zip.c
552
553 EXTRA_FILES = \
554 $(SRCDIR)/../extsrc/pikchr-module.js \
555 $(SRCDIR)/../extsrc/pikchr-worker.js \
556 $(SRCDIR)/../extsrc/pikchr.wasm \
557 $(SRCDIR)/../skins/ardoise/css.txt \
558 $(SRCDIR)/../skins/ardoise/details.txt \
559 $(SRCDIR)/../skins/ardoise/footer.txt \
560 $(SRCDIR)/../skins/ardoise/header.txt \
561 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
620 $(SRCDIR)/fossil.page.brlist.js \
621 $(SRCDIR)/fossil.page.chat.js \
622 $(SRCDIR)/fossil.page.fileedit.js \
623 $(SRCDIR)/fossil.page.forumpost.js \
624 $(SRCDIR)/fossil.page.pikchrshow.js \
625 $(SRCDIR)/fossil.page.pikchrshowasm.js \
626 $(SRCDIR)/fossil.page.whistory.js \
627 $(SRCDIR)/fossil.page.wikiedit.js \
628 $(SRCDIR)/fossil.pikchr.js \
629 $(SRCDIR)/fossil.popupwidget.js \
630 $(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
656 $(SRCDIR)/sounds/e.wav \
657 $(SRCDIR)/sounds/f.wav \
658 $(SRCDIR)/style.admin_log.css \
659 $(SRCDIR)/style.chat.css \
660 $(SRCDIR)/style.fileedit.css \
661 $(SRCDIR)/style.pikchrshow.css \
662 $(SRCDIR)/style.wikiedit.css \
663 $(SRCDIR)/tree.js \
664 $(SRCDIR)/useredit.js \
665 $(SRCDIR)/wiki.wiki
666
667
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549549
$(SRCDIR)/xfer.c \
550550
$(SRCDIR)/xfersetup.c \
551551
$(SRCDIR)/zip.c
552552
553553
EXTRA_FILES = \
554
+ $(SRCDIR)/../extsrc/pikchr-module.js \
555
+ $(SRCDIR)/../extsrc/pikchr-worker.js \
556
+ $(SRCDIR)/../extsrc/pikchr.wasm \
554557
$(SRCDIR)/../skins/ardoise/css.txt \
555558
$(SRCDIR)/../skins/ardoise/details.txt \
556559
$(SRCDIR)/../skins/ardoise/footer.txt \
557560
$(SRCDIR)/../skins/ardoise/header.txt \
558561
$(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
617620
$(SRCDIR)/fossil.page.brlist.js \
618621
$(SRCDIR)/fossil.page.chat.js \
619622
$(SRCDIR)/fossil.page.fileedit.js \
620623
$(SRCDIR)/fossil.page.forumpost.js \
621624
$(SRCDIR)/fossil.page.pikchrshow.js \
625
+ $(SRCDIR)/fossil.page.pikchrshowasm.js \
622626
$(SRCDIR)/fossil.page.whistory.js \
623627
$(SRCDIR)/fossil.page.wikiedit.js \
624628
$(SRCDIR)/fossil.pikchr.js \
625629
$(SRCDIR)/fossil.popupwidget.js \
626630
$(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
652656
$(SRCDIR)/sounds/e.wav \
653657
$(SRCDIR)/sounds/f.wav \
654658
$(SRCDIR)/style.admin_log.css \
655659
$(SRCDIR)/style.chat.css \
656660
$(SRCDIR)/style.fileedit.css \
661
+ $(SRCDIR)/style.pikchrshow.css \
657662
$(SRCDIR)/style.wikiedit.css \
658663
$(SRCDIR)/tree.js \
659664
$(SRCDIR)/useredit.js \
660665
$(SRCDIR)/wiki.wiki
661666
662667
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549 $(SRCDIR)/xfer.c \
550 $(SRCDIR)/xfersetup.c \
551 $(SRCDIR)/zip.c
552
553 EXTRA_FILES = \
 
 
 
554 $(SRCDIR)/../skins/ardoise/css.txt \
555 $(SRCDIR)/../skins/ardoise/details.txt \
556 $(SRCDIR)/../skins/ardoise/footer.txt \
557 $(SRCDIR)/../skins/ardoise/header.txt \
558 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
617 $(SRCDIR)/fossil.page.brlist.js \
618 $(SRCDIR)/fossil.page.chat.js \
619 $(SRCDIR)/fossil.page.fileedit.js \
620 $(SRCDIR)/fossil.page.forumpost.js \
621 $(SRCDIR)/fossil.page.pikchrshow.js \
 
622 $(SRCDIR)/fossil.page.whistory.js \
623 $(SRCDIR)/fossil.page.wikiedit.js \
624 $(SRCDIR)/fossil.pikchr.js \
625 $(SRCDIR)/fossil.popupwidget.js \
626 $(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
652 $(SRCDIR)/sounds/e.wav \
653 $(SRCDIR)/sounds/f.wav \
654 $(SRCDIR)/style.admin_log.css \
655 $(SRCDIR)/style.chat.css \
656 $(SRCDIR)/style.fileedit.css \
 
657 $(SRCDIR)/style.wikiedit.css \
658 $(SRCDIR)/tree.js \
659 $(SRCDIR)/useredit.js \
660 $(SRCDIR)/wiki.wiki
661
662
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -549,10 +549,13 @@
549 $(SRCDIR)/xfer.c \
550 $(SRCDIR)/xfersetup.c \
551 $(SRCDIR)/zip.c
552
553 EXTRA_FILES = \
554 $(SRCDIR)/../extsrc/pikchr-module.js \
555 $(SRCDIR)/../extsrc/pikchr-worker.js \
556 $(SRCDIR)/../extsrc/pikchr.wasm \
557 $(SRCDIR)/../skins/ardoise/css.txt \
558 $(SRCDIR)/../skins/ardoise/details.txt \
559 $(SRCDIR)/../skins/ardoise/footer.txt \
560 $(SRCDIR)/../skins/ardoise/header.txt \
561 $(SRCDIR)/../skins/black_and_white/css.txt \
@@ -617,10 +620,11 @@
620 $(SRCDIR)/fossil.page.brlist.js \
621 $(SRCDIR)/fossil.page.chat.js \
622 $(SRCDIR)/fossil.page.fileedit.js \
623 $(SRCDIR)/fossil.page.forumpost.js \
624 $(SRCDIR)/fossil.page.pikchrshow.js \
625 $(SRCDIR)/fossil.page.pikchrshowasm.js \
626 $(SRCDIR)/fossil.page.whistory.js \
627 $(SRCDIR)/fossil.page.wikiedit.js \
628 $(SRCDIR)/fossil.pikchr.js \
629 $(SRCDIR)/fossil.popupwidget.js \
630 $(SRCDIR)/fossil.storage.js \
@@ -652,10 +656,11 @@
656 $(SRCDIR)/sounds/e.wav \
657 $(SRCDIR)/sounds/f.wav \
658 $(SRCDIR)/style.admin_log.css \
659 $(SRCDIR)/style.chat.css \
660 $(SRCDIR)/style.fileedit.css \
661 $(SRCDIR)/style.pikchrshow.css \
662 $(SRCDIR)/style.wikiedit.css \
663 $(SRCDIR)/tree.js \
664 $(SRCDIR)/useredit.js \
665 $(SRCDIR)/wiki.wiki
666
667
+12 -2
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505505
"$(OX)\xfer_.c" \
506506
"$(OX)\xfersetup_.c" \
507507
"$(OX)\zip_.c" \
508508
"$(SRCDIR_extsrc)\pikchr.c"
509509
510
-EXTRA_FILES = "$(SRCDIR)\..\skins\ardoise\css.txt" \
510
+EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-module.js" \
511
+ "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
512
+ "$(SRCDIR)\..\extsrc\pikchr.wasm" \
513
+ "$(SRCDIR)\..\skins\ardoise\css.txt" \
511514
"$(SRCDIR)\..\skins\ardoise\details.txt" \
512515
"$(SRCDIR)\..\skins\ardoise\footer.txt" \
513516
"$(SRCDIR)\..\skins\ardoise\header.txt" \
514517
"$(SRCDIR)\..\skins\black_and_white\css.txt" \
515518
"$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
573576
"$(SRCDIR)\fossil.page.brlist.js" \
574577
"$(SRCDIR)\fossil.page.chat.js" \
575578
"$(SRCDIR)\fossil.page.fileedit.js" \
576579
"$(SRCDIR)\fossil.page.forumpost.js" \
577580
"$(SRCDIR)\fossil.page.pikchrshow.js" \
581
+ "$(SRCDIR)\fossil.page.pikchrshowasm.js" \
578582
"$(SRCDIR)\fossil.page.whistory.js" \
579583
"$(SRCDIR)\fossil.page.wikiedit.js" \
580584
"$(SRCDIR)\fossil.pikchr.js" \
581585
"$(SRCDIR)\fossil.popupwidget.js" \
582586
"$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
608612
"$(SRCDIR)\sounds\e.wav" \
609613
"$(SRCDIR)\sounds\f.wav" \
610614
"$(SRCDIR)\style.admin_log.css" \
611615
"$(SRCDIR)\style.chat.css" \
612616
"$(SRCDIR)\style.fileedit.css" \
617
+ "$(SRCDIR)\style.pikchrshow.css" \
613618
"$(SRCDIR)\style.wikiedit.css" \
614619
"$(SRCDIR)\tree.js" \
615620
"$(SRCDIR)\useredit.js" \
616621
"$(SRCDIR)\wiki.wiki"
617622
@@ -1129,11 +1134,14 @@
11291134
"$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
11301135
"$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
11311136
"$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
11321137
11331138
"$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1134
- echo "$(SRCDIR)\../skins/ardoise/css.txt" > $@
1139
+ echo "$(SRCDIR)\../extsrc/pikchr-module.js" > $@
1140
+ echo "$(SRCDIR)\../extsrc/pikchr-worker.js" >> $@
1141
+ echo "$(SRCDIR)\../extsrc/pikchr.wasm" >> $@
1142
+ echo "$(SRCDIR)\../skins/ardoise/css.txt" >> $@
11351143
echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
11361144
echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
11371145
echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
11381146
echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
11391147
echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
11971205
echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
11981206
echo "$(SRCDIR)\fossil.page.chat.js" >> $@
11991207
echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
12001208
echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
12011209
echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
1210
+ echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@
12021211
echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
12031212
echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
12041213
echo "$(SRCDIR)\fossil.pikchr.js" >> $@
12051214
echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
12061215
echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
12321241
echo "$(SRCDIR)\sounds/e.wav" >> $@
12331242
echo "$(SRCDIR)\sounds/f.wav" >> $@
12341243
echo "$(SRCDIR)\style.admin_log.css" >> $@
12351244
echo "$(SRCDIR)\style.chat.css" >> $@
12361245
echo "$(SRCDIR)\style.fileedit.css" >> $@
1246
+ echo "$(SRCDIR)\style.pikchrshow.css" >> $@
12371247
echo "$(SRCDIR)\style.wikiedit.css" >> $@
12381248
echo "$(SRCDIR)\tree.js" >> $@
12391249
echo "$(SRCDIR)\useredit.js" >> $@
12401250
echo "$(SRCDIR)\wiki.wiki" >> $@
12411251
12421252
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505 "$(OX)\xfer_.c" \
506 "$(OX)\xfersetup_.c" \
507 "$(OX)\zip_.c" \
508 "$(SRCDIR_extsrc)\pikchr.c"
509
510 EXTRA_FILES = "$(SRCDIR)\..\skins\ardoise\css.txt" \
 
 
 
511 "$(SRCDIR)\..\skins\ardoise\details.txt" \
512 "$(SRCDIR)\..\skins\ardoise\footer.txt" \
513 "$(SRCDIR)\..\skins\ardoise\header.txt" \
514 "$(SRCDIR)\..\skins\black_and_white\css.txt" \
515 "$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
573 "$(SRCDIR)\fossil.page.brlist.js" \
574 "$(SRCDIR)\fossil.page.chat.js" \
575 "$(SRCDIR)\fossil.page.fileedit.js" \
576 "$(SRCDIR)\fossil.page.forumpost.js" \
577 "$(SRCDIR)\fossil.page.pikchrshow.js" \
 
578 "$(SRCDIR)\fossil.page.whistory.js" \
579 "$(SRCDIR)\fossil.page.wikiedit.js" \
580 "$(SRCDIR)\fossil.pikchr.js" \
581 "$(SRCDIR)\fossil.popupwidget.js" \
582 "$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
608 "$(SRCDIR)\sounds\e.wav" \
609 "$(SRCDIR)\sounds\f.wav" \
610 "$(SRCDIR)\style.admin_log.css" \
611 "$(SRCDIR)\style.chat.css" \
612 "$(SRCDIR)\style.fileedit.css" \
 
613 "$(SRCDIR)\style.wikiedit.css" \
614 "$(SRCDIR)\tree.js" \
615 "$(SRCDIR)\useredit.js" \
616 "$(SRCDIR)\wiki.wiki"
617
@@ -1129,11 +1134,14 @@
1129 "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
1130 "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
1131 "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
1132
1133 "$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1134 echo "$(SRCDIR)\../skins/ardoise/css.txt" > $@
 
 
 
1135 echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
1136 echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
1137 echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
1138 echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
1139 echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
1197 echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
1198 echo "$(SRCDIR)\fossil.page.chat.js" >> $@
1199 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1200 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1201 echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
 
1202 echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
1203 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1204 echo "$(SRCDIR)\fossil.pikchr.js" >> $@
1205 echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
1206 echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
1232 echo "$(SRCDIR)\sounds/e.wav" >> $@
1233 echo "$(SRCDIR)\sounds/f.wav" >> $@
1234 echo "$(SRCDIR)\style.admin_log.css" >> $@
1235 echo "$(SRCDIR)\style.chat.css" >> $@
1236 echo "$(SRCDIR)\style.fileedit.css" >> $@
 
1237 echo "$(SRCDIR)\style.wikiedit.css" >> $@
1238 echo "$(SRCDIR)\tree.js" >> $@
1239 echo "$(SRCDIR)\useredit.js" >> $@
1240 echo "$(SRCDIR)\wiki.wiki" >> $@
1241
1242
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505 "$(OX)\xfer_.c" \
506 "$(OX)\xfersetup_.c" \
507 "$(OX)\zip_.c" \
508 "$(SRCDIR_extsrc)\pikchr.c"
509
510 EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-module.js" \
511 "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
512 "$(SRCDIR)\..\extsrc\pikchr.wasm" \
513 "$(SRCDIR)\..\skins\ardoise\css.txt" \
514 "$(SRCDIR)\..\skins\ardoise\details.txt" \
515 "$(SRCDIR)\..\skins\ardoise\footer.txt" \
516 "$(SRCDIR)\..\skins\ardoise\header.txt" \
517 "$(SRCDIR)\..\skins\black_and_white\css.txt" \
518 "$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
576 "$(SRCDIR)\fossil.page.brlist.js" \
577 "$(SRCDIR)\fossil.page.chat.js" \
578 "$(SRCDIR)\fossil.page.fileedit.js" \
579 "$(SRCDIR)\fossil.page.forumpost.js" \
580 "$(SRCDIR)\fossil.page.pikchrshow.js" \
581 "$(SRCDIR)\fossil.page.pikchrshowasm.js" \
582 "$(SRCDIR)\fossil.page.whistory.js" \
583 "$(SRCDIR)\fossil.page.wikiedit.js" \
584 "$(SRCDIR)\fossil.pikchr.js" \
585 "$(SRCDIR)\fossil.popupwidget.js" \
586 "$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
612 "$(SRCDIR)\sounds\e.wav" \
613 "$(SRCDIR)\sounds\f.wav" \
614 "$(SRCDIR)\style.admin_log.css" \
615 "$(SRCDIR)\style.chat.css" \
616 "$(SRCDIR)\style.fileedit.css" \
617 "$(SRCDIR)\style.pikchrshow.css" \
618 "$(SRCDIR)\style.wikiedit.css" \
619 "$(SRCDIR)\tree.js" \
620 "$(SRCDIR)\useredit.js" \
621 "$(SRCDIR)\wiki.wiki"
622
@@ -1129,11 +1134,14 @@
1134 "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
1135 "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
1136 "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
1137
1138 "$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1139 echo "$(SRCDIR)\../extsrc/pikchr-module.js" > $@
1140 echo "$(SRCDIR)\../extsrc/pikchr-worker.js" >> $@
1141 echo "$(SRCDIR)\../extsrc/pikchr.wasm" >> $@
1142 echo "$(SRCDIR)\../skins/ardoise/css.txt" >> $@
1143 echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
1144 echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
1145 echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
1146 echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
1147 echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
1205 echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
1206 echo "$(SRCDIR)\fossil.page.chat.js" >> $@
1207 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1208 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1209 echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
1210 echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@
1211 echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
1212 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1213 echo "$(SRCDIR)\fossil.pikchr.js" >> $@
1214 echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
1215 echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
1241 echo "$(SRCDIR)\sounds/e.wav" >> $@
1242 echo "$(SRCDIR)\sounds/f.wav" >> $@
1243 echo "$(SRCDIR)\style.admin_log.css" >> $@
1244 echo "$(SRCDIR)\style.chat.css" >> $@
1245 echo "$(SRCDIR)\style.fileedit.css" >> $@
1246 echo "$(SRCDIR)\style.pikchrshow.css" >> $@
1247 echo "$(SRCDIR)\style.wikiedit.css" >> $@
1248 echo "$(SRCDIR)\tree.js" >> $@
1249 echo "$(SRCDIR)\useredit.js" >> $@
1250 echo "$(SRCDIR)\wiki.wiki" >> $@
1251
1252
+12 -2
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505505
"$(OX)\xfer_.c" \
506506
"$(OX)\xfersetup_.c" \
507507
"$(OX)\zip_.c" \
508508
"$(SRCDIR_extsrc)\pikchr.c"
509509
510
-EXTRA_FILES = "$(SRCDIR)\..\skins\ardoise\css.txt" \
510
+EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-module.js" \
511
+ "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
512
+ "$(SRCDIR)\..\extsrc\pikchr.wasm" \
513
+ "$(SRCDIR)\..\skins\ardoise\css.txt" \
511514
"$(SRCDIR)\..\skins\ardoise\details.txt" \
512515
"$(SRCDIR)\..\skins\ardoise\footer.txt" \
513516
"$(SRCDIR)\..\skins\ardoise\header.txt" \
514517
"$(SRCDIR)\..\skins\black_and_white\css.txt" \
515518
"$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
573576
"$(SRCDIR)\fossil.page.brlist.js" \
574577
"$(SRCDIR)\fossil.page.chat.js" \
575578
"$(SRCDIR)\fossil.page.fileedit.js" \
576579
"$(SRCDIR)\fossil.page.forumpost.js" \
577580
"$(SRCDIR)\fossil.page.pikchrshow.js" \
581
+ "$(SRCDIR)\fossil.page.pikchrshowasm.js" \
578582
"$(SRCDIR)\fossil.page.whistory.js" \
579583
"$(SRCDIR)\fossil.page.wikiedit.js" \
580584
"$(SRCDIR)\fossil.pikchr.js" \
581585
"$(SRCDIR)\fossil.popupwidget.js" \
582586
"$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
608612
"$(SRCDIR)\sounds\e.wav" \
609613
"$(SRCDIR)\sounds\f.wav" \
610614
"$(SRCDIR)\style.admin_log.css" \
611615
"$(SRCDIR)\style.chat.css" \
612616
"$(SRCDIR)\style.fileedit.css" \
617
+ "$(SRCDIR)\style.pikchrshow.css" \
613618
"$(SRCDIR)\style.wikiedit.css" \
614619
"$(SRCDIR)\tree.js" \
615620
"$(SRCDIR)\useredit.js" \
616621
"$(SRCDIR)\wiki.wiki"
617622
@@ -1129,11 +1134,14 @@
11291134
"$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
11301135
"$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
11311136
"$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
11321137
11331138
"$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1134
- echo "$(SRCDIR)\../skins/ardoise/css.txt" > $@
1139
+ echo "$(SRCDIR)\../extsrc/pikchr-module.js" > $@
1140
+ echo "$(SRCDIR)\../extsrc/pikchr-worker.js" >> $@
1141
+ echo "$(SRCDIR)\../extsrc/pikchr.wasm" >> $@
1142
+ echo "$(SRCDIR)\../skins/ardoise/css.txt" >> $@
11351143
echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
11361144
echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
11371145
echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
11381146
echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
11391147
echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
11971205
echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
11981206
echo "$(SRCDIR)\fossil.page.chat.js" >> $@
11991207
echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
12001208
echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
12011209
echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
1210
+ echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@
12021211
echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
12031212
echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
12041213
echo "$(SRCDIR)\fossil.pikchr.js" >> $@
12051214
echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
12061215
echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
12321241
echo "$(SRCDIR)\sounds/e.wav" >> $@
12331242
echo "$(SRCDIR)\sounds/f.wav" >> $@
12341243
echo "$(SRCDIR)\style.admin_log.css" >> $@
12351244
echo "$(SRCDIR)\style.chat.css" >> $@
12361245
echo "$(SRCDIR)\style.fileedit.css" >> $@
1246
+ echo "$(SRCDIR)\style.pikchrshow.css" >> $@
12371247
echo "$(SRCDIR)\style.wikiedit.css" >> $@
12381248
echo "$(SRCDIR)\tree.js" >> $@
12391249
echo "$(SRCDIR)\useredit.js" >> $@
12401250
echo "$(SRCDIR)\wiki.wiki" >> $@
12411251
12421252
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505 "$(OX)\xfer_.c" \
506 "$(OX)\xfersetup_.c" \
507 "$(OX)\zip_.c" \
508 "$(SRCDIR_extsrc)\pikchr.c"
509
510 EXTRA_FILES = "$(SRCDIR)\..\skins\ardoise\css.txt" \
 
 
 
511 "$(SRCDIR)\..\skins\ardoise\details.txt" \
512 "$(SRCDIR)\..\skins\ardoise\footer.txt" \
513 "$(SRCDIR)\..\skins\ardoise\header.txt" \
514 "$(SRCDIR)\..\skins\black_and_white\css.txt" \
515 "$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
573 "$(SRCDIR)\fossil.page.brlist.js" \
574 "$(SRCDIR)\fossil.page.chat.js" \
575 "$(SRCDIR)\fossil.page.fileedit.js" \
576 "$(SRCDIR)\fossil.page.forumpost.js" \
577 "$(SRCDIR)\fossil.page.pikchrshow.js" \
 
578 "$(SRCDIR)\fossil.page.whistory.js" \
579 "$(SRCDIR)\fossil.page.wikiedit.js" \
580 "$(SRCDIR)\fossil.pikchr.js" \
581 "$(SRCDIR)\fossil.popupwidget.js" \
582 "$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
608 "$(SRCDIR)\sounds\e.wav" \
609 "$(SRCDIR)\sounds\f.wav" \
610 "$(SRCDIR)\style.admin_log.css" \
611 "$(SRCDIR)\style.chat.css" \
612 "$(SRCDIR)\style.fileedit.css" \
 
613 "$(SRCDIR)\style.wikiedit.css" \
614 "$(SRCDIR)\tree.js" \
615 "$(SRCDIR)\useredit.js" \
616 "$(SRCDIR)\wiki.wiki"
617
@@ -1129,11 +1134,14 @@
1129 "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
1130 "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
1131 "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
1132
1133 "$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1134 echo "$(SRCDIR)\../skins/ardoise/css.txt" > $@
 
 
 
1135 echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
1136 echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
1137 echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
1138 echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
1139 echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
1197 echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
1198 echo "$(SRCDIR)\fossil.page.chat.js" >> $@
1199 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1200 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1201 echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
 
1202 echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
1203 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1204 echo "$(SRCDIR)\fossil.pikchr.js" >> $@
1205 echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
1206 echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
1232 echo "$(SRCDIR)\sounds/e.wav" >> $@
1233 echo "$(SRCDIR)\sounds/f.wav" >> $@
1234 echo "$(SRCDIR)\style.admin_log.css" >> $@
1235 echo "$(SRCDIR)\style.chat.css" >> $@
1236 echo "$(SRCDIR)\style.fileedit.css" >> $@
 
1237 echo "$(SRCDIR)\style.wikiedit.css" >> $@
1238 echo "$(SRCDIR)\tree.js" >> $@
1239 echo "$(SRCDIR)\useredit.js" >> $@
1240 echo "$(SRCDIR)\wiki.wiki" >> $@
1241
1242
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -505,11 +505,14 @@
505 "$(OX)\xfer_.c" \
506 "$(OX)\xfersetup_.c" \
507 "$(OX)\zip_.c" \
508 "$(SRCDIR_extsrc)\pikchr.c"
509
510 EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-module.js" \
511 "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
512 "$(SRCDIR)\..\extsrc\pikchr.wasm" \
513 "$(SRCDIR)\..\skins\ardoise\css.txt" \
514 "$(SRCDIR)\..\skins\ardoise\details.txt" \
515 "$(SRCDIR)\..\skins\ardoise\footer.txt" \
516 "$(SRCDIR)\..\skins\ardoise\header.txt" \
517 "$(SRCDIR)\..\skins\black_and_white\css.txt" \
518 "$(SRCDIR)\..\skins\black_and_white\details.txt" \
@@ -573,10 +576,11 @@
576 "$(SRCDIR)\fossil.page.brlist.js" \
577 "$(SRCDIR)\fossil.page.chat.js" \
578 "$(SRCDIR)\fossil.page.fileedit.js" \
579 "$(SRCDIR)\fossil.page.forumpost.js" \
580 "$(SRCDIR)\fossil.page.pikchrshow.js" \
581 "$(SRCDIR)\fossil.page.pikchrshowasm.js" \
582 "$(SRCDIR)\fossil.page.whistory.js" \
583 "$(SRCDIR)\fossil.page.wikiedit.js" \
584 "$(SRCDIR)\fossil.pikchr.js" \
585 "$(SRCDIR)\fossil.popupwidget.js" \
586 "$(SRCDIR)\fossil.storage.js" \
@@ -608,10 +612,11 @@
612 "$(SRCDIR)\sounds\e.wav" \
613 "$(SRCDIR)\sounds\f.wav" \
614 "$(SRCDIR)\style.admin_log.css" \
615 "$(SRCDIR)\style.chat.css" \
616 "$(SRCDIR)\style.fileedit.css" \
617 "$(SRCDIR)\style.pikchrshow.css" \
618 "$(SRCDIR)\style.wikiedit.css" \
619 "$(SRCDIR)\tree.js" \
620 "$(SRCDIR)\useredit.js" \
621 "$(SRCDIR)\wiki.wiki"
622
@@ -1129,11 +1134,14 @@
1134 "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h"
1135 "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h"
1136 "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h"
1137
1138 "$(OX)\builtin_data.reslist": $(EXTRA_FILES) "$(B)\win\Makefile.msc"
1139 echo "$(SRCDIR)\../extsrc/pikchr-module.js" > $@
1140 echo "$(SRCDIR)\../extsrc/pikchr-worker.js" >> $@
1141 echo "$(SRCDIR)\../extsrc/pikchr.wasm" >> $@
1142 echo "$(SRCDIR)\../skins/ardoise/css.txt" >> $@
1143 echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@
1144 echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@
1145 echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@
1146 echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@
1147 echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@
@@ -1197,10 +1205,11 @@
1205 echo "$(SRCDIR)\fossil.page.brlist.js" >> $@
1206 echo "$(SRCDIR)\fossil.page.chat.js" >> $@
1207 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1208 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1209 echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@
1210 echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@
1211 echo "$(SRCDIR)\fossil.page.whistory.js" >> $@
1212 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1213 echo "$(SRCDIR)\fossil.pikchr.js" >> $@
1214 echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
1215 echo "$(SRCDIR)\fossil.storage.js" >> $@
@@ -1232,10 +1241,11 @@
1241 echo "$(SRCDIR)\sounds/e.wav" >> $@
1242 echo "$(SRCDIR)\sounds/f.wav" >> $@
1243 echo "$(SRCDIR)\style.admin_log.css" >> $@
1244 echo "$(SRCDIR)\style.chat.css" >> $@
1245 echo "$(SRCDIR)\style.fileedit.css" >> $@
1246 echo "$(SRCDIR)\style.pikchrshow.css" >> $@
1247 echo "$(SRCDIR)\style.wikiedit.css" >> $@
1248 echo "$(SRCDIR)\tree.js" >> $@
1249 echo "$(SRCDIR)\useredit.js" >> $@
1250 echo "$(SRCDIR)\wiki.wiki" >> $@
1251
1252

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button