Fossil SCM
Ensure there's enough contrast to read the text when the mouse is dropping over the attachment widget. Experimentally relable the Remove button as X.
Commit
05865c2310b5d4866a96317b7e2dd546a6ad4cf056c84c6c0c1e1b9e819630f8
Parent
4a8a290676c9c14…
2 files changed
+2
+6
-5
+2
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -2058,10 +2058,11 @@ | ||
| 2058 | 2058 | body.fossil-dark-style .attach-widget .attach-dropzone.populated{ |
| 2059 | 2059 | background-color: initial; |
| 2060 | 2060 | } |
| 2061 | 2061 | .attach-widget .attach-dropzone.dragover { |
| 2062 | 2062 | background-color: #e1f5fe; |
| 2063 | + color: black; | |
| 2063 | 2064 | border-color: #03a9f4; |
| 2064 | 2065 | } |
| 2065 | 2066 | body.fossil-dark-style .attach-widget .attach-dropzone.dragover{ |
| 2066 | 2067 | border-color: #03a9f4; |
| 2067 | 2068 | } |
| @@ -2098,10 +2099,11 @@ | ||
| 2098 | 2099 | background-color: #d32f2f; |
| 2099 | 2100 | color: #fff; |
| 2100 | 2101 | border: none; |
| 2101 | 2102 | border-radius: 0.25em; |
| 2102 | 2103 | cursor: pointer; |
| 2104 | + font-weight: bold; | |
| 2103 | 2105 | } |
| 2104 | 2106 | .attach-widget .attach-row-remove:hover { |
| 2105 | 2107 | background-color: #b71c1c; |
| 2106 | 2108 | } |
| 2107 | 2109 | .attach-widget .attach-controls { |
| 2108 | 2110 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -2058,10 +2058,11 @@ | |
| 2058 | body.fossil-dark-style .attach-widget .attach-dropzone.populated{ |
| 2059 | background-color: initial; |
| 2060 | } |
| 2061 | .attach-widget .attach-dropzone.dragover { |
| 2062 | background-color: #e1f5fe; |
| 2063 | border-color: #03a9f4; |
| 2064 | } |
| 2065 | body.fossil-dark-style .attach-widget .attach-dropzone.dragover{ |
| 2066 | border-color: #03a9f4; |
| 2067 | } |
| @@ -2098,10 +2099,11 @@ | |
| 2098 | background-color: #d32f2f; |
| 2099 | color: #fff; |
| 2100 | border: none; |
| 2101 | border-radius: 0.25em; |
| 2102 | cursor: pointer; |
| 2103 | } |
| 2104 | .attach-widget .attach-row-remove:hover { |
| 2105 | background-color: #b71c1c; |
| 2106 | } |
| 2107 | .attach-widget .attach-controls { |
| 2108 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -2058,10 +2058,11 @@ | |
| 2058 | body.fossil-dark-style .attach-widget .attach-dropzone.populated{ |
| 2059 | background-color: initial; |
| 2060 | } |
| 2061 | .attach-widget .attach-dropzone.dragover { |
| 2062 | background-color: #e1f5fe; |
| 2063 | color: black; |
| 2064 | border-color: #03a9f4; |
| 2065 | } |
| 2066 | body.fossil-dark-style .attach-widget .attach-dropzone.dragover{ |
| 2067 | border-color: #03a9f4; |
| 2068 | } |
| @@ -2098,10 +2099,11 @@ | |
| 2099 | background-color: #d32f2f; |
| 2100 | color: #fff; |
| 2101 | border: none; |
| 2102 | border-radius: 0.25em; |
| 2103 | cursor: pointer; |
| 2104 | font-weight: bold; |
| 2105 | } |
| 2106 | .attach-widget .attach-row-remove:hover { |
| 2107 | background-color: #b71c1c; |
| 2108 | } |
| 2109 | .attach-widget .attach-controls { |
| 2110 |
+6
-5
| --- src/fossil.attach.js | ||
| +++ src/fossil.attach.js | ||
| @@ -34,12 +34,11 @@ | ||
| 34 | 34 | opt.limit: optional max number of attachments to allow. This |
| 35 | 35 | defaults to "some sensible value". |
| 36 | 36 | |
| 37 | 37 | opt.startWith[=0]: if >0 then that many file selection widgets |
| 38 | 38 | are automatically activated, as if the user had tapped the Add |
| 39 | - button that many times. As a special case, if this is >0 | |
| 40 | - and the user removes the last entry, a new one is added. | |
| 39 | + button that many times. | |
| 41 | 40 | |
| 42 | 41 | opt.description[=true]: if true then show the file description |
| 43 | 42 | field, otherwise elide it. |
| 44 | 43 | |
| 45 | 44 | opt.controls = [array of DOM elements]. Optional DOM elements |
| @@ -183,11 +182,12 @@ | ||
| 183 | 182 | row: rowObj, |
| 184 | 183 | attacher: this |
| 185 | 184 | }) |
| 186 | 185 | }) |
| 187 | 186 | ); |
| 188 | - if( 0===this.#rows.length | |
| 187 | + if( false /* arguable */ | |
| 188 | + && 0===this.#rows.length | |
| 189 | 189 | && this.#opt.startWith>0 ){ |
| 190 | 190 | /* Intended primarily for /addattach. */ |
| 191 | 191 | this.#addRow(); |
| 192 | 192 | } |
| 193 | 193 | } |
| @@ -249,11 +249,11 @@ | ||
| 249 | 249 | ); |
| 250 | 250 | const eInfo = D.addClass(D.span(), 'attach-row-info'); |
| 251 | 251 | const eFilename = D.append( |
| 252 | 252 | D.addClass(D.span(), 'attach-filename'), |
| 253 | 253 | "Select/drop file or click the outer border and tap your "+ |
| 254 | - "platform's conventional Paste keyboard shortcut." | |
| 254 | + "platform's conventional <paste> keyboard shortcut." | |
| 255 | 255 | ); |
| 256 | 256 | const eSize = D.addClass(D.span(), 'attach-size'); |
| 257 | 257 | eInfo.append(eFilename, eSize); |
| 258 | 258 | const eDesc = this.#opt.description |
| 259 | 259 | ? D.addClass( |
| @@ -261,16 +261,17 @@ | ||
| 261 | 261 | 'Optional description...'), |
| 262 | 262 | 'hidden', 'attach-desc' |
| 263 | 263 | ) |
| 264 | 264 | : undefined; |
| 265 | 265 | const eRemove = D.addClass( |
| 266 | - D.button('Remove', (ev)=>{ | |
| 266 | + D.button('X', (ev)=>{ | |
| 267 | 267 | ev.stopPropagation(); |
| 268 | 268 | this.#removeRow(rowObj); |
| 269 | 269 | }), |
| 270 | 270 | 'attach-row-remove' |
| 271 | 271 | ); |
| 272 | + eRemove.setAttribute('title', 'Remove this attachment.'); | |
| 272 | 273 | eRemove.type = 'button'; |
| 273 | 274 | |
| 274 | 275 | D.append(eDropzone, eInfo, eFile, eRemove); |
| 275 | 276 | eDropzone.addEventListener('click', ()=>eFile.click()); |
| 276 | 277 | eFile.addEventListener('change', (ev)=>{ |
| 277 | 278 |
| --- src/fossil.attach.js | |
| +++ src/fossil.attach.js | |
| @@ -34,12 +34,11 @@ | |
| 34 | opt.limit: optional max number of attachments to allow. This |
| 35 | defaults to "some sensible value". |
| 36 | |
| 37 | opt.startWith[=0]: if >0 then that many file selection widgets |
| 38 | are automatically activated, as if the user had tapped the Add |
| 39 | button that many times. As a special case, if this is >0 |
| 40 | and the user removes the last entry, a new one is added. |
| 41 | |
| 42 | opt.description[=true]: if true then show the file description |
| 43 | field, otherwise elide it. |
| 44 | |
| 45 | opt.controls = [array of DOM elements]. Optional DOM elements |
| @@ -183,11 +182,12 @@ | |
| 183 | row: rowObj, |
| 184 | attacher: this |
| 185 | }) |
| 186 | }) |
| 187 | ); |
| 188 | if( 0===this.#rows.length |
| 189 | && this.#opt.startWith>0 ){ |
| 190 | /* Intended primarily for /addattach. */ |
| 191 | this.#addRow(); |
| 192 | } |
| 193 | } |
| @@ -249,11 +249,11 @@ | |
| 249 | ); |
| 250 | const eInfo = D.addClass(D.span(), 'attach-row-info'); |
| 251 | const eFilename = D.append( |
| 252 | D.addClass(D.span(), 'attach-filename'), |
| 253 | "Select/drop file or click the outer border and tap your "+ |
| 254 | "platform's conventional Paste keyboard shortcut." |
| 255 | ); |
| 256 | const eSize = D.addClass(D.span(), 'attach-size'); |
| 257 | eInfo.append(eFilename, eSize); |
| 258 | const eDesc = this.#opt.description |
| 259 | ? D.addClass( |
| @@ -261,16 +261,17 @@ | |
| 261 | 'Optional description...'), |
| 262 | 'hidden', 'attach-desc' |
| 263 | ) |
| 264 | : undefined; |
| 265 | const eRemove = D.addClass( |
| 266 | D.button('Remove', (ev)=>{ |
| 267 | ev.stopPropagation(); |
| 268 | this.#removeRow(rowObj); |
| 269 | }), |
| 270 | 'attach-row-remove' |
| 271 | ); |
| 272 | eRemove.type = 'button'; |
| 273 | |
| 274 | D.append(eDropzone, eInfo, eFile, eRemove); |
| 275 | eDropzone.addEventListener('click', ()=>eFile.click()); |
| 276 | eFile.addEventListener('change', (ev)=>{ |
| 277 |
| --- src/fossil.attach.js | |
| +++ src/fossil.attach.js | |
| @@ -34,12 +34,11 @@ | |
| 34 | opt.limit: optional max number of attachments to allow. This |
| 35 | defaults to "some sensible value". |
| 36 | |
| 37 | opt.startWith[=0]: if >0 then that many file selection widgets |
| 38 | are automatically activated, as if the user had tapped the Add |
| 39 | button that many times. |
| 40 | |
| 41 | opt.description[=true]: if true then show the file description |
| 42 | field, otherwise elide it. |
| 43 | |
| 44 | opt.controls = [array of DOM elements]. Optional DOM elements |
| @@ -183,11 +182,12 @@ | |
| 182 | row: rowObj, |
| 183 | attacher: this |
| 184 | }) |
| 185 | }) |
| 186 | ); |
| 187 | if( false /* arguable */ |
| 188 | && 0===this.#rows.length |
| 189 | && this.#opt.startWith>0 ){ |
| 190 | /* Intended primarily for /addattach. */ |
| 191 | this.#addRow(); |
| 192 | } |
| 193 | } |
| @@ -249,11 +249,11 @@ | |
| 249 | ); |
| 250 | const eInfo = D.addClass(D.span(), 'attach-row-info'); |
| 251 | const eFilename = D.append( |
| 252 | D.addClass(D.span(), 'attach-filename'), |
| 253 | "Select/drop file or click the outer border and tap your "+ |
| 254 | "platform's conventional <paste> keyboard shortcut." |
| 255 | ); |
| 256 | const eSize = D.addClass(D.span(), 'attach-size'); |
| 257 | eInfo.append(eFilename, eSize); |
| 258 | const eDesc = this.#opt.description |
| 259 | ? D.addClass( |
| @@ -261,16 +261,17 @@ | |
| 261 | 'Optional description...'), |
| 262 | 'hidden', 'attach-desc' |
| 263 | ) |
| 264 | : undefined; |
| 265 | const eRemove = D.addClass( |
| 266 | D.button('X', (ev)=>{ |
| 267 | ev.stopPropagation(); |
| 268 | this.#removeRow(rowObj); |
| 269 | }), |
| 270 | 'attach-row-remove' |
| 271 | ); |
| 272 | eRemove.setAttribute('title', 'Remove this attachment.'); |
| 273 | eRemove.type = 'button'; |
| 274 | |
| 275 | D.append(eDropzone, eInfo, eFile, eRemove); |
| 276 | eDropzone.addEventListener('click', ()=>eFile.click()); |
| 277 | eFile.addEventListener('change', (ev)=>{ |
| 278 |