Fossil SCM

'edit css' styled and made it pass HTML-Validator, optimized handling of additional styles in style.c

wolfgang 2010-09-11 16:14 wolfgangFormat2CSS
Commit 286d4bcaa0fb8c641c8efbfc5fd84d695d8453e8
+26 -26
--- src/login.c
+++ src/login.c
@@ -153,21 +153,21 @@
153153
if( db_int(1, "SELECT 0 FROM user"
154154
" WHERE uid=%d AND (pw=%Q OR pw=%Q)",
155155
g.userUid, zPasswd, zSha1Pw) ){
156156
sleep(1);
157157
zErrMsg =
158
- @ <p><font color="red">
158
+ @ <p><span class="loginError">
159159
@ You entered an incorrect old password while attempting to change
160160
@ your password. Your password is unchanged.
161
- @ </font></p>
161
+ @ </span></p>
162162
;
163163
}else if( strcmp(zNew1,zNew2)!=0 ){
164164
zErrMsg =
165
- @ <p><font color="red">
165
+ @ <p><span class="loginError">
166166
@ The two copies of your new passwords do not match.
167167
@ Your password is unchanged.
168
- @ </font></p>
168
+ @ </span></p>
169169
;
170170
}else{
171171
char *zNewPw = sha1_shared_secret(zNew1, g.zLogin);
172172
db_multi_exec(
173173
"UPDATE user SET pw=%Q WHERE uid=%d", zNewPw, g.userUid
@@ -206,13 +206,13 @@
206206
zUsername, zPasswd, zSha1Pw
207207
);
208208
if( uid<=0 ){
209209
sleep(1);
210210
zErrMsg =
211
- @ <p><font color="red">
211
+ @ <p><span class="loginError">
212212
@ You entered an unknown user or an incorrect password.
213
- @ </font></p>
213
+ @ </span></p>
214214
;
215215
}else{
216216
char *zCookie;
217217
const char *zCookieName = login_cookie_name();
218218
const char *zExpire = db_get("cookie-expire","8766");
@@ -233,22 +233,22 @@
233233
@ %s(zErrMsg)
234234
@ <form action="login" method="post">
235235
if( P("g") ){
236236
@ <input type="hidden" name="g" value="%h(P("g"))" />
237237
}
238
- @ <table align="left" hspace="10">
238
+ @ <table class="login_out">
239239
@ <tr>
240
- @ <td align="right">User ID:</td>
240
+ @ <td class="login_out_label">User ID:</td>
241241
if( anonFlag ){
242
- @ <td><input type="text" id="u" name="u" value="anonymous" size=30 /></td>
242
+ @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
243243
}else{
244
- @ <td><input type="text" id="u" name="u" value="" size=30 /></td>
244
+ @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
245245
}
246246
@ </tr>
247247
@ <tr>
248
- @ <td align="right">Password:</td>
249
- @ <td><input type="password" id="p" name="p" value="" size=30 /></td>
248
+ @ <td class="login_out_label">Password:</td>
249
+ @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
250250
@ </tr>
251251
if( g.zLogin==0 ){
252252
zAnonPw = db_text(0, "SELECT pw FROM user"
253253
" WHERE login='anonymous'"
254254
" AND cap!=''");
@@ -273,44 +273,44 @@
273273
unsigned int uSeed = captcha_seed();
274274
char const *zDecoded = captcha_decode(uSeed);
275275
int bAutoCaptcha = db_get_boolean("auto-captcha", 1);
276276
char *zCaptcha = captcha_render(zDecoded);
277277
278
- @ <input type="hidden" name="cs" value="%u(uSeed)" />
279
- @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
278
+ @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
279
+ @ Visitors may enter <b>anonymous</b> as the user-ID with
280280
@ the 8-character hexadecimal password shown below:</p>
281
- @ <center><table border="1" cellpadding="10"><tr><td><pre>
281
+ @ <div class="captcha"><table class="captcha"><tr><td><pre>
282282
@ %s(zCaptcha)
283283
@ </pre></td></tr></table>
284284
if( bAutoCaptcha ) {
285285
@ <input type="button" value="Fill out captcha"
286286
@ onclick="document.getElementById('u').value='anonymous';
287287
@ document.getElementById('p').value='%s(zDecoded)';" />
288288
}
289
- @ </center>
289
+ @ </div>
290290
free(zCaptcha);
291291
}
292292
if( g.zLogin ){
293
- @ <br><hr>
293
+ @ <hr />
294294
@ <p>To log off the system (and delete your login cookie)
295
- @ press the following button:<br>
295
+ @ press the following button:<br />
296296
@ <input type="submit" name="out" value="Logout" /></p>
297297
}
298298
@ </form>
299299
if( g.okPassword ){
300
- @ <br><hr>
300
+ @ <hr />
301301
@ <p>To change your password, enter your old password and your
302302
@ new password twice below then press the "Change Password"
303303
@ button.</p>
304
- @ <form action="login" method="POST">
304
+ @ <form action="login" method="post">
305305
@ <table>
306
- @ <tr><td align="right">Old Password:</td>
307
- @ <td><input type="password" name="p" size=30 /></td></tr>
308
- @ <tr><td align="right">New Password:</td>
309
- @ <td><input type="password" name="n1" size=30 /></td></tr>
310
- @ <tr><td align="right">Repeat New Password:</td>
311
- @ <td><input type="password" name="n2" size=30 /></td></tr>
306
+ @ <tr><td class="login_out_label">Old Password:</td>
307
+ @ <td><input type="password" name="p" size="30" /></td></tr>
308
+ @ <tr><td class="login_out_label">New Password:</td>
309
+ @ <td><input type="password" name="n1" size="30" /></td></tr>
310
+ @ <tr><td class="login_out_label">Repeat New Password:</td>
311
+ @ <td><input type="password" name="n2" size="30" /></td></tr>
312312
@ <tr><td></td>
313313
@ <td><input type="submit" value="Change Password" /></td></tr>
314314
@ </table>
315315
@ </form>
316316
}
317317
--- src/login.c
+++ src/login.c
@@ -153,21 +153,21 @@
153 if( db_int(1, "SELECT 0 FROM user"
154 " WHERE uid=%d AND (pw=%Q OR pw=%Q)",
155 g.userUid, zPasswd, zSha1Pw) ){
156 sleep(1);
157 zErrMsg =
158 @ <p><font color="red">
159 @ You entered an incorrect old password while attempting to change
160 @ your password. Your password is unchanged.
161 @ </font></p>
162 ;
163 }else if( strcmp(zNew1,zNew2)!=0 ){
164 zErrMsg =
165 @ <p><font color="red">
166 @ The two copies of your new passwords do not match.
167 @ Your password is unchanged.
168 @ </font></p>
169 ;
170 }else{
171 char *zNewPw = sha1_shared_secret(zNew1, g.zLogin);
172 db_multi_exec(
173 "UPDATE user SET pw=%Q WHERE uid=%d", zNewPw, g.userUid
@@ -206,13 +206,13 @@
206 zUsername, zPasswd, zSha1Pw
207 );
208 if( uid<=0 ){
209 sleep(1);
210 zErrMsg =
211 @ <p><font color="red">
212 @ You entered an unknown user or an incorrect password.
213 @ </font></p>
214 ;
215 }else{
216 char *zCookie;
217 const char *zCookieName = login_cookie_name();
218 const char *zExpire = db_get("cookie-expire","8766");
@@ -233,22 +233,22 @@
233 @ %s(zErrMsg)
234 @ <form action="login" method="post">
235 if( P("g") ){
236 @ <input type="hidden" name="g" value="%h(P("g"))" />
237 }
238 @ <table align="left" hspace="10">
239 @ <tr>
240 @ <td align="right">User ID:</td>
241 if( anonFlag ){
242 @ <td><input type="text" id="u" name="u" value="anonymous" size=30 /></td>
243 }else{
244 @ <td><input type="text" id="u" name="u" value="" size=30 /></td>
245 }
246 @ </tr>
247 @ <tr>
248 @ <td align="right">Password:</td>
249 @ <td><input type="password" id="p" name="p" value="" size=30 /></td>
250 @ </tr>
251 if( g.zLogin==0 ){
252 zAnonPw = db_text(0, "SELECT pw FROM user"
253 " WHERE login='anonymous'"
254 " AND cap!=''");
@@ -273,44 +273,44 @@
273 unsigned int uSeed = captcha_seed();
274 char const *zDecoded = captcha_decode(uSeed);
275 int bAutoCaptcha = db_get_boolean("auto-captcha", 1);
276 char *zCaptcha = captcha_render(zDecoded);
277
278 @ <input type="hidden" name="cs" value="%u(uSeed)" />
279 @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
280 @ the 8-character hexadecimal password shown below:</p>
281 @ <center><table border="1" cellpadding="10"><tr><td><pre>
282 @ %s(zCaptcha)
283 @ </pre></td></tr></table>
284 if( bAutoCaptcha ) {
285 @ <input type="button" value="Fill out captcha"
286 @ onclick="document.getElementById('u').value='anonymous';
287 @ document.getElementById('p').value='%s(zDecoded)';" />
288 }
289 @ </center>
290 free(zCaptcha);
291 }
292 if( g.zLogin ){
293 @ <br><hr>
294 @ <p>To log off the system (and delete your login cookie)
295 @ press the following button:<br>
296 @ <input type="submit" name="out" value="Logout" /></p>
297 }
298 @ </form>
299 if( g.okPassword ){
300 @ <br><hr>
301 @ <p>To change your password, enter your old password and your
302 @ new password twice below then press the "Change Password"
303 @ button.</p>
304 @ <form action="login" method="POST">
305 @ <table>
306 @ <tr><td align="right">Old Password:</td>
307 @ <td><input type="password" name="p" size=30 /></td></tr>
308 @ <tr><td align="right">New Password:</td>
309 @ <td><input type="password" name="n1" size=30 /></td></tr>
310 @ <tr><td align="right">Repeat New Password:</td>
311 @ <td><input type="password" name="n2" size=30 /></td></tr>
312 @ <tr><td></td>
313 @ <td><input type="submit" value="Change Password" /></td></tr>
314 @ </table>
315 @ </form>
316 }
317
--- src/login.c
+++ src/login.c
@@ -153,21 +153,21 @@
153 if( db_int(1, "SELECT 0 FROM user"
154 " WHERE uid=%d AND (pw=%Q OR pw=%Q)",
155 g.userUid, zPasswd, zSha1Pw) ){
156 sleep(1);
157 zErrMsg =
158 @ <p><span class="loginError">
159 @ You entered an incorrect old password while attempting to change
160 @ your password. Your password is unchanged.
161 @ </span></p>
162 ;
163 }else if( strcmp(zNew1,zNew2)!=0 ){
164 zErrMsg =
165 @ <p><span class="loginError">
166 @ The two copies of your new passwords do not match.
167 @ Your password is unchanged.
168 @ </span></p>
169 ;
170 }else{
171 char *zNewPw = sha1_shared_secret(zNew1, g.zLogin);
172 db_multi_exec(
173 "UPDATE user SET pw=%Q WHERE uid=%d", zNewPw, g.userUid
@@ -206,13 +206,13 @@
206 zUsername, zPasswd, zSha1Pw
207 );
208 if( uid<=0 ){
209 sleep(1);
210 zErrMsg =
211 @ <p><span class="loginError">
212 @ You entered an unknown user or an incorrect password.
213 @ </span></p>
214 ;
215 }else{
216 char *zCookie;
217 const char *zCookieName = login_cookie_name();
218 const char *zExpire = db_get("cookie-expire","8766");
@@ -233,22 +233,22 @@
233 @ %s(zErrMsg)
234 @ <form action="login" method="post">
235 if( P("g") ){
236 @ <input type="hidden" name="g" value="%h(P("g"))" />
237 }
238 @ <table class="login_out">
239 @ <tr>
240 @ <td class="login_out_label">User ID:</td>
241 if( anonFlag ){
242 @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
243 }else{
244 @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
245 }
246 @ </tr>
247 @ <tr>
248 @ <td class="login_out_label">Password:</td>
249 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
250 @ </tr>
251 if( g.zLogin==0 ){
252 zAnonPw = db_text(0, "SELECT pw FROM user"
253 " WHERE login='anonymous'"
254 " AND cap!=''");
@@ -273,44 +273,44 @@
273 unsigned int uSeed = captcha_seed();
274 char const *zDecoded = captcha_decode(uSeed);
275 int bAutoCaptcha = db_get_boolean("auto-captcha", 1);
276 char *zCaptcha = captcha_render(zDecoded);
277
278 @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
279 @ Visitors may enter <b>anonymous</b> as the user-ID with
280 @ the 8-character hexadecimal password shown below:</p>
281 @ <div class="captcha"><table class="captcha"><tr><td><pre>
282 @ %s(zCaptcha)
283 @ </pre></td></tr></table>
284 if( bAutoCaptcha ) {
285 @ <input type="button" value="Fill out captcha"
286 @ onclick="document.getElementById('u').value='anonymous';
287 @ document.getElementById('p').value='%s(zDecoded)';" />
288 }
289 @ </div>
290 free(zCaptcha);
291 }
292 if( g.zLogin ){
293 @ <hr />
294 @ <p>To log off the system (and delete your login cookie)
295 @ press the following button:<br />
296 @ <input type="submit" name="out" value="Logout" /></p>
297 }
298 @ </form>
299 if( g.okPassword ){
300 @ <hr />
301 @ <p>To change your password, enter your old password and your
302 @ new password twice below then press the "Change Password"
303 @ button.</p>
304 @ <form action="login" method="post">
305 @ <table>
306 @ <tr><td class="login_out_label">Old Password:</td>
307 @ <td><input type="password" name="p" size="30" /></td></tr>
308 @ <tr><td class="login_out_label">New Password:</td>
309 @ <td><input type="password" name="n1" size="30" /></td></tr>
310 @ <tr><td class="login_out_label">Repeat New Password:</td>
311 @ <td><input type="password" name="n2" size="30" /></td></tr>
312 @ <tr><td></td>
313 @ <td><input type="submit" value="Change Password" /></td></tr>
314 @ </table>
315 @ </form>
316 }
317
+10 -9
--- src/setup.c
+++ src/setup.c
@@ -130,11 +130,11 @@
130130
@ <td align="left">%s(db_column_text(&s,3))</td>
131131
@ </tr>
132132
}
133133
@ </table></td></tr></table>
134134
@ <td valign="top">
135
- @ <b>Notes:</b>
135
+ @ <span class="note">Notes:</span>
136136
@ <ol>
137137
@ <li><p>The permission flags are as follows:</p>
138138
@ <table>
139139
@ <tr><td valign="top"><b>a</b></td>
140140
@ <td><i>Admin:</i> Create and delete users</td></tr>
@@ -698,11 +698,12 @@
698698
db_set(zVar, zQ, 0);
699699
z = zQ;
700700
}
701701
if( rows>0 && cols>0 ){
702702
@ <textarea name="%s(zQP)" rows="%d(rows)" cols="%d(cols)">%h(z)</textarea>
703
- @ <b>%s(zLabel)</b>
703
+ if (zLabel && *zLabel)
704
+ @ <span class="textareaLabel">%s(zLabel)</span>
704705
}
705706
}
706707
707708
708709
/*
@@ -892,21 +893,21 @@
892893
if( P("submit")!=0 ){
893894
db_end_transaction(0);
894895
cgi_redirect("setup_editcss");
895896
}
896897
style_header("Edit CSS");
897
- @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
898
+ @ <form action="%s(g.zBaseURL)/setup_editcss" method="post"><div>
898899
login_insert_csrf_secret();
899900
@ Edit the CSS below:<br />
900901
textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
901902
@ <br />
902
- @ <input type="submit" name="submit" value="Apply Changes">
903
- @ <input type="submit" name="clear" value="Revert To Default">
904
- @ </form>
905
- @ <p><b>Note:</b> Press your browser Reload button after modifying the
903
+ @ <input type="submit" name="submit" value="Apply Changes" />
904
+ @ <input type="submit" name="clear" value="Revert To Default" />
905
+ @ </div></form>
906
+ @ <p><span class="note">Note:</span> Press your browser Reload button after modifying the
906907
@ CSS in order to pull in the modified CSS file.</p>
907
- @ <hr>
908
+ @ <hr />
908909
@ The default CSS is shown below for reference. Other examples
909910
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
910911
@ See also the <a href="setup_header">header</a> and
911912
@ <a href="setup_footer">footer</a> editing screens.
912913
@ <blockquote><pre>
@@ -1050,12 +1051,12 @@
10501051
@ <input type="file" name="im" size="60" accepts="image/*"><br>
10511052
@ <input type="submit" name="set" value="Change Logo">
10521053
@ <input type="submit" name="clr" value="Revert To Default">
10531054
@ </form>
10541055
@
1055
- @ <p><b>Note:</b> Your browser has probably cached the logo image, so
1056
+ @ <p><span class="note">Note:</span> Your browser has probably cached the logo image, so
10561057
@ you will probably need to press the Reload button on your browser after
10571058
@ changing the logo to provoke your browser to reload the new logo image.
10581059
@ </p>
10591060
style_footer();
10601061
db_end_transaction(0);
10611062
}
10621063
--- src/setup.c
+++ src/setup.c
@@ -130,11 +130,11 @@
130 @ <td align="left">%s(db_column_text(&s,3))</td>
131 @ </tr>
132 }
133 @ </table></td></tr></table>
134 @ <td valign="top">
135 @ <b>Notes:</b>
136 @ <ol>
137 @ <li><p>The permission flags are as follows:</p>
138 @ <table>
139 @ <tr><td valign="top"><b>a</b></td>
140 @ <td><i>Admin:</i> Create and delete users</td></tr>
@@ -698,11 +698,12 @@
698 db_set(zVar, zQ, 0);
699 z = zQ;
700 }
701 if( rows>0 && cols>0 ){
702 @ <textarea name="%s(zQP)" rows="%d(rows)" cols="%d(cols)">%h(z)</textarea>
703 @ <b>%s(zLabel)</b>
 
704 }
705 }
706
707
708 /*
@@ -892,21 +893,21 @@
892 if( P("submit")!=0 ){
893 db_end_transaction(0);
894 cgi_redirect("setup_editcss");
895 }
896 style_header("Edit CSS");
897 @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
898 login_insert_csrf_secret();
899 @ Edit the CSS below:<br />
900 textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
901 @ <br />
902 @ <input type="submit" name="submit" value="Apply Changes">
903 @ <input type="submit" name="clear" value="Revert To Default">
904 @ </form>
905 @ <p><b>Note:</b> Press your browser Reload button after modifying the
906 @ CSS in order to pull in the modified CSS file.</p>
907 @ <hr>
908 @ The default CSS is shown below for reference. Other examples
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>
@@ -1050,12 +1051,12 @@
1050 @ <input type="file" name="im" size="60" accepts="image/*"><br>
1051 @ <input type="submit" name="set" value="Change Logo">
1052 @ <input type="submit" name="clr" value="Revert To Default">
1053 @ </form>
1054 @
1055 @ <p><b>Note:</b> Your browser has probably cached the logo image, so
1056 @ you will probably need to press the Reload button on your browser after
1057 @ changing the logo to provoke your browser to reload the new logo image.
1058 @ </p>
1059 style_footer();
1060 db_end_transaction(0);
1061 }
1062
--- src/setup.c
+++ src/setup.c
@@ -130,11 +130,11 @@
130 @ <td align="left">%s(db_column_text(&s,3))</td>
131 @ </tr>
132 }
133 @ </table></td></tr></table>
134 @ <td valign="top">
135 @ <span class="note">Notes:</span>
136 @ <ol>
137 @ <li><p>The permission flags are as follows:</p>
138 @ <table>
139 @ <tr><td valign="top"><b>a</b></td>
140 @ <td><i>Admin:</i> Create and delete users</td></tr>
@@ -698,11 +698,12 @@
698 db_set(zVar, zQ, 0);
699 z = zQ;
700 }
701 if( rows>0 && cols>0 ){
702 @ <textarea name="%s(zQP)" rows="%d(rows)" cols="%d(cols)">%h(z)</textarea>
703 if (zLabel && *zLabel)
704 @ <span class="textareaLabel">%s(zLabel)</span>
705 }
706 }
707
708
709 /*
@@ -892,21 +893,21 @@
893 if( P("submit")!=0 ){
894 db_end_transaction(0);
895 cgi_redirect("setup_editcss");
896 }
897 style_header("Edit CSS");
898 @ <form action="%s(g.zBaseURL)/setup_editcss" method="post"><div>
899 login_insert_csrf_secret();
900 @ Edit the CSS below:<br />
901 textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
902 @ <br />
903 @ <input type="submit" name="submit" value="Apply Changes" />
904 @ <input type="submit" name="clear" value="Revert To Default" />
905 @ </div></form>
906 @ <p><span class="note">Note:</span> Press your browser Reload button after modifying the
907 @ CSS in order to pull in the modified CSS file.</p>
908 @ <hr />
909 @ The default CSS is shown below for reference. Other examples
910 @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
911 @ See also the <a href="setup_header">header</a> and
912 @ <a href="setup_footer">footer</a> editing screens.
913 @ <blockquote><pre>
@@ -1050,12 +1051,12 @@
1051 @ <input type="file" name="im" size="60" accepts="image/*"><br>
1052 @ <input type="submit" name="set" value="Change Logo">
1053 @ <input type="submit" name="clr" value="Revert To Default">
1054 @ </form>
1055 @
1056 @ <p><span class="note">Note:</span> Your browser has probably cached the logo image, so
1057 @ you will probably need to press the Reload button on your browser after
1058 @ changing the logo to provoke your browser to reload the new logo image.
1059 @ </p>
1060 style_footer();
1061 db_end_transaction(0);
1062 }
1063
+2 -2
--- src/stat.c
+++ src/stat.c
@@ -34,11 +34,11 @@
3434
char zBuf[100];
3535
char *zVers;
3636
login_check_credentials();
3737
if( !g.okRead ){ login_needed(); return; }
3838
style_header("Repository Statistics");
39
- @ <p><table class="label-value">
39
+ @ <table class="label-value">
4040
@ <tr><th>Repository&nbsp;Size:</th><td>
4141
fsize = file_size(g.zRepositoryName);
4242
@ %d(fsize) bytes
4343
@ </td></tr>
4444
@ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
@@ -117,8 +117,8 @@
117117
@ %d(db_int(0, "PRAGMA %s.freelist_count", g.zRepoDb)) free pages,
118118
@ %s(db_text(0, "PRAGMA %s.encoding", g.zRepoDb)),
119119
@ %s(db_text(0, "PRAGMA %s.journal_mode", g.zRepoDb)) mode
120120
@ </td></tr>
121121
122
- @ </table></p>
122
+ @ </table>
123123
style_footer();
124124
}
125125
--- src/stat.c
+++ src/stat.c
@@ -34,11 +34,11 @@
34 char zBuf[100];
35 char *zVers;
36 login_check_credentials();
37 if( !g.okRead ){ login_needed(); return; }
38 style_header("Repository Statistics");
39 @ <p><table class="label-value">
40 @ <tr><th>Repository&nbsp;Size:</th><td>
41 fsize = file_size(g.zRepositoryName);
42 @ %d(fsize) bytes
43 @ </td></tr>
44 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
@@ -117,8 +117,8 @@
117 @ %d(db_int(0, "PRAGMA %s.freelist_count", g.zRepoDb)) free pages,
118 @ %s(db_text(0, "PRAGMA %s.encoding", g.zRepoDb)),
119 @ %s(db_text(0, "PRAGMA %s.journal_mode", g.zRepoDb)) mode
120 @ </td></tr>
121
122 @ </table></p>
123 style_footer();
124 }
125
--- src/stat.c
+++ src/stat.c
@@ -34,11 +34,11 @@
34 char zBuf[100];
35 char *zVers;
36 login_check_credentials();
37 if( !g.okRead ){ login_needed(); return; }
38 style_header("Repository Statistics");
39 @ <table class="label-value">
40 @ <tr><th>Repository&nbsp;Size:</th><td>
41 fsize = file_size(g.zRepositoryName);
42 @ %d(fsize) bytes
43 @ </td></tr>
44 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
@@ -117,8 +117,8 @@
117 @ %d(db_int(0, "PRAGMA %s.freelist_count", g.zRepoDb)) free pages,
118 @ %s(db_text(0, "PRAGMA %s.encoding", g.zRepoDb)),
119 @ %s(db_text(0, "PRAGMA %s.journal_mode", g.zRepoDb)) mode
120 @ </td></tr>
121
122 @ </table>
123 style_footer();
124 }
125
+162 -185
--- src/style.c
+++ src/style.c
@@ -373,214 +373,184 @@
373373
@ div.footer a { color: white; }
374374
@ div.footer a:link { color: white; }
375375
@ div.footer a:visited { color: white; }
376376
@ div.footer a:hover { background-color: white; color: #558195; }
377377
@
378
-@ /* <verbatim> blocks */
378
+@ /* verbatim blocks */
379379
@ pre.verbatim {
380380
@ background-color: #f5f5f5;
381381
@ padding: 0.5em;
382382
@}
383383
@
384
-;
385
-const char zTableLabelValueCSS[] =
386384
@ /* The label/value pairs on (for example) the ci page */
387385
@ table.label-value th {
388386
@ vertical-align: top;
389387
@ text-align: right;
390388
@ padding: 0.2ex 2ex;
391389
@ }
392390
@
393
-;
394
-const char zDivSidebox[] =
395
-@ /* The nomenclature sidebox for branches,.. */
396
-@ div.sidebox {
397
-@ float: right;
398
-@ background-color: white;
399
-@ border-width: medium;
400
-@ border-style: double;
401
-@ margin: 10;
402
-@ }
403
-@
404
-;
405
-const char zDivSideboxTitle[] =
406
-@ /* The nomenclature title in sideboxes for branches,.. */
407
-@ div.sideboxTitle {
408
-@ display: inline;
409
-@ font-weight: bold;
410
-@ }
411
-@
412
-;
413
-const char zDivSideboxDescribed[] =
414
-@ /* The defined element in sideboxes for branches,.. */
415
-@ div.sideboxDescribed {
416
-@ display: inline;
417
-@ font-weight: bold;
418
-@ }
419
-@
420
-;
421
-const char zSpanDisabled[] =
422
-@ /* The defined element in sideboxes for branches,.. */
423
-@ span.disabled {
424
-@ color: red;
425
-@ }
426
-@
427
-;
428
-const char zSpanTimelineSuppressed[] =
429
-@ /* The suppressed duplicates lines in timeline, .. */
430
-@ span.timelineDisabled {
431
-@ font-style: italic;
432
-@ font-size: small;
433
-@ }
434
-@
435
-;
436
-const char zTableTimelineTable[] =
437
-@ /* the format for the timeline data table */
438
-@ table.timelineTable {
439
-@ cellspacing: 0;
440
-@ border: 0;
441
-@ cellpadding: 0
442
-@ }
443
-@
444
-;
445
-const char zTdTimelineTableCell[] =
446
-@ /* the format for the timeline data cells */
447
-@ td.timelineTableCell {
448
-@ valign: top;
449
-@ align: left;
450
-@ }
451
-@
452
-;
453
-const char zSpanTimelineLeaf[] =
454
-@ /* the format for the timeline leaf marks */
455
-@ span.timelineLeaf {
456
-@ font-weight: bold;
457
-@ }
458
-@
459
-;
460
-const char zATimelineHistLink[] =
461
-@ /* the format for the timeline version links */
462
-@ a.timelineHistLink {
463
-@ }
464
-@
465
-;
466
-const char zSpanTimelineHistDsp[] =
467
-@ /* the format for the timeline version display(no history permission!) */
468
-@ span.timelineHistDsp {
469
-@ font-weight: bold;
470
-@ }
471
-@
472
-;
473
-const char zTdTimelineTime[] =
474
-@ /* the format for the timeline time display */
475
-@ td.timelineTime {
476
-@ vertical-align: top;
477
-@ text-align: right;
478
-@ }
479
-@
480
-;
481
-const char zATagLink[] =
482
-@ /* the format for the tag links */
483
-@ a.tagLink {
484
-@ }
485
-@
486
-;
487
-const char zSpanTagDsp[] =
488
-@ /* the format for the tag display(no history permission!) */
489
-@ span.tagDsp {
490
-@ font-weight: bold;
491
-@ }
492
-@
493
-;
494
-const char zSpanWikiError[] =
495
-@ /* the format for wiki errors */
496
-@ span.wikiError {
497
-@ font-weight: bold;
498
-@ color: red;
499
-@ }
500
-@
501
-;
502
-const char zSpanInfoTagCancelled[] =
503
-@ /* the format for wiki errors */
504
-@ span.infoTagCancelled {
505
-@ font-weight: bold;
506
-@ text-decoration: line-through;
507
-@ }
508
-@
509
-;
510
-const char zSpanInfoTag[] =
511
-@ /* the format for wiki errors */
512
-@ span.infoTag {
513
-@ font-weight: bold;
514
-@ }
515
-@
516
-;
517
-const char zSpanWikiTagCancelled[] =
518
-@ /* the format for wiki errors */
519
-@ span.wikiTagCancelled {
520
-@ text-decoration: line-through;
521
-@ }
522
-@
523
-;
524
-const char zTableBrowser[] =
525
-@ /* the format for wiki errors */
526
-@ table.browser {
527
-@ width: 100%%;
528
-@ border: 0;
529
-@ }
530
-@
531
-;
532
-const char zTdBrowser[] =
533
-@ /* the format for wiki errors */
534
-@ td.browser {
535
-@ width: 25%%;
536
-@ vertical-align: top;
537
-@ }
538
-@
539
-;
540
-const char zUlBrowser[] =
541
-@ /* the format for wiki errors */
542
-@ ul.browser {
543
-@ margin-left: 0.5em;
544
-@ padding-left: 0.5em;
545
-@ }
546
-@
547391
;
548392
const struct strctCssDefaults {
549
- char const * const name;
393
+ char const * const elementClass;
394
+ char const * const comment;
550395
char const * const value;
551396
} cssDefaultList[] = {
552
- { "", zDefaultCSS },
553
- { "table.label-value", zTableLabelValueCSS },
554
- { "div.sidebox", zDivSidebox },
555
- { "div.sideboxTitle", zDivSideboxTitle },
556
- { "div.sideboxDescribed", zDivSideboxDescribed },
557
- { "span.disabled", zSpanDisabled },
558
- { "span.timelineDisabled", zSpanTimelineSuppressed },
559
- { "table.timelineTable", zTableTimelineTable },
560
- { "td.timelineTableCell", zTdTimelineTableCell },
561
- { "span.timelineLeaf", zSpanTimelineLeaf },
562
- { "a.timelineHistLink", zATimelineHistLink },
563
- { "span.timelineHistDsp", zSpanTimelineHistDsp },
564
- { "td.timelineTime", zTdTimelineTime },
565
- { "a.tagLink", zATagLink },
566
- { "span.tagDsp", zSpanTagDsp },
567
- { "span.wikiError", zSpanWikiError },
568
- { "span.infoTagCancelled", zSpanInfoTagCancelled },
569
- { "span.infoTag", zSpanInfoTag },
570
- { "span.wikiTagCancelled", zSpanWikiTagCancelled },
571
- { "table.browser", zTableBrowser },
572
- { "td.browser", zTdBrowser },
573
- { "ul.browser", zUlBrowser },
574
- { 0, 0 }
397
+ { "",
398
+ "",
399
+ zDefaultCSS
400
+ },
401
+ { "div.sidebox",
402
+ "The nomenclature sidebox for branches,..",
403
+ @ float: right;
404
+ @ background-color: white;
405
+ @ border-width: medium;
406
+ @ border-style: double;
407
+ @ margin: 10;
408
+ },
409
+ { "div.sideboxTitle",
410
+ "The nomenclature title in sideboxes for branches,..",
411
+ @ display: inline;
412
+ @ font-weight: bold;
413
+ },
414
+ { "div.sideboxDescribed",
415
+ "The defined element in sideboxes for branches,..",
416
+ @ display: inline;
417
+ @ font-weight: bold;
418
+ },
419
+ { "span.disabled",
420
+ "The defined element in sideboxes for branches,..",
421
+ @ color: red;
422
+ },
423
+ { "span.timelineDisabled",
424
+ "The suppressed duplicates lines in timeline, ..",
425
+ @ font-style: italic;
426
+ @ font-size: small;
427
+ },
428
+ { "table.timelineTable",
429
+ "the format for the timeline data table",
430
+ @ cellspacing: 0;
431
+ @ border: 0;
432
+ @ cellpadding: 0
433
+ },
434
+ { "td.timelineTableCell",
435
+ "the format for the timeline data cells",
436
+ @ valign: top;
437
+ @ align: left;
438
+ },
439
+ { "span.timelineLeaf",
440
+ "the format for the timeline leaf marks",
441
+ @ font-weight: bold;
442
+ },
443
+ { "a.timelineHistLink",
444
+ "the format for the timeline version links",
445
+ @
446
+ },
447
+ { "span.timelineHistDsp",
448
+ "the format for the timeline version display(no history permission!)",
449
+ @ font-weight: bold;
450
+ },
451
+ { "td.timelineTime",
452
+ "the format for the timeline time display",
453
+ @ vertical-align: top;
454
+ @ text-align: right;
455
+ },
456
+ { "a.tagLink",
457
+ "the format for the tag links",
458
+ @
459
+ },
460
+ { "span.tagDsp",
461
+ "the format for the tag display(no history permission!)",
462
+ @ font-weight: bold;
463
+ },
464
+ { "span.wikiError",
465
+ "the format for wiki errors",
466
+ @ font-weight: bold;
467
+ @ color: red;
468
+ },
469
+ { "span.infoTagCancelled",
470
+ "the format for fixed/canceled tags,..",
471
+ @ font-weight: bold;
472
+ @ text-decoration: line-through;
473
+ },
474
+ { "span.infoTag",
475
+ "the format for tags,..",
476
+ @ font-weight: bold;
477
+ },
478
+ { "span.wikiTagCancelled",
479
+ "the format for fixed/cancelled tags,.. on wiki pages",
480
+ @ text-decoration: line-through;
481
+ },
482
+ { "table.browser",
483
+ "format for the file display table",
484
+ @ /* the format for wiki errors */
485
+ @ width: 100%%;
486
+ @ border: 0;
487
+ },
488
+ { "td.browser",
489
+ "format for cells in the file browser",
490
+ @ width: 25%%;
491
+ @ vertical-align: top;
492
+ },
493
+ { "ul.browser",
494
+ "format for the list in the file browser",
495
+ @ margin-left: 0.5em;
496
+ @ padding-left: 0.5em;
497
+ },
498
+ { "table.login_out",
499
+ "table format for login/out label/input table",
500
+ @ text-align: left;
501
+ @ margin-right: 10px;
502
+ @ margin-left: 10px;
503
+ @ margin-top: 10px;
504
+ },
505
+ { "div.captcha",
506
+ "captcha display options",
507
+ @ text-align: center;
508
+ },
509
+ { "table.captcha",
510
+ "format for the layout table, used for the captcha display",
511
+ @ margin: auto;
512
+ @ padding: 10px;
513
+ @ outline-width: 1;
514
+ @ outline-style: double;
515
+ },
516
+ { "td.login_out_label",
517
+ "format for the label cells in the login/out table",
518
+ @ text-align: center;
519
+ },
520
+ { "span.loginError",
521
+ "format for login error messages",
522
+ @ color: red;
523
+ },
524
+ { "span.note",
525
+ "format for leading text for notes",
526
+ @ font-weight: bold;
527
+ },
528
+ { "span.textareaLabel",
529
+ "format for textare labels",
530
+ @ font-weight: bold;
531
+ },
532
+ { 0,
533
+ 0,
534
+ 0
535
+ }
575536
};
576537
577538
void cgi_append_default_css(void) {
578539
int i;
579540
580
- for (i=0;cssDefaultList[i].name;i++)
581
- cgi_printf(cssDefaultList[i].value);
541
+ for (i=0;cssDefaultList[i].elementClass;i++)
542
+ if (cssDefaultList[i].elementClass[0])
543
+ cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
544
+ cssDefaultList[i].comment,
545
+ cssDefaultList[i].elementClass,
546
+ cssDefaultList[i].value
547
+ );
548
+ else
549
+ cgi_printf("%s",
550
+ cssDefaultList[i].value
551
+ );
582552
}
583553
584554
/*
585555
** WEBPAGE: style.css
586556
*/
@@ -592,13 +562,20 @@
592562
cgi_set_content_type("text/css");
593563
zCSS = db_get("css",(char*)zDefaultCSS);
594564
/* append user defined css */
595565
cgi_append_content(zCSS, -1);
596566
/* add special missing definitions */
597
- for (i=1;cssDefaultList[i].name;i++)
598
- if (!strstr(zCSS,cssDefaultList[i].name))
567
+ for (i=1;cssDefaultList[i].elementClass;i++)
568
+ if (!strstr(zCSS,cssDefaultList[i].elementClass)) {
569
+ cgi_append_content("/* ", -1);
570
+ cgi_append_content(cssDefaultList[i].comment, -1);
571
+ cgi_append_content(" */\n", -1);
572
+ cgi_append_content(cssDefaultList[i].elementClass, -1);
573
+ cgi_append_content(" {\n", -1);
599574
cgi_append_content(cssDefaultList[i].value, -1);
575
+ cgi_append_content("}\n\n", -1);
576
+ }
600577
g.isConst = 1;
601578
}
602579
603580
/*
604581
** WEBPAGE: test_env
605582
--- src/style.c
+++ src/style.c
@@ -373,214 +373,184 @@
373 @ div.footer a { color: white; }
374 @ div.footer a:link { color: white; }
375 @ div.footer a:visited { color: white; }
376 @ div.footer a:hover { background-color: white; color: #558195; }
377 @
378 @ /* <verbatim> blocks */
379 @ pre.verbatim {
380 @ background-color: #f5f5f5;
381 @ padding: 0.5em;
382 @}
383 @
384 ;
385 const char zTableLabelValueCSS[] =
386 @ /* The label/value pairs on (for example) the ci page */
387 @ table.label-value th {
388 @ vertical-align: top;
389 @ text-align: right;
390 @ padding: 0.2ex 2ex;
391 @ }
392 @
393 ;
394 const char zDivSidebox[] =
395 @ /* The nomenclature sidebox for branches,.. */
396 @ div.sidebox {
397 @ float: right;
398 @ background-color: white;
399 @ border-width: medium;
400 @ border-style: double;
401 @ margin: 10;
402 @ }
403 @
404 ;
405 const char zDivSideboxTitle[] =
406 @ /* The nomenclature title in sideboxes for branches,.. */
407 @ div.sideboxTitle {
408 @ display: inline;
409 @ font-weight: bold;
410 @ }
411 @
412 ;
413 const char zDivSideboxDescribed[] =
414 @ /* The defined element in sideboxes for branches,.. */
415 @ div.sideboxDescribed {
416 @ display: inline;
417 @ font-weight: bold;
418 @ }
419 @
420 ;
421 const char zSpanDisabled[] =
422 @ /* The defined element in sideboxes for branches,.. */
423 @ span.disabled {
424 @ color: red;
425 @ }
426 @
427 ;
428 const char zSpanTimelineSuppressed[] =
429 @ /* The suppressed duplicates lines in timeline, .. */
430 @ span.timelineDisabled {
431 @ font-style: italic;
432 @ font-size: small;
433 @ }
434 @
435 ;
436 const char zTableTimelineTable[] =
437 @ /* the format for the timeline data table */
438 @ table.timelineTable {
439 @ cellspacing: 0;
440 @ border: 0;
441 @ cellpadding: 0
442 @ }
443 @
444 ;
445 const char zTdTimelineTableCell[] =
446 @ /* the format for the timeline data cells */
447 @ td.timelineTableCell {
448 @ valign: top;
449 @ align: left;
450 @ }
451 @
452 ;
453 const char zSpanTimelineLeaf[] =
454 @ /* the format for the timeline leaf marks */
455 @ span.timelineLeaf {
456 @ font-weight: bold;
457 @ }
458 @
459 ;
460 const char zATimelineHistLink[] =
461 @ /* the format for the timeline version links */
462 @ a.timelineHistLink {
463 @ }
464 @
465 ;
466 const char zSpanTimelineHistDsp[] =
467 @ /* the format for the timeline version display(no history permission!) */
468 @ span.timelineHistDsp {
469 @ font-weight: bold;
470 @ }
471 @
472 ;
473 const char zTdTimelineTime[] =
474 @ /* the format for the timeline time display */
475 @ td.timelineTime {
476 @ vertical-align: top;
477 @ text-align: right;
478 @ }
479 @
480 ;
481 const char zATagLink[] =
482 @ /* the format for the tag links */
483 @ a.tagLink {
484 @ }
485 @
486 ;
487 const char zSpanTagDsp[] =
488 @ /* the format for the tag display(no history permission!) */
489 @ span.tagDsp {
490 @ font-weight: bold;
491 @ }
492 @
493 ;
494 const char zSpanWikiError[] =
495 @ /* the format for wiki errors */
496 @ span.wikiError {
497 @ font-weight: bold;
498 @ color: red;
499 @ }
500 @
501 ;
502 const char zSpanInfoTagCancelled[] =
503 @ /* the format for wiki errors */
504 @ span.infoTagCancelled {
505 @ font-weight: bold;
506 @ text-decoration: line-through;
507 @ }
508 @
509 ;
510 const char zSpanInfoTag[] =
511 @ /* the format for wiki errors */
512 @ span.infoTag {
513 @ font-weight: bold;
514 @ }
515 @
516 ;
517 const char zSpanWikiTagCancelled[] =
518 @ /* the format for wiki errors */
519 @ span.wikiTagCancelled {
520 @ text-decoration: line-through;
521 @ }
522 @
523 ;
524 const char zTableBrowser[] =
525 @ /* the format for wiki errors */
526 @ table.browser {
527 @ width: 100%%;
528 @ border: 0;
529 @ }
530 @
531 ;
532 const char zTdBrowser[] =
533 @ /* the format for wiki errors */
534 @ td.browser {
535 @ width: 25%%;
536 @ vertical-align: top;
537 @ }
538 @
539 ;
540 const char zUlBrowser[] =
541 @ /* the format for wiki errors */
542 @ ul.browser {
543 @ margin-left: 0.5em;
544 @ padding-left: 0.5em;
545 @ }
546 @
547 ;
548 const struct strctCssDefaults {
549 char const * const name;
 
550 char const * const value;
551 } cssDefaultList[] = {
552 { "", zDefaultCSS },
553 { "table.label-value", zTableLabelValueCSS },
554 { "div.sidebox", zDivSidebox },
555 { "div.sideboxTitle", zDivSideboxTitle },
556 { "div.sideboxDescribed", zDivSideboxDescribed },
557 { "span.disabled", zSpanDisabled },
558 { "span.timelineDisabled", zSpanTimelineSuppressed },
559 { "table.timelineTable", zTableTimelineTable },
560 { "td.timelineTableCell", zTdTimelineTableCell },
561 { "span.timelineLeaf", zSpanTimelineLeaf },
562 { "a.timelineHistLink", zATimelineHistLink },
563 { "span.timelineHistDsp", zSpanTimelineHistDsp },
564 { "td.timelineTime", zTdTimelineTime },
565 { "a.tagLink", zATagLink },
566 { "span.tagDsp", zSpanTagDsp },
567 { "span.wikiError", zSpanWikiError },
568 { "span.infoTagCancelled", zSpanInfoTagCancelled },
569 { "span.infoTag", zSpanInfoTag },
570 { "span.wikiTagCancelled", zSpanWikiTagCancelled },
571 { "table.browser", zTableBrowser },
572 { "td.browser", zTdBrowser },
573 { "ul.browser", zUlBrowser },
574 { 0, 0 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
575 };
576
577 void cgi_append_default_css(void) {
578 int i;
579
580 for (i=0;cssDefaultList[i].name;i++)
581 cgi_printf(cssDefaultList[i].value);
 
 
 
 
 
 
 
 
 
582 }
583
584 /*
585 ** WEBPAGE: style.css
586 */
@@ -592,13 +562,20 @@
592 cgi_set_content_type("text/css");
593 zCSS = db_get("css",(char*)zDefaultCSS);
594 /* append user defined css */
595 cgi_append_content(zCSS, -1);
596 /* add special missing definitions */
597 for (i=1;cssDefaultList[i].name;i++)
598 if (!strstr(zCSS,cssDefaultList[i].name))
 
 
 
 
 
599 cgi_append_content(cssDefaultList[i].value, -1);
 
 
600 g.isConst = 1;
601 }
602
603 /*
604 ** WEBPAGE: test_env
605
--- src/style.c
+++ src/style.c
@@ -373,214 +373,184 @@
373 @ div.footer a { color: white; }
374 @ div.footer a:link { color: white; }
375 @ div.footer a:visited { color: white; }
376 @ div.footer a:hover { background-color: white; color: #558195; }
377 @
378 @ /* verbatim blocks */
379 @ pre.verbatim {
380 @ background-color: #f5f5f5;
381 @ padding: 0.5em;
382 @}
383 @
 
 
384 @ /* The label/value pairs on (for example) the ci page */
385 @ table.label-value th {
386 @ vertical-align: top;
387 @ text-align: right;
388 @ padding: 0.2ex 2ex;
389 @ }
390 @
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391 ;
392 const struct strctCssDefaults {
393 char const * const elementClass;
394 char const * const comment;
395 char const * const value;
396 } cssDefaultList[] = {
397 { "",
398 "",
399 zDefaultCSS
400 },
401 { "div.sidebox",
402 "The nomenclature sidebox for branches,..",
403 @ float: right;
404 @ background-color: white;
405 @ border-width: medium;
406 @ border-style: double;
407 @ margin: 10;
408 },
409 { "div.sideboxTitle",
410 "The nomenclature title in sideboxes for branches,..",
411 @ display: inline;
412 @ font-weight: bold;
413 },
414 { "div.sideboxDescribed",
415 "The defined element in sideboxes for branches,..",
416 @ display: inline;
417 @ font-weight: bold;
418 },
419 { "span.disabled",
420 "The defined element in sideboxes for branches,..",
421 @ color: red;
422 },
423 { "span.timelineDisabled",
424 "The suppressed duplicates lines in timeline, ..",
425 @ font-style: italic;
426 @ font-size: small;
427 },
428 { "table.timelineTable",
429 "the format for the timeline data table",
430 @ cellspacing: 0;
431 @ border: 0;
432 @ cellpadding: 0
433 },
434 { "td.timelineTableCell",
435 "the format for the timeline data cells",
436 @ valign: top;
437 @ align: left;
438 },
439 { "span.timelineLeaf",
440 "the format for the timeline leaf marks",
441 @ font-weight: bold;
442 },
443 { "a.timelineHistLink",
444 "the format for the timeline version links",
445 @
446 },
447 { "span.timelineHistDsp",
448 "the format for the timeline version display(no history permission!)",
449 @ font-weight: bold;
450 },
451 { "td.timelineTime",
452 "the format for the timeline time display",
453 @ vertical-align: top;
454 @ text-align: right;
455 },
456 { "a.tagLink",
457 "the format for the tag links",
458 @
459 },
460 { "span.tagDsp",
461 "the format for the tag display(no history permission!)",
462 @ font-weight: bold;
463 },
464 { "span.wikiError",
465 "the format for wiki errors",
466 @ font-weight: bold;
467 @ color: red;
468 },
469 { "span.infoTagCancelled",
470 "the format for fixed/canceled tags,..",
471 @ font-weight: bold;
472 @ text-decoration: line-through;
473 },
474 { "span.infoTag",
475 "the format for tags,..",
476 @ font-weight: bold;
477 },
478 { "span.wikiTagCancelled",
479 "the format for fixed/cancelled tags,.. on wiki pages",
480 @ text-decoration: line-through;
481 },
482 { "table.browser",
483 "format for the file display table",
484 @ /* the format for wiki errors */
485 @ width: 100%%;
486 @ border: 0;
487 },
488 { "td.browser",
489 "format for cells in the file browser",
490 @ width: 25%%;
491 @ vertical-align: top;
492 },
493 { "ul.browser",
494 "format for the list in the file browser",
495 @ margin-left: 0.5em;
496 @ padding-left: 0.5em;
497 },
498 { "table.login_out",
499 "table format for login/out label/input table",
500 @ text-align: left;
501 @ margin-right: 10px;
502 @ margin-left: 10px;
503 @ margin-top: 10px;
504 },
505 { "div.captcha",
506 "captcha display options",
507 @ text-align: center;
508 },
509 { "table.captcha",
510 "format for the layout table, used for the captcha display",
511 @ margin: auto;
512 @ padding: 10px;
513 @ outline-width: 1;
514 @ outline-style: double;
515 },
516 { "td.login_out_label",
517 "format for the label cells in the login/out table",
518 @ text-align: center;
519 },
520 { "span.loginError",
521 "format for login error messages",
522 @ color: red;
523 },
524 { "span.note",
525 "format for leading text for notes",
526 @ font-weight: bold;
527 },
528 { "span.textareaLabel",
529 "format for textare labels",
530 @ font-weight: bold;
531 },
532 { 0,
533 0,
534 0
535 }
536 };
537
538 void cgi_append_default_css(void) {
539 int i;
540
541 for (i=0;cssDefaultList[i].elementClass;i++)
542 if (cssDefaultList[i].elementClass[0])
543 cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
544 cssDefaultList[i].comment,
545 cssDefaultList[i].elementClass,
546 cssDefaultList[i].value
547 );
548 else
549 cgi_printf("%s",
550 cssDefaultList[i].value
551 );
552 }
553
554 /*
555 ** WEBPAGE: style.css
556 */
@@ -592,13 +562,20 @@
562 cgi_set_content_type("text/css");
563 zCSS = db_get("css",(char*)zDefaultCSS);
564 /* append user defined css */
565 cgi_append_content(zCSS, -1);
566 /* add special missing definitions */
567 for (i=1;cssDefaultList[i].elementClass;i++)
568 if (!strstr(zCSS,cssDefaultList[i].elementClass)) {
569 cgi_append_content("/* ", -1);
570 cgi_append_content(cssDefaultList[i].comment, -1);
571 cgi_append_content(" */\n", -1);
572 cgi_append_content(cssDefaultList[i].elementClass, -1);
573 cgi_append_content(" {\n", -1);
574 cgi_append_content(cssDefaultList[i].value, -1);
575 cgi_append_content("}\n\n", -1);
576 }
577 g.isConst = 1;
578 }
579
580 /*
581 ** WEBPAGE: test_env
582
+11 -8
--- src/translate.c
+++ src/translate.c
@@ -66,15 +66,16 @@
6666
6767
/*
6868
** Translate the input stream into the output stream
6969
*/
7070
static void trans(FILE *in, FILE *out){
71
- int i, j, k; /* Loop counters */
72
- char c1, c2; /* Characters used to start a comment */
73
- int lastWasEq = 0; /* True if last non-whitespace character was "=" */
74
- char zLine[2000]; /* A single line of input */
75
- char zOut[4000]; /* The input line translated into appropriate output */
71
+ int i, j, k; /* Loop counters */
72
+ char c1, c2; /* Characters used to start a comment */
73
+ int lastWasEq = 0; /* True if last non-whitespace character was "=" */
74
+ int lastWasComma = 0; /* True if last non-whitespace character was "," */
75
+ char zLine[2000]; /* A single line of input */
76
+ char zOut[4000]; /* The input line translated into appropriate output */
7677
7778
c1 = c2 = '-';
7879
while( fgets(zLine, sizeof(zLine), in) ){
7980
for(i=0; zLine[i] && isspace(zLine[i]); i++){}
8081
if( zLine[i]!='@' ){
@@ -85,14 +86,16 @@
8586
c1 = zLine[14];
8687
c2 = zLine[15];
8788
}
8889
i += strlen(&zLine[i]);
8990
while( i>0 && isspace(zLine[i-1]) ){ i--; }
90
- lastWasEq = i>0 && zLine[i-1]=='=';
91
- }else if( lastWasEq ){
91
+ lastWasEq = i>0 && zLine[i-1]=='=';
92
+ lastWasComma = i>0 && zLine[i-1]==',';
93
+ }else if( lastWasEq || lastWasComma){
9294
/* If the last non-whitespace character before the first @ was
93
- ** an "=" then generate a string literal. But skip comments
95
+ ** an "="(var init/set) or a ","(const definition in list) then
96
+ ** generate a string literal. But skip comments
9497
** consisting of all text between c1 and c2 (default "--")
9598
** and end of line.
9699
*/
97100
int indent, omitline;
98101
i++;
99102
--- src/translate.c
+++ src/translate.c
@@ -66,15 +66,16 @@
66
67 /*
68 ** Translate the input stream into the output stream
69 */
70 static void trans(FILE *in, FILE *out){
71 int i, j, k; /* Loop counters */
72 char c1, c2; /* Characters used to start a comment */
73 int lastWasEq = 0; /* True if last non-whitespace character was "=" */
74 char zLine[2000]; /* A single line of input */
75 char zOut[4000]; /* The input line translated into appropriate output */
 
76
77 c1 = c2 = '-';
78 while( fgets(zLine, sizeof(zLine), in) ){
79 for(i=0; zLine[i] && isspace(zLine[i]); i++){}
80 if( zLine[i]!='@' ){
@@ -85,14 +86,16 @@
85 c1 = zLine[14];
86 c2 = zLine[15];
87 }
88 i += strlen(&zLine[i]);
89 while( i>0 && isspace(zLine[i-1]) ){ i--; }
90 lastWasEq = i>0 && zLine[i-1]=='=';
91 }else if( lastWasEq ){
 
92 /* If the last non-whitespace character before the first @ was
93 ** an "=" then generate a string literal. But skip comments
 
94 ** consisting of all text between c1 and c2 (default "--")
95 ** and end of line.
96 */
97 int indent, omitline;
98 i++;
99
--- src/translate.c
+++ src/translate.c
@@ -66,15 +66,16 @@
66
67 /*
68 ** Translate the input stream into the output stream
69 */
70 static void trans(FILE *in, FILE *out){
71 int i, j, k; /* Loop counters */
72 char c1, c2; /* Characters used to start a comment */
73 int lastWasEq = 0; /* True if last non-whitespace character was "=" */
74 int lastWasComma = 0; /* True if last non-whitespace character was "," */
75 char zLine[2000]; /* A single line of input */
76 char zOut[4000]; /* The input line translated into appropriate output */
77
78 c1 = c2 = '-';
79 while( fgets(zLine, sizeof(zLine), in) ){
80 for(i=0; zLine[i] && isspace(zLine[i]); i++){}
81 if( zLine[i]!='@' ){
@@ -85,14 +86,16 @@
86 c1 = zLine[14];
87 c2 = zLine[15];
88 }
89 i += strlen(&zLine[i]);
90 while( i>0 && isspace(zLine[i-1]) ){ i--; }
91 lastWasEq = i>0 && zLine[i-1]=='=';
92 lastWasComma = i>0 && zLine[i-1]==',';
93 }else if( lastWasEq || lastWasComma){
94 /* If the last non-whitespace character before the first @ was
95 ** an "="(var init/set) or a ","(const definition in list) then
96 ** generate a string literal. But skip comments
97 ** consisting of all text between c1 and c2 (default "--")
98 ** and end of line.
99 */
100 int indent, omitline;
101 i++;
102

Keyboard Shortcuts

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