Fossil SCM
Several layout tweaks. The 'Prefer delta?' option is now checked by default if the repo contains any deltas and the forbid-delta-manifests setting is not true (that setting trumps this checkbox, in any case).
Commit
25f5f592d17569411c5dca976885156029df487d31c08f54ca5ad5006f9fbdb2
Parent
95f1753ffbbc087…
2 files changed
+7
-5
+29
-14
+7
-5
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -1836,31 +1836,30 @@ | ||
| 1836 | 1836 | /* Main tab container... */ |
| 1837 | 1837 | CX("<div id='fileedit-tabs' class='tab-container'></div>"); |
| 1838 | 1838 | |
| 1839 | 1839 | /***** File/version info tab *****/ |
| 1840 | 1840 | { |
| 1841 | - CX("<div id='fileedit-tab-version' " | |
| 1841 | + CX("<div id='fileedit-tab-fileselect' " | |
| 1842 | 1842 | "data-tab-parent='fileedit-tabs' " |
| 1843 | 1843 | "data-tab-label='File Info & Selection'" |
| 1844 | 1844 | ">"); |
| 1845 | 1845 | CX("<fieldset id='file-version-details'>" |
| 1846 | 1846 | "<legend>File/Version</legend>" |
| 1847 | 1847 | "<div>No file loaded.</div>" |
| 1848 | 1848 | "</fieldset>"); |
| 1849 | 1849 | CX("<h1>Select a file to edit:</h1>"); |
| 1850 | 1850 | CX("<div id='fileedit-file-selector'></div>"); |
| 1851 | - CX("</div>"/*#fileedit-tab-version*/); | |
| 1851 | + CX("</div>"/*#fileedit-tab-fileselect*/); | |
| 1852 | 1852 | } |
| 1853 | 1853 | |
| 1854 | 1854 | /******* Content tab *******/ |
| 1855 | 1855 | { |
| 1856 | 1856 | CX("<div id='fileedit-tab-content' " |
| 1857 | 1857 | "data-tab-parent='fileedit-tabs' " |
| 1858 | 1858 | "data-tab-label='File Content'" |
| 1859 | 1859 | ">"); |
| 1860 | - CX("<div class='fileedit-options " | |
| 1861 | - "flex-container flex-row child-gap-small'>"); | |
| 1860 | + CX("<div class='flex-container flex-row child-gap-small'>"); | |
| 1862 | 1861 | CX("<button class='fileedit-content-reload confirmer' " |
| 1863 | 1862 | "title='Reload the file from the server, discarding " |
| 1864 | 1863 | "any local edits. To help avoid accidental loss of " |
| 1865 | 1864 | "edits, it requires confirmation (a second click) within " |
| 1866 | 1865 | "a few seconds or it will not reload.'" |
| @@ -2028,11 +2027,14 @@ | ||
| 2028 | 2027 | "what appear to be fossil merge conflict " |
| 2029 | 2028 | "markers?"); |
| 2030 | 2029 | style_labeled_checkbox("cb-prefer-delta", |
| 2031 | 2030 | "prefer_delta", |
| 2032 | 2031 | "Prefer delta manifest?", "1", |
| 2033 | - cimi.flags & CIMINI_PREFER_DELTA, | |
| 2032 | + db_get_boolean("forbid-delta-manifests",0) | |
| 2033 | + ? 0 | |
| 2034 | + : (db_get_boolean("seen-delta-manifest",0) | |
| 2035 | + || cimi.flags & CIMINI_PREFER_DELTA), | |
| 2034 | 2036 | "Will create a delta manifest, instead of " |
| 2035 | 2037 | "baseline, if conditions are favorable to " |
| 2036 | 2038 | "do so. This option is only a suggestion."); |
| 2037 | 2039 | style_select_list_int("select-eol-style", |
| 2038 | 2040 | "eol", "EOL Style", |
| 2039 | 2041 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1836,31 +1836,30 @@ | |
| 1836 | /* Main tab container... */ |
| 1837 | CX("<div id='fileedit-tabs' class='tab-container'></div>"); |
| 1838 | |
| 1839 | /***** File/version info tab *****/ |
| 1840 | { |
| 1841 | CX("<div id='fileedit-tab-version' " |
| 1842 | "data-tab-parent='fileedit-tabs' " |
| 1843 | "data-tab-label='File Info & Selection'" |
| 1844 | ">"); |
| 1845 | CX("<fieldset id='file-version-details'>" |
| 1846 | "<legend>File/Version</legend>" |
| 1847 | "<div>No file loaded.</div>" |
| 1848 | "</fieldset>"); |
| 1849 | CX("<h1>Select a file to edit:</h1>"); |
| 1850 | CX("<div id='fileedit-file-selector'></div>"); |
| 1851 | CX("</div>"/*#fileedit-tab-version*/); |
| 1852 | } |
| 1853 | |
| 1854 | /******* Content tab *******/ |
| 1855 | { |
| 1856 | CX("<div id='fileedit-tab-content' " |
| 1857 | "data-tab-parent='fileedit-tabs' " |
| 1858 | "data-tab-label='File Content'" |
| 1859 | ">"); |
| 1860 | CX("<div class='fileedit-options " |
| 1861 | "flex-container flex-row child-gap-small'>"); |
| 1862 | CX("<button class='fileedit-content-reload confirmer' " |
| 1863 | "title='Reload the file from the server, discarding " |
| 1864 | "any local edits. To help avoid accidental loss of " |
| 1865 | "edits, it requires confirmation (a second click) within " |
| 1866 | "a few seconds or it will not reload.'" |
| @@ -2028,11 +2027,14 @@ | |
| 2028 | "what appear to be fossil merge conflict " |
| 2029 | "markers?"); |
| 2030 | style_labeled_checkbox("cb-prefer-delta", |
| 2031 | "prefer_delta", |
| 2032 | "Prefer delta manifest?", "1", |
| 2033 | cimi.flags & CIMINI_PREFER_DELTA, |
| 2034 | "Will create a delta manifest, instead of " |
| 2035 | "baseline, if conditions are favorable to " |
| 2036 | "do so. This option is only a suggestion."); |
| 2037 | style_select_list_int("select-eol-style", |
| 2038 | "eol", "EOL Style", |
| 2039 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1836,31 +1836,30 @@ | |
| 1836 | /* Main tab container... */ |
| 1837 | CX("<div id='fileedit-tabs' class='tab-container'></div>"); |
| 1838 | |
| 1839 | /***** File/version info tab *****/ |
| 1840 | { |
| 1841 | CX("<div id='fileedit-tab-fileselect' " |
| 1842 | "data-tab-parent='fileedit-tabs' " |
| 1843 | "data-tab-label='File Info & Selection'" |
| 1844 | ">"); |
| 1845 | CX("<fieldset id='file-version-details'>" |
| 1846 | "<legend>File/Version</legend>" |
| 1847 | "<div>No file loaded.</div>" |
| 1848 | "</fieldset>"); |
| 1849 | CX("<h1>Select a file to edit:</h1>"); |
| 1850 | CX("<div id='fileedit-file-selector'></div>"); |
| 1851 | CX("</div>"/*#fileedit-tab-fileselect*/); |
| 1852 | } |
| 1853 | |
| 1854 | /******* Content tab *******/ |
| 1855 | { |
| 1856 | CX("<div id='fileedit-tab-content' " |
| 1857 | "data-tab-parent='fileedit-tabs' " |
| 1858 | "data-tab-label='File Content'" |
| 1859 | ">"); |
| 1860 | CX("<div class='flex-container flex-row child-gap-small'>"); |
| 1861 | CX("<button class='fileedit-content-reload confirmer' " |
| 1862 | "title='Reload the file from the server, discarding " |
| 1863 | "any local edits. To help avoid accidental loss of " |
| 1864 | "edits, it requires confirmation (a second click) within " |
| 1865 | "a few seconds or it will not reload.'" |
| @@ -2028,11 +2027,14 @@ | |
| 2027 | "what appear to be fossil merge conflict " |
| 2028 | "markers?"); |
| 2029 | style_labeled_checkbox("cb-prefer-delta", |
| 2030 | "prefer_delta", |
| 2031 | "Prefer delta manifest?", "1", |
| 2032 | db_get_boolean("forbid-delta-manifests",0) |
| 2033 | ? 0 |
| 2034 | : (db_get_boolean("seen-delta-manifest",0) |
| 2035 | || cimi.flags & CIMINI_PREFER_DELTA), |
| 2036 | "Will create a delta manifest, instead of " |
| 2037 | "baseline, if conditions are favorable to " |
| 2038 | "do so. This option is only a suggestion."); |
| 2039 | style_select_list_int("select-eol-style", |
| 2040 | "eol", "EOL Style", |
| 2041 |
+29
-14
| --- src/fossil.page.fileedit.js | ||
| +++ src/fossil.page.fileedit.js | ||
| @@ -445,19 +445,17 @@ | ||
| 445 | 445 | Widget for listing and selecting $stash entries. |
| 446 | 446 | */ |
| 447 | 447 | P.stashWidget = { |
| 448 | 448 | e:{/*DOM element(s)*/}, |
| 449 | 449 | init: function(domInsertPoint/*insert widget BEFORE this element*/){ |
| 450 | - const flow = D.addClass(D.div(), 'flex-container','flex-column'); | |
| 451 | 450 | const wrapper = D.addClass( |
| 452 | 451 | D.attr(D.div(),'id','fileedit-stash-selector'), |
| 453 | 452 | 'input-with-label' |
| 454 | 453 | ); |
| 455 | 454 | const sel = this.e.select = D.select(); |
| 456 | 455 | const btnClear = this.e.btnClear |
| 457 | 456 | = D.addClass(D.button("Clear"),'hidden'); |
| 458 | - D.append(flow, wrapper); | |
| 459 | 457 | D.append(wrapper, "Local edits (", |
| 460 | 458 | D.append(D.code(), |
| 461 | 459 | F.storage.storageImplName()), |
| 462 | 460 | "):", |
| 463 | 461 | sel, btnClear); |
| @@ -477,18 +475,19 @@ | ||
| 477 | 475 | F.confirmer(btnClear, { |
| 478 | 476 | confirmText: "REALLY delete ALL local edits?", |
| 479 | 477 | onconfirm: (e)=>P.clearStash().loadFile(/*in case P.finfo() was in the stash*/), |
| 480 | 478 | ticks: 3 |
| 481 | 479 | }); |
| 482 | - if(F.storage.isTransient()){/*Warn if transient storage is in use...*/ | |
| 483 | - D.append(flow, D.append(D.addClass(D.div(),'warning'), | |
| 484 | - "Warning: persistent storage is not avaible, "+ | |
| 485 | - "so uncomitted edits will not survive a page reload.") | |
| 486 | - ); | |
| 487 | - } | |
| 488 | - domInsertPoint.parentNode.insertBefore(flow, domInsertPoint); | |
| 489 | - $stash._fireStashEvent(/*update this object with the load-time stash*/); | |
| 480 | + if(F.storage.isTransient()){/*Warn if our storage is particularly transient...*/ | |
| 481 | + D.append(wrapper, D.append( | |
| 482 | + D.addClass(D.span(),'warning'), | |
| 483 | + "Warning: persistent storage is not available, "+ | |
| 484 | + "so uncomitted edits will not survive a page reload." | |
| 485 | + )); | |
| 486 | + } | |
| 487 | + domInsertPoint.parentNode.insertBefore(wrapper, domInsertPoint); | |
| 488 | + $stash._fireStashEvent(/*read the page-load-time stash*/); | |
| 490 | 489 | delete this.init; |
| 491 | 490 | }, |
| 492 | 491 | /** |
| 493 | 492 | Regenerates the edit selection list. |
| 494 | 493 | */ |
| @@ -571,12 +570,11 @@ | ||
| 571 | 570 | taCommentSmall: E('#fileedit-comment'), |
| 572 | 571 | taCommentBig: E('#fileedit-comment-big'), |
| 573 | 572 | taComment: undefined/*gets set to one of taComment{Big,Small}*/, |
| 574 | 573 | ajaxContentTarget: E('#ajax-target'), |
| 575 | 574 | btnCommit: E("#fileedit-btn-commit"), |
| 576 | - btnReload: E("#fileedit-tab-content > .fileedit-options > " | |
| 577 | - +"button.fileedit-content-reload"), | |
| 575 | + btnReload: E("#fileedit-tab-content button.fileedit-content-reload"), | |
| 578 | 576 | selectPreviewMode: E('#select-preview-mode select'), |
| 579 | 577 | selectHtmlEmsWrap: E('#select-preview-html-ems'), |
| 580 | 578 | selectEolWrap: E('#select-eol-style'), |
| 581 | 579 | selectEol: E('#select-eol-style select[name=eol]'), |
| 582 | 580 | selectFontSizeWrap: E('#select-font-size'), |
| @@ -591,11 +589,12 @@ | ||
| 591 | 589 | fsFileVersionDetails: E('#file-version-details'), |
| 592 | 590 | tabs:{ |
| 593 | 591 | content: E('#fileedit-tab-content'), |
| 594 | 592 | preview: E('#fileedit-tab-preview'), |
| 595 | 593 | diff: E('#fileedit-tab-diff'), |
| 596 | - commit: E('#fileedit-tab-commit') | |
| 594 | + commit: E('#fileedit-tab-commit'), | |
| 595 | + fileSelect: E('#fileedit-tab-fileselect') | |
| 597 | 596 | } |
| 598 | 597 | }; |
| 599 | 598 | /* Figure out which comment editor to show by default and |
| 600 | 599 | hide the other one. By default we take the one which does |
| 601 | 600 | not have the 'hidden' CSS class. If neither do, we default |
| @@ -621,18 +620,31 @@ | ||
| 621 | 620 | /* Set up auto-refresh of the preview tab... */ |
| 622 | 621 | 'before-switch-to', function(ev){ |
| 623 | 622 | if(ev.detail===P.e.tabs.preview){ |
| 624 | 623 | P.baseHrefForFile(); |
| 625 | 624 | if(P.e.cbAutoPreview.checked) P.preview(); |
| 625 | + }else if(ev.detail===P.e.tabs.diff){ | |
| 626 | + /* Work around a weird bug where the page gets wider than | |
| 627 | + the window when the diff tab is NOT in view and the | |
| 628 | + current SBS diff widget is wider than the window. When | |
| 629 | + the diff IS in view then CSS overflow magically reduces | |
| 630 | + the page size again. Weird. Maybe FF-specific. Note that | |
| 631 | + this weirdness happens even though P.e.diffTarget's parent | |
| 632 | + is hidden (and therefore P.e.diffTarget is also hidden). | |
| 633 | + */ | |
| 634 | + D.removeClass(P.e.diffTarget, 'hidden'); | |
| 626 | 635 | } |
| 627 | 636 | } |
| 628 | 637 | ); |
| 629 | 638 | P.tabs.addEventListener( |
| 630 | 639 | /* Set up auto-refresh of the preview tab... */ |
| 631 | 640 | 'before-switch-from', function(ev){ |
| 632 | 641 | if(ev.detail===P.e.tabs.preview){ |
| 633 | 642 | P.baseHrefRestore(); |
| 643 | + }else if(ev.detail===P.e.tabs.diff){ | |
| 644 | + /* See notes in the before-switch-to handler. */ | |
| 645 | + D.addClass(P.e.diffTarget, 'hidden'); | |
| 634 | 646 | } |
| 635 | 647 | } |
| 636 | 648 | ); |
| 637 | 649 | |
| 638 | 650 | F.connectPagePreviewers( |
| @@ -722,11 +734,14 @@ | ||
| 722 | 734 | } |
| 723 | 735 | } |
| 724 | 736 | ); |
| 725 | 737 | |
| 726 | 738 | P.fileSelectWidget.init(); |
| 727 | - P.stashWidget.init(P.e.tabs.content.lastElementChild); | |
| 739 | + P.stashWidget.init( | |
| 740 | + P.e.tabs.content.lastElementChild | |
| 741 | + //P.e.tabs.fileSelect.querySelector("h1") | |
| 742 | + ); | |
| 728 | 743 | }/*F.onPageLoad()*/); |
| 729 | 744 | |
| 730 | 745 | /** |
| 731 | 746 | Getter (if called with no args) or setter (if passed an arg) for |
| 732 | 747 | the current file content. |
| 733 | 748 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -445,19 +445,17 @@ | |
| 445 | Widget for listing and selecting $stash entries. |
| 446 | */ |
| 447 | P.stashWidget = { |
| 448 | e:{/*DOM element(s)*/}, |
| 449 | init: function(domInsertPoint/*insert widget BEFORE this element*/){ |
| 450 | const flow = D.addClass(D.div(), 'flex-container','flex-column'); |
| 451 | const wrapper = D.addClass( |
| 452 | D.attr(D.div(),'id','fileedit-stash-selector'), |
| 453 | 'input-with-label' |
| 454 | ); |
| 455 | const sel = this.e.select = D.select(); |
| 456 | const btnClear = this.e.btnClear |
| 457 | = D.addClass(D.button("Clear"),'hidden'); |
| 458 | D.append(flow, wrapper); |
| 459 | D.append(wrapper, "Local edits (", |
| 460 | D.append(D.code(), |
| 461 | F.storage.storageImplName()), |
| 462 | "):", |
| 463 | sel, btnClear); |
| @@ -477,18 +475,19 @@ | |
| 477 | F.confirmer(btnClear, { |
| 478 | confirmText: "REALLY delete ALL local edits?", |
| 479 | onconfirm: (e)=>P.clearStash().loadFile(/*in case P.finfo() was in the stash*/), |
| 480 | ticks: 3 |
| 481 | }); |
| 482 | if(F.storage.isTransient()){/*Warn if transient storage is in use...*/ |
| 483 | D.append(flow, D.append(D.addClass(D.div(),'warning'), |
| 484 | "Warning: persistent storage is not avaible, "+ |
| 485 | "so uncomitted edits will not survive a page reload.") |
| 486 | ); |
| 487 | } |
| 488 | domInsertPoint.parentNode.insertBefore(flow, domInsertPoint); |
| 489 | $stash._fireStashEvent(/*update this object with the load-time stash*/); |
| 490 | delete this.init; |
| 491 | }, |
| 492 | /** |
| 493 | Regenerates the edit selection list. |
| 494 | */ |
| @@ -571,12 +570,11 @@ | |
| 571 | taCommentSmall: E('#fileedit-comment'), |
| 572 | taCommentBig: E('#fileedit-comment-big'), |
| 573 | taComment: undefined/*gets set to one of taComment{Big,Small}*/, |
| 574 | ajaxContentTarget: E('#ajax-target'), |
| 575 | btnCommit: E("#fileedit-btn-commit"), |
| 576 | btnReload: E("#fileedit-tab-content > .fileedit-options > " |
| 577 | +"button.fileedit-content-reload"), |
| 578 | selectPreviewMode: E('#select-preview-mode select'), |
| 579 | selectHtmlEmsWrap: E('#select-preview-html-ems'), |
| 580 | selectEolWrap: E('#select-eol-style'), |
| 581 | selectEol: E('#select-eol-style select[name=eol]'), |
| 582 | selectFontSizeWrap: E('#select-font-size'), |
| @@ -591,11 +589,12 @@ | |
| 591 | fsFileVersionDetails: E('#file-version-details'), |
| 592 | tabs:{ |
| 593 | content: E('#fileedit-tab-content'), |
| 594 | preview: E('#fileedit-tab-preview'), |
| 595 | diff: E('#fileedit-tab-diff'), |
| 596 | commit: E('#fileedit-tab-commit') |
| 597 | } |
| 598 | }; |
| 599 | /* Figure out which comment editor to show by default and |
| 600 | hide the other one. By default we take the one which does |
| 601 | not have the 'hidden' CSS class. If neither do, we default |
| @@ -621,18 +620,31 @@ | |
| 621 | /* Set up auto-refresh of the preview tab... */ |
| 622 | 'before-switch-to', function(ev){ |
| 623 | if(ev.detail===P.e.tabs.preview){ |
| 624 | P.baseHrefForFile(); |
| 625 | if(P.e.cbAutoPreview.checked) P.preview(); |
| 626 | } |
| 627 | } |
| 628 | ); |
| 629 | P.tabs.addEventListener( |
| 630 | /* Set up auto-refresh of the preview tab... */ |
| 631 | 'before-switch-from', function(ev){ |
| 632 | if(ev.detail===P.e.tabs.preview){ |
| 633 | P.baseHrefRestore(); |
| 634 | } |
| 635 | } |
| 636 | ); |
| 637 | |
| 638 | F.connectPagePreviewers( |
| @@ -722,11 +734,14 @@ | |
| 722 | } |
| 723 | } |
| 724 | ); |
| 725 | |
| 726 | P.fileSelectWidget.init(); |
| 727 | P.stashWidget.init(P.e.tabs.content.lastElementChild); |
| 728 | }/*F.onPageLoad()*/); |
| 729 | |
| 730 | /** |
| 731 | Getter (if called with no args) or setter (if passed an arg) for |
| 732 | the current file content. |
| 733 |
| --- src/fossil.page.fileedit.js | |
| +++ src/fossil.page.fileedit.js | |
| @@ -445,19 +445,17 @@ | |
| 445 | Widget for listing and selecting $stash entries. |
| 446 | */ |
| 447 | P.stashWidget = { |
| 448 | e:{/*DOM element(s)*/}, |
| 449 | init: function(domInsertPoint/*insert widget BEFORE this element*/){ |
| 450 | const wrapper = D.addClass( |
| 451 | D.attr(D.div(),'id','fileedit-stash-selector'), |
| 452 | 'input-with-label' |
| 453 | ); |
| 454 | const sel = this.e.select = D.select(); |
| 455 | const btnClear = this.e.btnClear |
| 456 | = D.addClass(D.button("Clear"),'hidden'); |
| 457 | D.append(wrapper, "Local edits (", |
| 458 | D.append(D.code(), |
| 459 | F.storage.storageImplName()), |
| 460 | "):", |
| 461 | sel, btnClear); |
| @@ -477,18 +475,19 @@ | |
| 475 | F.confirmer(btnClear, { |
| 476 | confirmText: "REALLY delete ALL local edits?", |
| 477 | onconfirm: (e)=>P.clearStash().loadFile(/*in case P.finfo() was in the stash*/), |
| 478 | ticks: 3 |
| 479 | }); |
| 480 | if(F.storage.isTransient()){/*Warn if our storage is particularly transient...*/ |
| 481 | D.append(wrapper, D.append( |
| 482 | D.addClass(D.span(),'warning'), |
| 483 | "Warning: persistent storage is not available, "+ |
| 484 | "so uncomitted edits will not survive a page reload." |
| 485 | )); |
| 486 | } |
| 487 | domInsertPoint.parentNode.insertBefore(wrapper, domInsertPoint); |
| 488 | $stash._fireStashEvent(/*read the page-load-time stash*/); |
| 489 | delete this.init; |
| 490 | }, |
| 491 | /** |
| 492 | Regenerates the edit selection list. |
| 493 | */ |
| @@ -571,12 +570,11 @@ | |
| 570 | taCommentSmall: E('#fileedit-comment'), |
| 571 | taCommentBig: E('#fileedit-comment-big'), |
| 572 | taComment: undefined/*gets set to one of taComment{Big,Small}*/, |
| 573 | ajaxContentTarget: E('#ajax-target'), |
| 574 | btnCommit: E("#fileedit-btn-commit"), |
| 575 | btnReload: E("#fileedit-tab-content button.fileedit-content-reload"), |
| 576 | selectPreviewMode: E('#select-preview-mode select'), |
| 577 | selectHtmlEmsWrap: E('#select-preview-html-ems'), |
| 578 | selectEolWrap: E('#select-eol-style'), |
| 579 | selectEol: E('#select-eol-style select[name=eol]'), |
| 580 | selectFontSizeWrap: E('#select-font-size'), |
| @@ -591,11 +589,12 @@ | |
| 589 | fsFileVersionDetails: E('#file-version-details'), |
| 590 | tabs:{ |
| 591 | content: E('#fileedit-tab-content'), |
| 592 | preview: E('#fileedit-tab-preview'), |
| 593 | diff: E('#fileedit-tab-diff'), |
| 594 | commit: E('#fileedit-tab-commit'), |
| 595 | fileSelect: E('#fileedit-tab-fileselect') |
| 596 | } |
| 597 | }; |
| 598 | /* Figure out which comment editor to show by default and |
| 599 | hide the other one. By default we take the one which does |
| 600 | not have the 'hidden' CSS class. If neither do, we default |
| @@ -621,18 +620,31 @@ | |
| 620 | /* Set up auto-refresh of the preview tab... */ |
| 621 | 'before-switch-to', function(ev){ |
| 622 | if(ev.detail===P.e.tabs.preview){ |
| 623 | P.baseHrefForFile(); |
| 624 | if(P.e.cbAutoPreview.checked) P.preview(); |
| 625 | }else if(ev.detail===P.e.tabs.diff){ |
| 626 | /* Work around a weird bug where the page gets wider than |
| 627 | the window when the diff tab is NOT in view and the |
| 628 | current SBS diff widget is wider than the window. When |
| 629 | the diff IS in view then CSS overflow magically reduces |
| 630 | the page size again. Weird. Maybe FF-specific. Note that |
| 631 | this weirdness happens even though P.e.diffTarget's parent |
| 632 | is hidden (and therefore P.e.diffTarget is also hidden). |
| 633 | */ |
| 634 | D.removeClass(P.e.diffTarget, 'hidden'); |
| 635 | } |
| 636 | } |
| 637 | ); |
| 638 | P.tabs.addEventListener( |
| 639 | /* Set up auto-refresh of the preview tab... */ |
| 640 | 'before-switch-from', function(ev){ |
| 641 | if(ev.detail===P.e.tabs.preview){ |
| 642 | P.baseHrefRestore(); |
| 643 | }else if(ev.detail===P.e.tabs.diff){ |
| 644 | /* See notes in the before-switch-to handler. */ |
| 645 | D.addClass(P.e.diffTarget, 'hidden'); |
| 646 | } |
| 647 | } |
| 648 | ); |
| 649 | |
| 650 | F.connectPagePreviewers( |
| @@ -722,11 +734,14 @@ | |
| 734 | } |
| 735 | } |
| 736 | ); |
| 737 | |
| 738 | P.fileSelectWidget.init(); |
| 739 | P.stashWidget.init( |
| 740 | P.e.tabs.content.lastElementChild |
| 741 | //P.e.tabs.fileSelect.querySelector("h1") |
| 742 | ); |
| 743 | }/*F.onPageLoad()*/); |
| 744 | |
| 745 | /** |
| 746 | Getter (if called with no args) or setter (if passed an arg) for |
| 747 | the current file content. |
| 748 |