Fossil

Check-in [34f9b9de58]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge in changes from the wolfgangFormat2CSS branch.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 34f9b9de586d3d468ace2585db76b19ebfa207ea
User & Date: drh 2010-09-09 10:31:38.000
Context
2010-09-09
13:57
Allow checkout of versions that have neither ancestors nor children. ... (check-in: 4980b9a796 user: drh tags: trunk)
10:31
Merge in changes from the wolfgangFormat2CSS branch. ... (check-in: 34f9b9de58 user: drh tags: trunk)
10:02
Fix a large memory leak in the "fossil reconstruct" command. Ticket [fc1a61329403f605c494] ... (check-in: 9ef4a184f4 user: drh tags: trunk)
2010-09-08
18:16
layout sideboxes using css, css is only added to the user defined css, if the corresponding class is missing ... (check-in: b34a583f32 user: wolfgang tags: wolfgangFormat2CSS)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/setup.c.
907
908
909
910
911
912
913



914
915
916
917
918
919
920
  @ <hr>
  @ The default CSS is shown below for reference.  Other examples
  @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_header">header</a> and
  @ <a href="setup_footer">footer</a> editing screens.
  @ <blockquote><pre>
  @ %h(zDefaultCSS)



  @ </pre></blockquote>
  style_footer();
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_header







>
>
>







907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
  @ <hr>
  @ The default CSS is shown below for reference.  Other examples
  @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_header">header</a> and
  @ <a href="setup_footer">footer</a> editing screens.
  @ <blockquote><pre>
  @ %h(zDefaultCSS)
  @ %h(zTableLabelValueCSS)
  @ %h(zDivSidebox)
  @ %h(zDivSideboxTitle)
  @ </pre></blockquote>
  style_footer();
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_header
Changes to src/style.c.
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

/*
** Begin a side-box on the right-hand side of a page.  The title and
** the width of the box are given as arguments.  The width is usually
** a percentage of total screen width.
*/
void style_sidebox_begin(const char *zTitle, const char *zWidth){
  @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5
  @  vspace=5 hspace=5>
  @ <tr><td>
  @ <b>%h(zTitle)</b>
}

/* End the side-box
*/
void style_sidebox_end(void){
  @ </td></tr></table>
}

/* @-comment: // */
/*
** The default page header.
*/
const char zDefaultHeader[] = 







|
<
<
|





|







158
159
160
161
162
163
164
165


166
167
168
169
170
171
172
173
174
175
176
177
178
179

/*
** Begin a side-box on the right-hand side of a page.  The title and
** the width of the box are given as arguments.  The width is usually
** a percentage of total screen width.
*/
void style_sidebox_begin(const char *zTitle, const char *zWidth){
  @ <div class="sidebox" style="width:%s(zWidth)">


  @ <div class="sideboxTitle">%h(zTitle)</div>
}

/* End the side-box
*/
void style_sidebox_end(void){
  @ </div>
}

/* @-comment: // */
/*
** The default page header.
*/
const char zDefaultHeader[] = 
241
242
243
244
245
246
247




248
249
250
251
252
253
254
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
;

/*
** The default Cascading Style Sheet.




*/
const char zDefaultCSS[] = 
@ /* General settings for the entire page */
@ body {
@   margin: 0ex 1ex;
@   padding: 0px;
@   background-color: white;







>
>
>
>







239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
;

/*
** The default Cascading Style Sheet.
** It's assembled by different strings for each class.
** The default css conatains all definitions.
** The style sheet, send to the client only contains the ones,
** not defined in the user defined css.
*/
const char zDefaultCSS[] = 
@ /* General settings for the entire page */
@ body {
@   margin: 0ex 1ex;
@   padding: 0px;
@   background-color: white;
370
371
372
373
374
375
376


377
378
379
380
381
382
383





























384
385
386
387
388
389

390
391
392

393






394
395
396
397
398
399
400
@ 
@ /* <verbatim> blocks */
@ pre.verbatim {
@    background-color: #f5f5f5;
@    padding: 0.5em;
@}
@


@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@   vertical-align: top;
@   text-align: right;
@   padding: 0.2ex 2ex;
@ }
;






























/*
** WEBPAGE: style.css
*/
void page_style_css(void){
  char *zCSS = 0;


  cgi_set_content_type("text/css");
  zCSS = db_get("css",(char*)zDefaultCSS);

  cgi_append_content(zCSS, -1);






  g.isConst = 1;
}

/*
** WEBPAGE: test_env
*/
void page_test_env(void){







>
>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|
>



>

>
>
>
>
>
>







372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
@ 
@ /* <verbatim> blocks */
@ pre.verbatim {
@    background-color: #f5f5f5;
@    padding: 0.5em;
@}
@
;
const char zTableLabelValueCSS[] = 
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@   vertical-align: top;
@   text-align: right;
@   padding: 0.2ex 2ex;
@ }
;
const char zDivSidebox[] =
@ /* The nomenclature sidebox for branches,.. */
@ div.sidebox {
@   float: right;
@   border-width: medium;
@   border-style: double;
@   margin: 10;
@ }
;
const char zDivSideboxTitle[] =
@ /* The nomenclature title in sideboxes for branches,.. */
@ div.sideboxTitle {
@   display: inline;
@   font-weight: bold;
@ }
;


/* The following table holds the names of CSS elements and the CSS
** text that implements those elements.
*/
static const struct {
  const char *zElement;   /* Name of the CSS element */
  const char *zText;      /* Text of the element */
} cssElements[] = {
  { "table.label-value", zTableLabelValueCSS },
  { "div.sidebox",       zDivSidebox         },
  { "div.sideboxTitle",  zDivSideboxTitle    },
};

/*
** WEBPAGE: style.css
*/
void page_style_css(void){
  const char *zCSS;
  int i;

  cgi_set_content_type("text/css");
  zCSS = db_get("css",(char*)zDefaultCSS);
  /* append user defined css */
  cgi_append_content(zCSS, -1);
  /* add special missing definitions */
  for(i=0; i<count(cssElements); i++){
    if( strstr(cssElements[i].zElement, zCSS)==0 ){
      cgi_append_content(cssElements[i].zText, -1);
    }
  }
  g.isConst = 1;
}

/*
** WEBPAGE: test_env
*/
void page_test_env(void){