Fossil SCM
When skin=X query parameter is processed, if a param named 'once' is also set then apply the skin change but do not save it to the cookie, as per /chat discussion. The intent is mainly to facilitate the development of docs using both light- and dark-mode skins at the same time, which is somewhat painful when the cookie constantly gets overwritten.
Commit
7db18bfe960901a2a7e3b9a40b19d73bc5717960b64040ebdd8a64d19f5c4b21
Parent
333942077877612…
1 file changed
+1
-1
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1172,11 +1172,11 @@ | ||
| 1172 | 1172 | z = fossil_strdup(z); |
| 1173 | 1173 | add_param_list(z, '&'); |
| 1174 | 1174 | z = (char*)P("skin"); |
| 1175 | 1175 | if(z){ |
| 1176 | 1176 | char *zErr = skin_use_alternative(z, 2); |
| 1177 | - if(!zErr){ | |
| 1177 | + if(!zErr && !P("once")){ | |
| 1178 | 1178 | cookie_write_parameter("skin","skin",z); |
| 1179 | 1179 | } |
| 1180 | 1180 | fossil_free(zErr); |
| 1181 | 1181 | } |
| 1182 | 1182 | } |
| 1183 | 1183 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1172,11 +1172,11 @@ | |
| 1172 | z = fossil_strdup(z); |
| 1173 | add_param_list(z, '&'); |
| 1174 | z = (char*)P("skin"); |
| 1175 | if(z){ |
| 1176 | char *zErr = skin_use_alternative(z, 2); |
| 1177 | if(!zErr){ |
| 1178 | cookie_write_parameter("skin","skin",z); |
| 1179 | } |
| 1180 | fossil_free(zErr); |
| 1181 | } |
| 1182 | } |
| 1183 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1172,11 +1172,11 @@ | |
| 1172 | z = fossil_strdup(z); |
| 1173 | add_param_list(z, '&'); |
| 1174 | z = (char*)P("skin"); |
| 1175 | if(z){ |
| 1176 | char *zErr = skin_use_alternative(z, 2); |
| 1177 | if(!zErr && !P("once")){ |
| 1178 | cookie_write_parameter("skin","skin",z); |
| 1179 | } |
| 1180 | fossil_free(zErr); |
| 1181 | } |
| 1182 | } |
| 1183 |