Fossil SCM

merged in trunk [11abffbb497d67a], added a test script to check a th1 memleak case.

stephan 2012-07-22 17:59 th1-query-api merge
Commit 13b0e0b4d4edb91926c22a2e74cc9fb9b74ac76b
+1 -1
--- src/browse.c
+++ src/browse.c
@@ -120,11 +120,11 @@
120120
Blob dirname;
121121
Manifest *pM = 0;
122122
const char *zSubdirLink;
123123
124124
login_check_credentials();
125
- if( !g.perm.Hyperlink ){ login_needed(); return; }
125
+ if( !g.perm.Read ){ login_needed(); return; }
126126
while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
127127
style_header("File List");
128128
sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
129129
pathelementFunc, 0, 0);
130130
131131
--- src/browse.c
+++ src/browse.c
@@ -120,11 +120,11 @@
120 Blob dirname;
121 Manifest *pM = 0;
122 const char *zSubdirLink;
123
124 login_check_credentials();
125 if( !g.perm.Hyperlink ){ login_needed(); return; }
126 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
127 style_header("File List");
128 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
129 pathelementFunc, 0, 0);
130
131
--- src/browse.c
+++ src/browse.c
@@ -120,11 +120,11 @@
120 Blob dirname;
121 Manifest *pM = 0;
122 const char *zSubdirLink;
123
124 login_check_credentials();
125 if( !g.perm.Read ){ login_needed(); return; }
126 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
127 style_header("File List");
128 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
129 pathelementFunc, 0, 0);
130
131
+7 -9
--- src/info.c
+++ src/info.c
@@ -1388,15 +1388,11 @@
13881388
if( z[0]=='\n' ) z++;
13891389
}
13901390
if( n<iEnd ) cgi_printf("</div>");
13911391
@ </pre>
13921392
if( iStart ){
1393
- @ <script type="text/JavaScript">
1394
- @ /* <![CDATA[ */
1395
- @ document.getElementById('topln').scrollIntoView(true);
1396
- @ /* ]]> */
1397
- @ </script>
1393
+ @ <script>gebi('topln').scrollIntoView(true);</script>
13981394
}
13991395
}
14001396
14011397
14021398
/*
@@ -2005,13 +2001,14 @@
20052001
render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
20062002
@ </td></tr>
20072003
20082004
@ <tr><td align="right" valign="top"><b>Tags:</b></td>
20092005
@ <td valign="top">
2010
- @ <input type="checkbox" name="newtag"%s(zNewTagFlag) />
2006
+ @ <input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) />
20112007
@ Add the following new tag name to this check-in:
2012
- @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" />
2008
+ @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)"
2009
+ @ onkeyup="gebi('newtag').checked=!!this.value" />
20132010
db_prepare(&q,
20142011
"SELECT tag.tagid, tagname FROM tagxref, tag"
20152012
" WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
20162013
" ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
20172014
" ELSE tagname END /*sort*/",
@@ -2036,13 +2033,14 @@
20362033
db_finalize(&q);
20372034
@ </td></tr>
20382035
20392036
@ <tr><td align="right" valign="top"><b>Branching:</b></td>
20402037
@ <td valign="top">
2041
- @ <input type="checkbox" name="newbr"%s(zNewBrFlag) />
2038
+ @ <input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
20422039
@ Make this check-in the start of a new branch named:
2043
- @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" />
2040
+ @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2041
+ @ onkeyup="gebi('newbr').checked=!!this.value" />
20442042
@ </td></tr>
20452043
20462044
if( is_a_leaf(rid)
20472045
&& !db_exists("SELECT 1 FROM tagxref "
20482046
" WHERE tagid=%d AND rid=%d AND tagtype>0",
20492047
--- src/info.c
+++ src/info.c
@@ -1388,15 +1388,11 @@
1388 if( z[0]=='\n' ) z++;
1389 }
1390 if( n<iEnd ) cgi_printf("</div>");
1391 @ </pre>
1392 if( iStart ){
1393 @ <script type="text/JavaScript">
1394 @ /* <![CDATA[ */
1395 @ document.getElementById('topln').scrollIntoView(true);
1396 @ /* ]]> */
1397 @ </script>
1398 }
1399 }
1400
1401
1402 /*
@@ -2005,13 +2001,14 @@
2005 render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
2006 @ </td></tr>
2007
2008 @ <tr><td align="right" valign="top"><b>Tags:</b></td>
2009 @ <td valign="top">
2010 @ <input type="checkbox" name="newtag"%s(zNewTagFlag) />
2011 @ Add the following new tag name to this check-in:
2012 @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" />
 
2013 db_prepare(&q,
2014 "SELECT tag.tagid, tagname FROM tagxref, tag"
2015 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
2016 " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
2017 " ELSE tagname END /*sort*/",
@@ -2036,13 +2033,14 @@
2036 db_finalize(&q);
2037 @ </td></tr>
2038
2039 @ <tr><td align="right" valign="top"><b>Branching:</b></td>
2040 @ <td valign="top">
2041 @ <input type="checkbox" name="newbr"%s(zNewBrFlag) />
2042 @ Make this check-in the start of a new branch named:
2043 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" />
 
