From d77753a0c054f93d2b6cf399e6b1cd669cead39e Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Fri, 9 Jun 2023 18:49:43 -0400 Subject: consistent ordering of corners --- virtual-programs/new-program-web-editor.folk | 348 ++++++++++++++------------- 1 file changed, 175 insertions(+), 173 deletions(-) (limited to 'virtual-programs/new-program-web-editor.folk') diff --git a/virtual-programs/new-program-web-editor.folk b/virtual-programs/new-program-web-editor.folk index 67a18832..692b00e0 100644 --- a/virtual-programs/new-program-web-editor.folk +++ b/virtual-programs/new-program-web-editor.folk @@ -1,177 +1,179 @@ Wish the web server handles route "/new" with handler { html { - - - - - - Status -
- -

-

-        
- - - - + + } } -} -}; -wsConnect(); - -function handleDrag() { -let [top, left, w, h] = [ele.offsetTop, ele.offsetLeft, ele.offsetWidth, ele.offsetHeight]; -send(` -set top [expr {int(double(${(top + (top/window.innerHeight) * h)}) * (double($Display::HEIGHT) / ${window.innerHeight}))}] -set left [expr {int(double(${(left + (left/window.innerWidth) * w)}) * (double($Display::WIDTH) / ${window.innerWidth}))}] -proc handleConfigure {program x y w h} { - set vertices [list [list $x $y] \ - [list [expr {$x+$w}] $y] \ - [list [expr {$x+$w}] [expr {$y+$h}]] \ - [list $x [expr {$y+$h}]]] - set edges [list [list 0 1] [list 1 2] [list 2 3] [list 3 0]] - Retract web claims $program has region /something/ - Assert web claims $program has region [list $vertices $edges] -} -handleConfigure {${program}} $left $top {${w}} {${h}} -if {$::isLaptop} { Step } -`); -} -function handleSave() { -const code = document.getElementById("code").value; -send(` -Retract web claims {${program}} has program code /something/ -Assert web claims {${program}} has program code {${code}} -if {$::isLaptop} { Step } -`); -setTimeout(() => { - send(`list ERROR: [Statements::findMatches [list {${program}} has error /err/ with info /errorInfo/]]`); -}, 500); -} -let jobid; -function handlePrint() { -const code = document.getElementById("code").value; -jobid = String(Math.random()); -send(`Assert web wishes to print {${code}} with job id {${jobid}}`); -setTimeout(500, () => { - send(`Retract web wishes to print {${code}} with job id {${jobid}}`); -}); -document.getElementById('printback').style.display = ''; -} -function handlePrintBack() { -send(`Assert web wishes to print the back of job id {${jobid}}`); -setTimeout(500, () => { - send(`Retract web wishes to print the back of job id {${jobid}}`); -}); -} - - - - } -} \ No newline at end of file -- cgit v1.2.3