Fossil SCM
Fix [c9525608f06] to ensure that we do not pass an empty CSS class name to domElement.classList.add(), as that breaks /pikchrshow and possibly other pages.
Commit
db3c8e1e49633645d04d469ec70e037f53c01f5b9e8891567b345f750cc17ab0
Parent
ee873715cc5f293…
1 file changed
+2
-2
+2
-2
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -705,12 +705,12 @@ | ||
| 705 | 705 | ** Summary: custom skins which emit their own BODY need to have |
| 706 | 706 | ** the BODY element's CSS classes set so that various CSS selectors |
| 707 | 707 | ** and JS-side filters will work. */ |
| 708 | 708 | char *pSlash = strchr(g.zPath,'/')/*hack taken from style.c*/; |
| 709 | 709 | if( pSlash ) *pSlash = 0; |
| 710 | - CX("document.body.classList.add(%!j, \"rpage-%j\"," | |
| 711 | - "\"cpage-%j\");\n", | |
| 710 | + CX("for(const x of [%!j, \"rpage-%j\",\"cpage-%j\"]) {" | |
| 711 | + "if(x) document.body.classList.add(x);};\n", | |
| 712 | 712 | style_get_current_feature(), g.zPath, g.zPhase+1); |
| 713 | 713 | if( pSlash ) *pSlash = '/'; |
| 714 | 714 | } |
| 715 | 715 | CX("if(fossil.config.skin.isDark) " |
| 716 | 716 | "document.body.classList.add('fossil-dark-style');\n"); |
| 717 | 717 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -705,12 +705,12 @@ | |
| 705 | ** Summary: custom skins which emit their own BODY need to have |
| 706 | ** the BODY element's CSS classes set so that various CSS selectors |
| 707 | ** and JS-side filters will work. */ |
| 708 | char *pSlash = strchr(g.zPath,'/')/*hack taken from style.c*/; |
| 709 | if( pSlash ) *pSlash = 0; |
| 710 | CX("document.body.classList.add(%!j, \"rpage-%j\"," |
| 711 | "\"cpage-%j\");\n", |
| 712 | style_get_current_feature(), g.zPath, g.zPhase+1); |
| 713 | if( pSlash ) *pSlash = '/'; |
| 714 | } |
| 715 | CX("if(fossil.config.skin.isDark) " |
| 716 | "document.body.classList.add('fossil-dark-style');\n"); |
| 717 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -705,12 +705,12 @@ | |
| 705 | ** Summary: custom skins which emit their own BODY need to have |
| 706 | ** the BODY element's CSS classes set so that various CSS selectors |
| 707 | ** and JS-side filters will work. */ |
| 708 | char *pSlash = strchr(g.zPath,'/')/*hack taken from style.c*/; |
| 709 | if( pSlash ) *pSlash = 0; |
| 710 | CX("for(const x of [%!j, \"rpage-%j\",\"cpage-%j\"]) {" |
| 711 | "if(x) document.body.classList.add(x);};\n", |
| 712 | style_get_current_feature(), g.zPath, g.zPhase+1); |
| 713 | if( pSlash ) *pSlash = '/'; |
| 714 | } |
| 715 | CX("if(fossil.config.skin.isDark) " |
| 716 | "document.body.classList.add('fossil-dark-style');\n"); |
| 717 |