| ︙ | | | ︙ | |
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
|
"title='Status message area. Double-click to clear them.'>"
"Status messages will go here.</div>\n"
/* will be moved into the tab container via JS */);
/* Main tab container... */
CX("<div id='fileedit-tabs' class='tab-container'></div>");
/***** File/version info tab *****/
{
CX("<div id='fileedit-tab-fileselect' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='File Info & Selection'"
">");
CX("<fieldset id='file-version-details'>"
"<legend>File/Version</legend>"
"<div>No file loaded.</div>"
"</fieldset>");
CX("<h1>Select a file to edit:</h1>");
CX("<div id='fileedit-file-selector'></div>");
CX("</div>"/*#fileedit-tab-fileselect*/);
}
/******* Content tab *******/
{
CX("<div id='fileedit-tab-content' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='File Content'"
">");
CX("<div class='flex-container flex-row child-gap-small'>");
CX("<button class='fileedit-content-reload confirmer' "
"title='Reload the file from the server, discarding "
"any local edits. To help avoid accidental loss of "
"edits, it requires confirmation (a second click) within "
"a few seconds or it will not reload.'"
|
>
>
>
|
>
|
>
|
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
|
"title='Status message area. Double-click to clear them.'>"
"Status messages will go here.</div>\n"
/* will be moved into the tab container via JS */);
/* Main tab container... */
CX("<div id='fileedit-tabs' class='tab-container'></div>");
/* The .hidden class on the following tab elements is to help lessen
the FOUC effect of the tabs before JS re-assembles them. */
/***** File/version info tab *****/
{
CX("<div id='fileedit-tab-fileselect' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='File Info & Selection' "
"class='hidden'"
">");
CX("<fieldset id='file-version-details'>"
"<legend>File/Version</legend>"
"<div>No file loaded.</div>"
"</fieldset>");
CX("<h1>Select a file to edit:</h1>");
CX("<div id='fileedit-file-selector'></div>");
CX("</div>"/*#fileedit-tab-fileselect*/);
}
/******* Content tab *******/
{
CX("<div id='fileedit-tab-content' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='File Content' "
"class='hidden'"
">");
CX("<div class='flex-container flex-row child-gap-small'>");
CX("<button class='fileedit-content-reload confirmer' "
"title='Reload the file from the server, discarding "
"any local edits. To help avoid accidental loss of "
"edits, it requires confirmation (a second click) within "
"a few seconds or it will not reload.'"
|
| ︙ | | | ︙ | |
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
|
CX("</div>"/*#tab-file-content*/);
}
/****** Preview tab ******/
{
CX("<div id='fileedit-tab-preview' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Preview'"
">");
CX("<div class='fileedit-options flex-container flex-row'>");
CX("<button id='btn-preview-refresh' "
"data-f-preview-from='fileContent' "
/* ^^^ fossil.page[methodName]() OR text source elem ID,
** but we need a method in order to support clients swapping out
** the text editor with their own. */
|
|
>
|
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
|
CX("</div>"/*#tab-file-content*/);
}
/****** Preview tab ******/
{
CX("<div id='fileedit-tab-preview' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Preview' "
"class='hidden'"
">");
CX("<div class='fileedit-options flex-container flex-row'>");
CX("<button id='btn-preview-refresh' "
"data-f-preview-from='fileContent' "
/* ^^^ fossil.page[methodName]() OR text source elem ID,
** but we need a method in order to support clients swapping out
** the text editor with their own. */
|
| ︙ | | | ︙ | |
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
|
CX("</div>"/*#fileedit-tab-preview*/);
}
/****** Diff tab ******/
{
CX("<div id='fileedit-tab-diff' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Diff'"
">");
CX("<div class='fileedit-options flex-container flex-row' "
"id='fileedit-tab-diff-buttons'>");
CX("<button class='sbs'>Side-by-side</button>"
"<button class='unified'>Unified</button>");
if(0){
|
|
>
|
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
|
CX("</div>"/*#fileedit-tab-preview*/);
}
/****** Diff tab ******/
{
CX("<div id='fileedit-tab-diff' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Diff' "
"class='hidden'"
">");
CX("<div class='fileedit-options flex-container flex-row' "
"id='fileedit-tab-diff-buttons'>");
CX("<button class='sbs'>Side-by-side</button>"
"<button class='unified'>Unified</button>");
if(0){
|
| ︙ | | | ︙ | |
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
|
"</div>");
CX("</div>"/*#fileedit-tab-diff*/);
}
/****** Commit ******/
CX("<div id='fileedit-tab-commit' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Commit'"
">");
{
/******* Commit flags/options *******/
CX("<div class='fileedit-options flex-container flex-row'>");
style_labeled_checkbox("cb-dry-run",
"dry_run", "Dry-run?", "1",
0,
|
|
>
|
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
|
"</div>");
CX("</div>"/*#fileedit-tab-diff*/);
}
/****** Commit ******/
CX("<div id='fileedit-tab-commit' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Commit' "
"class='hidden'"
">");
{
/******* Commit flags/options *******/
CX("<div class='fileedit-options flex-container flex-row'>");
style_labeled_checkbox("cb-dry-run",
"dry_run", "Dry-run?", "1",
0,
|
| ︙ | | | ︙ | |
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
|
/* Manifest gets rendered here after a commit. */);
}
CX("</div>"/*#fileedit-tab-commit*/);
/****** Help/Tips ******/
CX("<div id='fileedit-tab-help' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Help'"
">");
{
CX("<h1>Help & Tips</h1>");
CX("<ul>");
CX("<li><strong>Only files matching the <code>fileedit-glob</code> "
"repository setting</strong> can be edited online. That setting "
"must be a comma- or newline-delimited list of glob patterns "
|
|
>
|
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
|
/* Manifest gets rendered here after a commit. */);
}
CX("</div>"/*#fileedit-tab-commit*/);
/****** Help/Tips ******/
CX("<div id='fileedit-tab-help' "
"data-tab-parent='fileedit-tabs' "
"data-tab-label='Help' "
"class='hidden'"
">");
{
CX("<h1>Help & Tips</h1>");
CX("<ul>");
CX("<li><strong>Only files matching the <code>fileedit-glob</code> "
"repository setting</strong> can be edited online. That setting "
"must be a comma- or newline-delimited list of glob patterns "
|
| ︙ | | | ︙ | |
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
|
blob_appendf(&endScript,"}");
}
blob_appendf(&endScript,");\n");
}
blob_reset(&err);
CheckinMiniInfo_cleanup(&cimi);
style_emit_script_fossil_bootstrap(0);
append_diff_javascript(1);
builtin_request_js("fossil.fetch.js");
builtin_request_js("fossil.dom.js");
builtin_request_js("fossil.tabs.js");
builtin_request_js("fossil.confirmer.js");
builtin_request_js("fossil.storage.js");
/*
** Set up a JS-side mapping of the AJAX_RENDER_xyz values. This is
** used for dynamically toggling certain UI components on and off.
** Must come before fossil.page.fileedit.js and after the fetches
** above.
*/
builtin_fulfill_js_requests();
ajax_emit_js_preview_modes(1);
builtin_request_js("fossil.page.fileedit.js");
if(blob_size(&endScript)>0){
style_emit_script_tag(0,0);
CX("\n(function(){\n");
CX("try{\n%b}\n"
"catch(e){"
"fossil.error(e); console.error('Exception:',e);"
"}\n",
|
|
<
<
|
<
|
|
|
>
|
>
|
<
<
>
|
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
|
blob_appendf(&endScript,"}");
}
blob_appendf(&endScript,");\n");
}
blob_reset(&err);
CheckinMiniInfo_cleanup(&cimi);
builtin_request_js("sbsdiff.js");
style_emit_fossil_js_apis(0, "fetch", "dom", "tabs", "confirmer",
"storage", 0);
builtin_fulfill_js_requests();
/*
** Set up a JS-side mapping of the AJAX_RENDER_xyz values. This is
** used for dynamically toggling certain UI components on and off.
** Must come after window.fossil has been intialized and before
** fossil.page.fileedit.js. Potential TODO: move this into the
** window.fossil bootstrapping so that we don't have to "fulfill"
** the JS multiple times.
*/
ajax_emit_js_preview_modes(1);
builtin_request_js("fossil.page.fileedit.js");
builtin_fulfill_js_requests();
if(blob_size(&endScript)>0){
style_emit_script_tag(0,0);
CX("\n(function(){\n");
CX("try{\n%b}\n"
"catch(e){"
"fossil.error(e); console.error('Exception:',e);"
"}\n",
|
| ︙ | | | ︙ | |