Fossil

Check-in [b8a20e20ff]
Login

Check-in [b8a20e20ff]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rotated the paperclip 45 degrees (it's now horizontal) and restored the behavior that ctrl-enter will send a message if there is only an attachment with no text.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | chat-input-rework
Files: files | file ages | folders
SHA3-256: b8a20e20ff35f8879a1b3737771eed164647d269e55e0f82016e4838d55015b1
User & Date: stephan 2021-10-03 19:56:07.603
Context
2021-10-03
20:15
Resized the attachment SVG to an integer number of pixels to avoid a tiny rounding error in some browsers which would truncate a pixel of the right edge. ... (check-in: 083927f575 user: stephan tags: chat-input-rework)
19:56
Rotated the paperclip 45 degrees (it's now horizontal) and restored the behavior that ctrl-enter will send a message if there is only an attachment with no text. ... (check-in: b8a20e20ff user: stephan tags: chat-input-rework)
19:44
Resized the attachment SVG - its bounding box was far, far wider than the glyph. ... (check-in: c6cc5557c0 user: stephan tags: chat-input-rework)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/chat.c.
142
143
144
145
146
147
148
149
150
151
152
153

154
155

156
157
158

159
160
161
162
163
164
165
166
** send new chat message, delete older messages, or poll for changes.
*/
void chat_webpage(void){
  char *zAlert;
  char *zProjectName;
  char * zInputPlaceholder0;  /* Common text input placeholder value */
  const char *zPaperclip =
    "<svg height=\"12.28288\" width=\"13.990313\"><path d=\"M "
    "12.266368,0.65287795 A 4.1,4.1 0 0 0 7.0963684,1.2528779 "
    "l -6.24999999,6.25 a 2.79,2.79 0 0 0 -0.84,2.19 2.84,2.84 "
    "0 0 0 1.13999999,2.0600001 2.73,2.73 0 0 0 1.62,0.53 3.13,"
    "3.13 0 0 0 2.18,-0.92 L 10.346368,5.9628779 a 1.66,1.66 0 "

    "0 0 -2.3399996,-2.35 l -3.6,3.6 0.71,0.71 3.59,-3.6 a 0.66,"
    "0.66 0 0 1 0.93,0.93 l -5.39,5.4000001 a 2,2 0 0 1 -2.5,0.3 "

    "1.83,1.83 0 0 1 -0.2,-2.7400001 l 6.25,-6.25 a 3.11,3.11 0 "
    "0 1 3.8999996,-0.48 3,3 0 0 1 1.31,2.19 3,3 0 0 1 -0.86,2.37 "
    "l -5.2799996,5.2600001 0.7,0.71 5.2699996,-5.2600001 a 4,4 0 "

    "0 0 -0.57,-6.09999995 z\" /></svg>";

  login_check_credentials();
  if( !g.perm.Chat ){
    login_needed(g.anon.Chat);
    return;
  }
  zAlert = mprintf("%s/builtin/%s", g.zBaseURL,







|
|
|
|
|
>
|
<
>
|
|
<
>
|







142
143
144
145
146
147
148
149
150
151
152
153
154
155

156
157
158

159
160
161
162
163
164
165
166
167
** send new chat message, delete older messages, or poll for changes.
*/
void chat_webpage(void){
  char *zAlert;
  char *zProjectName;
  char * zInputPlaceholder0;  /* Common text input placeholder value */
  const char *zPaperclip =
    "<svg height=\"7.9485579\" width=\"15.807422\"><path d=\"M "
    "15.74273,3.2321262 A 4.1,4.1 0 0 0 11.662725,6.483619e-4 "
    "H 2.8238895 A 2.79,2.79 0 0 0 0.68135588,0.95524256 2.84,2.84 "
    "0 0 0 0.03081756,3.2179844 2.73,2.73 0 0 0 0.80156396,4.7382639 "
    "3.13,3.13 0 0 0 2.993595,5.6292185 l 7.636753,-4e-7 a 1.66,1.66 "
    "0 0 0 0.0071,-3.3163305 H 5.5462506 v 1.0040916 l "
    "5.0840974,-0.00707 a 0.66,0.66 0 0 1 0,1.3152186 l "

    "-7.6296819,0.00707 A 2,2 0 0 1 1.0207671,3.076563 1.83,1.83 0 0 "
    "1 2.8168184,0.99766896 h 8.8388356 a 3.11,3.11 0 0 1 "
    "3.097127,2.41830494 3,3 0 0 1 -0.622254,2.4748737 3,3 0 0 1 "

    "-2.283955,1.0677313 l -7.4529056,-0.014142 -0.00707,0.9970211 "
    "7.4458346,0.0071 a 4,4 0 0 0 3.9103,-4.716402 z\" /></svg>";

  login_check_credentials();
  if( !g.perm.Chat ){
    login_needed(g.anon.Chat);
    return;
  }
  zAlert = mprintf("%s/builtin/%s", g.zBaseURL,
Changes to src/fossil.page.chat.js.
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
      }else if(!text){
        f.$toggleCompact(compactMode);
      }else{
        Chat.e.btnPreview.click();
      }
      return false;
    }
    if(ev.ctrlKey && !text){
      /* Ctrl-enter on an empty field toggles Enter/Ctrl-enter mode */
      ev.preventDefault();
      ev.stopPropagation();
      f.$toggleCtrl(ctrlMode);
      return false;
    }
    if(!ctrlMode && ev.ctrlKey && text){
      //console.debug("!ctrlMode && ev.ctrlKey && text.");







|
|







1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
      }else if(!text){
        f.$toggleCompact(compactMode);
      }else{
        Chat.e.btnPreview.click();
      }
      return false;
    }
    if(ev.ctrlKey && !text && !BlobXferState.blob){
      /* Ctrl-enter on empty input field(s) toggles Enter/Ctrl-enter mode */
      ev.preventDefault();
      ev.stopPropagation();
      f.$toggleCtrl(ctrlMode);
      return false;
    }
    if(!ctrlMode && ev.ctrlKey && text){
      //console.debug("!ctrlMode && ev.ctrlKey && text.");