Fossil SCM

Merge in changes from the wolfgangFormat2CSS branch.

drh 2010-09-09 10:31 trunk merge
Commit 34f9b9de586d3d468ace2585db76b19ebfa207ea
3 files changed +3 +47 -6 +47 -6
--- src/setup.c
+++ src/setup.c
@@ -909,10 +909,13 @@
909909
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
910910
@ See also the <a href="setup_header">header</a> and
911911
@ <a href="setup_footer">footer</a> editing screens.
912912
@ <blockquote><pre>
913913
@ %h(zDefaultCSS)
914
+ @ %h(zTableLabelValueCSS)
915
+ @ %h(zDivSidebox)
916
+ @ %h(zDivSideboxTitle)
914917
@ </pre></blockquote>
915918
style_footer();
916919
db_end_transaction(0);
917920
}
918921
919922
--- src/setup.c
+++ src/setup.c
@@ -909,10 +909,13 @@
909 @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
910 @ See also the <a href="setup_header">header</a> and
911 @ <a href="setup_footer">footer</a> editing screens.
912 @ <blockquote><pre>
913 @ %h(zDefaultCSS)
 
 
 
914 @ </pre></blockquote>
915 style_footer();
916 db_end_transaction(0);
917 }
918
919
--- src/setup.c
+++ src/setup.c
@@ -909,10 +909,13 @@
909 @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
910 @ See also the <a href="setup_header">header</a> and
911 @ <a href="setup_footer">footer</a> editing screens.
912 @ <blockquote><pre>
913 @ %h(zDefaultCSS)
914 @ %h(zTableLabelValueCSS)
915 @ %h(zDivSidebox)
916 @ %h(zDivSideboxTitle)
917 @ </pre></blockquote>
918 style_footer();
919 db_end_transaction(0);
920 }
921
922
+47 -6
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160160
** Begin a side-box on the right-hand side of a page. The title and
161161
** the width of the box are given as arguments. The width is usually
162162
** a percentage of total screen width.
163163
*/
164164
void style_sidebox_begin(const char *zTitle, const char *zWidth){
165
- @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5
166
- @ vspace=5 hspace=5>
167
- @ <tr><td>
168
- @ <b>%h(zTitle)</b>
165
+ @ <div class="sidebox" style="width:%s(zWidth)">
166
+ @ <div class="sideboxTitle">%h(zTitle)</div>
169167
}
170168
171169
/* End the side-box
172170
*/
173171
void style_sidebox_end(void){
174
- @ </td></tr></table>
172
+ @ </div>
175173
}
176174
177175
/* @-comment: // */
178176
/*
179177
** The default page header.
@@ -243,10 +241,14 @@
243241
@ </body></html>
244242
;
245243
246244
/*
247245
** The default Cascading Style Sheet.
246
+** It's assembled by different strings for each class.
247
+** The default css conatains all definitions.
248
+** The style sheet, send to the client only contains the ones,
249
+** not defined in the user defined css.
248250
*/
249251
const char zDefaultCSS[] =
250252
@ /* General settings for the entire page */
251253
@ body {
252254
@ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
372374
@ pre.verbatim {
373375
@ background-color: #f5f5f5;
374376
@ padding: 0.5em;
375377
@}
376378
@
379
+;
380
+const char zTableLabelValueCSS[] =
377381
@ /* The label/value pairs on (for example) the ci page */
378382
@ table.label-value th {
379383
@ vertical-align: top;
380384
@ text-align: right;
381385
@ padding: 0.2ex 2ex;
382386
@ }
383387
;
388
+const char zDivSidebox[] =
389
+@ /* The nomenclature sidebox for branches,.. */
390
+@ div.sidebox {
391
+@ float: right;
392
+@ border-width: medium;
393
+@ border-style: double;
394
+@ margin: 10;
395
+@ }
396
+;
397
+const char zDivSideboxTitle[] =
398
+@ /* The nomenclature title in sideboxes for branches,.. */
399
+@ div.sideboxTitle {
400
+@ display: inline;
401
+@ font-weight: bold;
402
+@ }
403
+;
404
+
405
+
406
+/* The following table holds the names of CSS elements and the CSS
407
+** text that implements those elements.
408
+*/
409
+static const struct {
410
+ const char *zElement; /* Name of the CSS element */
411
+ const char *zText; /* Text of the element */
412
+} cssElements[] = {
413
+ { "table.label-value", zTableLabelValueCSS },
414
+ { "div.sidebox", zDivSidebox },
415
+ { "div.sideboxTitle", zDivSideboxTitle },
416
+};
384417
385418
/*
386419
** WEBPAGE: style.css
387420
*/
388421
void page_style_css(void){
389
- char *zCSS = 0;
422
+ const char *zCSS;
423
+ int i;
390424
391425
cgi_set_content_type("text/css");
392426
zCSS = db_get("css",(char*)zDefaultCSS);
427
+ /* append user defined css */
393428
cgi_append_content(zCSS, -1);
429
+ /* add special missing definitions */
430
+ for(i=0; i<count(cssElements); i++){
431
+ if( strstr(cssElements[i].zElement, zCSS)==0 ){
432
+ cgi_append_content(cssElements[i].zText, -1);
433
+ }
434
+ }
394435
g.isConst = 1;
395436
}
396437
397438
/*
398439
** WEBPAGE: test_env
399440
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160 ** Begin a side-box on the right-hand side of a page. The title and
161 ** the width of the box are given as arguments. The width is usually
162 ** a percentage of total screen width.
163 */
164 void style_sidebox_begin(const char *zTitle, const char *zWidth){
165 @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5
166 @ vspace=5 hspace=5>
167 @ <tr><td>
168 @ <b>%h(zTitle)</b>
169 }
170
171 /* End the side-box
172 */
173 void style_sidebox_end(void){
174 @ </td></tr></table>
175 }
176
177 /* @-comment: // */
178 /*
179 ** The default page header.
@@ -243,10 +241,14 @@
243 @ </body></html>
244 ;
245
246 /*
247 ** The default Cascading Style Sheet.
 
 
 
 
248 */
249 const char zDefaultCSS[] =
250 @ /* General settings for the entire page */
251 @ body {
252 @ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
372 @ pre.verbatim {
373 @ background-color: #f5f5f5;
374 @ padding: 0.5em;
375 @}
376 @
 
 
377 @ /* The label/value pairs on (for example) the ci page */
378 @ table.label-value th {
379 @ vertical-align: top;
380 @ text-align: right;
381 @ padding: 0.2ex 2ex;
382 @ }
383 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
385 /*
386 ** WEBPAGE: style.css
387 */
388 void page_style_css(void){
389 char *zCSS = 0;
 
390
391 cgi_set_content_type("text/css");
392 zCSS = db_get("css",(char*)zDefaultCSS);
 
393 cgi_append_content(zCSS, -1);
 
 
 
 
 
 
394 g.isConst = 1;
395 }
396
397 /*
398 ** WEBPAGE: test_env
399
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160 ** Begin a side-box on the right-hand side of a page. The title and
161 ** the width of the box are given as arguments. The width is usually
162 ** a percentage of total screen width.
163 */
164 void style_sidebox_begin(const char *zTitle, const char *zWidth){
165 @ <div class="sidebox" style="width:%s(zWidth)">
166 @ <div class="sideboxTitle">%h(zTitle)</div>
 
 
167 }
168
169 /* End the side-box
170 */
171 void style_sidebox_end(void){
172 @ </div>
173 }
174
175 /* @-comment: // */
176 /*
177 ** The default page header.
@@ -243,10 +241,14 @@
241 @ </body></html>
242 ;
243
244 /*
245 ** The default Cascading Style Sheet.
246 ** It's assembled by different strings for each class.
247 ** The default css conatains all definitions.
248 ** The style sheet, send to the client only contains the ones,
249 ** not defined in the user defined css.
250 */
251 const char zDefaultCSS[] =
252 @ /* General settings for the entire page */
253 @ body {
254 @ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
374 @ pre.verbatim {
375 @ background-color: #f5f5f5;
376 @ padding: 0.5em;
377 @}
378 @
379 ;
380 const char zTableLabelValueCSS[] =
381 @ /* The label/value pairs on (for example) the ci page */
382 @ table.label-value th {
383 @ vertical-align: top;
384 @ text-align: right;
385 @ padding: 0.2ex 2ex;
386 @ }
387 ;
388 const char zDivSidebox[] =
389 @ /* The nomenclature sidebox for branches,.. */
390 @ div.sidebox {
391 @ float: right;
392 @ border-width: medium;
393 @ border-style: double;
394 @ margin: 10;
395 @ }
396 ;
397 const char zDivSideboxTitle[] =
398 @ /* The nomenclature title in sideboxes for branches,.. */
399 @ div.sideboxTitle {
400 @ display: inline;
401 @ font-weight: bold;
402 @ }
403 ;
404
405
406 /* The following table holds the names of CSS elements and the CSS
407 ** text that implements those elements.
408 */
409 static const struct {
410 const char *zElement; /* Name of the CSS element */
411 const char *zText; /* Text of the element */
412 } cssElements[] = {
413 { "table.label-value", zTableLabelValueCSS },
414 { "div.sidebox", zDivSidebox },
415 { "div.sideboxTitle", zDivSideboxTitle },
416 };
417
418 /*
419 ** WEBPAGE: style.css
420 */
421 void page_style_css(void){
422 const char *zCSS;
423 int i;
424
425 cgi_set_content_type("text/css");
426 zCSS = db_get("css",(char*)zDefaultCSS);
427 /* append user defined css */
428 cgi_append_content(zCSS, -1);
429 /* add special missing definitions */
430 for(i=0; i<count(cssElements); i++){
431 if( strstr(cssElements[i].zElement, zCSS)==0 ){
432 cgi_append_content(cssElements[i].zText, -1);
433 }
434 }
435 g.isConst = 1;
436 }
437
438 /*
439 ** WEBPAGE: test_env
440
+47 -6
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160160
** Begin a side-box on the right-hand side of a page. The title and
161161
** the width of the box are given as arguments. The width is usually
162162
** a percentage of total screen width.
163163
*/
164164
void style_sidebox_begin(const char *zTitle, const char *zWidth){
165
- @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5
166
- @ vspace=5 hspace=5>
167
- @ <tr><td>
168
- @ <b>%h(zTitle)</b>
165
+ @ <div class="sidebox" style="width:%s(zWidth)">
166
+ @ <div class="sideboxTitle">%h(zTitle)</div>
169167
}
170168
171169
/* End the side-box
172170
*/
173171
void style_sidebox_end(void){
174
- @ </td></tr></table>
172
+ @ </div>
175173
}
176174
177175
/* @-comment: // */
178176
/*
179177
** The default page header.
@@ -243,10 +241,14 @@
243241
@ </body></html>
244242
;
245243
246244
/*
247245
** The default Cascading Style Sheet.
246
+** It's assembled by different strings for each class.
247
+** The default css conatains all definitions.
248
+** The style sheet, send to the client only contains the ones,
249
+** not defined in the user defined css.
248250
*/
249251
const char zDefaultCSS[] =
250252
@ /* General settings for the entire page */
251253
@ body {
252254
@ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
372374
@ pre.verbatim {
373375
@ background-color: #f5f5f5;
374376
@ padding: 0.5em;
375377
@}
376378
@
379
+;
380
+const char zTableLabelValueCSS[] =
377381
@ /* The label/value pairs on (for example) the ci page */
378382
@ table.label-value th {
379383
@ vertical-align: top;
380384
@ text-align: right;
381385
@ padding: 0.2ex 2ex;
382386
@ }
383387
;
388
+const char zDivSidebox[] =
389
+@ /* The nomenclature sidebox for branches,.. */
390
+@ div.sidebox {
391
+@ float: right;
392
+@ border-width: medium;
393
+@ border-style: double;
394
+@ margin: 10;
395
+@ }
396
+;
397
+const char zDivSideboxTitle[] =
398
+@ /* The nomenclature title in sideboxes for branches,.. */
399
+@ div.sideboxTitle {
400
+@ display: inline;
401
+@ font-weight: bold;
402
+@ }
403
+;
404
+
405
+
406
+/* The following table holds the names of CSS elements and the CSS
407
+** text that implements those elements.
408
+*/
409
+static const struct {
410
+ const char *zElement; /* Name of the CSS element */
411
+ const char *zText; /* Text of the element */
412
+} cssElements[] = {
413
+ { "table.label-value", zTableLabelValueCSS },
414
+ { "div.sidebox", zDivSidebox },
415
+ { "div.sideboxTitle", zDivSideboxTitle },
416
+};
384417
385418
/*
386419
** WEBPAGE: style.css
387420
*/
388421
void page_style_css(void){
389
- char *zCSS = 0;
422
+ const char *zCSS;
423
+ int i;
390424
391425
cgi_set_content_type("text/css");
392426
zCSS = db_get("css",(char*)zDefaultCSS);
427
+ /* append user defined css */
393428
cgi_append_content(zCSS, -1);
429
+ /* add special missing definitions */
430
+ for(i=0; i<count(cssElements); i++){
431
+ if( strstr(cssElements[i].zElement, zCSS)==0 ){
432
+ cgi_append_content(cssElements[i].zText, -1);
433
+ }
434
+ }
394435
g.isConst = 1;
395436
}
396437
397438
/*
398439
** WEBPAGE: test_env
399440
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160 ** Begin a side-box on the right-hand side of a page. The title and
161 ** the width of the box are given as arguments. The width is usually
162 ** a percentage of total screen width.
163 */
164 void style_sidebox_begin(const char *zTitle, const char *zWidth){
165 @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5
166 @ vspace=5 hspace=5>
167 @ <tr><td>
168 @ <b>%h(zTitle)</b>
169 }
170
171 /* End the side-box
172 */
173 void style_sidebox_end(void){
174 @ </td></tr></table>
175 }
176
177 /* @-comment: // */
178 /*
179 ** The default page header.
@@ -243,10 +241,14 @@
243 @ </body></html>
244 ;
245
246 /*
247 ** The default Cascading Style Sheet.
 
 
 
 
248 */
249 const char zDefaultCSS[] =
250 @ /* General settings for the entire page */
251 @ body {
252 @ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
372 @ pre.verbatim {
373 @ background-color: #f5f5f5;
374 @ padding: 0.5em;
375 @}
376 @
 
 
377 @ /* The label/value pairs on (for example) the ci page */
378 @ table.label-value th {
379 @ vertical-align: top;
380 @ text-align: right;
381 @ padding: 0.2ex 2ex;
382 @ }
383 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
385 /*
386 ** WEBPAGE: style.css
387 */
388 void page_style_css(void){
389 char *zCSS = 0;
 
390
391 cgi_set_content_type("text/css");
392 zCSS = db_get("css",(char*)zDefaultCSS);
 
393 cgi_append_content(zCSS, -1);
 
 
 
 
 
 
394 g.isConst = 1;
395 }
396
397 /*
398 ** WEBPAGE: test_env
399
--- src/style.c
+++ src/style.c
@@ -160,20 +160,18 @@
160 ** Begin a side-box on the right-hand side of a page. The title and
161 ** the width of the box are given as arguments. The width is usually
162 ** a percentage of total screen width.
163 */
164 void style_sidebox_begin(const char *zTitle, const char *zWidth){
165 @ <div class="sidebox" style="width:%s(zWidth)">
166 @ <div class="sideboxTitle">%h(zTitle)</div>
 
 
167 }
168
169 /* End the side-box
170 */
171 void style_sidebox_end(void){
172 @ </div>
173 }
174
175 /* @-comment: // */
176 /*
177 ** The default page header.
@@ -243,10 +241,14 @@
241 @ </body></html>
242 ;
243
244 /*
245 ** The default Cascading Style Sheet.
246 ** It's assembled by different strings for each class.
247 ** The default css conatains all definitions.
248 ** The style sheet, send to the client only contains the ones,
249 ** not defined in the user defined css.
250 */
251 const char zDefaultCSS[] =
252 @ /* General settings for the entire page */
253 @ body {
254 @ margin: 0ex 1ex;
@@ -372,27 +374,66 @@
374 @ pre.verbatim {
375 @ background-color: #f5f5f5;
376 @ padding: 0.5em;
377 @}
378 @
379 ;
380 const char zTableLabelValueCSS[] =
381 @ /* The label/value pairs on (for example) the ci page */
382 @ table.label-value th {
383 @ vertical-align: top;
384 @ text-align: right;
385 @ padding: 0.2ex 2ex;
386 @ }
387 ;
388 const char zDivSidebox[] =
389 @ /* The nomenclature sidebox for branches,.. */
390 @ div.sidebox {
391 @ float: right;
392 @ border-width: medium;
393 @ border-style: double;
394 @ margin: 10;
395 @ }
396 ;
397 const char zDivSideboxTitle[] =
398 @ /* The nomenclature title in sideboxes for branches,.. */
399 @ div.sideboxTitle {
400 @ display: inline;
401 @ font-weight: bold;
402 @ }
403 ;
404
405
406 /* The following table holds the names of CSS elements and the CSS
407 ** text that implements those elements.
408 */
409 static const struct {
410 const char *zElement; /* Name of the CSS element */
411 const char *zText; /* Text of the element */
412 } cssElements[] = {
413 { "table.label-value", zTableLabelValueCSS },
414 { "div.sidebox", zDivSidebox },
415 { "div.sideboxTitle", zDivSideboxTitle },
416 };
417
418 /*
419 ** WEBPAGE: style.css
420 */
421 void page_style_css(void){
422 const char *zCSS;
423 int i;
424
425 cgi_set_content_type("text/css");
426 zCSS = db_get("css",(char*)zDefaultCSS);
427 /* append user defined css */
428 cgi_append_content(zCSS, -1);
429 /* add special missing definitions */
430 for(i=0; i<count(cssElements); i++){
431 if( strstr(cssElements[i].zElement, zCSS)==0 ){
432 cgi_append_content(cssElements[i].zText, -1);
433 }
434 }
435 g.isConst = 1;
436 }
437
438 /*
439 ** WEBPAGE: test_env
440

Keyboard Shortcuts

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