Fossil SCM

Added option to render HTML previews inline, as opposed to in an iframe. Layout improvements in the preview/diff/commit tabs.

stephan 2020-05-05 22:18 fileedit-ajaxify
Commit bd81a5f60129963d6756613881904db7c45e045016bc4ee12d2abd26bc2d8c96
--- src/default_css.txt
+++ src/default_css.txt
@@ -989,10 +989,11 @@
989989
font-size: 175%;
990990
}
991991
.font-size-200 {
992992
font-size: 200%;
993993
}
994
+
994995
.tab-container {
995996
width: 100%;
996997
display: flex;
997998
flex-direction: column;
998999
align-items: stretch;
@@ -1029,6 +1030,42 @@
10291030
.tab-container > .tab-bar > button.selected {
10301031
font-style: italic;
10311032
font-weight: bold;
10321033
margin: 0 0.5em;
10331034
text-decoration: underline;
1035
+}
1036
+.tab-container > .tabs > .tab-panel > .fileedit-options {
1037
+ margin-top: 0;
1038
+ border: none;
1039
+ border-radius: 0;
1040
+ border-bottom-width: 1px;
1041
+ border-bottom-style: dotted;
1042
+}
1043
+.tab-container > .tabs > .tab-panel > .fileedit-options > button {
1044
+ vertical-align: middle;
1045
+ margin: 0.5em;
1046
+}
1047
+.flex-container {
1048
+ display: flex;
1049
+}
1050
+.flex-container.row {
1051
+ flex-direction: row;
1052
+ flex-wrap: wrap;
1053
+ justify-content: center;
1054
+ align-items: center;
1055
+}
1056
+.flex-container.row.stretch {
1057
+ flex-direction: row;
1058
+ flex-wrap: wrap;
1059
+ align-items: stretch;
1060
+ margin: 0;
1061
+}
1062
+.flex-container.column {
1063
+ flex-direction: column;
1064
+ flex-wrap: wrap;
1065
+ justify-content: center;
1066
+ align-items: center;
1067
+}
1068
+.flex-container.column.stretch {
1069
+ align-items: stretch;
1070
+ margin: 0;
10341071
}
10351072
--- src/default_css.txt
+++ src/default_css.txt
@@ -989,10 +989,11 @@
989 font-size: 175%;
990 }
991 .font-size-200 {
992 font-size: 200%;
993 }
 
