Fossil SCM

More style tweaks.

stephan 2020-05-17 06:09 fileedit-ajaxify
Commit 0209fa3277f0e135c6be02161b7474a12a6e7bf12f22630439bed0a52eb5aab8
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1075,10 +1075,29 @@
10751075
callback("Error fetching preview: "+e);
10761076
}
10771077
});
10781078
return this;
10791079
};
1080
+
1081
+ /**
1082
+ Undo some of the SBS diff-rendering bits which hurt us more than
1083
+ they help...
1084
+ */
1085
+ P.tweakSbsDiffs2 = function(){
1086
+ if(1){
1087
+ const dt = this.e.diffTarget;
1088
+ dt.querySelectorAll('.sbsdiffcols .difftxtcol').forEach(
1089
+ (dtc)=>{
1090
+ const pre = dtc.querySelector('pre');
1091
+ pre.style.width = 'initial';
1092
+ //pre.removeAttribute('style');
1093
+ //console.debug("pre width =",pre.style.width);
1094
+ }
1095
+ );
1096
+ }
1097
+ this.tweakSbsDiffs();
1098
+ };
10801099
10811100
/**
10821101
Fetches the content diff based on the contents and settings of
10831102
this page's input fields, and updates the UI with the diff view.
10841103
@@ -1104,11 +1123,11 @@
11041123
"<div>Diff <code>[",
11051124
self.finfo.checkin,
11061125
"]</code> &rarr; Local Edits</div>",
11071126
c||'No changes.'
11081127
].join('');
1109
- if(sbs) P.tweakSbsDiffs();
1128
+ if(sbs) P.tweakSbsDiffs2();
11101129
F.message('Updated diff.');
11111130
self.tabs.switchToTab(self.e.tabs.diff);
11121131
}
11131132
});
11141133
return this;
11151134
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1075,10 +1075,29 @@
1075 callback("Error fetching preview: "+e);
1076 }
1077 });
1078 return this;
1079 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1080
1081 /**
1082 Fetches the content diff based on the contents and settings of
1083 this page's input fields, and updates the UI with the diff view.
1084
@@ -1104,11 +1123,11 @@
1104 "<div>Diff <code>[",
1105 self.finfo.checkin,
1106 "]</code> &rarr; Local Edits</div>",
1107 c||'No changes.'
1108 ].join('');
1109 if(sbs) P.tweakSbsDiffs();
1110 F.message('Updated diff.');
1111 self.tabs.switchToTab(self.e.tabs.diff);
1112 }
1113 });
1114 return this;
1115
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -1075,10 +1075,29 @@
1075 callback("Error fetching preview: "+e);
1076 }
1077 });
1078 return this;
1079 };
1080
1081 /**
1082 Undo some of the SBS diff-rendering bits which hurt us more than
1083 they help...
1084 */
1085 P.tweakSbsDiffs2 = function(){
1086 if(1){
1087 const dt = this.e.diffTarget;
1088 dt.querySelectorAll('.sbsdiffcols .difftxtcol').forEach(
1089 (dtc)=>{
1090 const pre = dtc.querySelector('pre');
1091 pre.style.width = 'initial';
1092 //pre.removeAttribute('style');
1093 //console.debug("pre width =",pre.style.width);
1094 }
1095 );
1096 }
1097 this.tweakSbsDiffs();
1098 };
1099
1100 /**
1101 Fetches the content diff based on the contents and settings of
1102 this page's input fields, and updates the UI with the diff view.
1103
@@ -1104,11 +1123,11 @@
1123 "<div>Diff <code>[",
1124 self.finfo.checkin,
1125 "]</code> &rarr; Local Edits</div>",
1126 c||'No changes.'
1127 ].join('');
1128 if(sbs) P.tweakSbsDiffs2();
1129 F.message('Updated diff.');
1130 self.tabs.switchToTab(self.e.tabs.diff);
1131 }
1132 });
1133 return this;
1134
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -61,14 +61,12 @@
6161
}
6262
body.fileedit div.fileedit-preview {
6363
margin: 0;
6464
padding: 0;
6565
}
66
-body.fileedit #fileedit-tab-diff-wrapper {
67
- margin: 0;
68
- padding: 0;
69
- overflow: auto;
66
+body.fileedit #fileedit-tabs {
67
+ margin: 1em 0 0 0;
7068
}
7169
body.fileedit #fileedit-tab-preview-wrapper {
7270
overflow: auto;
7371
}
7472
body.fileedit .fileedit-options.commit-message > div {
@@ -152,10 +150,36 @@
152150
flex: 10 1 auto;
153151
}
154152
body.fileedit .tab-container > .tabs > .tab-panel {
155153
display: flex;
156154
flex-direction: column;
155
+}
156
+body.fileedit #fileedit-tab-diff-wrapper {
157
+ margin: 0;
158
+ padding: 0;
159
+ overflow: auto;
160
+ display: flex;
161
+ flex-direction: column;
162
+ align-items: stretch;
163
+}
164
+body.fileedit #fileedit-tab-diff-wrapper > div {
165
+ margin: 0.5em 0 0.5em 0;
166
+}
167
+body.fileedit table.sbsdiffcols {
168
+ /*width: initial;*/
169
+}
170
+body.fileedit #fileedit-tab-diff-wrapper > pre.udiff {
171
+ margin-top: 0;
172
+}
173
+body.fileedit .sbsdiffcols div.difftxtcol {
174
+ display: flex;
175
+ flex-direction: column;
176
+ align-items: stretch;
177
+ width: initial;
178
+}
179
+body.fileedit .sbsdiffcols div.difftxtcol pre {
180
+ max-width: 44em;
157181
}
158182
159183
/**
160184
Styles for fossil.tabs.js. As of this writing, currently
161185
only used by /fileedit, but it is anticipated that these
162186
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -61,14 +61,12 @@
61 }
62 body.fileedit div.fileedit-preview {
63 margin: 0;
64 padding: 0;
65 }
66 body.fileedit #fileedit-tab-diff-wrapper {
67 margin: 0;
68 padding: 0;
69 overflow: auto;
70 }
71 body.fileedit #fileedit-tab-preview-wrapper {
72 overflow: auto;
73 }
74 body.fileedit .fileedit-options.commit-message > div {
@@ -152,10 +150,36 @@
152 flex: 10 1 auto;
153 }
154 body.fileedit .tab-container > .tabs > .tab-panel {
155 display: flex;
156 flex-direction: column;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157 }
158
159 /**
160 Styles for fossil.tabs.js. As of this writing, currently
161 only used by /fileedit, but it is anticipated that these
162
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -61,14 +61,12 @@
61 }
62 body.fileedit div.fileedit-preview {
63 margin: 0;
64 padding: 0;
65 }
66 body.fileedit #fileedit-tabs {
67 margin: 1em 0 0 0;
 
 
68 }
69 body.fileedit #fileedit-tab-preview-wrapper {
70 overflow: auto;
71 }
72 body.fileedit .fileedit-options.commit-message > div {
@@ -152,10 +150,36 @@
150 flex: 10 1 auto;
151 }
152 body.fileedit .tab-container > .tabs > .tab-panel {
153 display: flex;
154 flex-direction: column;
155 }
156 body.fileedit #fileedit-tab-diff-wrapper {
157 margin: 0;
158 padding: 0;
159 overflow: auto;
160 display: flex;
161 flex-direction: column;
162 align-items: stretch;
163 }
164 body.fileedit #fileedit-tab-diff-wrapper > div {
165 margin: 0.5em 0 0.5em 0;
166 }
167 body.fileedit table.sbsdiffcols {
168 /*width: initial;*/
169 }
170 body.fileedit #fileedit-tab-diff-wrapper > pre.udiff {
171 margin-top: 0;
172 }
173 body.fileedit .sbsdiffcols div.difftxtcol {
174 display: flex;
175 flex-direction: column;
176 align-items: stretch;
177 width: initial;
178 }
179 body.fileedit .sbsdiffcols div.difftxtcol pre {
180 max-width: 44em;
181 }
182
183 /**
184 Styles for fossil.tabs.js. As of this writing, currently
185 only used by /fileedit, but it is anticipated that these
186

Keyboard Shortcuts

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