Fossil

Diff
Login

Diff

Differences From Artifact [b55901730c]:

To Artifact [df6ceef9ea]:


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
  char *zTitle;
  const char *zHeader = db_get("header", (char*)zDefaultHeader);  
  login_check_credentials();

  va_start(ap, zTitleFormat);
  zTitle = vmprintf(zTitleFormat, ap);
  va_end(ap);
  
  cgi_destination(CGI_HEADER);
  cgi_printf("%s","<!DOCTYPE html>");
  
  if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);

  /* Generate the header up through the main menu */
  Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
  Th_Store("title", zTitle);
  Th_Store("baseurl", g.zBaseURL);
  Th_Store("home", g.zTop);
  Th_Store("index_page", db_get("index-page","/home"));
  Th_Store("current_page", g.zPath);

  Th_Store("release_version", RELEASE_VERSION);
  Th_Store("manifest_version", MANIFEST_VERSION);
  Th_Store("manifest_date", MANIFEST_DATE);
  Th_Store("compiler_name", COMPILER_NAME);
  if( g.zLogin ){
    Th_Store("login", g.zLogin);
  }







|












>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  char *zTitle;
  const char *zHeader = db_get("header", (char*)zDefaultHeader);  
  login_check_credentials();

  va_start(ap, zTitleFormat);
  zTitle = vmprintf(zTitleFormat, ap);
  va_end(ap);

  cgi_destination(CGI_HEADER);
  cgi_printf("%s","<!DOCTYPE html>");
  
  if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);

  /* Generate the header up through the main menu */
  Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
  Th_Store("title", zTitle);
  Th_Store("baseurl", g.zBaseURL);
  Th_Store("home", g.zTop);
  Th_Store("index_page", db_get("index-page","/home"));
  Th_Store("current_page", g.zPath);
  Th_Store("stylesheet", db_get("style-stylesheet", "style.css"));
  Th_Store("release_version", RELEASE_VERSION);
  Th_Store("manifest_version", MANIFEST_VERSION);
  Th_Store("manifest_date", MANIFEST_DATE);
  Th_Store("compiler_name", COMPILER_NAME);
  if( g.zLogin ){
    Th_Store("login", g.zLogin);
  }
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
*/
const char zDefaultHeader[] = 
@ <html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@       href="$home/timeline.rss" />
@ <link rel="stylesheet" href="$home/style.css?default" type="text/css"
@       media="screen" />
@ </head>
@ <body>
@ <div class="header">
@   <div class="logo">
@     <img src="$home/logo" alt="logo" />
@   </div>







|







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
*/
const char zDefaultHeader[] = 
@ <html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@       href="$home/timeline.rss" />
@ <link rel="stylesheet" href="$home/$stylesheet" type="text/css"
@       media="screen" />
@ </head>
@ <body>
@ <div class="header">
@   <div class="logo">
@     <img src="$home/logo" alt="logo" />
@   </div>
696
697
698
699
700
701
702
703

704
705
706
707
708
709
710
    @ **  to the header and configure the java script file with
    @ **   1. use as bindClass :checkinUserColor
    @ **   2. change the default hash adding behaviour to ON
    @ ** or change the class defition of element identified by id="clrcust"
    @ ** to a standard jscolor definition with java script in the footer. */
  },
  { "div.endContent",
    "format for end of content area, to be used to clear page flow(sidebox on branch,..",

    @   clear: both;
  },
  { "p.generalError",
    "format for general errors",
    @   color: red;
  },
  { "p.tktsetupError",







|
>







697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
    @ **  to the header and configure the java script file with
    @ **   1. use as bindClass :checkinUserColor
    @ **   2. change the default hash adding behaviour to ON
    @ ** or change the class defition of element identified by id="clrcust"
    @ ** to a standard jscolor definition with java script in the footer. */
  },
  { "div.endContent",
    "format for end of content area, to be used to clear "
    "page flow(sidebox on branch,..",
    @   clear: both;
  },
  { "p.generalError",
    "format for general errors",
    @   color: red;
  },
  { "p.tktsetupError",
773
774
775
776
777
778
779







780
781
782
783


784

785
786
787

788









789


790
791
792
793
794
795
796
797
798
799

800


801
802
803
804
805
806
807
		);
    }
  }
}

/*
** WEBPAGE: style.css







*/
void page_style_css(void){
  const char *zCSS    = 0;
  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=1;cssDefaultList[i].elementClass;i++)
    if (!strstr(zCSS,cssDefaultList[i].elementClass)) {
      cgi_append_content("/* ", -1);
      cgi_append_content(cssDefaultList[i].comment, -1);
      cgi_append_content(" */\n", -1);
      cgi_append_content(cssDefaultList[i].elementClass, -1);
      cgi_append_content(" {\n", -1);
      cgi_append_content(cssDefaultList[i].value, -1);
      cgi_append_content("}\n\n", -1);
    }

  g.isConst = 1;


}

/*
** WEBPAGE: test_env
*/
void page_test_env(void){
  char c;







>
>
>
>
>
>
>


|

>
>

>

|
|
>
|
>
>
>
>
>
>
>
>
>
|
>
>


|
|
<
|
<
|
<

>
|
>
>







775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817

818

819

820
821
822
823
824
825
826
827
828
829
830
831
		);
    }
  }
}

/*
** WEBPAGE: style.css
** WEBPAGE: style
**
** The first form (style.css) is the default.  The second form (style) is
** intended to be used with a query path (ex: style/76a6de45.css) where the
** extra suffix (the "76a6de45.css") is a randomly-generated name that 
** changes every time the style sheet changes.  Changing the name causes
** the style-sheet to be reloaded by the web browser.
*/
void page_style_css(void){
  const char *zCSS;
  int i;
  Blob css;
  Stmt q;

  /* The mime-type for CSS */
  cgi_set_content_type("text/css");

  /* Content is cacheable */
  g.isConst = 1;

  /* Initialize TH1 variables that can appear in the stylesheet
  ** template.
  */
  db_prepare(&q, "SELECT substr(name,7), value FROM config"
                 " WHERE name GLOB 'style-*');
  while( db_step(&q)==SQLITE_ROW ){
    Th_Store(db_column_text(&q,0), db_column_text(&q,1));
  }
  db_finalize(&q);

  /* Construct the CSS text */
  blob_init(&css, db_get("css", (char*)zDefaultCSS), -1);
  for (i=1;cssDefaultList[i].elementClass;i++)
    if (!strstr(zCSS,cssDefaultList[i].elementClass)) {
      blob_appendf(&css, "/* %s */\n%s {\n%s}\n\n",
           cssDefaultList[i].comment,

           cssDefaultList[i].elementClass,

           cssDefaultList[i].value);

    }
  }

  /* Render the CSS */
  Th_Render(blob_str(&css));
}

/*
** WEBPAGE: test_env
*/
void page_test_env(void){
  char c;