Fossil SCM
Make gebi() work on browsers with javascipt < 5.1
Commit
e7ec49815b988811f8a8c4493209a5951a3a5e30
Parent
3b92154af8d44c0…
1 file changed
+2
-2
+2
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -406,13 +406,13 @@ | ||
| 406 | 406 | ** HEAD code can make use of it, but because the client can replace |
| 407 | 407 | ** the HEAD, and some fossil pages rely on gebi(), we put it here. |
| 408 | 408 | */ |
| 409 | 409 | @ <script> |
| 410 | 410 | @ function gebi(x){ |
| 411 | - @ if(/^#/.test(x)) x = x.substr(1); | |
| 411 | + @ if(x.substr(0,1)=='#') x = x.substr(1); | |
| 412 | 412 | @ var e = document.getElementById(x); |
| 413 | - @ if(!e) throw new Error("Expecting element with ID "+x); | |
| 413 | + @ if(!e) throw new Error('Expecting element with ID '+x); | |
| 414 | 414 | @ else return e;} |
| 415 | 415 | @ </script> |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | #if INTERFACE |
| 419 | 419 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -406,13 +406,13 @@ | |
| 406 | ** HEAD code can make use of it, but because the client can replace |
| 407 | ** the HEAD, and some fossil pages rely on gebi(), we put it here. |
| 408 | */ |
| 409 | @ <script> |
| 410 | @ function gebi(x){ |
| 411 | @ if(/^#/.test(x)) x = x.substr(1); |
| 412 | @ var e = document.getElementById(x); |
| 413 | @ if(!e) throw new Error("Expecting element with ID "+x); |
| 414 | @ else return e;} |
| 415 | @ </script> |
| 416 | } |
| 417 | |
| 418 | #if INTERFACE |
| 419 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -406,13 +406,13 @@ | |
| 406 | ** HEAD code can make use of it, but because the client can replace |
| 407 | ** the HEAD, and some fossil pages rely on gebi(), we put it here. |
| 408 | */ |
| 409 | @ <script> |
| 410 | @ function gebi(x){ |
| 411 | @ if(x.substr(0,1)=='#') x = x.substr(1); |
| 412 | @ var e = document.getElementById(x); |
| 413 | @ if(!e) throw new Error('Expecting element with ID '+x); |
| 414 | @ else return e;} |
| 415 | @ </script> |
| 416 | } |
| 417 | |
| 418 | #if INTERFACE |
| 419 |