Fossil SCM

solved ticket [1b41304d8b]: moved style clear: both from code for content to css, adding the corresponding div only, if a sidebox wass used

Ratte 2010-09-28 09:02 wolfgangFormat2CSS_2
Commit 26fc585ecf424419126f5f61451557424b8de1d6
1 file changed +18 -4
+18 -4
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
4040
** Remember that the header has been generated. The footer is omitted
4141
** if an error occurs before the header.
4242
*/
4343
static int headerHasBeenGenerated = 0;
4444
45
+/*
46
+** remember, if a sidebox was used
47
+*/
48
+static int sideboxUsed = 0;
49
+
4550
/*
4651
** Add a new element to the submenu
4752
*/
4853
void style_submenu_element(
4954
const char *zLabel,
@@ -106,10 +111,11 @@
106111
if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
107112
Th_Unstore("title"); /* Avoid collisions with ticket field names */
108113
cgi_destination(CGI_BODY);
109114
g.cgiOutput = 1;
110115
headerHasBeenGenerated = 1;
116
+ sideboxUsed = 0;
111117
}
112118
113119
/*
114120
** Draw the footer at the bottom of the page.
115121
*/
@@ -138,14 +144,17 @@
138144
@ </div>
139145
}
140146
@ <div class="content">
141147
cgi_destination(CGI_BODY);
142148
143
- /* Put the footer at the bottom of the page.
144
- ** the additional clear/both is needed to extend the content
145
- ** part to the end of an optional sidebox.
146
- */
149
+ if (sideboxUsed) {
150
+ /* Put the footer at the bottom of the page.
151
+ ** the additional clear/both is needed to extend the content
152
+ ** part to the end of an optional sidebox.
153
+ */
154
+ @ <div class="endContent"></div>
155
+ }
147156
@ </div>
148157
zFooter = db_get("footer", (char*)zDefaultFooter);
149158
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
150159
Th_Render(zFooter);
151160
if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
@@ -162,10 +171,11 @@
162171
** Begin a side-box on the right-hand side of a page. The title and
163172
** the width of the box are given as arguments. The width is usually
164173
** a percentage of total screen width.
165174
*/
166175
void style_sidebox_begin(const char *zTitle, const char *zWidth){
176
+ sideboxUsed = 1;
167177
@ <div class="sidebox" style="width:%s(zWidth)">
168178
@ <div class="sideboxTitle">%h(zTitle)</div>
169179
}
170180
171181
/* End the side-box
@@ -674,10 +684,14 @@
674684
@ # to the header and configure the java script file with
675685
@ # 1. use as bindClass :checkinUserColor
676686
@ # 2. change the default hash adding behaviour to ON
677687
@ # or change the class defition of element identified by id="clrcust"
678688
@ # to a standard jscolor definition with java script in the footer.
689
+ },
690
+ { "div.endContent",
691
+ "format for end of content area, to be used to clear page flow(sidebox on branch,..",
692
+ @ clear: both;
679693
},
680694
{ 0,
681695
0,
682696
0
683697
}
684698
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
40 ** Remember that the header has been generated. The footer is omitted
41 ** if an error occurs before the header.
42 */
43 static int headerHasBeenGenerated = 0;
44
 
 
 
 
 
45 /*
46 ** Add a new element to the submenu
47 */
48 void style_submenu_element(
49 const char *zLabel,
@@ -106,10 +111,11 @@
106 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
107 Th_Unstore("title"); /* Avoid collisions with ticket field names */
108 cgi_destination(CGI_BODY);
109 g.cgiOutput = 1;
110 headerHasBeenGenerated = 1;
 
111 }
112
113 /*
114 ** Draw the footer at the bottom of the page.
115 */
@@ -138,14 +144,17 @@
138 @ </div>
139 }
140 @ <div class="content">
141 cgi_destination(CGI_BODY);
142
143 /* Put the footer at the bottom of the page.
144 ** the additional clear/both is needed to extend the content
145 ** part to the end of an optional sidebox.
146 */
 
 
 
147 @ </div>
148 zFooter = db_get("footer", (char*)zDefaultFooter);
149 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
150 Th_Render(zFooter);
151 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
@@ -162,10 +171,11 @@
162 ** Begin a side-box on the right-hand side of a page. The title and
163 ** the width of the box are given as arguments. The width is usually
164 ** a percentage of total screen width.
165 */
166 void style_sidebox_begin(const char *zTitle, const char *zWidth){
 
167 @ <div class="sidebox" style="width:%s(zWidth)">
168 @ <div class="sideboxTitle">%h(zTitle)</div>
169 }
170
171 /* End the side-box
@@ -674,10 +684,14 @@
674 @ # to the header and configure the java script file with
675 @ # 1. use as bindClass :checkinUserColor
676 @ # 2. change the default hash adding behaviour to ON
677 @ # or change the class defition of element identified by id="clrcust"
678 @ # to a standard jscolor definition with java script in the footer.
 
 
 
 
679 },
680 { 0,
681 0,
682 0
683 }
684
--- src/style.c
+++ src/style.c
@@ -40,10 +40,15 @@
40 ** Remember that the header has been generated. The footer is omitted
41 ** if an error occurs before the header.
42 */
43 static int headerHasBeenGenerated = 0;
44
45 /*
46 ** remember, if a sidebox was used
47 */
48 static int sideboxUsed = 0;
49
50 /*
51 ** Add a new element to the submenu
52 */
53 void style_submenu_element(
54 const char *zLabel,
@@ -106,10 +111,11 @@
111 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
112 Th_Unstore("title"); /* Avoid collisions with ticket field names */
113 cgi_destination(CGI_BODY);
114 g.cgiOutput = 1;
115 headerHasBeenGenerated = 1;
116 sideboxUsed = 0;
117 }
118
119 /*
120 ** Draw the footer at the bottom of the page.
121 */
@@ -138,14 +144,17 @@
144 @ </div>
145 }
146 @ <div class="content">
147 cgi_destination(CGI_BODY);
148
149 if (sideboxUsed) {
150 /* Put the footer at the bottom of the page.
151 ** the additional clear/both is needed to extend the content
152 ** part to the end of an optional sidebox.
153 */
154 @ <div class="endContent"></div>
155 }
156 @ </div>
157 zFooter = db_get("footer", (char*)zDefaultFooter);
158 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
159 Th_Render(zFooter);
160 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
@@ -162,10 +171,11 @@
171 ** Begin a side-box on the right-hand side of a page. The title and
172 ** the width of the box are given as arguments. The width is usually
173 ** a percentage of total screen width.
174 */
175 void style_sidebox_begin(const char *zTitle, const char *zWidth){
176 sideboxUsed = 1;
177 @ <div class="sidebox" style="width:%s(zWidth)">
178 @ <div class="sideboxTitle">%h(zTitle)</div>
179 }
180
181 /* End the side-box
@@ -674,10 +684,14 @@
684 @ # to the header and configure the java script file with
685 @ # 1. use as bindClass :checkinUserColor
686 @ # 2. change the default hash adding behaviour to ON
687 @ # or change the class defition of element identified by id="clrcust"
688 @ # to a standard jscolor definition with java script in the footer.
689 },
690 { "div.endContent",
691 "format for end of content area, to be used to clear page flow(sidebox on branch,..",
692 @ clear: both;
693 },
694 { 0,
695 0,
696 0
697 }
698

Keyboard Shortcuts

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