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
Commit
26fc585ecf424419126f5f61451557424b8de1d6
Parent
15b3ad250914a22…
1 file changed
+18
-4
+18
-4
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -40,10 +40,15 @@ | ||
| 40 | 40 | ** Remember that the header has been generated. The footer is omitted |
| 41 | 41 | ** if an error occurs before the header. |
| 42 | 42 | */ |
| 43 | 43 | static int headerHasBeenGenerated = 0; |
| 44 | 44 | |
| 45 | +/* | |
| 46 | +** remember, if a sidebox was used | |
| 47 | +*/ | |
| 48 | +static int sideboxUsed = 0; | |
| 49 | + | |
| 45 | 50 | /* |
| 46 | 51 | ** Add a new element to the submenu |
| 47 | 52 | */ |
| 48 | 53 | void style_submenu_element( |
| 49 | 54 | const char *zLabel, |
| @@ -106,10 +111,11 @@ | ||
| 106 | 111 | if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1); |
| 107 | 112 | Th_Unstore("title"); /* Avoid collisions with ticket field names */ |
| 108 | 113 | cgi_destination(CGI_BODY); |
| 109 | 114 | g.cgiOutput = 1; |
| 110 | 115 | headerHasBeenGenerated = 1; |
| 116 | + sideboxUsed = 0; | |
| 111 | 117 | } |
| 112 | 118 | |
| 113 | 119 | /* |
| 114 | 120 | ** Draw the footer at the bottom of the page. |
| 115 | 121 | */ |
| @@ -138,14 +144,17 @@ | ||
| 138 | 144 | @ </div> |
| 139 | 145 | } |
| 140 | 146 | @ <div class="content"> |
| 141 | 147 | cgi_destination(CGI_BODY); |
| 142 | 148 | |
| 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 | + } | |
| 147 | 156 | @ </div> |
| 148 | 157 | zFooter = db_get("footer", (char*)zDefaultFooter); |
| 149 | 158 | if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); |
| 150 | 159 | Th_Render(zFooter); |
| 151 | 160 | if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); |
| @@ -162,10 +171,11 @@ | ||
| 162 | 171 | ** Begin a side-box on the right-hand side of a page. The title and |
| 163 | 172 | ** the width of the box are given as arguments. The width is usually |
| 164 | 173 | ** a percentage of total screen width. |
| 165 | 174 | */ |
| 166 | 175 | void style_sidebox_begin(const char *zTitle, const char *zWidth){ |
| 176 | + sideboxUsed = 1; | |
| 167 | 177 | @ <div class="sidebox" style="width:%s(zWidth)"> |
| 168 | 178 | @ <div class="sideboxTitle">%h(zTitle)</div> |
| 169 | 179 | } |
| 170 | 180 | |
| 171 | 181 | /* End the side-box |
| @@ -674,10 +684,14 @@ | ||
| 674 | 684 | @ # to the header and configure the java script file with |
| 675 | 685 | @ # 1. use as bindClass :checkinUserColor |
| 676 | 686 | @ # 2. change the default hash adding behaviour to ON |
| 677 | 687 | @ # or change the class defition of element identified by id="clrcust" |
| 678 | 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; | |
| 679 | 693 | }, |
| 680 | 694 | { 0, |
| 681 | 695 | 0, |
| 682 | 696 | 0 |
| 683 | 697 | } |
| 684 | 698 |
| --- 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 |