Fossil SCM
Wrapped the timeline-rendering JS in an anonymous function so that it no longer pollutes the global namespace. Added "type" tag to the script (required by HTML4, optional in HTML5).
Commit
e6d3e878a9a925787eb5f60f1698f2299478acda
Parent
fd223e5ec73d307…
1 file changed
+3
-3
+3
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -592,11 +592,11 @@ | ||
| 592 | 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | 593 | GraphRow *pRow; |
| 594 | 594 | int i; |
| 595 | 595 | char cSep; |
| 596 | 596 | |
| 597 | - @ <script> | |
| 597 | + @ <script type='text/javascript'>(function(){ | |
| 598 | 598 | @ var railPitch=%d(pGraph->iRailPitch); |
| 599 | 599 | |
| 600 | 600 | /* the rowinfo[] array contains all the information needed to generate |
| 601 | 601 | ** the graph. Each entry contains information for a single row: |
| 602 | 602 | ** |
| @@ -868,14 +868,14 @@ | ||
| 868 | 868 | @ var h = absoluteY(lastId); |
| 869 | 869 | @ if( h!=lastY ){ |
| 870 | 870 | @ renderGraph(); |
| 871 | 871 | @ lastY = h; |
| 872 | 872 | @ } |
| 873 | - @ setTimeout("checkHeight();", 1000); | |
| 873 | + @ setTimeout(arguments.callee, 1000); | |
| 874 | 874 | @ } |
| 875 | 875 | @ checkHeight(); |
| 876 | - @ </script> | |
| 876 | + @ })()</script> | |
| 877 | 877 | } |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | /* |
| 881 | 881 | ** Create a temporary table suitable for storing timeline data. |
| 882 | 882 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -592,11 +592,11 @@ | |
| 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | GraphRow *pRow; |
| 594 | int i; |
| 595 | char cSep; |
| 596 | |
| 597 | @ <script> |
| 598 | @ var railPitch=%d(pGraph->iRailPitch); |
| 599 | |
| 600 | /* the rowinfo[] array contains all the information needed to generate |
| 601 | ** the graph. Each entry contains information for a single row: |
| 602 | ** |
| @@ -868,14 +868,14 @@ | |
| 868 | @ var h = absoluteY(lastId); |
| 869 | @ if( h!=lastY ){ |
| 870 | @ renderGraph(); |
| 871 | @ lastY = h; |
| 872 | @ } |
| 873 | @ setTimeout("checkHeight();", 1000); |
| 874 | @ } |
| 875 | @ checkHeight(); |
| 876 | @ </script> |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | /* |
| 881 | ** Create a temporary table suitable for storing timeline data. |
| 882 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -592,11 +592,11 @@ | |
| 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | GraphRow *pRow; |
| 594 | int i; |
| 595 | char cSep; |
| 596 | |
| 597 | @ <script type='text/javascript'>(function(){ |
| 598 | @ var railPitch=%d(pGraph->iRailPitch); |
| 599 | |
| 600 | /* the rowinfo[] array contains all the information needed to generate |
| 601 | ** the graph. Each entry contains information for a single row: |
| 602 | ** |
| @@ -868,14 +868,14 @@ | |
| 868 | @ var h = absoluteY(lastId); |
| 869 | @ if( h!=lastY ){ |
| 870 | @ renderGraph(); |
| 871 | @ lastY = h; |
| 872 | @ } |
| 873 | @ setTimeout(arguments.callee, 1000); |
| 874 | @ } |
| 875 | @ checkHeight(); |
| 876 | @ })()</script> |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | /* |
| 881 | ** Create a temporary table suitable for storing timeline data. |
| 882 |