145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
-
+
|
/*
** WEBPAGE: chat loadavg-exempt
**
** Start up a browser-based chat session.
**
** This is the main page that humans use to access the chatroom. Simply
** point a web-browser at /chat and the screen fills with the latest
** chat messages, and waits for new one.
** chat messages, and waits for new ones.
**
** Other /chat-OP pages are used by XHR requests from this page to
** send new chat message, delete older messages, or poll for changes.
*/
void chat_webpage(void){
char *zAlert;
char *zProjectName;
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
-
-
-
+
+
+
+
+
+
|
@ </div>
@ <div id='chat-config' class='hidden chat-view'>
@ <div id='chat-config-options'></div>
/* ^^^populated client-side */
@ <div class='button-bar'><button class='action-close'>Close Settings</button></div>
@ </div>
@ <div id='chat-search' class='hidden chat-view'>
@ <div class='message-widget-content'></div>
/* ^^^populated client-side */
@ <div class='button-bar'><button class='action-close'>Close Search</button></div>
@ <div class='message-widget-content'></div>
/* ^^^populated client-side */
@ <div class='button-bar'>
@ <button class='action-clear'>Clear results</button>
@ <button class='action-close'>Close Search</button>
@ </div>
@ </div>
@ <div id='chat-messages-wrapper' class='chat-view'>
/* New chat messages get inserted immediately after this element */
@ <span id='message-inject-point'></span>
@ </div>
fossil_free(zProjectName);
fossil_free(zInputPlaceholder0);
|
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
|
@ }, false);
@ </script>
builtin_request_js("fossil.page.chat.js");
style_finish_page();
}
/*
** WEBPAGE: chat-search hidden loadavg-exempt
**
** Webpage allowing users to search the archive of chat messages using fts5.
*/
void chat_search_webpage(void){
login_check_credentials();
if( !g.perm.Chat ){
login_needed(g.anon.Chat);
return;
}
style_set_current_feature("chat");
style_set_current_page("chat") /* so that we use style.chat.css */;
style_header("Chat Search");
@
@ <div id=results>
@ </div>
@ <div class='searchForm'>
@ <input id=textinput type="text" name="s" size="40">
@ <input id=searchbutton type="submit" value="Search">
@ </div>
builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch",
"pikchr", "confirmer", "copybutton",
NULL);
/* Always in-line the javascript for the chat page */
@ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */
/* We need an onload handler to ensure that window.fossil is
initialized before the chat init code runs. */
@ window.addEventListener('load', function(){
@ document.body.classList.add('chat');
@ /*^^^for skins which add their own BODY tag */;
@ }, false);
@ </script>
builtin_request_js("fossil.page.chatsearch.js");
style_finish_page();
}
/* Definition of repository tables used by chat
** Definition of repository tables used by chat
*/
static const char zChatSchema1[] =
@ CREATE TABLE repository.chat(
@ msgid INTEGER PRIMARY KEY AUTOINCREMENT,
@ mtime JULIANDAY, -- Time for this entry - Julianday Zulu
@ lmtime TEXT, -- Client YYYY-MM-DDZHH:MM:SS when message originally sent
@ xfrom TEXT, -- Login of the sender
|