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.

stephan 2021-03-02 15:01 trunk
Commit 7db18bfe960901a2a7e3b9a40b19d73bc5717960b64040ebdd8a64d19f5c4b21
1 file changed +1 -1
+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -1172,11 +1172,11 @@
11721172
z = fossil_strdup(z);
11731173
add_param_list(z, '&');
11741174
z = (char*)P("skin");
11751175
if(z){
11761176
char *zErr = skin_use_alternative(z, 2);
1177
- if(!zErr){
1177
+ if(!zErr && !P("once")){
11781178
cookie_write_parameter("skin","skin",z);
11791179
}
11801180
fossil_free(zErr);
11811181
}
11821182
}
11831183
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button