Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Remove the now-superfluous /chat-search page. Preliminarily switch to long-format time strings in /chat messages, but that's up for reworking as we decide how we want to handle those. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | fts5-chat-search |
| Files: | files | file ages | folders |
| SHA3-256: |
e1f6c7f589b47ab89c17f98fe8ae7325 |
| User & Date: | stephan 2024-07-01 08:11:29.598 |
References
|
2024-07-01
| ||
| 08:32 | Remove the lingering JS code for the /chat-search page removed in [e1f6c7f589b4]. ... (check-in: 39496a32e6 user: stephan tags: fts5-chat-search) | |
Context
|
2024-07-01
| ||
| 08:32 | Remove the lingering JS code for the /chat-search page removed in [e1f6c7f589b4]. ... (check-in: 39496a32e6 user: stephan tags: fts5-chat-search) | |
| 08:11 | Remove the now-superfluous /chat-search page. Preliminarily switch to long-format time strings in /chat messages, but that's up for reworking as we decide how we want to handle those. ... (check-in: e1f6c7f589 user: stephan tags: fts5-chat-search) | |
| 08:09 | Typo fix in /alerts help text. ... (check-in: 62a7616184 user: stephan tags: fts5-chat-search) | |
Changes
Changes to src/chat.c.
| ︙ | ︙ | |||
145 146 147 148 149 150 151 | /* ** 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 | | | 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 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 |
@ </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'>
| | | > > | > | 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-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 |
@ }, false);
@ </script>
builtin_request_js("fossil.page.chat.js");
style_finish_page();
}
/*
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 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();
}
/*
** 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
|
| ︙ | ︙ |
Changes to src/fossil.page.chat.js.
| ︙ | ︙ | |||
924 925 926 927 928 929 930 |
/* Left-zero-pad a number to at least 2 digits */
const dowMap = {
/* Map of Date.getDay() values to weekday names. */
0: "Sunday", 1: "Monday", 2: "Tuesday",
3: "Wednesday", 4: "Thursday", 5: "Friday",
6: "Saturday"
};
| | | > > | | > > > > | | > > > > > > | | | > > | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 |
/* Left-zero-pad a number to at least 2 digits */
const dowMap = {
/* Map of Date.getDay() values to weekday names. */
0: "Sunday", 1: "Monday", 2: "Tuesday",
3: "Wednesday", 4: "Thursday", 5: "Friday",
6: "Saturday"
};
/* Given a Date, returns the timestamp string used in the "tab"
part of message widgets. If longFmt is true then a verbose
format is used, else a brief format is used. The returned string
is in client-local time. */
const theTime = function(d, longFmt=true){
const li = [];
if( longFmt ){
//li.push( d.toISOString() );
li.push(
d.getFullYear(),
'-', pad2(d.getMonth()+1/*sigh*/),
'-', pad2(d.getDate()),
' ',
d.getHours(), ":",
(d.getMinutes()+100).toString().slice(1,3)
);
}else{
li.push(
d.getHours(),":",
(d.getMinutes()+100).toString().slice(1,3),
' ', dowMap[d.getDay()]
);
}
return li.join('');
};
/**
Returns true if this page believes it can embed a view of the
file wrapped by the given message object, else returns false.
*/
const canEmbedFile = function f(msg){
|
| ︙ | ︙ | |||
1035 1036 1037 1038 1039 1040 1041 |
D.clearElement(this.e.tab);
var contentTarget = this.e.content;
var eXFrom /* element holding xfrom name */;
if(m.xfrom){
eXFrom = D.append(D.addClass(D.span(), 'xfrom'), m.xfrom);
const wrapper = D.append(
D.span(), eXFrom,
| | | 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 |
D.clearElement(this.e.tab);
var contentTarget = this.e.content;
var eXFrom /* element holding xfrom name */;
if(m.xfrom){
eXFrom = D.append(D.addClass(D.span(), 'xfrom'), m.xfrom);
const wrapper = D.append(
D.span(), eXFrom,
D.text(" #",(m.msgid||'???'),' ',theTime(d)))
D.append(this.e.tab, wrapper);
}else{/*notification*/
D.addClass(this.e.body, 'notification');
if(m.isError){
D.addClass([contentTarget, this.e.tab], 'error');
}
D.append(
|
| ︙ | ︙ | |||
2330 2331 2332 2333 2334 2335 2336 |
D.append( eMsgTgt, "Searching for ",term," ...");
F.fetch(
"chat-query", {
urlParams: {q: term},
responseType: 'json',
onload:function(jx){
let previd = 0;
| < | 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 |
D.append( eMsgTgt, "Searching for ",term," ...");
F.fetch(
"chat-query", {
urlParams: {q: term},
responseType: 'json',
onload:function(jx){
let previd = 0;
D.clearElement(eMsgTgt);
jx.msgs.forEach((m)=>{
const mw = new Chat.MessageWidget(m);
const spacer = new Chat.SearchCtxLoader({
first: jx.first,
last: jx.last,
previd: previd,
|
| ︙ | ︙ |
Changes to src/style.chat.css.
| ︙ | ︙ | |||
621 622 623 624 625 626 627 |
}
body.cpage-chat-search .spacer-widget button {
margin-left: 1ex;
margin-right: 1ex;
display: block;
}
| | | | | | 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 |
}
body.cpage-chat-search .spacer-widget button {
margin-left: 1ex;
margin-right: 1ex;
display: block;
}
body.chat .spacer-widget-buttons .up {
margin-top: 0.5em;
margin-bottom: 1em;
}
body.chat .spacer-widget-buttons .down {
margin-top: 1em;
margin-bottom: 0.5em;
}
body.chat .spacer-widget-buttons .all {
margin-bottom: 0.75em;
}
body.chat .anim-rotate-360 {
animation: rotate-360 750ms linear;
}
|
| ︙ | ︙ |