2044 @ </td></tr>
2045
2046 if( is_a_leaf(rid)
2047 && !db_exists("SELECT 1 FROM tagxref "
2048 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2049
--- src/info.c
+++ src/info.c
@@ -1388,15 +1388,11 @@
1388 if( z[0]=='\n' ) z++;
1389 }
1390 if( n<iEnd ) cgi_printf("</div>");
1391 @ </pre>
1392 if( iStart ){
1393 @ <script>gebi('topln').scrollIntoView(true);</script>
 
 
 
 
1394 }
1395 }
1396
1397
1398 /*
@@ -2005,13 +2001,14 @@
2001 render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
2002 @ </td></tr>
2003
2004 @ <tr><td align="right" valign="top"><b>Tags:</b></td>
2005 @ <td valign="top">
2006 @ <input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) />
2007 @ Add the following new tag name to this check-in:
2008 @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)"
2009 @ onkeyup="gebi('newtag').checked=!!this.value" />
2010 db_prepare(&q,
2011 "SELECT tag.tagid, tagname FROM tagxref, tag"
2012 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid"
2013 " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)"
2014 " ELSE tagname END /*sort*/",
@@ -2036,13 +2033,14 @@
2033 db_finalize(&q);
2034 @ </td></tr>
2035
2036 @ <tr><td align="right" valign="top"><b>Branching:</b></td>
2037 @ <td valign="top">
2038 @ <input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2039 @ Make this check-in the start of a new branch named:
2040 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2041 @ onkeyup="gebi('newbr').checked=!!this.value" />
2042 @ </td></tr>
2043
2044 if( is_a_leaf(rid)
2045 && !db_exists("SELECT 1 FROM tagxref "
2046 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2047
+2 -2
--- src/json_dir.c
+++ src/json_dir.c
@@ -66,12 +66,12 @@
6666
char * zUuid = NULL;
6767
char const * zCI = NULL;
6868
Manifest * pM = NULL;
6969
Stmt q = empty_Stmt;
7070
int rid = 0;
71
- if( !g.perm.Hyperlink ){
72
- json_set_err(FSL_JSON_E_DENIED, "Requires 'h' permissions.");
71
+ if( !g.perm.Read ){
72
+ json_set_err(FSL_JSON_E_DENIED, "Requires 'o' permissions.");
7373
return NULL;
7474
}
7575
zCI = json_find_option_cstr("checkin",NULL,"ci" );
7676
7777
/* If a specific check-in is requested, fetch and parse it. If the
7878
--- src/json_dir.c
+++ src/json_dir.c
@@ -66,12 +66,12 @@
66 char * zUuid = NULL;
67 char const * zCI = NULL;
68 Manifest * pM = NULL;
69 Stmt q = empty_Stmt;
70 int rid = 0;
71 if( !g.perm.Hyperlink ){
72 json_set_err(FSL_JSON_E_DENIED, "Requires 'h' permissions.");
73 return NULL;
74 }
75 zCI = json_find_option_cstr("checkin",NULL,"ci" );
76
77 /* If a specific check-in is requested, fetch and parse it. If the
78
--- src/json_dir.c
+++ src/json_dir.c
@@ -66,12 +66,12 @@
66 char * zUuid = NULL;
67 char const * zCI = NULL;
68 Manifest * pM = NULL;
69 Stmt q = empty_Stmt;
70 int rid = 0;
71 if( !g.perm.Read ){
72 json_set_err(FSL_JSON_E_DENIED, "Requires 'o' permissions.");
73 return NULL;
74 }
75 zCI = json_find_option_cstr("checkin",NULL,"ci" );
76
77 /* If a specific check-in is requested, fetch and parse it. If the
78
+2 -3
--- src/login.c
+++ src/login.c
@@ -594,11 +594,11 @@
594594
@ <td><input type="submit" name="in" value="Login"
595595
@ onClick="chngAction(this.form)" /></td>
596596
@ </tr>
597597
@ </table>
598598
@ <script type="text/JavaScript">
599
- @ document.getElementById('u').focus()
599
+ @ gebi('u').focus()
600600
@ function chngAction(form){
601601
if( g.sslNotAvailable==0
602602
&& memcmp(g.zBaseURL,"https:",6)!=0
603603
&& db_get_boolean("https-login",0)
604604
){
@@ -635,12 +635,11 @@
635635
@ <div class="captcha"><table class="captcha"><tr><td><pre>
636636
@ %s(zCaptcha)
637637
@ </pre></td></tr></table>
638638
if( bAutoCaptcha ) {
639639
@ <input type="button" value="Fill out captcha"
640
- @ onclick="document.getElementById('u').value='anonymous';
641
- @ document.getElementById('p').value='%s(zDecoded)';" />
640
+ @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" />
642641
}
643642
@ </div>
644643
free(zCaptcha);
645644
}
646645
if( g.zLogin ){
647646
--- src/login.c
+++ src/login.c
@@ -594,11 +594,11 @@
594 @ <td><input type="submit" name="in" value="Login"
595 @ onClick="chngAction(this.form)" /></td>
596 @ </tr>
597 @ </table>
598 @ <script type="text/JavaScript">
599 @ document.getElementById('u').focus()
600 @ function chngAction(form){
601 if( g.sslNotAvailable==0
602 && memcmp(g.zBaseURL,"https:",6)!=0
603 && db_get_boolean("https-login",0)
604 ){
@@ -635,12 +635,11 @@
635 @ <div class="captcha"><table class="captcha"><tr><td><pre>
636 @ %s(zCaptcha)
637 @ </pre></td></tr></table>
638 if( bAutoCaptcha ) {
639 @ <input type="button" value="Fill out captcha"
640 @ onclick="document.getElementById('u').value='anonymous';
641 @ document.getElementById('p').value='%s(zDecoded)';" />
642 }
643 @ </div>
644 free(zCaptcha);
645 }
646 if( g.zLogin ){
647
--- src/login.c
+++ src/login.c
@@ -594,11 +594,11 @@
594 @ <td><input type="submit" name="in" value="Login"
595 @ onClick="chngAction(this.form)" /></td>
596 @ </tr>
597 @ </table>
598 @ <script type="text/JavaScript">
599 @ gebi('u').focus()
600 @ function chngAction(form){
601 if( g.sslNotAvailable==0
602 && memcmp(g.zBaseURL,"https:",6)!=0
603 && db_get_boolean("https-login",0)
604 ){
@@ -635,12 +635,11 @@
635 @ <div class="captcha"><table class="captcha"><tr><td><pre>
636 @ %s(zCaptcha)
637 @ </pre></td></tr></table>
638 if( bAutoCaptcha ) {
639 @ <input type="button" value="Fill out captcha"
640 @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" />
 
641 }
642 @ </div>
643 free(zCaptcha);
644 }
645 if( g.zLogin ){
646
+1 -1
--- src/setup.c
+++ src/setup.c
@@ -1166,11 +1166,11 @@
11661166
} else {
11671167
@ <br />
11681168
}
11691169
}
11701170
}
1171
- @ </td><td style="width: 30;"></td><td valign="top">
1171
+ @ </td><td style="width:50px;"></td><td valign="top">
11721172
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
11731173
if( pSet->width!=0 ){
11741174
entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
11751175
pSet->var!=0 ? pSet->var : pSet->name,
11761176
(char*)pSet->def);
11771177
--- src/setup.c
+++ src/setup.c
@@ -1166,11 +1166,11 @@
1166 } else {
1167 @ <br />
1168 }
1169 }
1170 }
1171 @ </td><td style="width: 30;"></td><td valign="top">
1172 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1173 if( pSet->width!=0 ){
1174 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
1175 pSet->var!=0 ? pSet->var : pSet->name,
1176 (char*)pSet->def);
1177
--- src/setup.c
+++ src/setup.c
@@ -1166,11 +1166,11 @@
1166 } else {
1167 @ <br />
1168 }
1169 }
1170 }
1171 @ </td><td style="width:50px;"></td><td valign="top">
1172 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1173 if( pSet->width!=0 ){
1174 entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name,
1175 pSet->var!=0 ? pSet->var : pSet->name,
1176 (char*)pSet->def);
1177
+19 -2
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123123
void style_resolve_href(void){
124124
int i;
125125
if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126126
@ <script type="text/JavaScript">
127127
@ /* <![CDATA[ */
128
- @ function u(i,h){ document.getElementById(i).href=h; }
128
+ @ function u(i,h){gebi(i).href=h;}
129129
for(i=0; i<nHref; i++){
130130
@ u(%d(i+1),"%s(aHref[i])");
131131
}
132132
@ /* ]]> */
133133
@ </script>
@@ -173,11 +173,12 @@
173173
va_start(ap, zTitleFormat);
174174
zTitle = vmprintf(zTitleFormat, ap);
175175
va_end(ap);
176176
177177
cgi_destination(CGI_HEADER);
178
- cgi_printf("%s","<!DOCTYPE html>");
178
+
179
+ @ <!DOCTYPE html>
179180
180181
if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
181182
182183
/* Generate the header up through the main menu */
183184
Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
199200
Th_Unstore("title"); /* Avoid collisions with ticket field names */
200201
cgi_destination(CGI_BODY);
201202
g.cgiOutput = 1;
202203
headerHasBeenGenerated = 1;
203204
sideboxUsed = 0;
205
+
206
+ /* Make the gebi(x) function available as an almost-alias for
207
+ ** document.getElementById(x) (except that it throws if the element is not found).
208
+ **
209
+ ** Maintenance note: this function must of course be available
210
+ ** before it is called. It "should" go in the HEAD so that client
211
+ ** HEAD code can make use of it, but because the client can replace
212
+ ** the HEAD, and some fossil pages rely on gebi(), we put it here.
213
+ */
214
+ @ <script>
215
+ @ function gebi(x){
216
+ @ if(/^#/.test(x)) x = x.substr(1);
217
+ @ var e = document.getElementById(x);
218
+ @ if(!e) throw new Error("Expecting element with ID "+x);
219
+ @ else return e;}
220
+ @ </script>
204221
}
205222
206223
/*
207224
** Append ad unit text if appropriate.
208225
*/
209226
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123 void style_resolve_href(void){
124 int i;
125 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126 @ <script type="text/JavaScript">
127 @ /* <![CDATA[ */
128 @ function u(i,h){ document.getElementById(i).href=h; }
129 for(i=0; i<nHref; i++){
130 @ u(%d(i+1),"%s(aHref[i])");
131 }
132 @ /* ]]> */
133 @ </script>
@@ -173,11 +173,12 @@
173 va_start(ap, zTitleFormat);
174 zTitle = vmprintf(zTitleFormat, ap);
175 va_end(ap);
176
177 cgi_destination(CGI_HEADER);
178 cgi_printf("%s","<!DOCTYPE html>");
 
179
180 if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
181
182 /* Generate the header up through the main menu */
183 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
199 Th_Unstore("title"); /* Avoid collisions with ticket field names */
200 cgi_destination(CGI_BODY);
201 g.cgiOutput = 1;
202 headerHasBeenGenerated = 1;
203 sideboxUsed = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204 }
205
206 /*
207 ** Append ad unit text if appropriate.
208 */
209
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123 void style_resolve_href(void){
124 int i;
125 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126 @ <script type="text/JavaScript">
127 @ /* <![CDATA[ */
128 @ function u(i,h){gebi(i).href=h;}
129 for(i=0; i<nHref; i++){
130 @ u(%d(i+1),"%s(aHref[i])");
131 }
132 @ /* ]]> */
133 @ </script>
@@ -173,11 +173,12 @@
173 va_start(ap, zTitleFormat);
174 zTitle = vmprintf(zTitleFormat, ap);
175 va_end(ap);
176
177 cgi_destination(CGI_HEADER);
178
179 @ <!DOCTYPE html>
180
181 if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
182
183 /* Generate the header up through the main menu */
184 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
200 Th_Unstore("title"); /* Avoid collisions with ticket field names */
201 cgi_destination(CGI_BODY);
202 g.cgiOutput = 1;
203 headerHasBeenGenerated = 1;
204 sideboxUsed = 0;
205
206 /* Make the gebi(x) function available as an almost-alias for
207 ** document.getElementById(x) (except that it throws if the element is not found).
208 **
209 ** Maintenance note: this function must of course be available
210 ** before it is called. It "should" go in the HEAD so that client
211 ** HEAD code can make use of it, but because the client can replace
212 ** the HEAD, and some fossil pages rely on gebi(), we put it here.
213 */
214 @ <script>
215 @ function gebi(x){
216 @ if(/^#/.test(x)) x = x.substr(1);
217 @ var e = document.getElementById(x);
218 @ if(!e) throw new Error("Expecting element with ID "+x);
219 @ else return e;}
220 @ </script>
221 }
222
223 /*
224 ** Append ad unit text if appropriate.
225 */
226
+19 -2
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123123
void style_resolve_href(void){
124124
int i;
125125
if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126126
@ <script type="text/JavaScript">
127127
@ /* <![CDATA[ */
128
- @ function u(i,h){ document.getElementById(i).href=h; }
128
+ @ function u(i,h){gebi(i).href=h;}
129129
for(i=0; i<nHref; i++){
130130
@ u(%d(i+1),"%s(aHref[i])");
131131
}
132132
@ /* ]]> */
133133
@ </script>
@@ -173,11 +173,12 @@
173173
va_start(ap, zTitleFormat);
174174
zTitle = vmprintf(zTitleFormat, ap);
175175
va_end(ap);
176176
177177
cgi_destination(CGI_HEADER);
178
- cgi_printf("%s","<!DOCTYPE html>");
178
+
179
+ @ <!DOCTYPE html>
179180
180181
if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
181182
182183
/* Generate the header up through the main menu */
183184
Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
199200
Th_Unstore("title"); /* Avoid collisions with ticket field names */
200201
cgi_destination(CGI_BODY);
201202
g.cgiOutput = 1;
202203
headerHasBeenGenerated = 1;
203204
sideboxUsed = 0;
205
+
206
+ /* Make the gebi(x) function available as an almost-alias for
207
+ ** document.getElementById(x) (except that it throws if the element is not found).
208
+ **
209
+ ** Maintenance note: this function must of course be available
210
+ ** before it is called. It "should" go in the HEAD so that client
211
+ ** HEAD code can make use of it, but because the client can replace
212
+ ** the HEAD, and some fossil pages rely on gebi(), we put it here.
213
+ */
214
+ @ <script>
215
+ @ function gebi(x){
216
+ @ if(/^#/.test(x)) x = x.substr(1);
217
+ @ var e = document.getElementById(x);
218
+ @ if(!e) throw new Error("Expecting element with ID "+x);
219
+ @ else return e;}
220
+ @ </script>
204221
}
205222
206223
/*
207224
** Append ad unit text if appropriate.
208225
*/
209226
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123 void style_resolve_href(void){
124 int i;
125 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126 @ <script type="text/JavaScript">
127 @ /* <![CDATA[ */
128 @ function u(i,h){ document.getElementById(i).href=h; }
129 for(i=0; i<nHref; i++){
130 @ u(%d(i+1),"%s(aHref[i])");
131 }
132 @ /* ]]> */
133 @ </script>
@@ -173,11 +173,12 @@
173 va_start(ap, zTitleFormat);
174 zTitle = vmprintf(zTitleFormat, ap);
175 va_end(ap);
176
177 cgi_destination(CGI_HEADER);
178 cgi_printf("%s","<!DOCTYPE html>");
 
179
180 if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
181
182 /* Generate the header up through the main menu */
183 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
199 Th_Unstore("title"); /* Avoid collisions with ticket field names */
200 cgi_destination(CGI_BODY);
201 g.cgiOutput = 1;
202 headerHasBeenGenerated = 1;
203 sideboxUsed = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204 }
205
206 /*
207 ** Append ad unit text if appropriate.
208 */
209
--- src/style.c
+++ src/style.c
@@ -123,11 +123,11 @@
123 void style_resolve_href(void){
124 int i;
125 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return;
126 @ <script type="text/JavaScript">
127 @ /* <![CDATA[ */
128 @ function u(i,h){gebi(i).href=h;}
129 for(i=0; i<nHref; i++){
130 @ u(%d(i+1),"%s(aHref[i])");
131 }
132 @ /* ]]> */
133 @ </script>
@@ -173,11 +173,12 @@
173 va_start(ap, zTitleFormat);
174 zTitle = vmprintf(zTitleFormat, ap);
175 va_end(ap);
176
177 cgi_destination(CGI_HEADER);
178
179 @ <!DOCTYPE html>
180
181 if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1);
182
183 /* Generate the header up through the main menu */
184 Th_Store("project_name", db_get("project-name","Unnamed Fossil Project"));
@@ -199,10 +200,26 @@
200 Th_Unstore("title"); /* Avoid collisions with ticket field names */
201 cgi_destination(CGI_BODY);
202 g.cgiOutput = 1;
203 headerHasBeenGenerated = 1;
204 sideboxUsed = 0;
205
206 /* Make the gebi(x) function available as an almost-alias for
207 ** document.getElementById(x) (except that it throws if the element is not found).
208 **
209 ** Maintenance note: this function must of course be available
210 ** before it is called. It "should" go in the HEAD so that client
211 ** HEAD code can make use of it, but because the client can replace
212 ** the HEAD, and some fossil pages rely on gebi(), we put it here.
213 */
214 @ <script>
215 @ function gebi(x){
216 @ if(/^#/.test(x)) x = x.substr(1);
217 @ var e = document.getElementById(x);
218 @ if(!e) throw new Error("Expecting element with ID "+x);
219 @ else return e;}
220 @ </script>
221 }
222
223 /*
224 ** Append ad unit text if appropriate.
225 */
226
+5 -5
--- src/timeline.c
+++ src/timeline.c
@@ -567,11 +567,11 @@
567567
if( cSep=='[' ) cgi_printf("[");
568568
cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n");
569569
}
570570
cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
571571
graph_free(pGraph);
572
- @ var canvasDiv = document.getElementById("canvas");
572
+ @ var canvasDiv = gebi("canvas");
573573
#if 0
574574
@ var realCanvas = null;
575575
#endif
576576
@ function drawBox(color,x0,y0,x1,y1){
577577
@ var n = document.createElement("div");
@@ -587,11 +587,11 @@
587587
@ n.style.height = h+"px";
588588
@ n.style.backgroundColor = color;
589589
@ canvasDiv.appendChild(n);
590590
@ }
591591
@ function absoluteY(id){
592
- @ var obj = document.getElementById(id);
592
+ @ var obj = gebi(id);
593593
@ if( !obj ) return;
594594
@ var top = 0;
595595
@ if( obj.offsetParent ){
596596
@ do{
597597
@ top += obj.offsetTop;
@@ -598,11 +598,11 @@
598598
@ }while( obj = obj.offsetParent );
599599
@ }
600600
@ return top;
601601
@ }
602602
@ function absoluteX(id){
603
- @ var obj = document.getElementById(id);
603
+ @ var obj = gebi(id);
604604
@ if( !obj ) return;
605605
@ var left = 0;
606606
@ if( obj.offsetParent ){
607607
@ do{
608608
@ left += obj.offsetLeft;
@@ -687,11 +687,11 @@
687687
@ drawThinArrow(y0,mx,p.x-5);
688688
@ }
689689
@ }
690690
@ }
691691
@ function renderGraph(){
692
- @ var canvasDiv = document.getElementById("canvas");
692
+ @ var canvasDiv = gebi("canvas");
693693
@ while( canvasDiv.hasChildNodes() ){
694694
@ canvasDiv.removeChild(canvasDiv.firstChild);
695695
@ }
696696
@ var canvasY = absoluteY("timelineTable");
697697
@ var left = absoluteX("m"+rowinfo[0].id) - absoluteX("canvas") + 15;
@@ -704,11 +704,11 @@
704704
#if 0
705705
@ if( btm<32768 ){
706706
@ canvasDiv.innerHTML = '<canvas id="timeline-canvas" '+
707707
@ 'style="position:absolute;left:'+(left-5)+'px;"' +
708708
@ ' width="'+width+'" height="'+btm+'"><'+'/canvas>';
709
- @ realCanvas = document.getElementById('timeline-canvas');
709
+ @ realCanvas = gebi('timeline-canvas');
710710
@ }else{
711711
@ realCanvas = 0;
712712
@ }
713713
@ var context;
714714
@ if( realCanvas && realCanvas.getContext
715715
716716
ADDED test/th1-variadic-proc.th1
--- src/timeline.c
+++ src/timeline.c
@@ -567,11 +567,11 @@
567 if( cSep=='[' ) cgi_printf("[");
568 cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n");
569 }
570 cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
571 graph_free(pGraph);
572 @ var canvasDiv = document.getElementById("canvas");
573 #if 0
574 @ var realCanvas = null;
575 #endif
576 @ function drawBox(color,x0,y0,x1,y1){
577 @ var n = document.createElement("div");
@@ -587,11 +587,11 @@
587 @ n.style.height = h+"px";
588 @ n.style.backgroundColor = color;
589 @ canvasDiv.appendChild(n);
590 @ }
591 @ function absoluteY(id){
592 @ var obj = document.getElementById(id);
593 @ if( !obj ) return;
594 @ var top = 0;
595 @ if( obj.offsetParent ){
596 @ do{
597 @ top += obj.offsetTop;
@@ -598,11 +598,11 @@
598 @ }while( obj = obj.offsetParent );
599 @ }
600 @ return top;
601 @ }
602 @ function absoluteX(id){
603 @ var obj = document.getElementById(id);
604 @ if( !obj ) return;
605 @ var left = 0;
606 @ if( obj.offsetParent ){
607 @ do{
608 @ left += obj.offsetLeft;
@@ -687,11 +687,11 @@
687 @ drawThinArrow(y0,mx,p.x-5);
688 @ }
689 @ }
690 @ }
691 @ function renderGraph(){
692 @ var canvasDiv = document.getElementById("canvas");
693 @ while( canvasDiv.hasChildNodes() ){
694 @ canvasDiv.removeChild(canvasDiv.firstChild);
695 @ }
696 @ var canvasY = absoluteY("timelineTable");
697 @ var left = absoluteX("m"+rowinfo[0].id) - absoluteX("canvas") + 15;
@@ -704,11 +704,11 @@
704 #if 0
705 @ if( btm<32768 ){
706 @ canvasDiv.innerHTML = '<canvas id="timeline-canvas" '+
707 @ 'style="position:absolute;left:'+(left-5)+'px;"' +
708 @ ' width="'+width+'" height="'+btm+'"><'+'/canvas>';
709 @ realCanvas = document.getElementById('timeline-canvas');
710 @ }else{
711 @ realCanvas = 0;
712 @ }
713 @ var context;
714 @ if( realCanvas && realCanvas.getContext
715
716 DDED test/th1-variadic-proc.th1
--- src/timeline.c
+++ src/timeline.c
@@ -567,11 +567,11 @@
567 if( cSep=='[' ) cgi_printf("[");
568 cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n");
569 }
570 cgi_printf("var nrail = %d\n", pGraph->mxRail+1);
571 graph_free(pGraph);
572 @ var canvasDiv = gebi("canvas");
573 #if 0
574 @ var realCanvas = null;
575 #endif
576 @ function drawBox(color,x0,y0,x1,y1){
577 @ var n = document.createElement("div");
@@ -587,11 +587,11 @@
587 @ n.style.height = h+"px";
588 @ n.style.backgroundColor = color;
589 @ canvasDiv.appendChild(n);
590 @ }
591 @ function absoluteY(id){
592 @ var obj = gebi(id);
593 @ if( !obj ) return;
594 @ var top = 0;
595 @ if( obj.offsetParent ){
596 @ do{
597 @ top += obj.offsetTop;
@@ -598,11 +598,11 @@
598 @ }while( obj = obj.offsetParent );
599 @ }
600 @ return top;
601 @ }
602 @ function absoluteX(id){
603 @ var obj = gebi(id);
604 @ if( !obj ) return;
605 @ var left = 0;
606 @ if( obj.offsetParent ){
607 @ do{
608 @ left += obj.offsetLeft;
@@ -687,11 +687,11 @@
687 @ drawThinArrow(y0,mx,p.x-5);
688 @ }
689 @ }
690 @ }
691 @ function renderGraph(){
692 @ var canvasDiv = gebi("canvas");
693 @ while( canvasDiv.hasChildNodes() ){
694 @ canvasDiv.removeChild(canvasDiv.firstChild);
695 @ }
696 @ var canvasY = absoluteY("timelineTable");
697 @ var left = absoluteX("m"+rowinfo[0].id) - absoluteX("canvas") + 15;
@@ -704,11 +704,11 @@
704 #if 0
705 @ if( btm<32768 ){
706 @ canvasDiv.innerHTML = '<canvas id="timeline-canvas" '+
707 @ 'style="position:absolute;left:'+(left-5)+'px;"' +
708 @ ' width="'+width+'" height="'+btm+'"><'+'/canvas>';
709 @ realCanvas = gebi('timeline-canvas');
710 @ }else{
711 @ realCanvas = 0;
712 @ }
713 @ var context;
714 @ if( realCanvas && realCanvas.getContext
715
716 DDED test/th1-variadic-proc.th1
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
1
+<th1>
2
+proc vfunc {args} {
3
+ set argc [llength $args]
4
+ puts "argc=$argc Check this for a memleak when args length > 0\n"
5
+}
6
+vfunc
7
+vfunc 1
8
+vfunc 1 2
9
+vfunc 1 2 3
10
+</th1>
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
1 <th1>
2 proc vfunc {args} {
3 set argc [llength $args]
4 puts "argc=$argc Check this for a memleak when args length > 0\n"
5 }
6 vfunc
7 vfunc 1
8 vfunc 1 2
9 vfunc 1 2 3
10 </th1>
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
1
+<th1>
2
+proc vfunc {args} {
3
+ set argc [llength $args]
4
+ puts "argc=$argc Check this for a memleak when args length > 0\n"
5
+}
6
+vfunc
7
+vfunc 1
8
+vfunc 1 2
9
+vfunc 1 2 3
10
+</th1>
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
--- a/test/th1-variadic-proc.th1
+++ b/test/th1-variadic-proc.th1
@@ -0,0 +1,10 @@
1 <th1>
2 proc vfunc {args} {
3 set argc [llength $args]
4 puts "argc=$argc Check this for a memleak when args length > 0\n"
5 }
6 vfunc
7 vfunc 1
8 vfunc 1 2
9 vfunc 1 2 3
10 </th1>

Keyboard Shortcuts

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