From fdfe34ded306526bd87568e50ac9a6e03c9c0594 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 26 Dec 2016 21:23:55 -0800 Subject: 3715 Fix cross-links in html for the edit/ app. I originally thought I'd need to provide a commandline flag like --rel-path or something. But we need to support different relative paths in a single html file. So the solution instead is appropriately engineering the tags file. --- html/edit/006-sandbox-copy.mu.html | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'html/edit/006-sandbox-copy.mu.html') diff --git a/html/edit/006-sandbox-copy.mu.html b/html/edit/006-sandbox-copy.mu.html index afe578cf..43baf39f 100644 --- a/html/edit/006-sandbox-copy.mu.html +++ b/html/edit/006-sandbox-copy.mu.html @@ -66,12 +66,12 @@ if ('onhashchange' in window) { 8 # empty recipes 9 assume-resources [ 10 ] - 11 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor + 11 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor 12 # run it 13 assume-console [ 14 press F4 15 ] - 16 event-loop screen, console, env, resources + 16 event-loop screen, console, env, resources 17 screen-should-contain [ 18 . run (F4) . 19 . ╎ . @@ -87,7 +87,7 @@ if ('onhashchange' in window) { 29 left-click 3, 69 30 ] 31 run [ - 32 event-loop screen, console, env, resources + 32 event-loop screen, console, env, resources 33 ] 34 # it copies into editor 35 screen-should-contain [ @@ -105,7 +105,7 @@ if ('onhashchange' in window) { 47 type [0] 48 ] 49 run [ - 50 event-loop screen, console, env, resources + 50 event-loop screen, console, env, resources 51 ] 52 screen-should-contain [ 53 . run (F4) . @@ -126,12 +126,12 @@ if ('onhashchange' in window) { 68 # empty recipes 69 assume-resources [ 70 ] - 71 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor + 71 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor 72 # run it 73 assume-console [ 74 press F4 75 ] - 76 event-loop screen, console, env, resources + 76 event-loop screen, console, env, resources 77 screen-should-contain [ 78 . run (F4) . 79 . ╎ . @@ -147,7 +147,7 @@ if ('onhashchange' in window) { 89 left-click 3, 84 90 ] 91 run [ - 92 event-loop screen, console, env, resources + 92 event-loop screen, console, env, resources 93 ] 94 # it copies into editor 95 screen-should-contain [ @@ -165,7 +165,7 @@ if ('onhashchange' in window) { 107 type [0] 108 ] 109 run [ -110 event-loop screen, console, env, resources +110 event-loop screen, console, env, resources 111 ] 112 screen-should-contain [ 113 . run (F4) . @@ -182,55 +182,55 @@ if ('onhashchange' in window) { 124 after <global-touch> [ 125 # support 'copy' button 126 { -127 copy?:bool <- should-attempt-copy? click-row, click-column, env +127 copy?:bool <- should-attempt-copy? click-row, click-column, env 128 break-unless copy? -129 copy?, env <- try-copy-sandbox click-row, env +129 copy?, env <- try-copy-sandbox click-row, env 130 break-unless copy? -131 hide-screen screen -132 screen <- render-sandbox-side screen, env, render -133 screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env -134 show-screen screen +131 hide-screen screen +132 screen <- render-sandbox-side screen, env, render +133 screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env +134 show-screen screen 135 loop +next-event 136 } 137 ] 138 139 # some preconditions for attempting to copy a sandbox -140 def should-attempt-copy? click-row:num, click-column:num, env:&:environment -> result:bool [ +140 def should-attempt-copy? click-row:num, click-column:num, env:&:environment -> result:bool [ 141 local-scope 142 load-ingredients 143 # are we below the sandbox editor? -144 click-sandbox-area?:bool <- click-on-sandbox-area? click-row, click-column, env +144 click-sandbox-area?:bool <- click-on-sandbox-area? click-row, click-column, env 145 return-unless click-sandbox-area?, 0/false 146 # narrower, is the click in the columns spanning the 'copy' button? 147 first-sandbox:&:editor <- get *env, current-sandbox:offset 148 assert first-sandbox, [!!] 149 sandbox-left-margin:num <- get *first-sandbox, left:offset 150 sandbox-right-margin:num <- get *first-sandbox, right:offset -151 _, _, copy-button-left:num, copy-button-right:num, _ <- sandbox-menu-columns sandbox-left-margin, sandbox-right-margin -152 copy-button-vertical-area?:bool <- within-range? click-column, copy-button-left, copy-button-right +151 _, _, copy-button-left:num, copy-button-right:num, _ <- sandbox-menu-columns sandbox-left-margin, sandbox-right-margin +152 copy-button-vertical-area?:bool <- within-range? click-column, copy-button-left, copy-button-right 153 return-unless copy-button-vertical-area?, 0/false 154 # finally, is sandbox editor empty? 155 current-sandbox:&:editor <- get *env, current-sandbox:offset -156 result <- empty-editor? current-sandbox +156 result <- empty-editor? current-sandbox 157 ] 158 -159 def try-copy-sandbox click-row:num, env:&:environment -> clicked-on-copy-button?:bool, env:&:environment [ +159 def try-copy-sandbox click-row:num, env:&:environment -> clicked-on-copy-button?:bool, env:&:environment [ 160 local-scope 161 load-ingredients 162 # identify the sandbox to copy, if the click was actually on the 'copy' button -163 sandbox:&:sandbox <- find-sandbox env, click-row +163 sandbox:&:sandbox <- find-sandbox env, click-row 164 return-unless sandbox, 0/false 165 clicked-on-copy-button? <- copy 1/true 166 text:text <- get *sandbox, data:offset 167 current-sandbox:&:editor <- get *env, current-sandbox:offset -168 current-sandbox <- insert-text current-sandbox, text +168 current-sandbox <- insert-text current-sandbox, text 169 # reset scroll 170 *env <- put *env, render-from:offset, -1 171 # position cursor in sandbox editor 172 *env <- put *env, sandbox-in-focus?:offset, 1/true 173 ] 174 -175 def find-sandbox env:&:environment, click-row:num -> result:&:sandbox [ +175 def find-sandbox env:&:environment, click-row:num -> result:&:sandbox [ 176 local-scope 177 load-ingredients 178 curr-sandbox:&:sandbox <- get *env, sandbox:offset @@ -245,7 +245,7 @@ if ('onhashchange' in window) { 187 return 0/not-found 188 ] 189 -190 def click-on-sandbox-area? click-row:num, click-column:num, env:&:environment -> result:bool [ +190 def click-on-sandbox-area? click-row:num, click-column:num, env:&:environment -> result:bool [ 191 local-scope 192 load-ingredients 193 current-sandbox:&:editor <- get *env, current-sandbox:offset @@ -258,15 +258,15 @@ if ('onhashchange' in window) { 200 result <- greater-or-equal click-row, first-sandbox-begins 201 ] 202 -203 def empty-editor? editor:&:editor -> result:bool [ +203 def empty-editor? editor:&:editor -> result:bool [ 204 local-scope 205 load-ingredients 206 head:&:duplex-list:char <- get *editor, data:offset -207 first:&:duplex-list:char <- next head +207 first:&:duplex-list:char <- next head 208 result <- not first 209 ] 210 -211 def within-range? x:num, low:num, high:num -> result:bool [ +211 def within-range? x:num, low:num, high:num -> result:bool [ 212 local-scope 213 load-ingredients 214 not-too-far-left?:bool <- greater-or-equal x, low @@ -281,12 +281,12 @@ if ('onhashchange' in window) { 223 # empty recipes 224 assume-resources [ 225 ] -226 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor +226 env:&:environment <- new-programming-environment resources, screen, [add 1, 1] # contents of sandbox editor 227 # run it 228 assume-console [ 229 press F4 230 ] -231 event-loop screen, console, env, resources +231 event-loop screen, console, env, resources 232 screen-should-contain [ 233 . run (F4) . 234 . ╎ . @@ -304,7 +304,7 @@ if ('onhashchange' in window) { 246 left-click 3, 70 # click 'copy' button 247 ] 248 run [ -249 event-loop screen, console, env, resources +249 event-loop screen, console, env, resources 250 ] 251 # copy doesn't happen 252 screen-should-contain [ @@ -322,7 +322,7 @@ if ('onhashchange' in window) { 264 type [1] 265 ] 266 run [ -267 event-loop screen, console, env, resources +267 event-loop screen, console, env, resources 268 ] 269 screen-should-contain [ 270 . run (F4) . -- cgit 1.4.1-2-gfad0