994 .tab-container {
995 width: 100%;
996 display: flex;
997 flex-direction: column;
998 align-items: stretch;
@@ -1029,6 +1030,42 @@
1029 .tab-container > .tab-bar > button.selected {
1030 font-style: italic;
1031 font-weight: bold;
1032 margin: 0 0.5em;
1033 text-decoration: underline;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1034 }
1035
--- src/default_css.txt
+++ src/default_css.txt
@@ -989,10 +989,11 @@
989 font-size: 175%;
990 }
991 .font-size-200 {
992 font-size: 200%;
993 }
994
995 .tab-container {
996 width: 100%;
997 display: flex;
998 flex-direction: column;
999 align-items: stretch;
@@ -1029,6 +1030,42 @@
1030 .tab-container > .tab-bar > button.selected {
1031 font-style: italic;
1032 font-weight: bold;
1033 margin: 0 0.5em;
1034 text-decoration: underline;
1035 }
1036 .tab-container > .tabs > .tab-panel > .fileedit-options {
1037 margin-top: 0;
1038 border: none;
1039 border-radius: 0;
1040 border-bottom-width: 1px;
1041 border-bottom-style: dotted;
1042 }
1043 .tab-container > .tabs > .tab-panel > .fileedit-options > button {
1044 vertical-align: middle;
1045 margin: 0.5em;
1046 }
1047 .flex-container {
1048 display: flex;
1049 }
1050 .flex-container.row {
1051 flex-direction: row;
1052 flex-wrap: wrap;
1053 justify-content: center;
1054 align-items: center;
1055 }
1056 .flex-container.row.stretch {
1057 flex-direction: row;
1058 flex-wrap: wrap;
1059 align-items: stretch;
1060 margin: 0;
1061 }
1062 .flex-container.column {
1063 flex-direction: column;
1064 flex-wrap: wrap;
1065 justify-content: center;
1066 align-items: center;
1067 }
1068 .flex-container.column.stretch {
1069 align-items: stretch;
1070 margin: 0;
1071 }
1072
+25 -21
--- src/fileedit.c
+++ src/fileedit.c
@@ -906,19 +906,20 @@
906906
};
907907
enum fileedit_render_modes {
908908
/* GUESS must be 0. All others have unspecified values. */
909909
FE_RENDER_GUESS = 0,
910910
FE_RENDER_PLAIN_TEXT,
911
-FE_RENDER_HTML,
911
+FE_RENDER_HTML_IFRAME,
912
+FE_RENDER_HTML_INLINE,
912913
FE_RENDER_WIKI
913914
};
914915
915916
static int fileedit_render_mode_for_mimetype(const char * zMimetype){
916917
int rc = FE_RENDER_PLAIN_TEXT;
917918
if( zMimetype ){
918919
if( fossil_strcmp(zMimetype, "text/html")==0 ){
919
- rc = FE_RENDER_HTML;
920
+ rc = FE_RENDER_HTML_IFRAME;
920921
}else if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0
921922
|| fossil_strcmp(zMimetype, "text/x-markdown")==0 ){
922923
rc = FE_RENDER_WIKI;
923924
}
924925
}
@@ -936,20 +937,24 @@
936937
zMime = mimetype_from_name(zFilename);
937938
if(FE_RENDER_GUESS==renderMode){
938939
renderMode = fileedit_render_mode_for_mimetype(zMime);
939940
}
940941
switch(renderMode){
941
- case FE_RENDER_HTML:{
942
+ case FE_RENDER_HTML_IFRAME:{
942943
char * z64 = encode64(blob_str(pContent), blob_size(pContent));
943944
CX("<iframe width='100%%' frameborder='0' "
944945
"marginwidth='0' style='height:%dem' "
945946
"marginheight='0' sandbox='allow-same-origin' "
946947
"id='ifm1' src='data:text/html;base64,%z'"
947948
"></iframe>",
948949
nIframeHeightEm ? nIframeHeightEm : 40,
949950
z64);
950951
break;
952
+ }
953
+ case FE_RENDER_HTML_INLINE:{
954
+ CX("%b",pContent);
955
+ break;
951956
}
952957
case FE_RENDER_WIKI:
953958
wiki_render_by_mimetype(pContent, zMime);
954959
break;
955960
default:{
@@ -1590,14 +1595,11 @@
15901595
CX("<div id='fileedit-tab-preview' "
15911596
"data-tab-parent='fileedit-tabs' "
15921597
"data-tab-label='Preview'"
15931598
">");
15941599
1595
- CX("<fieldset class='fileedit-options'>"
1596
- "<legend>Preview...</legend><div>");
1597
-
1598
- CX("<div class='preview-controls'>");
1600
+ CX("<div class='fileedit-options flex-container row'>");
15991601
CX("<button>Refresh</button>");
16001602
/* Default preview rendering mode selection... */
16011603
previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime);
16021604
style_select_list_int("select-preview-mode",
16031605
"preview_render_mode",
@@ -1604,24 +1606,28 @@
16041606
"Preview Mode",
16051607
"Preview mode format.",
16061608
previewRenderMode,
16071609
"Guess", FE_RENDER_GUESS,
16081610
"Wiki/Markdown", FE_RENDER_WIKI,
1609
- "HTML (iframe)", FE_RENDER_HTML,
1611
+ "HTML (iframe)", FE_RENDER_HTML_IFRAME,
1612
+ "HTML (inline)", FE_RENDER_HTML_INLINE,
16101613
"Plain Text", FE_RENDER_PLAIN_TEXT,
16111614
NULL);
16121615
/*
1613
- ** Set up a JS-side mapping of the FE_RENDER_xyz values. This is
1616
+ ** Set up a JS-side mapping of the FE_RENDER_xyz values. This is
16141617
** used for dynamically toggling certain UI components on and off.
16151618
*/
16161619
blob_appendf(&endScript, "fossil.page.previewModes={"
16171620
"guess: %d, %d: 'guess', wiki: %d, %d: 'wiki',"
1618
- "html: %d, %d: 'html', text: %d, %d: 'text'"
1621
+ "htmlIframe: %d, %d: 'htmlIframe', "
1622
+ "htmlInline: %d, %d: 'htmlInline', "
1623
+ "text: %d, %d: 'text'"
16191624
"};\n",
16201625
FE_RENDER_GUESS, FE_RENDER_GUESS,
16211626
FE_RENDER_WIKI, FE_RENDER_WIKI,
1622
- FE_RENDER_HTML, FE_RENDER_HTML,
1627
+ FE_RENDER_HTML_IFRAME, FE_RENDER_HTML_IFRAME,
1628
+ FE_RENDER_HTML_INLINE, FE_RENDER_HTML_INLINE,
16231629
FE_RENDER_PLAIN_TEXT, FE_RENDER_PLAIN_TEXT);
16241630
/* Allow selection of HTML preview iframe height */
16251631
previewHtmlHeight = atoi(PD("preview_html_ems","0"));
16261632
if(!previewHtmlHeight){
16271633
previewHtmlHeight = 40;
@@ -1641,11 +1647,11 @@
16411647
"Add line numbers to plain-text previews?",
16421648
"1",
16431649
"If on, plain-text files (only) will get "
16441650
"line numbers added to the preview.",
16451651
P("preview_ln")!=0);
1646
- CX("</div></fieldset>"/*.fileedit-options*/);
1652
+ CX("</div>"/*.fileedit-options*/);
16471653
CX("<div id='fileedit-tab-preview-wrapper'></div>");
16481654
CX("</div>"/*#fileedit-tab-preview*/);
16491655
}
16501656
16511657
/****** Diff tab ******/
@@ -1652,18 +1658,20 @@
16521658
{
16531659
CX("<div id='fileedit-tab-diff' "
16541660
"data-tab-parent='fileedit-tabs' "
16551661
"data-tab-label='Diff'"
16561662
">");
1657
- CX("<div id='fileedit-tab-diff-buttons'>"
1663
+
1664
+ CX("<div class='fileedit-options flex-container row' "
1665
+ "id='fileedit-tab-diff-buttons'>"
16581666
"<button class='sbs'>Side-by-side</button>"
16591667
"<button class='unified'>Unified</button>"
16601668
"</div>");
16611669
CX("<div id='fileedit-tab-diff-wrapper'>"
16621670
"Diffs will be shown here."
16631671
"</div>");
1664
- CX("</div>");
1672
+ CX("</div>"/*#fileedit-tab-diff*/);
16651673
}
16661674
16671675
16681676
/****** Commit ******/
16691677
CX("<div id='fileedit-tab-commit' "
@@ -1671,15 +1679,11 @@
16711679
"data-tab-label='Commit'"
16721680
">");
16731681
16741682
{
16751683
/******* Flags/options *******/
1676
- CX("<fieldset class='fileedit-options'>"
1677
- "<legend>Options</legend><div>"
1678
- /* Chrome does not sanely lay out multiple
1679
- ** fieldset children after the <legend>, so
1680
- ** a containing div is necessary. */);
1684
+ CX("<div class='fileedit-options flex-container row'>");
16811685
style_labeled_checkbox("cb-dry-run",
16821686
"dry_run", "Dry-run?", "1",
16831687
"In dry-run mode, the Save button performs "
16841688
"all work needed for saving but then rolls "
16851689
"back the transaction, and thus does not "
@@ -1731,11 +1735,11 @@
17311735
100,
17321736
"100%", 100, "125%", 125,
17331737
"150%", 150, "175%", 175,
17341738
"200%", 200, NULL);
17351739
#endif
1736
- CX("</div></fieldset>"/*checkboxes*/);
1740
+ CX("</div>"/*checkboxes*/);
17371741
}
17381742
17391743
{ /******* Comment *******/
17401744
CX("<fieldset class='fileedit-options'>"
17411745
"<legend>Message (required)</legend><div>");
@@ -1750,11 +1754,11 @@
17501754
}
17511755
CX("</input>\n");
17521756
CX("<div class='fileedit-hint'>Comments use the Fossil wiki markup "
17531757
"syntax.</div>\n"/*TODO: select for fossil/md/plain text*/);
17541758
CX("</div></fieldset>\n"/*commit comment*/);
1755
- CX("<div>"
1759
+ CX("<div class='flex-container row'>"
17561760
"<button id='fileedit-btn-commit'>Commit</button>"
17571761
"</div>\n");
17581762
CX("<div id='fileedit-manifest'></div>\n");
17591763
}
17601764
17611765
--- src/fileedit.c
+++ src/fileedit.c
@@ -906,19 +906,20 @@
906 };
907 enum fileedit_render_modes {
908 /* GUESS must be 0. All others have unspecified values. */
909 FE_RENDER_GUESS = 0,
910 FE_RENDER_PLAIN_TEXT,
911 FE_RENDER_HTML,
 
912 FE_RENDER_WIKI
913 };
914
915 static int fileedit_render_mode_for_mimetype(const char * zMimetype){
916 int rc = FE_RENDER_PLAIN_TEXT;
917 if( zMimetype ){
918 if( fossil_strcmp(zMimetype, "text/html")==0 ){
919 rc = FE_RENDER_HTML;
920 }else if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0
921 || fossil_strcmp(zMimetype, "text/x-markdown")==0 ){
922 rc = FE_RENDER_WIKI;
923 }
924 }
@@ -936,20 +937,24 @@
936 zMime = mimetype_from_name(zFilename);
937 if(FE_RENDER_GUESS==renderMode){
938 renderMode = fileedit_render_mode_for_mimetype(zMime);
939 }
940 switch(renderMode){
941 case FE_RENDER_HTML:{
942 char * z64 = encode64(blob_str(pContent), blob_size(pContent));
943 CX("<iframe width='100%%' frameborder='0' "
944 "marginwidth='0' style='height:%dem' "
945 "marginheight='0' sandbox='allow-same-origin' "
946 "id='ifm1' src='data:text/html;base64,%z'"
947 "></iframe>",
948 nIframeHeightEm ? nIframeHeightEm : 40,
949 z64);
950 break;
 
 
 
 
951 }
952 case FE_RENDER_WIKI:
953 wiki_render_by_mimetype(pContent, zMime);
954 break;
955 default:{
@@ -1590,14 +1595,11 @@
1590 CX("<div id='fileedit-tab-preview' "
1591 "data-tab-parent='fileedit-tabs' "
1592 "data-tab-label='Preview'"
1593 ">");
1594
1595 CX("<fieldset class='fileedit-options'>"
1596 "<legend>Preview...</legend><div>");
1597
1598 CX("<div class='preview-controls'>");
1599 CX("<button>Refresh</button>");
1600 /* Default preview rendering mode selection... */
1601 previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime);
1602 style_select_list_int("select-preview-mode",
1603 "preview_render_mode",
@@ -1604,24 +1606,28 @@
1604 "Preview Mode",
1605 "Preview mode format.",
1606 previewRenderMode,
1607 "Guess", FE_RENDER_GUESS,
1608 "Wiki/Markdown", FE_RENDER_WIKI,
1609 "HTML (iframe)", FE_RENDER_HTML,
 
1610 "Plain Text", FE_RENDER_PLAIN_TEXT,
1611 NULL);
1612 /*
1613 ** Set up a JS-side mapping of the FE_RENDER_xyz values. This is
1614 ** used for dynamically toggling certain UI components on and off.
1615 */
1616 blob_appendf(&endScript, "fossil.page.previewModes={"
1617 "guess: %d, %d: 'guess', wiki: %d, %d: 'wiki',"
1618 "html: %d, %d: 'html', text: %d, %d: 'text'"
 
 
1619 "};\n",
1620 FE_RENDER_GUESS, FE_RENDER_GUESS,
1621 FE_RENDER_WIKI, FE_RENDER_WIKI,
1622 FE_RENDER_HTML, FE_RENDER_HTML,
 
1623 FE_RENDER_PLAIN_TEXT, FE_RENDER_PLAIN_TEXT);
1624 /* Allow selection of HTML preview iframe height */
1625 previewHtmlHeight = atoi(PD("preview_html_ems","0"));
1626 if(!previewHtmlHeight){
1627 previewHtmlHeight = 40;
@@ -1641,11 +1647,11 @@
1641 "Add line numbers to plain-text previews?",
1642 "1",
1643 "If on, plain-text files (only) will get "
1644 "line numbers added to the preview.",
1645 P("preview_ln")!=0);
1646 CX("</div></fieldset>"/*.fileedit-options*/);
1647 CX("<div id='fileedit-tab-preview-wrapper'></div>");
1648 CX("</div>"/*#fileedit-tab-preview*/);
1649 }
1650
1651 /****** Diff tab ******/
@@ -1652,18 +1658,20 @@
1652 {
1653 CX("<div id='fileedit-tab-diff' "
1654 "data-tab-parent='fileedit-tabs' "
1655 "data-tab-label='Diff'"
1656 ">");
1657 CX("<div id='fileedit-tab-diff-buttons'>"
 
 
1658 "<button class='sbs'>Side-by-side</button>"
1659 "<button class='unified'>Unified</button>"
1660 "</div>");
1661 CX("<div id='fileedit-tab-diff-wrapper'>"
1662 "Diffs will be shown here."
1663 "</div>");
1664 CX("</div>");
1665 }
1666
1667
1668 /****** Commit ******/
1669 CX("<div id='fileedit-tab-commit' "
@@ -1671,15 +1679,11 @@
1671 "data-tab-label='Commit'"
1672 ">");
1673
1674 {
1675 /******* Flags/options *******/
1676 CX("<fieldset class='fileedit-options'>"
1677 "<legend>Options</legend><div>"
1678 /* Chrome does not sanely lay out multiple
1679 ** fieldset children after the <legend>, so
1680 ** a containing div is necessary. */);
1681 style_labeled_checkbox("cb-dry-run",
1682 "dry_run", "Dry-run?", "1",
1683 "In dry-run mode, the Save button performs "
1684 "all work needed for saving but then rolls "
1685 "back the transaction, and thus does not "
@@ -1731,11 +1735,11 @@
1731 100,
1732 "100%", 100, "125%", 125,
1733 "150%", 150, "175%", 175,
1734 "200%", 200, NULL);
1735 #endif
1736 CX("</div></fieldset>"/*checkboxes*/);
1737 }
1738
1739 { /******* Comment *******/
1740 CX("<fieldset class='fileedit-options'>"
1741 "<legend>Message (required)</legend><div>");
@@ -1750,11 +1754,11 @@
1750 }
1751 CX("</input>\n");
1752 CX("<div class='fileedit-hint'>Comments use the Fossil wiki markup "
1753 "syntax.</div>\n"/*TODO: select for fossil/md/plain text*/);
1754 CX("</div></fieldset>\n"/*commit comment*/);
1755 CX("<div>"
1756 "<button id='fileedit-btn-commit'>Commit</button>"
1757 "</div>\n");
1758 CX("<div id='fileedit-manifest'></div>\n");
1759 }
1760
1761
--- src/fileedit.c
+++ src/fileedit.c
@@ -906,19 +906,20 @@
906 };
907 enum fileedit_render_modes {
908 /* GUESS must be 0. All others have unspecified values. */
909 FE_RENDER_GUESS = 0,
910 FE_RENDER_PLAIN_TEXT,
911 FE_RENDER_HTML_IFRAME,
912 FE_RENDER_HTML_INLINE,
913 FE_RENDER_WIKI
914 };
915
916 static int fileedit_render_mode_for_mimetype(const char * zMimetype){
917 int rc = FE_RENDER_PLAIN_TEXT;
918 if( zMimetype ){
919 if( fossil_strcmp(zMimetype, "text/html")==0 ){
920 rc = FE_RENDER_HTML_IFRAME;
921 }else if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0
922 || fossil_strcmp(zMimetype, "text/x-markdown")==0 ){
923 rc = FE_RENDER_WIKI;
924 }
925 }
@@ -936,20 +937,24 @@
937 zMime = mimetype_from_name(zFilename);
938 if(FE_RENDER_GUESS==renderMode){
939 renderMode = fileedit_render_mode_for_mimetype(zMime);
940 }
941 switch(renderMode){
942 case FE_RENDER_HTML_IFRAME:{
943 char * z64 = encode64(blob_str(pContent), blob_size(pContent));
944 CX("<iframe width='100%%' frameborder='0' "
945 "marginwidth='0' style='height:%dem' "
946 "marginheight='0' sandbox='allow-same-origin' "
947 "id='ifm1' src='data:text/html;base64,%z'"
948 "></iframe>",
949 nIframeHeightEm ? nIframeHeightEm : 40,
950 z64);
951 break;
952 }
953 case FE_RENDER_HTML_INLINE:{
954 CX("%b",pContent);
955 break;
956 }
957 case FE_RENDER_WIKI:
958 wiki_render_by_mimetype(pContent, zMime);
959 break;
960 default:{
@@ -1590,14 +1595,11 @@
1595 CX("<div id='fileedit-tab-preview' "
1596 "data-tab-parent='fileedit-tabs' "
1597 "data-tab-label='Preview'"
1598 ">");
1599
1600 CX("<div class='fileedit-options flex-container row'>");
 
 
 
1601 CX("<button>Refresh</button>");
1602 /* Default preview rendering mode selection... */
1603 previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime);
1604 style_select_list_int("select-preview-mode",
1605 "preview_render_mode",
@@ -1604,24 +1606,28 @@
1606 "Preview Mode",
1607 "Preview mode format.",
1608 previewRenderMode,
1609 "Guess", FE_RENDER_GUESS,
1610 "Wiki/Markdown", FE_RENDER_WIKI,
1611 "HTML (iframe)", FE_RENDER_HTML_IFRAME,
1612 "HTML (inline)", FE_RENDER_HTML_INLINE,
1613 "Plain Text", FE_RENDER_PLAIN_TEXT,
1614 NULL);
1615 /*
1616 ** Set up a JS-side mapping of the FE_RENDER_xyz values. This is
1617 ** used for dynamically toggling certain UI components on and off.
1618 */
1619 blob_appendf(&endScript, "fossil.page.previewModes={"
1620 "guess: %d, %d: 'guess', wiki: %d, %d: 'wiki',"
1621 "htmlIframe: %d, %d: 'htmlIframe', "
1622 "htmlInline: %d, %d: 'htmlInline', "
1623 "text: %d, %d: 'text'"
1624 "};\n",
1625 FE_RENDER_GUESS, FE_RENDER_GUESS,
1626 FE_RENDER_WIKI, FE_RENDER_WIKI,
1627 FE_RENDER_HTML_IFRAME, FE_RENDER_HTML_IFRAME,
1628 FE_RENDER_HTML_INLINE, FE_RENDER_HTML_INLINE,
1629 FE_RENDER_PLAIN_TEXT, FE_RENDER_PLAIN_TEXT);
1630 /* Allow selection of HTML preview iframe height */
1631 previewHtmlHeight = atoi(PD("preview_html_ems","0"));
1632 if(!previewHtmlHeight){
1633 previewHtmlHeight = 40;
@@ -1641,11 +1647,11 @@
1647 "Add line numbers to plain-text previews?",
1648 "1",
1649 "If on, plain-text files (only) will get "
1650 "line numbers added to the preview.",
1651 P("preview_ln")!=0);
1652 CX("</div>"/*.fileedit-options*/);
1653 CX("<div id='fileedit-tab-preview-wrapper'></div>");
1654 CX("</div>"/*#fileedit-tab-preview*/);
1655 }
1656
1657 /****** Diff tab ******/
@@ -1652,18 +1658,20 @@
1658 {
1659 CX("<div id='fileedit-tab-diff' "
1660 "data-tab-parent='fileedit-tabs' "
1661 "data-tab-label='Diff'"
1662 ">");
1663
1664 CX("<div class='fileedit-options flex-container row' "
1665 "id='fileedit-tab-diff-buttons'>"
1666 "<button class='sbs'>Side-by-side</button>"
1667 "<button class='unified'>Unified</button>"
1668 "</div>");
1669 CX("<div id='fileedit-tab-diff-wrapper'>"
1670 "Diffs will be shown here."
1671 "</div>");
1672 CX("</div>"/*#fileedit-tab-diff*/);
1673 }
1674
1675
1676 /****** Commit ******/
1677 CX("<div id='fileedit-tab-commit' "
@@ -1671,15 +1679,11 @@
1679 "data-tab-label='Commit'"
1680 ">");
1681
1682 {
1683 /******* Flags/options *******/
1684 CX("<div class='fileedit-options flex-container row'>");
 
 
 
 
1685 style_labeled_checkbox("cb-dry-run",
1686 "dry_run", "Dry-run?", "1",
1687 "In dry-run mode, the Save button performs "
1688 "all work needed for saving but then rolls "
1689 "back the transaction, and thus does not "
@@ -1731,11 +1735,11 @@
1735 100,
1736 "100%", 100, "125%", 125,
1737 "150%", 150, "175%", 175,
1738 "200%", 200, NULL);
1739 #endif
1740 CX("</div>"/*checkboxes*/);
1741 }
1742
1743 { /******* Comment *******/
1744 CX("<fieldset class='fileedit-options'>"
1745 "<legend>Message (required)</legend><div>");
@@ -1750,11 +1754,11 @@
1754 }
1755 CX("</input>\n");
1756 CX("<div class='fileedit-hint'>Comments use the Fossil wiki markup "
1757 "syntax.</div>\n"/*TODO: select for fossil/md/plain text*/);
1758 CX("</div></fieldset>\n"/*commit comment*/);
1759 CX("<div class='flex-container row'>"
1760 "<button id='fileedit-btn-commit'>Commit</button>"
1761 "</div>\n");
1762 CX("<div id='fileedit-manifest'></div>\n");
1763 }
1764
1765
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -83,14 +83,14 @@
8383
hide = [], unhide = [];
8484
if('guess'===name){
8585
unhide.push(P.e.cbLineNumbersWrap,
8686
P.e.selectHtmlEmsWrap);
8787
}else{
88
- if('text'!==name) hide.push(P.e.cbLineNumbersWrap);
89
- else unhide.push(P.e.cbLineNumbersWrap);
90
- if('html'!==name) hide.push(P.e.selectHtmlEmsWrap);
91
- else unhide.push(P.e.selectHtmlEmsWrap);
88
+ if('text'===name) unhide.push(P.e.cbLineNumbersWrap);
89
+ else hide.push(P.e.cbLineNumbersWrap);
90
+ if('htmlIframe'===name) unhide.push(P.e.selectHtmlEmsWrap);
91
+ else hide.push(P.e.selectHtmlEmsWrap);
9292
}
9393
hide.forEach((e)=>e.classList.add('hidden'));
9494
unhide.forEach((e)=>e.classList.remove('hidden'));
9595
}, false
9696
);
9797
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -83,14 +83,14 @@
83 hide = [], unhide = [];
84 if('guess'===name){
85 unhide.push(P.e.cbLineNumbersWrap,
86 P.e.selectHtmlEmsWrap);
87 }else{
88 if('text'!==name) hide.push(P.e.cbLineNumbersWrap);
89 else unhide.push(P.e.cbLineNumbersWrap);
90 if('html'!==name) hide.push(P.e.selectHtmlEmsWrap);
91 else unhide.push(P.e.selectHtmlEmsWrap);
92 }
93 hide.forEach((e)=>e.classList.add('hidden'));
94 unhide.forEach((e)=>e.classList.remove('hidden'));
95 }, false
96 );
97
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -83,14 +83,14 @@
83 hide = [], unhide = [];
84 if('guess'===name){
85 unhide.push(P.e.cbLineNumbersWrap,
86 P.e.selectHtmlEmsWrap);
87 }else{
88 if('text'===name) unhide.push(P.e.cbLineNumbersWrap);
89 else hide.push(P.e.cbLineNumbersWrap);
90 if('htmlIframe'===name) unhide.push(P.e.selectHtmlEmsWrap);
91 else hide.push(P.e.selectHtmlEmsWrap);
92 }
93 hide.forEach((e)=>e.classList.add('hidden'));
94 unhide.forEach((e)=>e.classList.remove('hidden'));
95 }, false
96 );
97

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button