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.
Commit
321f01a86e835d37d4e9c4952f4eac2dc791b18b58aa8ef78468377e665b8f04
Parent
e65544571e21c70…
23 files changed
+83
+83
+75
+75
+1
-1
+9
-1
+9
-1
+104
+104
+5
+5
+124
-5
+124
-5
+2
+2
+5
+5
+5
+5
+12
-2
+12
-2
+
extsrc/pikchr-module.js
+
extsrc/pikchr-module.js
+
extsrc/pikchr-worker.js
+
extsrc/pikchr-worker.js
+
extsrc/pikchr.wasm
+
extsrc/pikchr.wasm
~
src/cgi.c
~
src/fossil.page.pikchrshow.js
~
src/fossil.page.pikchrshow.js
+
src/fossil.page.pikchrshowasm.js
+
src/fossil.page.pikchrshowasm.js
~
src/main.mk
~
src/main.mk
~
src/pikchrshow.c
~
src/pikchrshow.c
~
tools/makemake.tcl
~
tools/makemake.tcl
~
tools/mkbuiltin.c
~
tools/mkbuiltin.c
~
win/Makefile.mingw
~
win/Makefile.mingw
~
win/Makefile.msc
~
win/Makefile.msc
+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 @@ | |
| --- 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 |
+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 @@ | |
| --- 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 |
+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 @@ | |
| --- 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; |
+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 @@ | |
| --- 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 @@ | ||
| 493 | 493 | |
| 494 | 494 | /* Content intended for logged in users should only be cached in |
| 495 | 495 | ** the browser, not some shared location. |
| 496 | 496 | */ |
| 497 | 497 | 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); | |
| 499 | 499 | if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){ |
| 500 | 500 | cgi_combine_header_and_body(); |
| 501 | 501 | blob_compress(&cgiContent[0], &cgiContent[0]); |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 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; 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 |
+9
-1
| --- src/fossil.page.pikchrshow.js | ||
| +++ src/fossil.page.pikchrshow.js | ||
| @@ -1,12 +1,20 @@ | ||
| 1 | 1 | (function(F/*the fossil object*/){ |
| 2 | 2 | "use strict"; |
| 3 | 3 | /** |
| 4 | - Client-side implementation of the /pikchrshow app. Requires that | |
| 4 | + Client-side implementation of the /pikchrshowcs app. Requires that | |
| 5 | 5 | the fossil JS bootstrapping is complete and that these fossil JS |
| 6 | 6 | APIs have been installed: fossil.fetch, fossil.dom, |
| 7 | 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. | |
| 8 | 16 | */ |
| 9 | 17 | const E = (s)=>document.querySelector(s), |
| 10 | 18 | D = F.dom, |
| 11 | 19 | P = F.page; |
| 12 | 20 | |
| 13 | 21 | |
| 14 | 22 | 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 |
+9
-1
| --- src/fossil.page.pikchrshow.js | ||
| +++ src/fossil.page.pikchrshow.js | ||
| @@ -1,12 +1,20 @@ | ||
| 1 | 1 | (function(F/*the fossil object*/){ |
| 2 | 2 | "use strict"; |
| 3 | 3 | /** |
| 4 | - Client-side implementation of the /pikchrshow app. Requires that | |
| 4 | + Client-side implementation of the /pikchrshowcs app. Requires that | |
| 5 | 5 | the fossil JS bootstrapping is complete and that these fossil JS |
| 6 | 6 | APIs have been installed: fossil.fetch, fossil.dom, |
| 7 | 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. | |
| 8 | 16 | */ |
| 9 | 17 | const E = (s)=>document.querySelector(s), |
| 10 | 18 | D = F.dom, |
| 11 | 19 | P = F.page; |
| 12 | 20 | |
| 13 | 21 | |
| 14 | 22 | 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 | } |
+5
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -163,10 +163,13 @@ | ||
| 163 | 163 | $(SRCDIR)/xfer.c \ |
| 164 | 164 | $(SRCDIR)/xfersetup.c \ |
| 165 | 165 | $(SRCDIR)/zip.c |
| 166 | 166 | |
| 167 | 167 | EXTRA_FILES = \ |
| 168 | + $(SRCDIR)/../extsrc/pikchr-module.js \ | |
| 169 | + $(SRCDIR)/../extsrc/pikchr-worker.js \ | |
| 170 | + $(SRCDIR)/../extsrc/pikchr.wasm \ | |
| 168 | 171 | $(SRCDIR)/../skins/ardoise/css.txt \ |
| 169 | 172 | $(SRCDIR)/../skins/ardoise/details.txt \ |
| 170 | 173 | $(SRCDIR)/../skins/ardoise/footer.txt \ |
| 171 | 174 | $(SRCDIR)/../skins/ardoise/header.txt \ |
| 172 | 175 | $(SRCDIR)/../skins/black_and_white/css.txt \ |
| @@ -231,10 +234,11 @@ | ||
| 231 | 234 | $(SRCDIR)/fossil.page.brlist.js \ |
| 232 | 235 | $(SRCDIR)/fossil.page.chat.js \ |
| 233 | 236 | $(SRCDIR)/fossil.page.fileedit.js \ |
| 234 | 237 | $(SRCDIR)/fossil.page.forumpost.js \ |
| 235 | 238 | $(SRCDIR)/fossil.page.pikchrshow.js \ |
| 239 | + $(SRCDIR)/fossil.page.pikchrshowasm.js \ | |
| 236 | 240 | $(SRCDIR)/fossil.page.whistory.js \ |
| 237 | 241 | $(SRCDIR)/fossil.page.wikiedit.js \ |
| 238 | 242 | $(SRCDIR)/fossil.pikchr.js \ |
| 239 | 243 | $(SRCDIR)/fossil.popupwidget.js \ |
| 240 | 244 | $(SRCDIR)/fossil.storage.js \ |
| @@ -266,10 +270,11 @@ | ||
| 266 | 270 | $(SRCDIR)/sounds/e.wav \ |
| 267 | 271 | $(SRCDIR)/sounds/f.wav \ |
| 268 | 272 | $(SRCDIR)/style.admin_log.css \ |
| 269 | 273 | $(SRCDIR)/style.chat.css \ |
| 270 | 274 | $(SRCDIR)/style.fileedit.css \ |
| 275 | + $(SRCDIR)/style.pikchrshow.css \ | |
| 271 | 276 | $(SRCDIR)/style.wikiedit.css \ |
| 272 | 277 | $(SRCDIR)/tree.js \ |
| 273 | 278 | $(SRCDIR)/useredit.js \ |
| 274 | 279 | $(SRCDIR)/wiki.wiki |
| 275 | 280 | |
| 276 | 281 |
| --- 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 |
+5
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -163,10 +163,13 @@ | ||
| 163 | 163 | $(SRCDIR)/xfer.c \ |
| 164 | 164 | $(SRCDIR)/xfersetup.c \ |
| 165 | 165 | $(SRCDIR)/zip.c |
| 166 | 166 | |
| 167 | 167 | EXTRA_FILES = \ |
| 168 | + $(SRCDIR)/../extsrc/pikchr-module.js \ | |
| 169 | + $(SRCDIR)/../extsrc/pikchr-worker.js \ | |
| 170 | + $(SRCDIR)/../extsrc/pikchr.wasm \ | |
| 168 | 171 | $(SRCDIR)/../skins/ardoise/css.txt \ |
| 169 | 172 | $(SRCDIR)/../skins/ardoise/details.txt \ |
| 170 | 173 | $(SRCDIR)/../skins/ardoise/footer.txt \ |
| 171 | 174 | $(SRCDIR)/../skins/ardoise/header.txt \ |
| 172 | 175 | $(SRCDIR)/../skins/black_and_white/css.txt \ |
| @@ -231,10 +234,11 @@ | ||
| 231 | 234 | $(SRCDIR)/fossil.page.brlist.js \ |
| 232 | 235 | $(SRCDIR)/fossil.page.chat.js \ |
| 233 | 236 | $(SRCDIR)/fossil.page.fileedit.js \ |
| 234 | 237 | $(SRCDIR)/fossil.page.forumpost.js \ |
| 235 | 238 | $(SRCDIR)/fossil.page.pikchrshow.js \ |
| 239 | + $(SRCDIR)/fossil.page.pikchrshowasm.js \ | |
| 236 | 240 | $(SRCDIR)/fossil.page.whistory.js \ |
| 237 | 241 | $(SRCDIR)/fossil.page.wikiedit.js \ |
| 238 | 242 | $(SRCDIR)/fossil.pikchr.js \ |
| 239 | 243 | $(SRCDIR)/fossil.popupwidget.js \ |
| 240 | 244 | $(SRCDIR)/fossil.storage.js \ |
| @@ -266,10 +270,11 @@ | ||
| 266 | 270 | $(SRCDIR)/sounds/e.wav \ |
| 267 | 271 | $(SRCDIR)/sounds/f.wav \ |
| 268 | 272 | $(SRCDIR)/style.admin_log.css \ |
| 269 | 273 | $(SRCDIR)/style.chat.css \ |
| 270 | 274 | $(SRCDIR)/style.fileedit.css \ |
| 275 | + $(SRCDIR)/style.pikchrshow.css \ | |
| 271 | 276 | $(SRCDIR)/style.wikiedit.css \ |
| 272 | 277 | $(SRCDIR)/tree.js \ |
| 273 | 278 | $(SRCDIR)/useredit.js \ |
| 274 | 279 | $(SRCDIR)/wiki.wiki |
| 275 | 280 | |
| 276 | 281 |
| --- 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 @@ | ||
| 230 | 230 | blob_reset(&bIn); |
| 231 | 231 | return isErr; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /* |
| 235 | -** WEBPAGE: pikchrshow | |
| 235 | +** WEBPAGE: pikchrshowcs* | |
| 236 | 236 | ** |
| 237 | 237 | ** A pikchr code editor and previewer, allowing users to experiment |
| 238 | 238 | ** 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. | |
| 240 | 244 | ** |
| 241 | 245 | ** It optionally accepts a p=pikchr-script-code URL parameter or POST |
| 242 | 246 | ** value to pre-populate the editor with that code. |
| 243 | 247 | */ |
| 244 | -void pikchrshow_page(void){ | |
| 248 | +void pikchrshowcs_page(void){ | |
| 245 | 249 | const char *zContent = 0; |
| 246 | 250 | int isDark; /* true if the current skin is "dark" */ |
| 247 | 251 | int pikFlags = |
| 248 | 252 | PIKCHR_PROCESS_DIV |
| 249 | 253 | | PIKCHR_PROCESS_SRC |
| 250 | 254 | | PIKCHR_PROCESS_ERR_PRE; |
| 251 | 255 | |
| 252 | 256 | login_check_credentials(); |
| 253 | 257 | 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; | |
| 255 | 263 | } |
| 256 | 264 | zContent = PD("content",P("p")); |
| 257 | 265 | if(P("ajax")!=0){ |
| 258 | 266 | /* Called from the JS-side preview updater. |
| 259 | 267 | TODO: respond with JSON instead.*/ |
| @@ -279,11 +287,11 @@ | ||
| 279 | 287 | "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n" |
| 280 | 288 | "arrow right 200% \"HTML+SVG\" \"Output\"\n" |
| 281 | 289 | "arrow <-> down from last box.s\n" |
| 282 | 290 | "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n"; |
| 283 | 291 | } |
| 284 | - style_header("PikchrShow"); | |
| 292 | + style_header("PikchrShow Client/Server"); | |
| 285 | 293 | CX("<style>"); { |
| 286 | 294 | CX("div.content { padding-top: 0.5em }\n"); |
| 287 | 295 | CX("#sbs-wrapper {" |
| 288 | 296 | "display: flex; flex-direction: column;" |
| 289 | 297 | "}\n"); |
| @@ -376,10 +384,121 @@ | ||
| 376 | 384 | "storage", "pikchr", NULL); |
| 377 | 385 | builtin_request_js("fossil.page.pikchrshow.js"); |
| 378 | 386 | builtin_fulfill_js_requests(); |
| 379 | 387 | style_finish_page(); |
| 380 | 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 | + | |
| 381 | 500 | |
| 382 | 501 | /* |
| 383 | 502 | ** COMMAND: pikchr* |
| 384 | 503 | ** |
| 385 | 504 | ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE? |
| 386 | 505 |
| --- 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 @@ | ||
| 230 | 230 | blob_reset(&bIn); |
| 231 | 231 | return isErr; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /* |
| 235 | -** WEBPAGE: pikchrshow | |
| 235 | +** WEBPAGE: pikchrshowcs* | |
| 236 | 236 | ** |
| 237 | 237 | ** A pikchr code editor and previewer, allowing users to experiment |
| 238 | 238 | ** 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. | |
| 240 | 244 | ** |
| 241 | 245 | ** It optionally accepts a p=pikchr-script-code URL parameter or POST |
| 242 | 246 | ** value to pre-populate the editor with that code. |
| 243 | 247 | */ |
| 244 | -void pikchrshow_page(void){ | |
| 248 | +void pikchrshowcs_page(void){ | |
| 245 | 249 | const char *zContent = 0; |
| 246 | 250 | int isDark; /* true if the current skin is "dark" */ |
| 247 | 251 | int pikFlags = |
| 248 | 252 | PIKCHR_PROCESS_DIV |
| 249 | 253 | | PIKCHR_PROCESS_SRC |
| 250 | 254 | | PIKCHR_PROCESS_ERR_PRE; |
| 251 | 255 | |
| 252 | 256 | login_check_credentials(); |
| 253 | 257 | 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; | |
| 255 | 263 | } |
| 256 | 264 | zContent = PD("content",P("p")); |
| 257 | 265 | if(P("ajax")!=0){ |
| 258 | 266 | /* Called from the JS-side preview updater. |
| 259 | 267 | TODO: respond with JSON instead.*/ |
| @@ -279,11 +287,11 @@ | ||
| 279 | 287 | "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n" |
| 280 | 288 | "arrow right 200% \"HTML+SVG\" \"Output\"\n" |
| 281 | 289 | "arrow <-> down from last box.s\n" |
| 282 | 290 | "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n"; |
| 283 | 291 | } |
| 284 | - style_header("PikchrShow"); | |
| 292 | + style_header("PikchrShow Client/Server"); | |
| 285 | 293 | CX("<style>"); { |
| 286 | 294 | CX("div.content { padding-top: 0.5em }\n"); |
| 287 | 295 | CX("#sbs-wrapper {" |
| 288 | 296 | "display: flex; flex-direction: column;" |
| 289 | 297 | "}\n"); |
| @@ -376,10 +384,121 @@ | ||
| 376 | 384 | "storage", "pikchr", NULL); |
| 377 | 385 | builtin_request_js("fossil.page.pikchrshow.js"); |
| 378 | 386 | builtin_fulfill_js_requests(); |
| 379 | 387 | style_finish_page(); |
| 380 | 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 | + | |
| 381 | 500 | |
| 382 | 501 | /* |
| 383 | 502 | ** COMMAND: pikchr* |
| 384 | 503 | ** |
| 385 | 504 | ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE? |
| 386 | 505 |
| --- 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 |
+2
| --- tools/makemake.tcl | ||
| +++ tools/makemake.tcl | ||
| @@ -217,10 +217,12 @@ | ||
| 217 | 217 | default.css |
| 218 | 218 | style.*.css |
| 219 | 219 | ../skins/*/*.txt |
| 220 | 220 | sounds/*.wav |
| 221 | 221 | alerts/*.wav |
| 222 | + ../extsrc/pikchr.wasm | |
| 223 | + ../extsrc/pikchr-*.js | |
| 222 | 224 | } |
| 223 | 225 | |
| 224 | 226 | # Options used to compile the included SQLite library. |
| 225 | 227 | # |
| 226 | 228 | set SQLITE_OPTIONS { |
| 227 | 229 |
| --- 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 |
+2
| --- tools/makemake.tcl | ||
| +++ tools/makemake.tcl | ||
| @@ -217,10 +217,12 @@ | ||
| 217 | 217 | default.css |
| 218 | 218 | style.*.css |
| 219 | 219 | ../skins/*/*.txt |
| 220 | 220 | sounds/*.wav |
| 221 | 221 | alerts/*.wav |
| 222 | + ../extsrc/pikchr.wasm | |
| 223 | + ../extsrc/pikchr-*.js | |
| 222 | 224 | } |
| 223 | 225 | |
| 224 | 226 | # Options used to compile the included SQLite library. |
| 225 | 227 | # |
| 226 | 228 | set SQLITE_OPTIONS { |
| 227 | 229 |
| --- 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 |
+5
| --- tools/mkbuiltin.c | ||
| +++ tools/mkbuiltin.c | ||
| @@ -354,10 +354,14 @@ | ||
| 354 | 354 | while( pData[nSkip]=='#' ){ |
| 355 | 355 | while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; } |
| 356 | 356 | if( pData[nSkip]=='\n' ) nSkip++; |
| 357 | 357 | } |
| 358 | 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. */ | |
| 359 | 363 | #ifndef FOSSIL_DEBUG |
| 360 | 364 | /* Compress javascript source files */ |
| 361 | 365 | nName = (int)strlen(aRes[i].zName); |
| 362 | 366 | if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0) |
| 363 | 367 | || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0) |
| @@ -364,10 +368,11 @@ | ||
| 364 | 368 | ){ |
| 365 | 369 | int x = sz-nSkip; |
| 366 | 370 | compressJavascript(pData+nSkip, &x); |
| 367 | 371 | sz = x + nSkip; |
| 368 | 372 | } |
| 373 | +#endif | |
| 369 | 374 | #endif |
| 370 | 375 | |
| 371 | 376 | aRes[i].nByte = sz - nSkip; |
| 372 | 377 | aRes[i].idx = i; |
| 373 | 378 | printf("/* Content of file %s */\n", aRes[i].zName); |
| 374 | 379 |
| --- 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 |
+5
| --- tools/mkbuiltin.c | ||
| +++ tools/mkbuiltin.c | ||
| @@ -354,10 +354,14 @@ | ||
| 354 | 354 | while( pData[nSkip]=='#' ){ |
| 355 | 355 | while( pData[nSkip]!=0 && pData[nSkip]!='\n' ){ nSkip++; } |
| 356 | 356 | if( pData[nSkip]=='\n' ) nSkip++; |
| 357 | 357 | } |
| 358 | 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. */ | |
| 359 | 363 | #ifndef FOSSIL_DEBUG |
| 360 | 364 | /* Compress javascript source files */ |
| 361 | 365 | nName = (int)strlen(aRes[i].zName); |
| 362 | 366 | if( (nName>3 && strcmp(&aRes[i].zName[nName-3],".js")==0) |
| 363 | 367 | || (nName>7 && strcmp(&aRes[i].zName[nName-7], "/js.txt")==0) |
| @@ -364,10 +368,11 @@ | ||
| 364 | 368 | ){ |
| 365 | 369 | int x = sz-nSkip; |
| 366 | 370 | compressJavascript(pData+nSkip, &x); |
| 367 | 371 | sz = x + nSkip; |
| 368 | 372 | } |
| 373 | +#endif | |
| 369 | 374 | #endif |
| 370 | 375 | |
| 371 | 376 | aRes[i].nByte = sz - nSkip; |
| 372 | 377 | aRes[i].idx = i; |
| 373 | 378 | printf("/* Content of file %s */\n", aRes[i].zName); |
| 374 | 379 |
| --- 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 |
+5
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -549,10 +549,13 @@ | ||
| 549 | 549 | $(SRCDIR)/xfer.c \ |
| 550 | 550 | $(SRCDIR)/xfersetup.c \ |
| 551 | 551 | $(SRCDIR)/zip.c |
| 552 | 552 | |
| 553 | 553 | EXTRA_FILES = \ |
| 554 | + $(SRCDIR)/../extsrc/pikchr-module.js \ | |
| 555 | + $(SRCDIR)/../extsrc/pikchr-worker.js \ | |
| 556 | + $(SRCDIR)/../extsrc/pikchr.wasm \ | |
| 554 | 557 | $(SRCDIR)/../skins/ardoise/css.txt \ |
| 555 | 558 | $(SRCDIR)/../skins/ardoise/details.txt \ |
| 556 | 559 | $(SRCDIR)/../skins/ardoise/footer.txt \ |
| 557 | 560 | $(SRCDIR)/../skins/ardoise/header.txt \ |
| 558 | 561 | $(SRCDIR)/../skins/black_and_white/css.txt \ |
| @@ -617,10 +620,11 @@ | ||
| 617 | 620 | $(SRCDIR)/fossil.page.brlist.js \ |
| 618 | 621 | $(SRCDIR)/fossil.page.chat.js \ |
| 619 | 622 | $(SRCDIR)/fossil.page.fileedit.js \ |
| 620 | 623 | $(SRCDIR)/fossil.page.forumpost.js \ |
| 621 | 624 | $(SRCDIR)/fossil.page.pikchrshow.js \ |
| 625 | + $(SRCDIR)/fossil.page.pikchrshowasm.js \ | |
| 622 | 626 | $(SRCDIR)/fossil.page.whistory.js \ |
| 623 | 627 | $(SRCDIR)/fossil.page.wikiedit.js \ |
| 624 | 628 | $(SRCDIR)/fossil.pikchr.js \ |
| 625 | 629 | $(SRCDIR)/fossil.popupwidget.js \ |
| 626 | 630 | $(SRCDIR)/fossil.storage.js \ |
| @@ -652,10 +656,11 @@ | ||
| 652 | 656 | $(SRCDIR)/sounds/e.wav \ |
| 653 | 657 | $(SRCDIR)/sounds/f.wav \ |
| 654 | 658 | $(SRCDIR)/style.admin_log.css \ |
| 655 | 659 | $(SRCDIR)/style.chat.css \ |
| 656 | 660 | $(SRCDIR)/style.fileedit.css \ |
| 661 | + $(SRCDIR)/style.pikchrshow.css \ | |
| 657 | 662 | $(SRCDIR)/style.wikiedit.css \ |
| 658 | 663 | $(SRCDIR)/tree.js \ |
| 659 | 664 | $(SRCDIR)/useredit.js \ |
| 660 | 665 | $(SRCDIR)/wiki.wiki |
| 661 | 666 | |
| 662 | 667 |
| --- 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 |
+5
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -549,10 +549,13 @@ | ||
| 549 | 549 | $(SRCDIR)/xfer.c \ |
| 550 | 550 | $(SRCDIR)/xfersetup.c \ |
| 551 | 551 | $(SRCDIR)/zip.c |
| 552 | 552 | |
| 553 | 553 | EXTRA_FILES = \ |
| 554 | + $(SRCDIR)/../extsrc/pikchr-module.js \ | |
| 555 | + $(SRCDIR)/../extsrc/pikchr-worker.js \ | |
| 556 | + $(SRCDIR)/../extsrc/pikchr.wasm \ | |
| 554 | 557 | $(SRCDIR)/../skins/ardoise/css.txt \ |
| 555 | 558 | $(SRCDIR)/../skins/ardoise/details.txt \ |
| 556 | 559 | $(SRCDIR)/../skins/ardoise/footer.txt \ |
| 557 | 560 | $(SRCDIR)/../skins/ardoise/header.txt \ |
| 558 | 561 | $(SRCDIR)/../skins/black_and_white/css.txt \ |
| @@ -617,10 +620,11 @@ | ||
| 617 | 620 | $(SRCDIR)/fossil.page.brlist.js \ |
| 618 | 621 | $(SRCDIR)/fossil.page.chat.js \ |
| 619 | 622 | $(SRCDIR)/fossil.page.fileedit.js \ |
| 620 | 623 | $(SRCDIR)/fossil.page.forumpost.js \ |
| 621 | 624 | $(SRCDIR)/fossil.page.pikchrshow.js \ |
| 625 | + $(SRCDIR)/fossil.page.pikchrshowasm.js \ | |
| 622 | 626 | $(SRCDIR)/fossil.page.whistory.js \ |
| 623 | 627 | $(SRCDIR)/fossil.page.wikiedit.js \ |
| 624 | 628 | $(SRCDIR)/fossil.pikchr.js \ |
| 625 | 629 | $(SRCDIR)/fossil.popupwidget.js \ |
| 626 | 630 | $(SRCDIR)/fossil.storage.js \ |
| @@ -652,10 +656,11 @@ | ||
| 652 | 656 | $(SRCDIR)/sounds/e.wav \ |
| 653 | 657 | $(SRCDIR)/sounds/f.wav \ |
| 654 | 658 | $(SRCDIR)/style.admin_log.css \ |
| 655 | 659 | $(SRCDIR)/style.chat.css \ |
| 656 | 660 | $(SRCDIR)/style.fileedit.css \ |
| 661 | + $(SRCDIR)/style.pikchrshow.css \ | |
| 657 | 662 | $(SRCDIR)/style.wikiedit.css \ |
| 658 | 663 | $(SRCDIR)/tree.js \ |
| 659 | 664 | $(SRCDIR)/useredit.js \ |
| 660 | 665 | $(SRCDIR)/wiki.wiki |
| 661 | 666 | |
| 662 | 667 |
| --- 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 @@ | ||
| 505 | 505 | "$(OX)\xfer_.c" \ |
| 506 | 506 | "$(OX)\xfersetup_.c" \ |
| 507 | 507 | "$(OX)\zip_.c" \ |
| 508 | 508 | "$(SRCDIR_extsrc)\pikchr.c" |
| 509 | 509 | |
| 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" \ | |
| 511 | 514 | "$(SRCDIR)\..\skins\ardoise\details.txt" \ |
| 512 | 515 | "$(SRCDIR)\..\skins\ardoise\footer.txt" \ |
| 513 | 516 | "$(SRCDIR)\..\skins\ardoise\header.txt" \ |
| 514 | 517 | "$(SRCDIR)\..\skins\black_and_white\css.txt" \ |
| 515 | 518 | "$(SRCDIR)\..\skins\black_and_white\details.txt" \ |
| @@ -573,10 +576,11 @@ | ||
| 573 | 576 | "$(SRCDIR)\fossil.page.brlist.js" \ |
| 574 | 577 | "$(SRCDIR)\fossil.page.chat.js" \ |
| 575 | 578 | "$(SRCDIR)\fossil.page.fileedit.js" \ |
| 576 | 579 | "$(SRCDIR)\fossil.page.forumpost.js" \ |
| 577 | 580 | "$(SRCDIR)\fossil.page.pikchrshow.js" \ |
| 581 | + "$(SRCDIR)\fossil.page.pikchrshowasm.js" \ | |
| 578 | 582 | "$(SRCDIR)\fossil.page.whistory.js" \ |
| 579 | 583 | "$(SRCDIR)\fossil.page.wikiedit.js" \ |
| 580 | 584 | "$(SRCDIR)\fossil.pikchr.js" \ |
| 581 | 585 | "$(SRCDIR)\fossil.popupwidget.js" \ |
| 582 | 586 | "$(SRCDIR)\fossil.storage.js" \ |
| @@ -608,10 +612,11 @@ | ||
| 608 | 612 | "$(SRCDIR)\sounds\e.wav" \ |
| 609 | 613 | "$(SRCDIR)\sounds\f.wav" \ |
| 610 | 614 | "$(SRCDIR)\style.admin_log.css" \ |
| 611 | 615 | "$(SRCDIR)\style.chat.css" \ |
| 612 | 616 | "$(SRCDIR)\style.fileedit.css" \ |
| 617 | + "$(SRCDIR)\style.pikchrshow.css" \ | |
| 613 | 618 | "$(SRCDIR)\style.wikiedit.css" \ |
| 614 | 619 | "$(SRCDIR)\tree.js" \ |
| 615 | 620 | "$(SRCDIR)\useredit.js" \ |
| 616 | 621 | "$(SRCDIR)\wiki.wiki" |
| 617 | 622 | |
| @@ -1129,11 +1134,14 @@ | ||
| 1129 | 1134 | "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h" |
| 1130 | 1135 | "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h" |
| 1131 | 1136 | "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h" |
| 1132 | 1137 | |
| 1133 | 1138 | "$(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" >> $@ | |
| 1135 | 1143 | echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@ |
| 1136 | 1144 | echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@ |
| 1137 | 1145 | echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@ |
| 1138 | 1146 | echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@ |
| 1139 | 1147 | echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@ |
| @@ -1197,10 +1205,11 @@ | ||
| 1197 | 1205 | echo "$(SRCDIR)\fossil.page.brlist.js" >> $@ |
| 1198 | 1206 | echo "$(SRCDIR)\fossil.page.chat.js" >> $@ |
| 1199 | 1207 | echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@ |
| 1200 | 1208 | echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@ |
| 1201 | 1209 | echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@ |
| 1210 | + echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@ | |
| 1202 | 1211 | echo "$(SRCDIR)\fossil.page.whistory.js" >> $@ |
| 1203 | 1212 | echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@ |
| 1204 | 1213 | echo "$(SRCDIR)\fossil.pikchr.js" >> $@ |
| 1205 | 1214 | echo "$(SRCDIR)\fossil.popupwidget.js" >> $@ |
| 1206 | 1215 | echo "$(SRCDIR)\fossil.storage.js" >> $@ |
| @@ -1232,10 +1241,11 @@ | ||
| 1232 | 1241 | echo "$(SRCDIR)\sounds/e.wav" >> $@ |
| 1233 | 1242 | echo "$(SRCDIR)\sounds/f.wav" >> $@ |
| 1234 | 1243 | echo "$(SRCDIR)\style.admin_log.css" >> $@ |
| 1235 | 1244 | echo "$(SRCDIR)\style.chat.css" >> $@ |
| 1236 | 1245 | echo "$(SRCDIR)\style.fileedit.css" >> $@ |
| 1246 | + echo "$(SRCDIR)\style.pikchrshow.css" >> $@ | |
| 1237 | 1247 | echo "$(SRCDIR)\style.wikiedit.css" >> $@ |
| 1238 | 1248 | echo "$(SRCDIR)\tree.js" >> $@ |
| 1239 | 1249 | echo "$(SRCDIR)\useredit.js" >> $@ |
| 1240 | 1250 | echo "$(SRCDIR)\wiki.wiki" >> $@ |
| 1241 | 1251 | |
| 1242 | 1252 |
| --- 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 @@ | ||
| 505 | 505 | "$(OX)\xfer_.c" \ |
| 506 | 506 | "$(OX)\xfersetup_.c" \ |
| 507 | 507 | "$(OX)\zip_.c" \ |
| 508 | 508 | "$(SRCDIR_extsrc)\pikchr.c" |
| 509 | 509 | |
| 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" \ | |
| 511 | 514 | "$(SRCDIR)\..\skins\ardoise\details.txt" \ |
| 512 | 515 | "$(SRCDIR)\..\skins\ardoise\footer.txt" \ |
| 513 | 516 | "$(SRCDIR)\..\skins\ardoise\header.txt" \ |
| 514 | 517 | "$(SRCDIR)\..\skins\black_and_white\css.txt" \ |
| 515 | 518 | "$(SRCDIR)\..\skins\black_and_white\details.txt" \ |
| @@ -573,10 +576,11 @@ | ||
| 573 | 576 | "$(SRCDIR)\fossil.page.brlist.js" \ |
| 574 | 577 | "$(SRCDIR)\fossil.page.chat.js" \ |
| 575 | 578 | "$(SRCDIR)\fossil.page.fileedit.js" \ |
| 576 | 579 | "$(SRCDIR)\fossil.page.forumpost.js" \ |
| 577 | 580 | "$(SRCDIR)\fossil.page.pikchrshow.js" \ |
| 581 | + "$(SRCDIR)\fossil.page.pikchrshowasm.js" \ | |
| 578 | 582 | "$(SRCDIR)\fossil.page.whistory.js" \ |
| 579 | 583 | "$(SRCDIR)\fossil.page.wikiedit.js" \ |
| 580 | 584 | "$(SRCDIR)\fossil.pikchr.js" \ |
| 581 | 585 | "$(SRCDIR)\fossil.popupwidget.js" \ |
| 582 | 586 | "$(SRCDIR)\fossil.storage.js" \ |
| @@ -608,10 +612,11 @@ | ||
| 608 | 612 | "$(SRCDIR)\sounds\e.wav" \ |
| 609 | 613 | "$(SRCDIR)\sounds\f.wav" \ |
| 610 | 614 | "$(SRCDIR)\style.admin_log.css" \ |
| 611 | 615 | "$(SRCDIR)\style.chat.css" \ |
| 612 | 616 | "$(SRCDIR)\style.fileedit.css" \ |
| 617 | + "$(SRCDIR)\style.pikchrshow.css" \ | |
| 613 | 618 | "$(SRCDIR)\style.wikiedit.css" \ |
| 614 | 619 | "$(SRCDIR)\tree.js" \ |
| 615 | 620 | "$(SRCDIR)\useredit.js" \ |
| 616 | 621 | "$(SRCDIR)\wiki.wiki" |
| 617 | 622 | |
| @@ -1129,11 +1134,14 @@ | ||
| 1129 | 1134 | "$(OBJDIR)\json_timeline$O" : "$(SRCDIR)\json_detail.h" |
| 1130 | 1135 | "$(OBJDIR)\json_user$O" : "$(SRCDIR)\json_detail.h" |
| 1131 | 1136 | "$(OBJDIR)\json_wiki$O" : "$(SRCDIR)\json_detail.h" |
| 1132 | 1137 | |
| 1133 | 1138 | "$(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" >> $@ | |
| 1135 | 1143 | echo "$(SRCDIR)\../skins/ardoise/details.txt" >> $@ |
| 1136 | 1144 | echo "$(SRCDIR)\../skins/ardoise/footer.txt" >> $@ |
| 1137 | 1145 | echo "$(SRCDIR)\../skins/ardoise/header.txt" >> $@ |
| 1138 | 1146 | echo "$(SRCDIR)\../skins/black_and_white/css.txt" >> $@ |
| 1139 | 1147 | echo "$(SRCDIR)\../skins/black_and_white/details.txt" >> $@ |
| @@ -1197,10 +1205,11 @@ | ||
| 1197 | 1205 | echo "$(SRCDIR)\fossil.page.brlist.js" >> $@ |
| 1198 | 1206 | echo "$(SRCDIR)\fossil.page.chat.js" >> $@ |
| 1199 | 1207 | echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@ |
| 1200 | 1208 | echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@ |
| 1201 | 1209 | echo "$(SRCDIR)\fossil.page.pikchrshow.js" >> $@ |
| 1210 | + echo "$(SRCDIR)\fossil.page.pikchrshowasm.js" >> $@ | |
| 1202 | 1211 | echo "$(SRCDIR)\fossil.page.whistory.js" >> $@ |
| 1203 | 1212 | echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@ |
| 1204 | 1213 | echo "$(SRCDIR)\fossil.pikchr.js" >> $@ |
| 1205 | 1214 | echo "$(SRCDIR)\fossil.popupwidget.js" >> $@ |
| 1206 | 1215 | echo "$(SRCDIR)\fossil.storage.js" >> $@ |
| @@ -1232,10 +1241,11 @@ | ||
| 1232 | 1241 | echo "$(SRCDIR)\sounds/e.wav" >> $@ |
| 1233 | 1242 | echo "$(SRCDIR)\sounds/f.wav" >> $@ |
| 1234 | 1243 | echo "$(SRCDIR)\style.admin_log.css" >> $@ |
| 1235 | 1244 | echo "$(SRCDIR)\style.chat.css" >> $@ |
| 1236 | 1245 | echo "$(SRCDIR)\style.fileedit.css" >> $@ |
| 1246 | + echo "$(SRCDIR)\style.pikchrshow.css" >> $@ | |
| 1237 | 1247 | echo "$(SRCDIR)\style.wikiedit.css" >> $@ |
| 1238 | 1248 | echo "$(SRCDIR)\tree.js" >> $@ |
| 1239 | 1249 | echo "$(SRCDIR)\useredit.js" >> $@ |
| 1240 | 1250 | echo "$(SRCDIR)\wiki.wiki" >> $@ |
| 1241 | 1251 | |
| 1242 | 1252 |
| --- 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 |