Fossil SCM
Create a javascript function $(id) which is an alias for document.getElementById(id). Use the $(id) function everywhere that document.getElementById(id) was used.
Commit
97d651b85a74ba6cb56a7ad752c4dd2f076fee1c
Parent
b2164fb70c0e4d0…
4 files changed
+3
-7
+2
-3
+7
-2
+5
-5
+3
-7
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1388,15 +1388,11 @@ | ||
| 1388 | 1388 | if( z[0]=='\n' ) z++; |
| 1389 | 1389 | } |
| 1390 | 1390 | if( n<iEnd ) cgi_printf("</div>"); |
| 1391 | 1391 | @ </pre> |
| 1392 | 1392 | if( iStart ){ |
| 1393 | - @ <script type="text/JavaScript"> | |
| 1394 | - @ /* <![CDATA[ */ | |
| 1395 | - @ document.getElementById('topln').scrollIntoView(true); | |
| 1396 | - @ /* ]]> */ | |
| 1397 | - @ </script> | |
| 1393 | + @ <script>$('topln').scrollIntoView(true);</script> | |
| 1398 | 1394 | } |
| 1399 | 1395 | } |
| 1400 | 1396 | |
| 1401 | 1397 | |
| 1402 | 1398 | /* |
| @@ -2008,11 +2004,11 @@ | ||
| 2008 | 2004 | @ <tr><td align="right" valign="top"><b>Tags:</b></td> |
| 2009 | 2005 | @ <td valign="top"> |
| 2010 | 2006 | @ <input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2011 | 2007 | @ Add the following new tag name to this check-in: |
| 2012 | 2008 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2013 | - @ onkeyup="document.getElementById('newtag').checked=!!this.value" /> | |
| 2009 | + @ onkeyup="$('newtag').checked=!!this.value" /> | |
| 2014 | 2010 | db_prepare(&q, |
| 2015 | 2011 | "SELECT tag.tagid, tagname FROM tagxref, tag" |
| 2016 | 2012 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2017 | 2013 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2018 | 2014 | " ELSE tagname END /*sort*/", |
| @@ -2040,11 +2036,11 @@ | ||
| 2040 | 2036 | @ <tr><td align="right" valign="top"><b>Branching:</b></td> |
| 2041 | 2037 | @ <td valign="top"> |
| 2042 | 2038 | @ <input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) /> |
| 2043 | 2039 | @ Make this check-in the start of a new branch named: |
| 2044 | 2040 | @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" |
| 2045 | - @ onkeyup="document.getElementById('newbr').checked=!!this.value" /> | |
| 2041 | + @ onkeyup="$('newbr').checked=!!this.value" /> | |
| 2046 | 2042 | @ </td></tr> |
| 2047 | 2043 | |
| 2048 | 2044 | if( is_a_leaf(rid) |
| 2049 | 2045 | && !db_exists("SELECT 1 FROM tagxref " |
| 2050 | 2046 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 2051 | 2047 |
| --- 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 | /* |
| @@ -2008,11 +2004,11 @@ | |
| 2008 | @ <tr><td align="right" valign="top"><b>Tags:</b></td> |
| 2009 | @ <td valign="top"> |
| 2010 | @ <input type="checkbox" id="newtag" 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 | @ onkeyup="document.getElementById('newtag').checked=!!this.value" /> |
| 2014 | db_prepare(&q, |
| 2015 | "SELECT tag.tagid, tagname FROM tagxref, tag" |
| 2016 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2017 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2018 | " ELSE tagname END /*sort*/", |
| @@ -2040,11 +2036,11 @@ | |
| 2040 | @ <tr><td align="right" valign="top"><b>Branching:</b></td> |
| 2041 | @ <td valign="top"> |
| 2042 | @ <input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) /> |
| 2043 | @ Make this check-in the start of a new branch named: |
| 2044 | @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)" |
| 2045 | @ onkeyup="document.getElementById('newbr').checked=!!this.value" /> |
| 2046 | @ </td></tr> |
| 2047 | |
| 2048 | if( is_a_leaf(rid) |
| 2049 | && !db_exists("SELECT 1 FROM tagxref " |
| 2050 | " WHERE tagid=%d AND rid=%d AND tagtype>0", |
| 2051 |
| --- 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>$('topln').scrollIntoView(true);</script> |
| 1394 | } |
| 1395 | } |
| 1396 | |
| 1397 | |
| 1398 | /* |
| @@ -2008,11 +2004,11 @@ | |
| 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="$('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*/", |
| @@ -2040,11 +2036,11 @@ | |
| 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="$('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
-3
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -594,11 +594,11 @@ | ||
| 594 | 594 | @ <td><input type="submit" name="in" value="Login" |
| 595 | 595 | @ onClick="chngAction(this.form)" /></td> |
| 596 | 596 | @ </tr> |
| 597 | 597 | @ </table> |
| 598 | 598 | @ <script type="text/JavaScript"> |
| 599 | - @ document.getElementById('u').focus() | |
| 599 | + @ $('u').focus() | |
| 600 | 600 | @ function chngAction(form){ |
| 601 | 601 | if( g.sslNotAvailable==0 |
| 602 | 602 | && memcmp(g.zBaseURL,"https:",6)!=0 |
| 603 | 603 | && db_get_boolean("https-login",0) |
| 604 | 604 | ){ |
| @@ -635,12 +635,11 @@ | ||
| 635 | 635 | @ <div class="captcha"><table class="captcha"><tr><td><pre> |
| 636 | 636 | @ %s(zCaptcha) |
| 637 | 637 | @ </pre></td></tr></table> |
| 638 | 638 | if( bAutoCaptcha ) { |
| 639 | 639 | @ <input type="button" value="Fill out captcha" |
| 640 | - @ onclick="document.getElementById('u').value='anonymous'; | |
| 641 | - @ document.getElementById('p').value='%s(zDecoded)';" /> | |
| 640 | + @ onclick="$('u').value='anonymous'; $('p').value='%s(zDecoded)';" /> | |
| 642 | 641 | } |
| 643 | 642 | @ </div> |
| 644 | 643 | free(zCaptcha); |
| 645 | 644 | } |
| 646 | 645 | if( g.zLogin ){ |
| 647 | 646 |
| --- 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 | @ $('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="$('u').value='anonymous'; $('p').value='%s(zDecoded)';" /> |
| 641 | } |
| 642 | @ </div> |
| 643 | free(zCaptcha); |
| 644 | } |
| 645 | if( g.zLogin ){ |
| 646 |
+7
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -124,11 +124,11 @@ | ||
| 124 | 124 | void style_resolve_href(void){ |
| 125 | 125 | int i; |
| 126 | 126 | if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return; |
| 127 | 127 | @ <script type="text/JavaScript"> |
| 128 | 128 | @ /* <![CDATA[ */ |
| 129 | - @ function u(i,h){ document.getElementById(i).href=h; } | |
| 129 | + @ function u(i,h){$(i).href=h;} | |
| 130 | 130 | for(i=0; i<nHref; i++){ |
| 131 | 131 | @ u(%d(i+1),"%s(aHref[i])"); |
| 132 | 132 | } |
| 133 | 133 | @ /* ]]> */ |
| 134 | 134 | @ </script> |
| @@ -174,11 +174,12 @@ | ||
| 174 | 174 | va_start(ap, zTitleFormat); |
| 175 | 175 | zTitle = vmprintf(zTitleFormat, ap); |
| 176 | 176 | va_end(ap); |
| 177 | 177 | |
| 178 | 178 | cgi_destination(CGI_HEADER); |
| 179 | - cgi_printf("%s","<!DOCTYPE html>"); | |
| 179 | + | |
| 180 | + @ <!DOCTYPE html> | |
| 180 | 181 | |
| 181 | 182 | if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1); |
| 182 | 183 | |
| 183 | 184 | /* Generate the header up through the main menu */ |
| 184 | 185 | Th_Store("project_name", db_get("project-name","Unnamed Fossil Project")); |
| @@ -200,10 +201,14 @@ | ||
| 200 | 201 | Th_Unstore("title"); /* Avoid collisions with ticket field names */ |
| 201 | 202 | cgi_destination(CGI_BODY); |
| 202 | 203 | g.cgiOutput = 1; |
| 203 | 204 | headerHasBeenGenerated = 1; |
| 204 | 205 | sideboxUsed = 0; |
| 206 | + | |
| 207 | + /* Make the $(x) function available as an alias for | |
| 208 | + ** document.getElementById(x), since it seems like everybody does this */ | |
| 209 | + @ <script>function $(x){return document.getElementById(x);}</script> | |
| 205 | 210 | } |
| 206 | 211 | |
| 207 | 212 | /* |
| 208 | 213 | ** Append ad unit text if appropriate. |
| 209 | 214 | */ |
| 210 | 215 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -124,11 +124,11 @@ | |
| 124 | void style_resolve_href(void){ |
| 125 | int i; |
| 126 | if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return; |
| 127 | @ <script type="text/JavaScript"> |
| 128 | @ /* <![CDATA[ */ |
| 129 | @ function u(i,h){ document.getElementById(i).href=h; } |
| 130 | for(i=0; i<nHref; i++){ |
| 131 | @ u(%d(i+1),"%s(aHref[i])"); |
| 132 | } |
| 133 | @ /* ]]> */ |
| 134 | @ </script> |
| @@ -174,11 +174,12 @@ | |
| 174 | va_start(ap, zTitleFormat); |
| 175 | zTitle = vmprintf(zTitleFormat, ap); |
| 176 | va_end(ap); |
| 177 | |
| 178 | cgi_destination(CGI_HEADER); |
| 179 | cgi_printf("%s","<!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")); |
| @@ -200,10 +201,14 @@ | |
| 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 | |
| 207 | /* |
| 208 | ** Append ad unit text if appropriate. |
| 209 | */ |
| 210 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -124,11 +124,11 @@ | |
| 124 | void style_resolve_href(void){ |
| 125 | int i; |
| 126 | if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return; |
| 127 | @ <script type="text/JavaScript"> |
| 128 | @ /* <![CDATA[ */ |
| 129 | @ function u(i,h){$(i).href=h;} |
| 130 | for(i=0; i<nHref; i++){ |
| 131 | @ u(%d(i+1),"%s(aHref[i])"); |
| 132 | } |
| 133 | @ /* ]]> */ |
| 134 | @ </script> |
| @@ -174,11 +174,12 @@ | |
| 174 | va_start(ap, zTitleFormat); |
| 175 | zTitle = vmprintf(zTitleFormat, ap); |
| 176 | va_end(ap); |
| 177 | |
| 178 | cgi_destination(CGI_HEADER); |
| 179 | |
| 180 | @ <!DOCTYPE html> |
| 181 | |
| 182 | if( g.thTrace ) Th_Trace("BEGIN_HEADER<br />\n", -1); |
| 183 | |
| 184 | /* Generate the header up through the main menu */ |
| 185 | Th_Store("project_name", db_get("project-name","Unnamed Fossil Project")); |
| @@ -200,10 +201,14 @@ | |
| 201 | Th_Unstore("title"); /* Avoid collisions with ticket field names */ |
| 202 | cgi_destination(CGI_BODY); |
| 203 | g.cgiOutput = 1; |
| 204 | headerHasBeenGenerated = 1; |
| 205 | sideboxUsed = 0; |
| 206 | |
| 207 | /* Make the $(x) function available as an alias for |
| 208 | ** document.getElementById(x), since it seems like everybody does this */ |
| 209 | @ <script>function $(x){return document.getElementById(x);}</script> |
| 210 | } |
| 211 | |
| 212 | /* |
| 213 | ** Append ad unit text if appropriate. |
| 214 | */ |
| 215 |
+5
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -567,11 +567,11 @@ | ||
| 567 | 567 | if( cSep=='[' ) cgi_printf("["); |
| 568 | 568 | cgi_printf("]}%s", pRow->pNext ? ",\n" : "];\n"); |
| 569 | 569 | } |
| 570 | 570 | cgi_printf("var nrail = %d\n", pGraph->mxRail+1); |
| 571 | 571 | graph_free(pGraph); |
| 572 | - @ var canvasDiv = document.getElementById("canvas"); | |
| 572 | + @ var canvasDiv = $("canvas"); | |
| 573 | 573 | #if 0 |
| 574 | 574 | @ var realCanvas = null; |
| 575 | 575 | #endif |
| 576 | 576 | @ function drawBox(color,x0,y0,x1,y1){ |
| 577 | 577 | @ var n = document.createElement("div"); |
| @@ -587,11 +587,11 @@ | ||
| 587 | 587 | @ n.style.height = h+"px"; |
| 588 | 588 | @ n.style.backgroundColor = color; |
| 589 | 589 | @ canvasDiv.appendChild(n); |
| 590 | 590 | @ } |
| 591 | 591 | @ function absoluteY(id){ |
| 592 | - @ var obj = document.getElementById(id); | |
| 592 | + @ var obj = $(id); | |
| 593 | 593 | @ if( !obj ) return; |
| 594 | 594 | @ var top = 0; |
| 595 | 595 | @ if( obj.offsetParent ){ |
| 596 | 596 | @ do{ |
| 597 | 597 | @ top += obj.offsetTop; |
| @@ -598,11 +598,11 @@ | ||
| 598 | 598 | @ }while( obj = obj.offsetParent ); |
| 599 | 599 | @ } |
| 600 | 600 | @ return top; |
| 601 | 601 | @ } |
| 602 | 602 | @ function absoluteX(id){ |
| 603 | - @ var obj = document.getElementById(id); | |
| 603 | + @ var obj = $(id); | |
| 604 | 604 | @ if( !obj ) return; |
| 605 | 605 | @ var left = 0; |
| 606 | 606 | @ if( obj.offsetParent ){ |
| 607 | 607 | @ do{ |
| 608 | 608 | @ left += obj.offsetLeft; |
| @@ -687,11 +687,11 @@ | ||
| 687 | 687 | @ drawThinArrow(y0,mx,p.x-5); |
| 688 | 688 | @ } |
| 689 | 689 | @ } |
| 690 | 690 | @ } |
| 691 | 691 | @ function renderGraph(){ |
| 692 | - @ var canvasDiv = document.getElementById("canvas"); | |
| 692 | + @ var canvasDiv = $("canvas"); | |
| 693 | 693 | @ while( canvasDiv.hasChildNodes() ){ |
| 694 | 694 | @ canvasDiv.removeChild(canvasDiv.firstChild); |
| 695 | 695 | @ } |
| 696 | 696 | @ var canvasY = absoluteY("timelineTable"); |
| 697 | 697 | @ var left = absoluteX("m"+rowinfo[0].id) - absoluteX("canvas") + 15; |
| @@ -704,11 +704,11 @@ | ||
| 704 | 704 | #if 0 |
| 705 | 705 | @ if( btm<32768 ){ |
| 706 | 706 | @ canvasDiv.innerHTML = '<canvas id="timeline-canvas" '+ |
| 707 | 707 | @ 'style="position:absolute;left:'+(left-5)+'px;"' + |
| 708 | 708 | @ ' width="'+width+'" height="'+btm+'"><'+'/canvas>'; |
| 709 | - @ realCanvas = document.getElementById('timeline-canvas'); | |
| 709 | + @ realCanvas = $('timeline-canvas'); | |
| 710 | 710 | @ }else{ |
| 711 | 711 | @ realCanvas = 0; |
| 712 | 712 | @ } |
| 713 | 713 | @ var context; |
| 714 | 714 | @ if( realCanvas && realCanvas.getContext |
| 715 | 715 |
| --- 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 |
| --- 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 = $("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 = $(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 = $(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 = $("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 = $('timeline-canvas'); |
| 710 | @ }else{ |
| 711 | @ realCanvas = 0; |
| 712 | @ } |
| 713 | @ var context; |
| 714 | @ if( realCanvas && realCanvas.getContext |
| 715 |