Fossil SCM
Fixed multi-line commit comment (was not being submitted with commit) and change page title to reflect the file being edited, both per forum feedback.
Commit
ef2166a0ac4cb33527722813818dcc5da8f76085a5729ec8a7cc5b8d64529988
Parent
4818e7fdacc0c35…
2 files changed
+10
+13
-7
+10
| --- src/fossil.bootstrap.js | ||
| +++ src/fossil.bootstrap.js | ||
| @@ -316,7 +316,17 @@ | ||
| 316 | 316 | console.error(eventName,"event listener threw:",e); |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | return this; |
| 320 | 320 | }; |
| 321 | + | |
| 322 | + /** | |
| 323 | + Sets the innerText of the page's TITLE tag to | |
| 324 | + the given text and returns this object. | |
| 325 | + */ | |
| 326 | + F.page.setPageTitle = function(title){ | |
| 327 | + const t = document.querySelector('title'); | |
| 328 | + if(t) t.innerText = title; | |
| 329 | + return this; | |
| 330 | + }; | |
| 321 | 331 | |
| 322 | 332 | })(window); |
| 323 | 333 |
| --- src/fossil.bootstrap.js | |
| +++ src/fossil.bootstrap.js | |
| @@ -316,7 +316,17 @@ | |
| 316 | console.error(eventName,"event listener threw:",e); |
| 317 | } |
| 318 | } |
| 319 | return this; |
| 320 | }; |
| 321 | |
| 322 | })(window); |
| 323 |
| --- src/fossil.bootstrap.js | |
| +++ src/fossil.bootstrap.js | |
| @@ -316,7 +316,17 @@ | |
| 316 | console.error(eventName,"event listener threw:",e); |
| 317 | } |
| 318 | } |
| 319 | return this; |
| 320 | }; |
| 321 | |
| 322 | /** |
| 323 | Sets the innerText of the page's TITLE tag to |
| 324 | the given text and returns this object. |
| 325 | */ |
| 326 | F.page.setPageTitle = function(title){ |
| 327 | const t = document.querySelector('title'); |
| 328 | if(t) t.innerText = title; |
| 329 | return this; |
| 330 | }; |
| 331 | |
| 332 | })(window); |
| 333 |
+13
-7
| --- src/fossil.page.fileedit.js | ||
| +++ src/fossil.page.fileedit.js | ||
| @@ -468,11 +468,11 @@ | ||
| 468 | 468 | */ |
| 469 | 469 | const affirmHasFile = function(){ |
| 470 | 470 | if(!P.finfo) F.error("No file is loaded."); |
| 471 | 471 | return !!P.finfo; |
| 472 | 472 | }; |
| 473 | - | |
| 473 | + | |
| 474 | 474 | /** |
| 475 | 475 | updateVersion() updates the filename and version in various UI |
| 476 | 476 | elements... |
| 477 | 477 | |
| 478 | 478 | Returns this object. |
| @@ -482,10 +482,12 @@ | ||
| 482 | 482 | this.finfo = arguments[0]; |
| 483 | 483 | file = this.finfo.filename; |
| 484 | 484 | rev = this.finfo.checkin; |
| 485 | 485 | }else if(0===arguments.length){ |
| 486 | 486 | if(!affirmHasFile()) return this; |
| 487 | + file = this.finfo.filename; | |
| 488 | + rev = this.finfo.checkin; | |
| 487 | 489 | }else{ |
| 488 | 490 | this.finfo = {filename:file,checkin:rev}; |
| 489 | 491 | } |
| 490 | 492 | const eTgt = this.e.fsFileVersionDetails.querySelector('div'), |
| 491 | 493 | rHuman = F.hashDigits(rev), |
| @@ -514,10 +516,11 @@ | ||
| 514 | 516 | },false,true); |
| 515 | 517 | const purl = F.repoUrl('fileedit',purlArgs); |
| 516 | 518 | D.append( |
| 517 | 519 | eTgt,"[",D.a(purl,"Editor permalink"),"]" |
| 518 | 520 | ); |
| 521 | + this.setPageTitle("Edit: "+this.finfo.filename); | |
| 519 | 522 | return this; |
| 520 | 523 | }; |
| 521 | 524 | |
| 522 | 525 | /** |
| 523 | 526 | Removes the default editor widget (and any dependent elements) |
| @@ -728,16 +731,19 @@ | ||
| 728 | 731 | fd.append('checkin', this.finfo.checkin); |
| 729 | 732 | fd.append('content',content); |
| 730 | 733 | fd.append('dry_run',isDryRun ? 1 : 0); |
| 731 | 734 | fd.append('eol', this.e.selectEol.value || 0); |
| 732 | 735 | /* Text fields or select lists... */ |
| 733 | - ['comment_mimetype', | |
| 734 | - 'comment' | |
| 735 | - ].forEach(function(name){ | |
| 736 | - var e = E('[name='+name+']'); | |
| 737 | - if(e) fd.append(name,e.value); | |
| 738 | - }); | |
| 736 | + fd.append('comment', this.e.taComment.value); | |
| 737 | + if(0){ | |
| 738 | + // Comment mimetype is currently not supported by the UI... | |
| 739 | + ['comment_mimetype' | |
| 740 | + ].forEach(function(name){ | |
| 741 | + var e = E('[name='+name+']'); | |
| 742 | + if(e) fd.append(name,e.value); | |
| 743 | + }); | |
| 744 | + } | |
| 739 | 745 | /* Checkboxes: */ |
| 740 | 746 | ['allow_fork', |
| 741 | 747 | 'allow_older', |
| 742 | 748 | 'exec_bit', |
| 743 | 749 | 'allow_merge_conflict', |
| 744 | 750 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | const affirmHasFile = function(){ |
| 470 | if(!P.finfo) F.error("No file is loaded."); |
| 471 | return !!P.finfo; |
| 472 | }; |
| 473 | |
| 474 | /** |
| 475 | updateVersion() updates the filename and version in various UI |
| 476 | elements... |
| 477 | |
| 478 | Returns this object. |
| @@ -482,10 +482,12 @@ | |
| 482 | this.finfo = arguments[0]; |
| 483 | file = this.finfo.filename; |
| 484 | rev = this.finfo.checkin; |
| 485 | }else if(0===arguments.length){ |
| 486 | if(!affirmHasFile()) return this; |
| 487 | }else{ |
| 488 | this.finfo = {filename:file,checkin:rev}; |
| 489 | } |
| 490 | const eTgt = this.e.fsFileVersionDetails.querySelector('div'), |
| 491 | rHuman = F.hashDigits(rev), |
| @@ -514,10 +516,11 @@ | |
| 514 | },false,true); |
| 515 | const purl = F.repoUrl('fileedit',purlArgs); |
| 516 | D.append( |
| 517 | eTgt,"[",D.a(purl,"Editor permalink"),"]" |
| 518 | ); |
| 519 | return this; |
| 520 | }; |
| 521 | |
| 522 | /** |
| 523 | Removes the default editor widget (and any dependent elements) |
| @@ -728,16 +731,19 @@ | |
| 728 | fd.append('checkin', this.finfo.checkin); |
| 729 | fd.append('content',content); |
| 730 | fd.append('dry_run',isDryRun ? 1 : 0); |
| 731 | fd.append('eol', this.e.selectEol.value || 0); |
| 732 | /* Text fields or select lists... */ |
| 733 | ['comment_mimetype', |
| 734 | 'comment' |
| 735 | ].forEach(function(name){ |
| 736 | var e = E('[name='+name+']'); |
| 737 | if(e) fd.append(name,e.value); |
| 738 | }); |
| 739 | /* Checkboxes: */ |
| 740 | ['allow_fork', |
| 741 | 'allow_older', |
| 742 | 'exec_bit', |
| 743 | 'allow_merge_conflict', |
| 744 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | const affirmHasFile = function(){ |
| 470 | if(!P.finfo) F.error("No file is loaded."); |
| 471 | return !!P.finfo; |
| 472 | }; |
| 473 | |
| 474 | /** |
| 475 | updateVersion() updates the filename and version in various UI |
| 476 | elements... |
| 477 | |
| 478 | Returns this object. |
| @@ -482,10 +482,12 @@ | |
| 482 | this.finfo = arguments[0]; |
| 483 | file = this.finfo.filename; |
| 484 | rev = this.finfo.checkin; |
| 485 | }else if(0===arguments.length){ |
| 486 | if(!affirmHasFile()) return this; |
| 487 | file = this.finfo.filename; |
| 488 | rev = this.finfo.checkin; |
| 489 | }else{ |
| 490 | this.finfo = {filename:file,checkin:rev}; |
| 491 | } |
| 492 | const eTgt = this.e.fsFileVersionDetails.querySelector('div'), |
| 493 | rHuman = F.hashDigits(rev), |
| @@ -514,10 +516,11 @@ | |
| 516 | },false,true); |
| 517 | const purl = F.repoUrl('fileedit',purlArgs); |
| 518 | D.append( |
| 519 | eTgt,"[",D.a(purl,"Editor permalink"),"]" |
| 520 | ); |
| 521 | this.setPageTitle("Edit: "+this.finfo.filename); |
| 522 | return this; |
| 523 | }; |
| 524 | |
| 525 | /** |
| 526 | Removes the default editor widget (and any dependent elements) |
| @@ -728,16 +731,19 @@ | |
| 731 | fd.append('checkin', this.finfo.checkin); |
| 732 | fd.append('content',content); |
| 733 | fd.append('dry_run',isDryRun ? 1 : 0); |
| 734 | fd.append('eol', this.e.selectEol.value || 0); |
| 735 | /* Text fields or select lists... */ |
| 736 | fd.append('comment', this.e.taComment.value); |
| 737 | if(0){ |
| 738 | // Comment mimetype is currently not supported by the UI... |
| 739 | ['comment_mimetype' |
| 740 | ].forEach(function(name){ |
| 741 | var e = E('[name='+name+']'); |
| 742 | if(e) fd.append(name,e.value); |
| 743 | }); |
| 744 | } |
| 745 | /* Checkboxes: */ |
| 746 | ['allow_fork', |
| 747 | 'allow_older', |
| 748 | 'exec_bit', |
| 749 | 'allow_merge_conflict', |
| 750 |