Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them.
Page: /drakestapleton/interplane-forge/blob/main/collab/co3view.om
# interplane-forge
INTERPLANE Forge
Brought by drakestapleton
Sign in to star 0 stars 0 watching
About Files History Releases Proposed changes Issues For developers
branch `main` Branches Tags History
`interplane-forge / collab / co3view.om`
544 lines ยท 9410 bytes Raw Blame History
1 note collab/co3view.om (ForgePatches): shared rendering for patch and issue pages, and the list pages.
2 note Class names come from server/forge.css only (box meta muted mono ok bad hit repos rname bar rhead).
3 text tcah ""
5 text tcae ""
6 text tcpatp "/patches/"
7 text tcissp "/issues/"
8 text tcpats "/patches"
9 text tcisss "/issues"
10 text tcdidk "did:key:"
11 text tcutc " UTC"
12 text tcsp1 ""
13 text tcspe ""
14 text tcnot "(no title)"
15 text tcmidd " · "
16 text tcstq "?state="
17 text tcstn "state"
18 text tcopen "open"
19 text tcmerged "merged"
20 text tcall "all"
21 text tcsopen "Open"
22 text tcsdraft "Draft"
23 text tcsclos "Closed"
24 text tcsmerg "Merged"
25 text tcsarch "Archived"
26 text tcsall "All"
27 text tcpat "Patches"
28 text tciss "Issues"
29 text tcbon ""
30 text tcboff ""
31 text tcopar " ("
32 text tccpar ")"
33 note list summaries (at most 200 COBs per list page)
34 global gcss ulong 256
35 global gcsu ulong 256
36 global gcsc ulong 256
37 global gcsk ulong 256
38 global gcsr ulong 256
39 global gcst ulong 512
40 global gclp uchar 262144
41 global gclpl ulong 1
42 global gcsv uchar 32768
43 global gcsvl ulong 256
44 global gcsau uchar 16384
45 global gcsal ulong 256
46 global gcsn ulong 1
47 global gccnt ulong 8
48 note ---- byte output helpers
49 fn copool o ulong n ulong to void
50 for i ulong n bound `4194304`
51 fescc get gcpool add o i
52 end
53 end
54 fn copoolm k ulong to void
55 o = get gcm k
56 n = get gcm add k 1
57 copool o n
58 end
59 fn coidh n ulong to void
60 for k ulong n bound 40
61 fputc get gcid k
62 end
63 end
64 fn corhex r ulong n ulong to void
65 for k ulong n bound 40
66 fputc get gcrv add mul r 40 k
67 end
68 end
69 fn cobhex r ulong n ulong to void
70 for k ulong n bound 40
71 fputc get gcrb add mul r 40 k
72 end
73 end
74 fn cohhex r ulong n ulong to void
75 for k ulong n bound 40
76 fputc get gcro add mul r 40 k
77 end
78 end
79 fn comhex m ulong n ulong to void
80 for k ulong n bound 40
81 fputc get gcmc add mul m 40 k
82 end
83 end
84 fn cochex ci ulong n ulong to void
85 for k ulong n bound 40
86 fputc get gcch add mul ci 40 k
87 end
88 end
89 fn cosp to void
90 fputc 32
91 end
92 note coisown: change ci was written by the node delegate (owner drakestapleton)
93 fn coisown ci ulong to bool
94 if ne get gccal ci len tfnid
95 ret false
96 end
97 for i ulong len tfnid
98 if ne get gccau add mul ci 64 i get tfnid i
99 ret false
100 end
101 end
102 ret true
103 end
104 fn codid ci ulong to void
105 fput tcdidk
106 for i ulong get gccal ci bound 64
107 fescc get gccau add mul ci 64 i
108 end
109 end
110 note coauth: the author of change ci: the owner name when it is the delegate, and the DID
111 fn coauth ci ulong to void
112 if coisown ci
113 fput tcah
114 fputb
115 fput tfowner
116 fput tcqg
117 fput tfowner
118 fput tcae
119 cosp
120 end
121 fput tcsp1
122 codid ci
123 fput tcspe
124 end
125 note ---- dates: seconds since 1970 to YYYY-MM-DD HH:MM UTC (days to civil date, proleptic Gregorian)
126 fn co2d v ulong to void
127 if lt v 10
128 fputc 48
129 end
130 fnum v
131 end
132 fn codate t ulong to void
133 cociv div t 86400
134 cosp
135 s = rem t 86400
136 co2d div s 3600
137 fputc 58
138 co2d div rem s 3600 60
139 fput tcutc
140 end
141 fn codateo t ulong to void
142 cociv div t 86400
143 end
144 fn cociv dy ulong to void
145 z = add dy 719468
146 era = div z 146097
147 doe = sub z mul era 146097
148 coymd doe era
149 end
150 fn coymd doe ulong era ulong to void
151 yoe = div sub add sub doe div doe 1460 div doe 36524 div doe 146096 365
152 y = add yoe mul era 400
153 doy = sub doe sub add mul 365 yoe div yoe 4 div yoe 100
154 mp = div add mul 5 doy 2 153
155 dd = add sub doy div add mul 153 mp 2 5 1
156 mm = ulong 0
157 if lt mp 10
158 mm = add mp 3
159 else
160 mm = sub mp 9
161 end
162 if le mm 2
163 y = add y 1
164 end
165 fnum y
166 fputc 45
167 co2d mm
168 fputc 45
169 co2d dd
170 end
171 note ---- links
172 fn copatl to void
173 fputrl
174 fput tcpatp
175 end
176 fn coissl to void
177 fputrl
178 fput tcissp
179 end
180 note coplink kd: href of the current COB gcid
181 fn coplink kd ulong to void
182 if eq kd 1
183 copatl
184 else
185 coissl
186 end
187 coidh 40
188 end
189 note coqeq t: the value of the last fqget (fval[0,n)) equals t
190 fn coqeq n long t view uchar * to bool
191 if ne ulong n len t
192 ret false
193 end
194 for i ulong len t
195 if ne get fval i get t i
196 ret false
197 end
198 end
199 ret true
200 end
201 note coqstate kd: the state filter, 0 open 1 draft 2 closed 3 merged 9 all (default open)
202 fn coqstate kd ulong to ulong
203 n = fqget tcstn
204 if lt n 0
205 ret ulong 0
206 end
207 if coqeq n tcdraft
208 ret ulong 1
209 end
210 if or coqeq n tcclosed coqeq n tcarch
211 ret ulong 2
212 end
213 if coqeq n tcmerged
214 ret ulong 3
215 end
216 if coqeq n tcall
217 ret ulong 9
218 end
219 ret ulong 0
220 end
221 note costname kd s: the visible name of a state
222 fn costname kd ulong s ulong to void
223 if eq s 9
224 fput tcsall
225 ret
226 end
227 if eq s 0
228 fput tcsopen
229 ret
230 end
231 if eq s 1
232 fput tcsdraft
233 ret
234 end
235 if eq s 3
236 fput tcsmerg
237 ret
238 end
239 if eq kd 1
240 fput tcsarch
241 ret
242 end
243 fput tcsclos
244 end
245 text tcbok ""
246 text tcbbad ""
247 text tcbmut ""
248 fn costbadge kd ulong s ulong to void
249 if or eq s 0 eq s 3
250 fput tcbok
251 else
252 if eq s 1
253 fput tcbmut
254 else
255 fput tcbbad
256 end
257 end
258 costname kd s
259 fput tcboff
260 end
261 note ---- list pages
262 fn cosumm kd ulong to void
263 i = get gcsn 0
264 if ge i 200
265 ret
266 end
267 s = get gcm 2
268 if eq kd 1
269 s = costate
270 end
271 put gcss i s
272 put gccnt s add get gccnt s 1
273 put gcsc i get gcrn 0
274 put gcsk i add get gcqn 0 get gcwn 0
275 put gcsu i colast
276 cosumt i
277 cosumv i
278 cosuma i
279 put gcsn 0 add i 1
280 end
281 fn colast to ulong
282 t = ulong 0
283 for ci ulong get gccn 0
284 if gt get gccts ci t
285 t = get gccts ci
286 end
287 end
288 ret t
289 end
290 fn cosumt i ulong to void
291 o = get gcm 0
292 n = get gcm 1
293 if gt n 300
294 n = ulong 300
295 end
296 p = get gclpl 0
297 if gt add p n 262144
298 n = ulong 0
299 end
300 for k ulong n
301 put gclp add p k get gcpool add o k
302 end
303 put gcst mul i 2 p
304 put gcst add mul i 2 1 n
305 put gclpl 0 add p n
306 end
307 fn cosumv i ulong to void
308 put gcsvl i 0
309 r = get gcrn 0
310 if eq r 0
311 ret
312 end
313 r = sub r 1
314 n = get gcrvl r
315 if gt n 128
316 n = ulong 128
317 end
318 for k ulong n
319 put gcsv add mul i 128 k get gcrvd add mul r 256 k
320 end
321 put gcsvl i n
322 end
323 fn cosuma i ulong to void
324 n = get gccal 0
325 for k ulong n bound 64
326 put gcsau add mul i 64 k get gccau k
327 end
328 put gcsal i n
329 end
330 text tclh1 ""
331 text tclh2 "
\n
Nothing here in this state.
\n" 336 text tclcap "Only the 200 most recently updated are listed.
\n" 337 text tcpnote "Patches are stored in this repository and read from it. Opening a new patch from a clone is closed for now: Interplane does not accept pushes yet.
\n" 338 text tcinote "Issues are stored in this repository and read from it. Opening a new issue is closed for now: Interplane does not accept issues yet.
\n" 339 note cotab f s nm v: one filter link (kind in gcm 9); v is the query value 340 fn cotab f ulong s ulong nm view uchar * v view uchar * to void 341 kd = get gcm 9 342 fput tcah 343 fputrl 344 if eq kd 1 345 fput tcpats 346 else 347 fput tcisss 348 end 349 fput tcstq 350 fput v 351 fput tcqg 352 if eq f s 353 fput tcbon 354 end 355 fput nm 356 fput tcopar 357 cotabn kd s 358 fput tccpar 359 if eq f s 360 fput tcboff 361 end 362 fput tcae 363 cosp 364 end 365 fn cotabn kd ulong s ulong to void 366 if eq s 9 367 fnum get gcsn 0 368 ret 369 end 370 fnum get gccnt s 371 end 372 fn cotabs kd ulong f ulong to void 373 cotab f 0 tcsopen tcopen 374 if eq kd 1 375 cotab f 1 tcsdraft tcdraft 376 cotab f 3 tcsmerg tcmerged 377 cotab f 2 tcsarch tcarch 378 else 379 cotab f 2 tcsclos tcclosed 380 end 381 cotab f 9 tcsall tcall 382 end 383 text tcli1 "