Fossil SCM

Add the tools/chat.tcl Wapp script so that it can be collaboratively developed. This branch may wither and die. Or, the chatroom idea might be recoded in the Fossil trunk using C. Or it might continue as a separate Wapp extension. We'll see. But for now it is here on a branch so that people can hack at it.

drh 2020-12-22 03:51 trunk
Commit 84b31f44950caa767f480472ed2839c8af2d1f8f89fc8fac192d5232b03edfdc
1 file changed +390
--- a/tools/chat.tcl
+++ b/tools/chat.tcl
@@ -0,0 +1,390 @@
1
+#!/usr/bin/wapptclsh
2
+#
3
+# A chat program designed to run using the extcgi mechanism of Fossil.
4
+#
5
+encoding system utf-8
6
+
7
+# The name of the chat database file
8
+#
9
+proc chat-db-name {} {
10
+ set x [wapp-param SCRIPT_FILENAME]
11
+ set dir [file dir $x]
12
+ set fn [file tail $x]
13
+ return $dir/-$fn.db
14
+}
15
+
16
+# Verify permission to use chat. Return true if not authorized.
17
+# Return false if the Fossil user is allowed to access chat.
18
+#
19
+proc not-authorized {} {
20
+ set cap [wapp-param FOSSIL_CAPABILITIES]
21
+ return [expr {![string match *i* $cap]}]
22
+}
23
+
24
+# The default page.
25
+# Load the initial chat screen.
26
+#
27
+proc wapp-default {} {
28
+ wapp-content-security-policy off
29
+ wapp-trim {
30
+ <div class="fossil-doc" data-title="Chat">
31
+ }
32
+ i(function(){
33
+ let xt authorized.
34
+# Return falsesbox");
35
+ let form = document.forms[0]
36
+ var mxMsg = 0
37
+ var _me = "%string($me)"
38
+ t have privileges e.preventDefault();
39
+ chat program designed to ru>
40
+ <table border="0" cellpadding="2" id="intab" width="100%">
41
+ <tr>
42
+ <td align="right">Message:</td>
43
+ <td width="100%">: 'POST',
44
+ ></td>
45
+ <td>db
46
+}
47
+
48
+# Verify permissirue if not </td>
49
+ </tr>
50
+ <tr>
51
+ <td align="right">File:</td>
52
+ <td align="left"> var m = jx.msgs[i]
53
+ </td>
54
+ </trchanis#!/usr/bin/wapputtr")
55
+ nt</a> |
56
+ <
57
+ f.rxt</a>
58
+ <style>
59
+\# varextcgi mechanis#!/usr/bin/wapptclsh
60
+#
61
+# A 1;
62
+ margin-bottom: 1em;
63
+ al$dir/-$fn.db
64
+}m.xfrom))
65
+ }
66
+ file
67
+#
68
+proc chat-db: flex;
69
+ flex-direction: 1 varoration:r = functio td.appendChild(span)
70
+ .str.substring(pptclsh
71
+#
72
+# A chchat prhat program designed to r varof Fossil.
73
+#
74
+encoding of the chat databa
75
+ssil.
76
+#
77
+enco#!/usr/bin/wapptcimg)
78
+ il.
79
+# flex;
80
+ flex-direction: 1 fn [file tail $x]
81
+ return $d$dir/-$fn.db
82
+}
83
+
84
+# Verify pe }
85
+ }
86
+ if not authorized.
87
+# Ret
88
+ }
89
+ not authorized.
90
+# Return falsllowed to acces ccess chat.
91
+#
92
+proc not
93
+ app-param FOS im {
94
+ <div class="fossil-doc"
95
+ let xt authorized.;
96
+ let form = document.forms[0]
97
+ var mxMsg = 0
98
+ var _me = "%string($me)"
99
+ t have privileges e.preventDefault();
100
+ chat program designed to run using the extcgi mechanism of Fossil.
101
+#
102
+#
103
+encoding s method: 'POST',
104
+ e file
105
+#
106
+pro }at database file
107
+form.msg.value = ""
108
+ dir [file dir $x]
109
+ set
110
+ });
111
+ ir/-$fn.db
112
+}
113
+
114
+# Verify permissirue if not authorized.
115
+# for(var i=0; i<jx.msgs.length; i++){
116
+ var m = jx.msgs[i]
117
+ var rossil.
118
+#
119
+encoding system uttr")
120
+ nt</a> |
121
+ <
122
+ f.rxt</a>
123
+ <style>
124
+\# varextcgi mechanis#!/usr/bin/wapptclsh
125
+#
126
+# A 1;
127
+ margin-bottom: 1em;
128
+ al$dir/-$fn.db
129
+}m.xfrom))
130
+ }
131
+ file
132
+#
133
+proc chat-db: flex;
134
+ flex-direction: 1 varoration:r = functio td.appendChild(span)
135
+ .str.substring(pptclsh
136
+#
137
+# A chchat prhat program designed to r varof Fossil.
138
+#
139
+encoding of the chat databa
140
+ssil.
141
+#
142
+enco#!/usr/bin/wapptcimg)
143
+ il.
144
+#
145
+encoding system var aossil.
146
+#
147
+encoding system uta");
148
+ var) user have the .user
149
+ ad2dde1;*/
150
+}
151
+/* The conten
152
+ element of a FIELDSET) */
153
+ssil.
154
+#
155
+enco#!/usr/bin/wapptcls
156
+ }
157
+ var brossil.
158
+#
159
+encoding system utbr");
160
+
161
+ set dir [fi
162
+.#!/usr/bin/wapptcbr);
163
+ }t dir [file dir $x]
164
+ set
165
+ return $dir/-$fn.db
166
+}m.xmsg));
167
+ A chat program designed to run usif Fossil.
168
+#
169
+adow: 0.2em 0.2em 0Fossil.
170
+#
171
+encoding system s');
172
+ }
173
+ file
174
+#
175
+proc chat-db: flex;
176
+ flex-direction: 1 fn [file tail $x]
177
+ return $d$dir/-$fn.db
178
+}
179
+
180
+# Verify pe }
181
+ }
182
+ if not authorized.
183
+# Ret
184
+ }
185
+ not authorized.
186
+# Return falsllowed to acces ccess chat.
187
+#
188
+proc not
189
+ app-param FOSSIL_CAPABILITIES]
190
+ return [expr {![string match *i* $cap]}]
191
+}
192
+
193
+# The default page.
194
+# Load the initial chat screen.
195
+#
196
+proc wapp-default {} {
197
+ wapp-content-security-policy off
198
+ wapp-trim {
199
+ <div class="fossil-doc" data-title="Chat">
200
+ }
201
+ if {[noconst dmsg = messageToDOM(m. setTimeout(poll, dmsgub);
202
+ #!/usr/bin/wapptclsh
203
+#
204
+# A chat program designed to run using the extcgi mechanism of Fossil.
205
+#
206
+encoding system utf-8
207
+
208
+# The name of the chat database file
209
+#
210
+proc chat-db-name {} {
211
+ set x [wapp-param SCRIPT_FILENAME]
212
+ set dir [file dir $x]
213
+ set fn [file tail $x]
214
+ return $dir/-$fn.db
215
+}
216
+
217
+# Verify permission to use chat. Return true if not authorized.
218
+# Return false if the Fossil user is allowed to access chat.
219
+#
220
+proc not-authorized {} {
221
+ set cap [wapp-param FOSSIL_CAPABILITIES]
222
+ return [expr {![string match *i* $cap]}]
223
+}
224
+
225
+# The default page.
226
+# Load the initial chat screen.
227
+#
228
+proc wapp-default {} {
229
+ wapp-content-security-policy off
230
+ wapp-trim {
231
+ <div class="fossil-doc" data-title="Chat">
232
+ }
233
+ if {[not-authorized]} {
234
+ wapp-trim {
235
+ <h1>Not authorized</h1> the results to.
236
+
237
+ return [expr {![string match *i* $cap]}]
238
+}
239
+
240
+# The default page.
241
+# Load the initial chat screen.
242
+#
243
+proc wapp-default {} {
244
+ wapp-content-security-policy off
245
+ wapp-trim {
246
+ <div class="fossil-doc" data-title="Chat">
247
+ }
248
+ if {[not-authorized]} {
249
+ wapp-trim {
250
+ <h1>Not authorized</h1>
251
+ <p>You must have privileges to use this chatroom</p>
252
+ </dptclsh
253
+#
254
+# A chat program designed to run using the extcgi mechanism of Fossil.
255
+#
256
+encoding system utf-8
257
+
258
+# The name of the chat database file
259
+#
260
+proc chat-db-name {} {
261
+ set x [wapp-param SCRIPT_FILENAME]
262
+ set dir [file dir $x]
263
+ set fn [file tail $x]
264
+ return $dir/-$fn.db
265
+}
266
+
267
+# Verify permission to use chat. Return true if not authorized.
268
+# Return false if the Fossil user is allowed to access cha
269
+ <hr>
270
+ <table id="diallt {}#!/u/env">CGI environment</a> |
271
+ <a href="%string($cgiFn)/self">Wapp script</a>
272
+ <style>
273
+\#dialog {
274
+ width: 97%;
275
+}
276
+\#chat-input-area {
277
+ wlex;
278
+ flex-d display: flex;
279
+ flex-direction: 1;
280
+ margin-bottom: 1em;
281
+ aligns: center;
282
+}
283
+\#chat-inpu# A chat program designed to run #e { /* for @USERNAME references */
284
+ text-decoration: underline;
285
+ font-weight: bold;
286
+}
287
+/* A wrapmargin-bottom: 1em;
288
+ align for @USERNAME references */
289
+ text-decoration: underline;
290
+ font-weight: bold;
291
+}
292
+/* A wrapper for a single single message (one row of the UI) */
293
+.message-row {
294
+ margin-bottom: 0.5em;
295
+ border: none;
296
+ display: flex;
297
+ flex-direction: row;
298
+ justify-content: flex-start;
299
+ /*border: 1px solid rgba(0,0,0,0.2);
300
+ border-radius: 0.25em;
301
+ box-shadow: 0.2em 0.2em 0.2em rgba(0, 0, 0, 0.29);*/
302
+ border: none;
303
+}
304
+/* Rows for the current user have the .user-is-me CSS class
305
+ and get right-aligned. */
306
+.message-row.user-is-me {
307
+ justify-content: flex-end;
308
+.2em rgba(0, 0, 0, 0.29) user hav(0, 0, 0, 0.29) user hprevStart = 0;
309
+ f.str = straligned. */
310
+.messad2dd, f.replacer);
311
+ f.rx(0, 0, 0, 0.29) userdelete f.str;
312
+ if(f(the body element of a FIE#!/usr/bipptclsh
313
+#nt of a FIELDSET) */#!/usr/bin/wapptclsh
314
+#
315
+# A chat program designed to run using the extcgi mepptclsh
316
+#
317
+# A chat program designed to run using the extcgi mechanism of Fossil.
318
+#
319
+encoding system utf-8
320
+
321
+# The name of the chat database file
322
+#
323
+proc chat-db-name {} {
324
+ set x [wapp-param SCRIPT_FILENAME]
325
+ set dir [file dir $x]
326
+ set fn [file tail $x]
327
+ return $dir/-$fn.db
328
+}
329
+
330
+# Verify permission to use chat. Return true if not authorized.
331
+# Return false if the Fossil user is allowed to access chat.
332
+#
333
+proc not-authorized {} {
334
+ set cap [wapp-param FOSSIL_CAPABILITIES]
335
+ return [expr {![string match *i* $cap]}]
336
+}
337
+
338
+# The default page.
339
+# Load the initial chat screen.
340
+#
341
+proc wapp-default {} {
342
+ wapp-content-security-policy off
343
+ wapp-trim {
344
+ <div class="fossil-doc" data-title="Chat">
345
+ }
346
+ if {[not-authorized]} {
347
+ wapp-trim {
348
+ <h1>Not authorized</h1>
349
+ <p>You must have privileges to use this chatroom</p>
350
+ </dptclsh
351
+#
352
+# A chat program designed to run using the extcgi mechanism of Fossil.
353
+#
354
+encoding system utf-8
355
+
356
+# The name of the chat database file
357
+#
358
+proc chat-db-name {} {
359
+ set x [wapp-param SCRIPT_FILENAME]
360
+ set dir [file dir $x]
361
+ set fn [file tail $x]
362
+ return $dir/-$fn.db
363
+}
364
+
365
+# Verify permissi poll()
366
+ E references */
367
+ text-decoration: underline;
368
+ font-weight: bold;
369
+}
370
+/* A wrapper for a single single message (one row of the UI) */
371
+.message-row {
372
+ margin-bottom: 0.5em;
373
+ border: none;
374
+ display: flex;
375
+ flex-direction: row;
376
+ justify-content: flex-start;
377
+ /*border: 1px solid rgba(0,0,0,0.2);
378
+ border-radius: 0.25em;
379
+ box-shadow: 0.2em 0.2em 0.2em rgba(0, 0, 0, 0.29);*/
380
+ border: none;
381
+}
382
+/* Rows for the current user have the .user-is-me CSS class
383
+ and get right-aligned. */
384
+.message-row.user-is-me {
385
+ justify-content: flex-end;
386
+.2em rgba(0, 0, 0, 0.29) user hav(0, 0, 0, 0.29) user hprevStart = 0;
387
+ f.str = straligned. */
388
+.messad2dd, f.replacer);
389
+ f.rx(0, 0, 0, 0.29) userdelete f.str;
390
+ if(f(the body element of a FIE#!/usr/bipptcl
--- a/tools/chat.tcl
+++ b/tools/chat.tcl
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/chat.tcl
+++ b/tools/chat.tcl
@@ -0,0 +1,390 @@
1 #!/usr/bin/wapptclsh
2 #
3 # A chat program designed to run using the extcgi mechanism of Fossil.
4 #
5 encoding system utf-8
6
7 # The name of the chat database file
8 #
9 proc chat-db-name {} {
10 set x [wapp-param SCRIPT_FILENAME]
11 set dir [file dir $x]
12 set fn [file tail $x]
13 return $dir/-$fn.db
14 }
15
16 # Verify permission to use chat. Return true if not authorized.
17 # Return false if the Fossil user is allowed to access chat.
18 #
19 proc not-authorized {} {
20 set cap [wapp-param FOSSIL_CAPABILITIES]
21 return [expr {![string match *i* $cap]}]
22 }
23
24 # The default page.
25 # Load the initial chat screen.
26 #
27 proc wapp-default {} {
28 wapp-content-security-policy off
29 wapp-trim {
30 <div class="fossil-doc" data-title="Chat">
31 }
32 i(function(){
33 let xt authorized.
34 # Return falsesbox");
35 let form = document.forms[0]
36 var mxMsg = 0
37 var _me = "%string($me)"
38 t have privileges e.preventDefault();
39 chat program designed to ru>
40 <table border="0" cellpadding="2" id="intab" width="100%">
41 <tr>
42 <td align="right">Message:</td>
43 <td width="100%">: 'POST',
44 ></td>
45 <td>db
46 }
47
48 # Verify permissirue if not </td>
49 </tr>
50 <tr>
51 <td align="right">File:</td>
52 <td align="left"> var m = jx.msgs[i]
53 </td>
54 </trchanis#!/usr/bin/wapputtr")
55 nt</a> |
56 <
57 f.rxt</a>
58 <style>
59 \# varextcgi mechanis#!/usr/bin/wapptclsh
60 #
61 # A 1;
62 margin-bottom: 1em;
63 al$dir/-$fn.db
64 }m.xfrom))
65 }
66 file
67 #
68 proc chat-db: flex;
69 flex-direction: 1 varoration:r = functio td.appendChild(span)
70 .str.substring(pptclsh
71 #
72 # A chchat prhat program designed to r varof Fossil.
73 #
74 encoding of the chat databa
75 ssil.
76 #
77 enco#!/usr/bin/wapptcimg)
78 il.
79 # flex;
80 flex-direction: 1 fn [file tail $x]
81 return $d$dir/-$fn.db
82 }
83
84 # Verify pe }
85 }
86 if not authorized.
87 # Ret
88 }
89 not authorized.
90 # Return falsllowed to acces ccess chat.
91 #
92 proc not
93 app-param FOS im {
94 <div class="fossil-doc"
95 let xt authorized.;
96 let form = document.forms[0]
97 var mxMsg = 0
98 var _me = "%string($me)"
99 t have privileges e.preventDefault();
100 chat program designed to run using the extcgi mechanism of Fossil.
101 #
102 #
103 encoding s method: 'POST',
104 e file
105 #
106 pro }at database file
107 form.msg.value = ""
108 dir [file dir $x]
109 set
110 });
111 ir/-$fn.db
112 }
113
114 # Verify permissirue if not authorized.
115 # for(var i=0; i<jx.msgs.length; i++){
116 var m = jx.msgs[i]
117 var rossil.
118 #
119 encoding system uttr")
120 nt</a> |
121 <
122 f.rxt</a>
123 <style>
124 \# varextcgi mechanis#!/usr/bin/wapptclsh
125 #
126 # A 1;
127 margin-bottom: 1em;
128 al$dir/-$fn.db
129 }m.xfrom))
130 }
131 file
132 #
133 proc chat-db: flex;
134 flex-direction: 1 varoration:r = functio td.appendChild(span)
135 .str.substring(pptclsh
136 #
137 # A chchat prhat program designed to r varof Fossil.
138 #
139 encoding of the chat databa
140 ssil.
141 #
142 enco#!/usr/bin/wapptcimg)
143 il.
144 #
145 encoding system var aossil.
146 #
147 encoding system uta");
148 var) user have the .user
149 ad2dde1;*/
150 }
151 /* The conten
152 element of a FIELDSET) */
153 ssil.
154 #
155 enco#!/usr/bin/wapptcls
156 }
157 var brossil.
158 #
159 encoding system utbr");
160
161 set dir [fi
162 .#!/usr/bin/wapptcbr);
163 }t dir [file dir $x]
164 set
165 return $dir/-$fn.db
166 }m.xmsg));
167 A chat program designed to run usif Fossil.
168 #
169 adow: 0.2em 0.2em 0Fossil.
170 #
171 encoding system s');
172 }
173 file
174 #
175 proc chat-db: flex;
176 flex-direction: 1 fn [file tail $x]
177 return $d$dir/-$fn.db
178 }
179
180 # Verify pe }
181 }
182 if not authorized.
183 # Ret
184 }
185 not authorized.
186 # Return falsllowed to acces ccess chat.
187 #
188 proc not
189 app-param FOSSIL_CAPABILITIES]
190 return [expr {![string match *i* $cap]}]
191 }
192
193 # The default page.
194 # Load the initial chat screen.
195 #
196 proc wapp-default {} {
197 wapp-content-security-policy off
198 wapp-trim {
199 <div class="fossil-doc" data-title="Chat">
200 }
201 if {[noconst dmsg = messageToDOM(m. setTimeout(poll, dmsgub);
202 #!/usr/bin/wapptclsh
203 #
204 # A chat program designed to run using the extcgi mechanism of Fossil.
205 #
206 encoding system utf-8
207
208 # The name of the chat database file
209 #
210 proc chat-db-name {} {
211 set x [wapp-param SCRIPT_FILENAME]
212 set dir [file dir $x]
213 set fn [file tail $x]
214 return $dir/-$fn.db
215 }
216
217 # Verify permission to use chat. Return true if not authorized.
218 # Return false if the Fossil user is allowed to access chat.
219 #
220 proc not-authorized {} {
221 set cap [wapp-param FOSSIL_CAPABILITIES]
222 return [expr {![string match *i* $cap]}]
223 }
224
225 # The default page.
226 # Load the initial chat screen.
227 #
228 proc wapp-default {} {
229 wapp-content-security-policy off
230 wapp-trim {
231 <div class="fossil-doc" data-title="Chat">
232 }
233 if {[not-authorized]} {
234 wapp-trim {
235 <h1>Not authorized</h1> the results to.
236
237 return [expr {![string match *i* $cap]}]
238 }
239
240 # The default page.
241 # Load the initial chat screen.
242 #
243 proc wapp-default {} {
244 wapp-content-security-policy off
245 wapp-trim {
246 <div class="fossil-doc" data-title="Chat">
247 }
248 if {[not-authorized]} {
249 wapp-trim {
250 <h1>Not authorized</h1>
251 <p>You must have privileges to use this chatroom</p>
252 </dptclsh
253 #
254 # A chat program designed to run using the extcgi mechanism of Fossil.
255 #
256 encoding system utf-8
257
258 # The name of the chat database file
259 #
260 proc chat-db-name {} {
261 set x [wapp-param SCRIPT_FILENAME]
262 set dir [file dir $x]
263 set fn [file tail $x]
264 return $dir/-$fn.db
265 }
266
267 # Verify permission to use chat. Return true if not authorized.
268 # Return false if the Fossil user is allowed to access cha
269 <hr>
270 <table id="diallt {}#!/u/env">CGI environment</a> |
271 <a href="%string($cgiFn)/self">Wapp script</a>
272 <style>
273 \#dialog {
274 width: 97%;
275 }
276 \#chat-input-area {
277 wlex;
278 flex-d display: flex;
279 flex-direction: 1;
280 margin-bottom: 1em;
281 aligns: center;
282 }
283 \#chat-inpu# A chat program designed to run #e { /* for @USERNAME references */
284 text-decoration: underline;
285 font-weight: bold;
286 }
287 /* A wrapmargin-bottom: 1em;
288 align for @USERNAME references */
289 text-decoration: underline;
290 font-weight: bold;
291 }
292 /* A wrapper for a single single message (one row of the UI) */
293 .message-row {
294 margin-bottom: 0.5em;
295 border: none;
296 display: flex;
297 flex-direction: row;
298 justify-content: flex-start;
299 /*border: 1px solid rgba(0,0,0,0.2);
300 border-radius: 0.25em;
301 box-shadow: 0.2em 0.2em 0.2em rgba(0, 0, 0, 0.29);*/
302 border: none;
303 }
304 /* Rows for the current user have the .user-is-me CSS class
305 and get right-aligned. */
306 .message-row.user-is-me {
307 justify-content: flex-end;
308 .2em rgba(0, 0, 0, 0.29) user hav(0, 0, 0, 0.29) user hprevStart = 0;
309 f.str = straligned. */
310 .messad2dd, f.replacer);
311 f.rx(0, 0, 0, 0.29) userdelete f.str;
312 if(f(the body element of a FIE#!/usr/bipptclsh
313 #nt of a FIELDSET) */#!/usr/bin/wapptclsh
314 #
315 # A chat program designed to run using the extcgi mepptclsh
316 #
317 # A chat program designed to run using the extcgi mechanism of Fossil.
318 #
319 encoding system utf-8
320
321 # The name of the chat database file
322 #
323 proc chat-db-name {} {
324 set x [wapp-param SCRIPT_FILENAME]
325 set dir [file dir $x]
326 set fn [file tail $x]
327 return $dir/-$fn.db
328 }
329
330 # Verify permission to use chat. Return true if not authorized.
331 # Return false if the Fossil user is allowed to access chat.
332 #
333 proc not-authorized {} {
334 set cap [wapp-param FOSSIL_CAPABILITIES]
335 return [expr {![string match *i* $cap]}]
336 }
337
338 # The default page.
339 # Load the initial chat screen.
340 #
341 proc wapp-default {} {
342 wapp-content-security-policy off
343 wapp-trim {
344 <div class="fossil-doc" data-title="Chat">
345 }
346 if {[not-authorized]} {
347 wapp-trim {
348 <h1>Not authorized</h1>
349 <p>You must have privileges to use this chatroom</p>
350 </dptclsh
351 #
352 # A chat program designed to run using the extcgi mechanism of Fossil.
353 #
354 encoding system utf-8
355
356 # The name of the chat database file
357 #
358 proc chat-db-name {} {
359 set x [wapp-param SCRIPT_FILENAME]
360 set dir [file dir $x]
361 set fn [file tail $x]
362 return $dir/-$fn.db
363 }
364
365 # Verify permissi poll()
366 E references */
367 text-decoration: underline;
368 font-weight: bold;
369 }
370 /* A wrapper for a single single message (one row of the UI) */
371 .message-row {
372 margin-bottom: 0.5em;
373 border: none;
374 display: flex;
375 flex-direction: row;
376 justify-content: flex-start;
377 /*border: 1px solid rgba(0,0,0,0.2);
378 border-radius: 0.25em;
379 box-shadow: 0.2em 0.2em 0.2em rgba(0, 0, 0, 0.29);*/
380 border: none;
381 }
382 /* Rows for the current user have the .user-is-me CSS class
383 and get right-aligned. */
384 .message-row.user-is-me {
385 justify-content: flex-end;
386 .2em rgba(0, 0, 0, 0.29) user hav(0, 0, 0, 0.29) user hprevStart = 0;
387 f.str = straligned. */
388 .messad2dd, f.replacer);
389 f.rx(0, 0, 0, 0.29) userdelete f.str;
390 if(f(the body element of a FIE#!/usr/bipptcl

Keyboard Shortcuts

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