Fossil SCM
Replace some hard-coded /chat-search styles with project-conventional CSS classes. Minor layout tweaks.
Commit
3b84b4f8c6de64cfc5cd0ff2cbdefe10357af1cf36ff558baaf6e68b006e6bf0
Parent
3bf2275393d213f…
2 files changed
+7
-14
+3
-1
+7
-14
| --- src/fossil.page.chatsearch.js | ||
| +++ src/fossil.page.chatsearch.js | ||
| @@ -251,14 +251,14 @@ | ||
| 251 | 251 | const zUpArrow = '\u25B2'; |
| 252 | 252 | const zDownArrow = '\u25BC'; |
| 253 | 253 | |
| 254 | 254 | const cf = function(o){ |
| 255 | 255 | |
| 256 | - /* iFirstInTable: | |
| 256 | + /* iFirstInTable: | |
| 257 | 257 | ** msgid of first row in chatfts table. |
| 258 | 258 | ** |
| 259 | - ** iLastInTable: | |
| 259 | + ** iLastInTable: | |
| 260 | 260 | ** msgid of last row in chatfts table. |
| 261 | 261 | ** |
| 262 | 262 | ** iPrevId: |
| 263 | 263 | ** msgid of message immediately above this spacer. Or 0 if this |
| 264 | 264 | ** spacer is above all results. |
| @@ -269,11 +269,11 @@ | ||
| 269 | 269 | ** |
| 270 | 270 | ** bIgnoreClick: |
| 271 | 271 | ** ignore any clicks if this is true. This is used to ensure there |
| 272 | 272 | ** is only ever one request belonging to this widget outstanding |
| 273 | 273 | ** at any time. |
| 274 | - */ | |
| 274 | + */ | |
| 275 | 275 | this.o = { |
| 276 | 276 | iFirstInTable: o.first, |
| 277 | 277 | iLastInTable: o.last, |
| 278 | 278 | iPrevId: o.previd, |
| 279 | 279 | iNextId: o.nextid, |
| @@ -297,15 +297,10 @@ | ||
| 297 | 297 | D.addClass(this.e.all, 'all'); |
| 298 | 298 | |
| 299 | 299 | D.append(this.e.buttons, this.e.up, this.e.down, this.e.all); |
| 300 | 300 | D.append(this.e.body, this.e.above, this.e.buttons, this.e.below); |
| 301 | 301 | |
| 302 | - this.e.up.style.float = 'left'; | |
| 303 | - this.e.down.style.float = 'left'; | |
| 304 | - this.e.all.style.float = 'left'; | |
| 305 | - this.e.below.style.clear = 'both'; | |
| 306 | - | |
| 307 | 302 | const ms = this; |
| 308 | 303 | this.e.up.addEventListener('click', function(){ |
| 309 | 304 | ms.load_messages(false); |
| 310 | 305 | }); |
| 311 | 306 | this.e.down.addEventListener('click', function(){ |
| @@ -324,28 +319,26 @@ | ||
| 324 | 319 | |
| 325 | 320 | var iPrevId = (o.iPrevId!=0) ? o.iPrevId : o.iFirstInTable-1; |
| 326 | 321 | var iNextId = (o.iNextId!=0) ? o.iNextId : o.iLastInTable+1; |
| 327 | 322 | var nDiff = (iNextId - iPrevId) - 1; |
| 328 | 323 | |
| 329 | - this.e.up.style.display = 'none'; | |
| 330 | - this.e.down.style.display = 'none'; | |
| 331 | - this.e.all.style.display = 'none'; | |
| 324 | + D.addClass([this.e.up, this.e.down, this.e.all], 'hidden'); | |
| 332 | 325 | |
| 333 | 326 | if( nDiff>0 ){ |
| 334 | 327 | |
| 335 | 328 | if( nDiff>nMsgContext && (o.iPrevId==0 || o.iNextId==0) ){ |
| 336 | 329 | nDiff = nMsgContext; |
| 337 | 330 | } |
| 338 | 331 | |
| 339 | 332 | if( nDiff<=nMsgContext && o.iPrevId!=0 && o.iNextId!=0 ){ |
| 340 | - this.e.all.style.display = 'block'; | |
| 333 | + D.removeClass(this.e.all, 'hidden'); | |
| 341 | 334 | this.e.all.innerText = ( |
| 342 | 335 | zUpArrow + " Load " + nDiff + " more " + zDownArrow |
| 343 | 336 | ); |
| 344 | 337 | }else{ |
| 345 | - if( o.iPrevId!=0 ) this.e.up.style.display = 'block'; | |
| 346 | - if( o.iNextId!=0 ) this.e.down.style.display = 'block'; | |
| 338 | + if( o.iPrevId!=0 ) D.removeClass(this.e.up, 'hidden'); | |
| 339 | + if( o.iNextId!=0 ) D.removeClass(this.e.down, 'hidden'); | |
| 347 | 340 | } |
| 348 | 341 | } |
| 349 | 342 | }, |
| 350 | 343 | |
| 351 | 344 | load_messages: function(bDown) { |
| 352 | 345 |
| --- src/fossil.page.chatsearch.js | |
| +++ src/fossil.page.chatsearch.js | |
| @@ -251,14 +251,14 @@ | |
| 251 | const zUpArrow = '\u25B2'; |
| 252 | const zDownArrow = '\u25BC'; |
| 253 | |
| 254 | const cf = function(o){ |
| 255 | |
| 256 | /* iFirstInTable: |
| 257 | ** msgid of first row in chatfts table. |
| 258 | ** |
| 259 | ** iLastInTable: |
| 260 | ** msgid of last row in chatfts table. |
| 261 | ** |
| 262 | ** iPrevId: |
| 263 | ** msgid of message immediately above this spacer. Or 0 if this |
| 264 | ** spacer is above all results. |
| @@ -269,11 +269,11 @@ | |
| 269 | ** |
| 270 | ** bIgnoreClick: |
| 271 | ** ignore any clicks if this is true. This is used to ensure there |
| 272 | ** is only ever one request belonging to this widget outstanding |
| 273 | ** at any time. |
| 274 | */ |
| 275 | this.o = { |
| 276 | iFirstInTable: o.first, |
| 277 | iLastInTable: o.last, |
| 278 | iPrevId: o.previd, |
| 279 | iNextId: o.nextid, |
| @@ -297,15 +297,10 @@ | |
| 297 | D.addClass(this.e.all, 'all'); |
| 298 | |
| 299 | D.append(this.e.buttons, this.e.up, this.e.down, this.e.all); |
| 300 | D.append(this.e.body, this.e.above, this.e.buttons, this.e.below); |
| 301 | |
| 302 | this.e.up.style.float = 'left'; |
| 303 | this.e.down.style.float = 'left'; |
| 304 | this.e.all.style.float = 'left'; |
| 305 | this.e.below.style.clear = 'both'; |
| 306 | |
| 307 | const ms = this; |
| 308 | this.e.up.addEventListener('click', function(){ |
| 309 | ms.load_messages(false); |
| 310 | }); |
| 311 | this.e.down.addEventListener('click', function(){ |
| @@ -324,28 +319,26 @@ | |
| 324 | |
| 325 | var iPrevId = (o.iPrevId!=0) ? o.iPrevId : o.iFirstInTable-1; |
| 326 | var iNextId = (o.iNextId!=0) ? o.iNextId : o.iLastInTable+1; |
| 327 | var nDiff = (iNextId - iPrevId) - 1; |
| 328 | |
| 329 | this.e.up.style.display = 'none'; |
| 330 | this.e.down.style.display = 'none'; |
| 331 | this.e.all.style.display = 'none'; |
| 332 | |
| 333 | if( nDiff>0 ){ |
| 334 | |
| 335 | if( nDiff>nMsgContext && (o.iPrevId==0 || o.iNextId==0) ){ |
| 336 | nDiff = nMsgContext; |
| 337 | } |
| 338 | |
| 339 | if( nDiff<=nMsgContext && o.iPrevId!=0 && o.iNextId!=0 ){ |
| 340 | this.e.all.style.display = 'block'; |
| 341 | this.e.all.innerText = ( |
| 342 | zUpArrow + " Load " + nDiff + " more " + zDownArrow |
| 343 | ); |
| 344 | }else{ |
| 345 | if( o.iPrevId!=0 ) this.e.up.style.display = 'block'; |
| 346 | if( o.iNextId!=0 ) this.e.down.style.display = 'block'; |
| 347 | } |
| 348 | } |
| 349 | }, |
| 350 | |
| 351 | load_messages: function(bDown) { |
| 352 |
| --- src/fossil.page.chatsearch.js | |
| +++ src/fossil.page.chatsearch.js | |
| @@ -251,14 +251,14 @@ | |
| 251 | const zUpArrow = '\u25B2'; |
| 252 | const zDownArrow = '\u25BC'; |
| 253 | |
| 254 | const cf = function(o){ |
| 255 | |
| 256 | /* iFirstInTable: |
| 257 | ** msgid of first row in chatfts table. |
| 258 | ** |
| 259 | ** iLastInTable: |
| 260 | ** msgid of last row in chatfts table. |
| 261 | ** |
| 262 | ** iPrevId: |
| 263 | ** msgid of message immediately above this spacer. Or 0 if this |
| 264 | ** spacer is above all results. |
| @@ -269,11 +269,11 @@ | |
| 269 | ** |
| 270 | ** bIgnoreClick: |
| 271 | ** ignore any clicks if this is true. This is used to ensure there |
| 272 | ** is only ever one request belonging to this widget outstanding |
| 273 | ** at any time. |
| 274 | */ |
| 275 | this.o = { |
| 276 | iFirstInTable: o.first, |
| 277 | iLastInTable: o.last, |
| 278 | iPrevId: o.previd, |
| 279 | iNextId: o.nextid, |
| @@ -297,15 +297,10 @@ | |
| 297 | D.addClass(this.e.all, 'all'); |
| 298 | |
| 299 | D.append(this.e.buttons, this.e.up, this.e.down, this.e.all); |
| 300 | D.append(this.e.body, this.e.above, this.e.buttons, this.e.below); |
| 301 | |
| 302 | const ms = this; |
| 303 | this.e.up.addEventListener('click', function(){ |
| 304 | ms.load_messages(false); |
| 305 | }); |
| 306 | this.e.down.addEventListener('click', function(){ |
| @@ -324,28 +319,26 @@ | |
| 319 | |
| 320 | var iPrevId = (o.iPrevId!=0) ? o.iPrevId : o.iFirstInTable-1; |
| 321 | var iNextId = (o.iNextId!=0) ? o.iNextId : o.iLastInTable+1; |
| 322 | var nDiff = (iNextId - iPrevId) - 1; |
| 323 | |
| 324 | D.addClass([this.e.up, this.e.down, this.e.all], 'hidden'); |
| 325 | |
| 326 | if( nDiff>0 ){ |
| 327 | |
| 328 | if( nDiff>nMsgContext && (o.iPrevId==0 || o.iNextId==0) ){ |
| 329 | nDiff = nMsgContext; |
| 330 | } |
| 331 | |
| 332 | if( nDiff<=nMsgContext && o.iPrevId!=0 && o.iNextId!=0 ){ |
| 333 | D.removeClass(this.e.all, 'hidden'); |
| 334 | this.e.all.innerText = ( |
| 335 | zUpArrow + " Load " + nDiff + " more " + zDownArrow |
| 336 | ); |
| 337 | }else{ |
| 338 | if( o.iPrevId!=0 ) D.removeClass(this.e.up, 'hidden'); |
| 339 | if( o.iNextId!=0 ) D.removeClass(this.e.down, 'hidden'); |
| 340 | } |
| 341 | } |
| 342 | }, |
| 343 | |
| 344 | load_messages: function(bDown) { |
| 345 |
+3
-1
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -627,18 +627,20 @@ | ||
| 627 | 627 | margin-top: 1em; |
| 628 | 628 | } |
| 629 | 629 | body.cpage-chat-search .spacer-widget button { |
| 630 | 630 | margin-left: 1ex; |
| 631 | 631 | margin-right: 1ex; |
| 632 | + display: block; | |
| 632 | 633 | } |
| 633 | 634 | |
| 634 | 635 | body.cpage-chat-search .spacer-widget-buttons .up { |
| 635 | - margin-top: -0.75em; | |
| 636 | + margin-top: -0.25em; | |
| 636 | 637 | margin-bottom: 1em; |
| 637 | 638 | } |
| 638 | 639 | body.cpage-chat-search .spacer-widget-buttons .down { |
| 639 | 640 | margin-top: 1em; |
| 641 | + margin-bottom: 0.5em; | |
| 640 | 642 | } |
| 641 | 643 | body.cpage-chat-search .spacer-widget-buttons .all { |
| 642 | 644 | margin-bottom: 0.75em; |
| 643 | 645 | } |
| 644 | 646 | |
| 645 | 647 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -627,18 +627,20 @@ | |
| 627 | margin-top: 1em; |
| 628 | } |
| 629 | body.cpage-chat-search .spacer-widget button { |
| 630 | margin-left: 1ex; |
| 631 | margin-right: 1ex; |
| 632 | } |
| 633 | |
| 634 | body.cpage-chat-search .spacer-widget-buttons .up { |
| 635 | margin-top: -0.75em; |
| 636 | margin-bottom: 1em; |
| 637 | } |
| 638 | body.cpage-chat-search .spacer-widget-buttons .down { |
| 639 | margin-top: 1em; |
| 640 | } |
| 641 | body.cpage-chat-search .spacer-widget-buttons .all { |
| 642 | margin-bottom: 0.75em; |
| 643 | } |
| 644 | |
| 645 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -627,18 +627,20 @@ | |
| 627 | margin-top: 1em; |
| 628 | } |
| 629 | body.cpage-chat-search .spacer-widget button { |
| 630 | margin-left: 1ex; |
| 631 | margin-right: 1ex; |
| 632 | display: block; |
| 633 | } |
| 634 | |
| 635 | body.cpage-chat-search .spacer-widget-buttons .up { |
| 636 | margin-top: -0.25em; |
| 637 | margin-bottom: 1em; |
| 638 | } |
| 639 | body.cpage-chat-search .spacer-widget-buttons .down { |
| 640 | margin-top: 1em; |
| 641 | margin-bottom: 0.5em; |
| 642 | } |
| 643 | body.cpage-chat-search .spacer-widget-buttons .all { |
| 644 | margin-bottom: 0.75em; |
| 645 | } |
| 646 | |
| 647 |