Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch chat-config-options Excluding Merge-Ins
This is equivalent to a diff from 76f65b4362 to c23aa77411
2021-09-18
| ||
03:40 | Reimplemented /chat settings selection to be more usable, device-portable, and extensible. Re-enabled client-side selection of repo-specific chat nofication sounds. ... (check-in: 9c777150ed user: stephan tags: trunk) | |
03:26 | /chat: Corrected storage of selected audio URI to account for multiple sounds. Updated change log and chat.md. ... (Closed-Leaf check-in: c23aa77411 user: stephan tags: chat-config-options) | |
02:36 | /chat: re-enable inclusion of unversioned sound files (mp3, wav, ogg) in the list of chat notification sounds. ... (check-in: 2a59a9a15a user: stephan tags: chat-config-options) | |
2021-09-17
| ||
23:21 | Replace /chat config popup with a friendlier and more flexible widget. Reintroduces ability to select from multiple alerts. Seems to work but needs more testing. [forum:d97c869900 | Forum post d97c869900]. ... (check-in: 6f5e04b340 user: stephan tags: chat-config-options) | |
21:48 | Clarified the read/write access issue in the #webonly section of the main user capabilities doc. ... (check-in: 391bc36987 user: wyoung tags: trunk) | |
19:48 | Formatting improvements on the change log. Improvements to the help text for the "fossil ui" command. ... (check-in: 76f65b4362 user: drh tags: trunk) | |
19:32 | Update the changes log. Fix a minor typo in the help text for "diff". ... (check-in: 5839abaee4 user: drh tags: trunk) | |
Changes to src/chat.c.
︙ | ︙ | |||
45 46 47 48 49 50 51 | /* ** Outputs JS code to initialize a list of chat alert audio files for ** use by the chat front-end client. A handful of builtin files ** (from alerts/\*.wav) and all unversioned files matching ** alert-sounds/\*.{mp3,ogg,wav} are included. */ static void chat_emit_alert_list(void){ | < | > > < < < < | | < | | | | | | | | | < > | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | /* ** Outputs JS code to initialize a list of chat alert audio files for ** use by the chat front-end client. A handful of builtin files ** (from alerts/\*.wav) and all unversioned files matching ** alert-sounds/\*.{mp3,ogg,wav} are included. */ static void chat_emit_alert_list(void){ unsigned int i; const char * azBuiltins[] = { "builtin/alerts/plunk.wav", "builtin/alerts/bflat2.wav", "builtin/alerts/bflat3.wav", "builtin/alerts/bloop.wav" }; CX("window.fossil.config.chat.alerts = [\n"); for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){ CX("%s%!j", i ? ", " : "", azBuiltins[i]); } if( db_table_exists("repository","unversioned") ){ Stmt q = empty_Stmt; db_prepare(&q, "SELECT 'uv/'||name FROM unversioned " "WHERE content IS NOT NULL " "AND (name LIKE 'alert-sounds/%%.wav' " "OR name LIKE 'alert-sounds/%%.mp3' " "OR name LIKE 'alert-sounds/%%.ogg')"); while(SQLITE_ROW==db_step(&q)){ CX(", %!j", db_column_text(&q, 0)); } db_finalize(&q); } CX("\n];\n"); } /* Settings that can be used to control chat */ /* ** SETTING: chat-initial-history width=10 default=50 ** |
︙ | ︙ | |||
179 180 181 182 183 184 185 186 187 188 189 190 191 192 | @ </div> @ <input type="file" name="file" id="chat-input-file"> @ </div> @ <div id="chat-drop-details"></div> @ </div> @ </div> @ </form> @ <div id='chat-messages-wrapper'> /* New chat messages get inserted immediately after this element */ @ <span id='message-inject-point'></span> @ </div> fossil_free(zProjectName); builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); /* Always in-line the javascript for the chat page */ | > > > > > | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | @ </div> @ <input type="file" name="file" id="chat-input-file"> @ </div> @ <div id="chat-drop-details"></div> @ </div> @ </div> @ </form> @ <div id='chat-config' class='hidden'> @ <div id='chat-config-options'></div> /* ^^^populated client-side */ @ <button>Close</button> @ </div> @ <div id='chat-messages-wrapper'> /* New chat messages get inserted immediately after this element */ @ <span id='message-inject-point'></span> @ </div> fossil_free(zProjectName); builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); /* Always in-line the javascript for the chat page */ |
︙ | ︙ |
Changes to src/chat.js.
︙ | ︙ | |||
107 108 109 110 111 112 113 | messagesWrapper: E1('#chat-messages-wrapper'), inputForm: E1('#chat-form'), btnSubmit: E1('#chat-message-submit'), inputSingle: E1('#chat-input-single'), inputMulti: E1('#chat-input-multi'), inputCurrent: undefined/*one of inputSingle or inputMulti*/, inputFile: E1('#chat-input-file'), | | > | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | messagesWrapper: E1('#chat-messages-wrapper'), inputForm: E1('#chat-form'), btnSubmit: E1('#chat-message-submit'), inputSingle: E1('#chat-input-single'), inputMulti: E1('#chat-input-multi'), inputCurrent: undefined/*one of inputSingle or inputMulti*/, inputFile: E1('#chat-input-file'), contentDiv: E1('div.content'), configArea: E1('#chat-config') }, me: F.user.name, mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, pageIsActive: 'visible'===document.visibilityState, changesSincePageHidden: 0, notificationBubbleColor: 'white', |
︙ | ︙ | |||
383 384 385 386 387 388 389 | repository-relative path which responds with an audio file). Pass a falsy value to disable audio alerts. Returns this. */ setNewMessageSound: function f(uri){ delete this.playNewMessageSound.audio; this.playNewMessageSound.uri = uri; | | | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | repository-relative path which responds with an audio file). Pass a falsy value to disable audio alerts. Returns this. */ setNewMessageSound: function f(uri){ delete this.playNewMessageSound.audio; this.playNewMessageSound.uri = uri; this.settings.set('audible-alert', uri); return this; } }; F.fetch.beforesend = ()=>cs.ajaxStart(); F.fetch.aftersend = ()=>cs.ajaxEnd(); cs.e.inputCurrent = cs.e.inputSingle; /* Install default settings... */ |
︙ | ︙ | |||
948 949 950 951 952 953 954 | const iso8601ish = function(d){ return d.toISOString() .replace('T',' ').replace(/\.\d+/,'').replace('Z', ' zulu'); }; (function(){/*Set up #chat-settings-button */ const settingsButton = document.querySelector('#chat-settings-button'); | | | | | > > | 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 | const iso8601ish = function(d){ return d.toISOString() .replace('T',' ').replace(/\.\d+/,'').replace('Z', ' zulu'); }; (function(){/*Set up #chat-settings-button */ const settingsButton = document.querySelector('#chat-settings-button'); const optionsMenu = E1('#chat-config-options'); const cbToggle = function(){ D.toggleClass([Chat.e.messagesWrapper, Chat.e.configArea], 'hidden'); }; D.attr(settingsButton, 'role', 'button').addEventListener('click', cbToggle, false); Chat.e.configArea.querySelector('button').addEventListener('click', cbToggle, false); /* Settings menu entries... */ const settingsOps = [{ label: "Multi-line input", boolValue: ()=>Chat.inputElement()===Chat.e.inputMulti, persistentSetting: 'edit-multiline', callback: function(){ Chat.inputToggleSingleMulti(); |
︙ | ︙ | |||
990 991 992 993 994 995 996 | callback: function(){ const v = Chat.settings.toggle('images-inline'); F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+"."); } }]; /** Set up selection list of notification sounds. */ | | | > > > | > | | | | < | < < < | | | > > | < | | | | | < | > > | | > > > > | > > > | | | | | | | < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | callback: function(){ const v = Chat.settings.toggle('images-inline'); F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+"."); } }]; /** Set up selection list of notification sounds. */ if(false/*flip this to false to enable selection of audio files*/){ settingsOps.push({ label: "Audible alerts", boolValue: ()=>Chat.settings.getBool('audible-alert'), callback: function(){ const v = Chat.settings.toggle('audible-alert'); Chat.setNewMessageSound(v ? F.config.chat.alertSound : false); if(v) setTimeout(()=>Chat.playNewMessageSound(), 50); F.toast.message("Audio notifications "+(v ? "enabled" : "disabled")+"."); } }); Chat.setNewMessageSound( Chat.settings.getBool('audible-alert') ? F.config.chat.alertSound : false ); }else{ /* Disabled per chatroom discussion: selection list of audio files for chat notification. */ settingsOps.selectSound = D.addClass(D.div(), 'menu-entry'); const selectSound = D.select(); D.append(settingsOps.selectSound, D.append(D.span(),"Audio alert"), selectSound); D.option(selectSound, "", "(no audio)"); const firstSoundIndex = selectSound.options.length; F.config.chat.alerts.forEach(function(a){ D.option(selectSound, a); }); if(true===Chat.settings.getBool('audible-alert')){ selectSound.selectedIndex = firstSoundIndex; }else{ selectSound.value = Chat.settings.get('audible-alert',''); if(selectSound.selectedIndex<0){ /*Missing file - removed after this setting was applied. Fall back to the first sound in the list. */ selectSound.selectedIndex = firstSoundIndex; } } selectSound.addEventListener('change',function(){ const v = this.value; Chat.setNewMessageSound(v); F.toast.message("Audio notifications "+(v ? "enabled" : "disabled")+"."); if(v) setTimeout(()=>Chat.playNewMessageSound(), 0); }, false); Chat.setNewMessageSound(selectSound.value); }/*audio notification config*/ /** Build list of options... */ settingsOps.forEach(function f(op){ const line = D.addClass(D.div(), 'menu-entry'); const btn = D.append( D.addClass(D.label(), 'cbutton'/*bootstrap skin hijacks 'button'*/), op.label); const callback = function(ev){ op.callback(ev); if(op.persistentSetting){ Chat.settings.set(op.persistentSetting, op.boolValue()); } }; if(op.hasOwnProperty('boolValue')){ if(undefined === f.$id) f.$id = 0; ++f.$id; const check = D.attr(D.checkbox(1, op.boolValue()), 'aria-label', op.label); const id = 'cfgopt'+f.$id; if(op.boolValue()) check.checked = true; D.attr(check, 'id', id); D.attr(btn, 'for', id); D.append(line, check); check.addEventListener('change', callback); }else{ line.addEventListener('click', callback); } D.append(line, btn); D.append(optionsMenu, line); }); if(settingsOps.selectSound){ D.append(optionsMenu, settingsOps.selectSound); } //settingsButton.click()/*for for development*/; })()/*#chat-settings-button setup*/; /** Callback for poll() to inject new content into the page. jx == the response from /chat-poll. If atEnd is true, the message is appended to the end of the chat list (for loading older messages), else the beginning (the default). */ const newcontent = function f(jx,atEnd){ |
︙ | ︙ |
Changes to src/default.css.
︙ | ︙ | |||
1895 1896 1897 1898 1899 1900 1901 | font-family: monospace; } body.chat #chat-drop-details img { max-width: 45%; max-height: 45%; } | > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > | 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 | font-family: monospace; } body.chat #chat-drop-details img { max-width: 45%; max-height: 45%; } body.chat #chat-config { /* /chat configuration widget */ display: flex; flex-direction: column; flex: 1 0 auto; overflow: auto; flex: 2 1 auto; padding: 0 0.25em; } body.chat #chat-config > button { padding: 0.5em; flex: 0 1 auto; margin: 0.25em 0; } body.chat #chat-config #chat-config-options { /* /chat config options go here */ flex: 1 1 auto; display: flex; flex-direction: column; overflow: auto; } body.chat #chat-config #chat-config-options .menu-entry { display: flex; align-items: center; flex-direction: row; flex-wrap: wrap; padding: 1em; } body.chat #chat-config #chat-config-options .menu-entry > *:first-child { margin-right: 1em; } input[type="checkbox"].diff-toggle { float: right; } body.branch .brlist > table > tbody > tr:hover:not(.selected), body.branch .brlist > table > tbody > tr.selected { background-color: #ffc; |
︙ | ︙ |
Changes to www/changes.wiki.
︙ | ︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | block HTML markup (such as <table>) in most cases. Only content of <pre> and <script> is passed through verbatim. * The [/help?cmd=wiki|wiki list command] no longer lists "deleted" pages by default. Use the new <tt>--all</tt> option to include deleted pages in the output. * The [/help?cmd=all|fossil all git status] command only shows reports for the subset of repositories that have a configured Git export. <h2 id='v2_16'>Changes for Version 2.16 (2021-07-02)</h2> * <b>Security:</b> Fix the client-side TLS so that it verifies that the server hostname matches its certificate. * The default "ssh" command on Windows is changed to "ssh" instead of the legacy "plink", as ssh is now generally available on Windows systems. Installations that still need to use the legacy "plink" can make that | > > > | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | block HTML markup (such as <table>) in most cases. Only content of <pre> and <script> is passed through verbatim. * The [/help?cmd=wiki|wiki list command] no longer lists "deleted" pages by default. Use the new <tt>--all</tt> option to include deleted pages in the output. * The [/help?cmd=all|fossil all git status] command only shows reports for the subset of repositories that have a configured Git export. * Enhanced the [/help?cmd=/chat|/chat page] configuration and added the ability for a repository administrator to [./chat.md#notifications|extend the selection of notification sounds via unversioned files]. <h2 id='v2_16'>Changes for Version 2.16 (2021-07-02)</h2> * <b>Security:</b> Fix the client-side TLS so that it verifies that the server hostname matches its certificate. * The default "ssh" command on Windows is changed to "ssh" instead of the legacy "plink", as ssh is now generally available on Windows systems. Installations that still need to use the legacy "plink" can make that |
︙ | ︙ |
Changes to www/chat.md.
︙ | ︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | at the top of the message and clicking the button which appears. Such deletions are local-only, and the messages will reappear if the page is reloaded. The user who posted a given message, or any Admin users, may additionally choose to globally delete a message from the chat record, which deletes it not only from their own browser but also propagates the removal to all connected clients the next time they poll for new messages. ## Implementation Details *You do not need to understand how Fossil chat works in order to use it. But many developers prefer to know how their tools work. This section is provided for the benefit of those curious developers.* | > > > > > > > > | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | at the top of the message and clicking the button which appears. Such deletions are local-only, and the messages will reappear if the page is reloaded. The user who posted a given message, or any Admin users, may additionally choose to globally delete a message from the chat record, which deletes it not only from their own browser but also propagates the removal to all connected clients the next time they poll for new messages. ### <a id='notifications'></a>Customizing New-message Notification Sounds By default, the list of new-message notification sounds is limited to a few built in to the fossil binary. In addition, any [unversioned files](./unvers.wiki) named `alert-sounds/*.{mp3,wav,ogg}` will be included in that list. To switch sounds, tap the "settings" button. ## Implementation Details *You do not need to understand how Fossil chat works in order to use it. But many developers prefer to know how their tools work. This section is provided for the benefit of those curious developers.* |
︙ | ︙ |