Fossil SCM
The 'placeholder' attribute of the two /chat text input fields how includes the project name to help avoid confusion about which /chat one is typing into without requiring new screen real estate for a project-name label.
Commit
69135e4f61bddb40529f5943254732e5b17425b79b5727f959c82b1095439979
Parent
5312f3738e71360…
1 file changed
+5
-3
+5
-3
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -145,26 +145,28 @@ | ||
| 145 | 145 | ** Other /chat-OP pages are used by XHR requests from this page to |
| 146 | 146 | ** send new chat message, delete older messages, or poll for changes. |
| 147 | 147 | */ |
| 148 | 148 | void chat_webpage(void){ |
| 149 | 149 | char *zAlert; |
| 150 | + char *zProjectName; | |
| 150 | 151 | login_check_credentials(); |
| 151 | 152 | if( !g.perm.Chat ){ |
| 152 | 153 | login_needed(g.anon.Chat); |
| 153 | 154 | return; |
| 154 | 155 | } |
| 155 | 156 | zAlert = mprintf("%s/builtin/%s", g.zBaseURL, |
| 156 | 157 | db_get("chat-alert-sound","alerts/plunk.wav")); |
| 158 | + zProjectName = db_get("project-name","Unnamed project"); | |
| 157 | 159 | style_set_current_feature("chat"); |
| 158 | 160 | style_header("Chat"); |
| 159 | 161 | @ <form accept-encoding="utf-8" id="chat-form" autocomplete="off"> |
| 160 | 162 | @ <div id='chat-input-area'> |
| 161 | 163 | @ <div id='chat-input-line'> |
| 162 | 164 | @ <input type="text" name="msg" id="chat-input-single" \ |
| 163 | - @ placeholder="Type message here." autocomplete="off"> | |
| 165 | + @ placeholder="Type message for %h(zProjectName)." autocomplete="off"> | |
| 164 | 166 | @ <textarea rows="8" id="chat-input-multi" \ |
| 165 | - @ placeholder="Type message here. Ctrl-Enter sends it." \ | |
| 167 | + @ placeholder="Type message for %h(zProjectName). Ctrl-Enter sends it." \ | |
| 166 | 168 | @ class="hidden"></textarea> |
| 167 | 169 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 168 | 170 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 169 | 171 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 170 | 172 | @ </div> |
| @@ -183,11 +185,11 @@ | ||
| 183 | 185 | @ </form> |
| 184 | 186 | @ <div id='chat-messages-wrapper'> |
| 185 | 187 | /* New chat messages get inserted immediately after this element */ |
| 186 | 188 | @ <span id='message-inject-point'></span> |
| 187 | 189 | @ </div> |
| 188 | - | |
| 190 | + fossil_free(zProjectName); | |
| 189 | 191 | builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); |
| 190 | 192 | /* Always in-line the javascript for the chat page */ |
| 191 | 193 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 192 | 194 | /* We need an onload handler to ensure that window.fossil is |
| 193 | 195 | initialized before the chat init code runs. */ |
| 194 | 196 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -145,26 +145,28 @@ | |
| 145 | ** Other /chat-OP pages are used by XHR requests from this page to |
| 146 | ** send new chat message, delete older messages, or poll for changes. |
| 147 | */ |
| 148 | void chat_webpage(void){ |
| 149 | char *zAlert; |
| 150 | login_check_credentials(); |
| 151 | if( !g.perm.Chat ){ |
| 152 | login_needed(g.anon.Chat); |
| 153 | return; |
| 154 | } |
| 155 | zAlert = mprintf("%s/builtin/%s", g.zBaseURL, |
| 156 | db_get("chat-alert-sound","alerts/plunk.wav")); |
| 157 | style_set_current_feature("chat"); |
| 158 | style_header("Chat"); |
| 159 | @ <form accept-encoding="utf-8" id="chat-form" autocomplete="off"> |
| 160 | @ <div id='chat-input-area'> |
| 161 | @ <div id='chat-input-line'> |
| 162 | @ <input type="text" name="msg" id="chat-input-single" \ |
| 163 | @ placeholder="Type message here." autocomplete="off"> |
| 164 | @ <textarea rows="8" id="chat-input-multi" \ |
| 165 | @ placeholder="Type message here. Ctrl-Enter sends it." \ |
| 166 | @ class="hidden"></textarea> |
| 167 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 168 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 169 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 170 | @ </div> |
| @@ -183,11 +185,11 @@ | |
| 183 | @ </form> |
| 184 | @ <div id='chat-messages-wrapper'> |
| 185 | /* New chat messages get inserted immediately after this element */ |
| 186 | @ <span id='message-inject-point'></span> |
| 187 | @ </div> |
| 188 | |
| 189 | builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); |
| 190 | /* Always in-line the javascript for the chat page */ |
| 191 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 192 | /* We need an onload handler to ensure that window.fossil is |
| 193 | initialized before the chat init code runs. */ |
| 194 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -145,26 +145,28 @@ | |
| 145 | ** Other /chat-OP pages are used by XHR requests from this page to |
| 146 | ** send new chat message, delete older messages, or poll for changes. |
| 147 | */ |
| 148 | void chat_webpage(void){ |
| 149 | char *zAlert; |
| 150 | char *zProjectName; |
| 151 | login_check_credentials(); |
| 152 | if( !g.perm.Chat ){ |
| 153 | login_needed(g.anon.Chat); |
| 154 | return; |
| 155 | } |
| 156 | zAlert = mprintf("%s/builtin/%s", g.zBaseURL, |
| 157 | db_get("chat-alert-sound","alerts/plunk.wav")); |
| 158 | zProjectName = db_get("project-name","Unnamed project"); |
| 159 | style_set_current_feature("chat"); |
| 160 | style_header("Chat"); |
| 161 | @ <form accept-encoding="utf-8" id="chat-form" autocomplete="off"> |
| 162 | @ <div id='chat-input-area'> |
| 163 | @ <div id='chat-input-line'> |
| 164 | @ <input type="text" name="msg" id="chat-input-single" \ |
| 165 | @ placeholder="Type message for %h(zProjectName)." autocomplete="off"> |
| 166 | @ <textarea rows="8" id="chat-input-multi" \ |
| 167 | @ placeholder="Type message for %h(zProjectName). Ctrl-Enter sends it." \ |
| 168 | @ class="hidden"></textarea> |
| 169 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 170 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 171 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 172 | @ </div> |
| @@ -183,11 +185,11 @@ | |
| 185 | @ </form> |
| 186 | @ <div id='chat-messages-wrapper'> |
| 187 | /* New chat messages get inserted immediately after this element */ |
| 188 | @ <span id='message-inject-point'></span> |
| 189 | @ </div> |
| 190 | fossil_free(zProjectName); |
| 191 | builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); |
| 192 | /* Always in-line the javascript for the chat page */ |
| 193 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 194 | /* We need an onload handler to ensure that window.fossil is |
| 195 | initialized before the chat init code runs. */ |
| 196 |