Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Bungled merge. Was: The /chat page redirects to the login page if the user does not have appropriate permissions to use chat. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | mistake |
| Files: | files | file ages | folders |
| SHA3-256: |
fee74ce5e7cf0d1a7fe6a03a07350189 |
| User & Date: | drh 2020-12-24 01:04:32.434 |
| Original Comment: | The /chat page redirects to the login page if the user does not have appropriate permissions to use chat. |
Context
|
2020-12-24
| ||
| 01:04 | Bungled merge. Was: The /chat page redirects to the login page if the user does not have appropriate permissions to use chat. ... (Closed-Leaf check-in: fee74ce5e7 user: drh tags: mistake) | |
|
2020-12-23
| ||
| 23:27 | Several internal cleanups in chat app, e.g. replace document.createXYZ with simpler fossil.dom API. Eliminate assignment to innerHTML, which is widely considered unsafe. ... (check-in: 68da24594f user: stephan tags: trunk) | |
Changes
Changes to src/chat.c.
| ︙ | ︙ | |||
73 74 75 76 77 78 79 |
/*
** WEBPAGE: chat
**
** Start up a browser-based chat session.
*/
void chat_webpage(void){
login_check_credentials();
| < | < < < < > | | > < < < < < < | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
/*
** WEBPAGE: chat
**
** Start up a browser-based chat session.
*/
void chat_webpage(void){
login_check_credentials();
if( !g.perm.Chat ){
login_needed(g.anon.Chat);
return;
}
style_set_current_feature("chat");
style_header("Chat");
@ <style>
@ #dialog {
@ width: 97%%;
@ }
@ #chat-input-area {
@ width: 100%%;
@ display: flex;
@ flex-direction: column;
@ }
@ #chat-input-line {
@ display: flex;
@ flex-direction: row;
@ margin-bottom: 1em;
@ align-items: center;
@ }
@ #chat-input-line > input[type=submit] {
@ flex: 1 5 auto;
@ max-width: 6em;
@ }
@ #chat-input-line > input[type=text] {
@ flex: 5 1 auto;
@ }
@ #chat-input-file-area {
@ display: flex;
@ flex-direction: row;
@ align-items: center;
@ }
@ #chat-input-file-area > .help-buttonlet,
@ #chat-input-file {
@ align-self: flex-start;
@ margin-right: 0.5em;
@ flex: 0 1 auto;
@ }
@ #chat-input-file {
@ border:1px solid rgba(0,0,0,0);/*avoid UI shift during drop-targeting*/
@ border-radius: 0.25em;
@ }
@ #chat-input-file > input {
@ flex: 1 0 auto;
@ }
@ .chat-timestamp {
@ font-family: monospace;
@ font-size: 0.8em;
|
| ︙ | ︙ | |||
155 156 157 158 159 160 161 | @ <div id='chat-input-area'> @ <div id='chat-input-line'> @ <input type="text" name="msg" id="sbox" \ @ placeholder="Type message here."> @ <input type="submit" value="Send"> @ </div> @ <div id='chat-input-file-area'> | < < < < < < | < | < | < > | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
@ <div id='chat-input-area'>
@ <div id='chat-input-line'>
@ <input type="text" name="msg" id="sbox" \
@ placeholder="Type message here.">
@ <input type="submit" value="Send">
@ </div>
@ <div id='chat-input-file-area'>
@ <input type="file" name="file" id="chat-input-file">
@ <div id="chat-drop-details"></div>
@ </div>
@ </div>
@ </form>
@ <hr>
/* New chat messages get inserted immediately after this element */
@ <span id='message-inject-point'></span>
builtin_fossil_js_bundle_or("popupwidget", NULL);
/* Always in-line the javascript for the chat page */
@ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */
@ window.fossilChatInitSize = %d(db_get_int("chat-initial-history",50));
@ window.addEventListener('load', function(){
/* We need an onload handler to ensure that window.fossil is
loaded first. */
cgi_append_content(builtin_text("chat.js"),-1);
@ }, false);
@ </script>
style_finish_page();
}
|
| ︙ | ︙ |