Fossil SCM
More style tweaks.
Commit
0209fa3277f0e135c6be02161b7474a12a6e7bf12f22630439bed0a52eb5aab8
Parent
100c67fa507b44a…
2 files changed
+20
-1
+28
-4
+20
-1
| --- src/fossil.page.fileedit.js | ||
| +++ src/fossil.page.fileedit.js | ||
| @@ -1075,10 +1075,29 @@ | ||
| 1075 | 1075 | callback("Error fetching preview: "+e); |
| 1076 | 1076 | } |
| 1077 | 1077 | }); |
| 1078 | 1078 | return this; |
| 1079 | 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 | + }; | |
| 1080 | 1099 | |
| 1081 | 1100 | /** |
| 1082 | 1101 | Fetches the content diff based on the contents and settings of |
| 1083 | 1102 | this page's input fields, and updates the UI with the diff view. |
| 1084 | 1103 | |
| @@ -1104,11 +1123,11 @@ | ||
| 1104 | 1123 | "<div>Diff <code>[", |
| 1105 | 1124 | self.finfo.checkin, |
| 1106 | 1125 | "]</code> → Local Edits</div>", |
| 1107 | 1126 | c||'No changes.' |
| 1108 | 1127 | ].join(''); |
| 1109 | - if(sbs) P.tweakSbsDiffs(); | |
| 1128 | + if(sbs) P.tweakSbsDiffs2(); | |
| 1110 | 1129 | F.message('Updated diff.'); |
| 1111 | 1130 | self.tabs.switchToTab(self.e.tabs.diff); |
| 1112 | 1131 | } |
| 1113 | 1132 | }); |
| 1114 | 1133 | return this; |
| 1115 | 1134 |
| --- 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> → 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> → 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 |
+28
-4
| --- src/style.fileedit.css | ||
| +++ src/style.fileedit.css | ||
| @@ -61,14 +61,12 @@ | ||
| 61 | 61 | } |
| 62 | 62 | body.fileedit div.fileedit-preview { |
| 63 | 63 | margin: 0; |
| 64 | 64 | padding: 0; |
| 65 | 65 | } |
| 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; | |
| 70 | 68 | } |
| 71 | 69 | body.fileedit #fileedit-tab-preview-wrapper { |
| 72 | 70 | overflow: auto; |
| 73 | 71 | } |
| 74 | 72 | body.fileedit .fileedit-options.commit-message > div { |
| @@ -152,10 +150,36 @@ | ||
| 152 | 150 | flex: 10 1 auto; |
| 153 | 151 | } |
| 154 | 152 | body.fileedit .tab-container > .tabs > .tab-panel { |
| 155 | 153 | display: flex; |
| 156 | 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; | |
| 157 | 181 | } |
| 158 | 182 | |
| 159 | 183 | /** |
| 160 | 184 | Styles for fossil.tabs.js. As of this writing, currently |
| 161 | 185 | only used by /fileedit, but it is anticipated that these |
| 162 | 186 |
| --- 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 |