Fossil SCM
Remove the "default-skin" setting that was added by [24e015de71cfdc79].
Commit
1975bfd279759471d7aac8c83bf72500911b27f1e11b98f66ddd4e2966dd9f6f
Parent
33cc83ffb8550a8…
1 file changed
+5
-37
+5
-37
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -19,17 +19,10 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include <assert.h> |
| 22 | 22 | #include "skins.h" |
| 23 | 23 | |
| 24 | -/* | |
| 25 | -** SETTING: default-skin width=16 | |
| 26 | -** | |
| 27 | -** If the text value if this setting is the name of a built-in skin | |
| 28 | -** then the named skin becomes the default skin for the repository. | |
| 29 | -*/ | |
| 30 | - | |
| 31 | 24 | /* |
| 32 | 25 | ** An array of available built-in skins. |
| 33 | 26 | ** |
| 34 | 27 | ** To add new built-in skins: |
| 35 | 28 | ** |
| @@ -94,16 +87,14 @@ | ||
| 94 | 87 | #define SKIN_FROM_DRAFT 0 /* The "draftN" prefix on the PATH_INFO */ |
| 95 | 88 | #define SKIN_FROM_CMDLINE 1 /* --skin option to server command-line */ |
| 96 | 89 | #define SKIN_FROM_CGI 2 /* skin: parameter in CGI script */ |
| 97 | 90 | #define SKIN_FROM_QPARAM 3 /* skin= query parameter */ |
| 98 | 91 | #define SKIN_FROM_COOKIE 4 /* skin= from fossil_display_settings cookie*/ |
| 99 | -#define SKIN_FROM_SETTING 5 /* Built-in named by "default-skin" setting */ | |
| 100 | -#define SKIN_FROM_CUSTOM 6 /* Skin values in CONFIG table */ | |
| 101 | -#define SKIN_FROM_DEFAULT 7 /* The built-in named "default" */ | |
| 102 | -#define SKIN_FROM_UNKNOWN 8 /* Do not yet know which skin to use */ | |
| 92 | +#define SKIN_FROM_CUSTOM 5 /* Skin values in CONFIG table */ | |
| 93 | +#define SKIN_FROM_DEFAULT 6 /* The built-in named "default" */ | |
| 103 | 94 | #endif /* INTERFACE */ |
| 104 | -static int iSkinSource = SKIN_FROM_UNKNOWN; | |
| 95 | +static int iSkinSource = SKIN_FROM_DEFAULT; | |
| 105 | 96 | |
| 106 | 97 | |
| 107 | 98 | /* |
| 108 | 99 | ** Skin details are a set of key/value pairs that define display |
| 109 | 100 | ** attributes of the skin that cannot be easily specified using CSS |
| @@ -162,17 +153,14 @@ | ||
| 162 | 153 | ** 2) The "skin" display setting cookie or URL argument, in that |
| 163 | 154 | ** order. If the "skin" URL argument is provided and refers to a legal |
| 164 | 155 | ** skin then that will update the display cookie. If the skin name is |
| 165 | 156 | ** illegal it is silently ignored. |
| 166 | 157 | ** |
| 167 | -** 3) The built-in skin identfied by the "default-skin" setting, if such | |
| 168 | -** a setting exists and matches one of the built-in skin names. | |
| 169 | -** | |
| 170 | -** 4) Skin properties (settings "css", "details", "footer", "header", | |
| 158 | +** 3) Skin properties (settings "css", "details", "footer", "header", | |
| 171 | 159 | ** and "js") from the CONFIG db table |
| 172 | 160 | ** |
| 173 | -** 5) The built-in skin named "default" | |
| 161 | +** 4) The built-in skin named "default" | |
| 174 | 162 | ** |
| 175 | 163 | ** The iSource integer privides additional detail about where the skin |
| 176 | 164 | ** |
| 177 | 165 | ** As a special case, a NULL or empty name resets zAltSkinDir and |
| 178 | 166 | ** pAltSkin to 0 to indicate that the current config-side skin should |
| @@ -259,24 +247,10 @@ | ||
| 259 | 247 | fossil_free(z); |
| 260 | 248 | return blob_str(&x); |
| 261 | 249 | } |
| 262 | 250 | fossil_free(z); |
| 263 | 251 | } |
| 264 | - if( iSkinSource==SKIN_FROM_UNKNOWN ){ | |
| 265 | - const char *zDflt = db_get("default-skin", 0); | |
| 266 | - iSkinSource = SKIN_FROM_DEFAULT; | |
| 267 | - if( zDflt!=0 ){ | |
| 268 | - int i; | |
| 269 | - for(i=0; i<count(aBuiltinSkin); i++){ | |
| 270 | - if( fossil_strcmp(aBuiltinSkin[i].zLabel, zDflt)==0 ){ | |
| 271 | - pAltSkin = &aBuiltinSkin[i]; | |
| 272 | - iSkinSource = SKIN_FROM_SETTING; | |
| 273 | - break; | |
| 274 | - } | |
| 275 | - } | |
| 276 | - } | |
| 277 | - } | |
| 278 | 252 | if( pAltSkin ){ |
| 279 | 253 | z = mprintf("skins/%s/%s.txt", pAltSkin->zLabel, zWhat); |
| 280 | 254 | zOut = builtin_text(z); |
| 281 | 255 | fossil_free(z); |
| 282 | 256 | }else{ |
| @@ -718,13 +692,10 @@ | ||
| 718 | 692 | break; |
| 719 | 693 | case SKIN_FROM_COOKIE: |
| 720 | 694 | @ the "skin" value of the |
| 721 | 695 | @ <a href='./fdscookie'>fossil_display_setting</a> cookie. |
| 722 | 696 | break; |
| 723 | - case SKIN_FROM_SETTING: | |
| 724 | - @ the "default-skin" setting. | |
| 725 | - break; | |
| 726 | 697 | default: |
| 727 | 698 | @ reasons unknown. (Fix me!) |
| 728 | 699 | break; |
| 729 | 700 | } |
| 730 | 701 | @ </tr> |
| @@ -1360,13 +1331,10 @@ | ||
| 1360 | 1331 | break; |
| 1361 | 1332 | case SKIN_FROM_COOKIE: |
| 1362 | 1333 | @ the "skin" property in the |
| 1363 | 1334 | @ "%z(href("%R/fdscookie"))fossil_display_settings</a>" cookie. |
| 1364 | 1335 | break; |
| 1365 | - case SKIN_FROM_SETTING: | |
| 1366 | - @ the "default-skin" setting on the repository. | |
| 1367 | - break; | |
| 1368 | 1336 | } |
| 1369 | 1337 | } |
| 1370 | 1338 | style_finish_page(); |
| 1371 | 1339 | fossil_free(zBase); |
| 1372 | 1340 | } |
| 1373 | 1341 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -19,17 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "skins.h" |
| 23 | |
| 24 | /* |
| 25 | ** SETTING: default-skin width=16 |
| 26 | ** |
| 27 | ** If the text value if this setting is the name of a built-in skin |
| 28 | ** then the named skin becomes the default skin for the repository. |
| 29 | */ |
| 30 | |
| 31 | /* |
| 32 | ** An array of available built-in skins. |
| 33 | ** |
| 34 | ** To add new built-in skins: |
| 35 | ** |
| @@ -94,16 +87,14 @@ | |
| 94 | #define SKIN_FROM_DRAFT 0 /* The "draftN" prefix on the PATH_INFO */ |
| 95 | #define SKIN_FROM_CMDLINE 1 /* --skin option to server command-line */ |
| 96 | #define SKIN_FROM_CGI 2 /* skin: parameter in CGI script */ |
| 97 | #define SKIN_FROM_QPARAM 3 /* skin= query parameter */ |
| 98 | #define SKIN_FROM_COOKIE 4 /* skin= from fossil_display_settings cookie*/ |
| 99 | #define SKIN_FROM_SETTING 5 /* Built-in named by "default-skin" setting */ |
| 100 | #define SKIN_FROM_CUSTOM 6 /* Skin values in CONFIG table */ |
| 101 | #define SKIN_FROM_DEFAULT 7 /* The built-in named "default" */ |
| 102 | #define SKIN_FROM_UNKNOWN 8 /* Do not yet know which skin to use */ |
| 103 | #endif /* INTERFACE */ |
| 104 | static int iSkinSource = SKIN_FROM_UNKNOWN; |
| 105 | |
| 106 | |
| 107 | /* |
| 108 | ** Skin details are a set of key/value pairs that define display |
| 109 | ** attributes of the skin that cannot be easily specified using CSS |
| @@ -162,17 +153,14 @@ | |
| 162 | ** 2) The "skin" display setting cookie or URL argument, in that |
| 163 | ** order. If the "skin" URL argument is provided and refers to a legal |
| 164 | ** skin then that will update the display cookie. If the skin name is |
| 165 | ** illegal it is silently ignored. |
| 166 | ** |
| 167 | ** 3) The built-in skin identfied by the "default-skin" setting, if such |
| 168 | ** a setting exists and matches one of the built-in skin names. |
| 169 | ** |
| 170 | ** 4) Skin properties (settings "css", "details", "footer", "header", |
| 171 | ** and "js") from the CONFIG db table |
| 172 | ** |
| 173 | ** 5) The built-in skin named "default" |
| 174 | ** |
| 175 | ** The iSource integer privides additional detail about where the skin |
| 176 | ** |
| 177 | ** As a special case, a NULL or empty name resets zAltSkinDir and |
| 178 | ** pAltSkin to 0 to indicate that the current config-side skin should |
| @@ -259,24 +247,10 @@ | |
| 259 | fossil_free(z); |
| 260 | return blob_str(&x); |
| 261 | } |
| 262 | fossil_free(z); |
| 263 | } |
| 264 | if( iSkinSource==SKIN_FROM_UNKNOWN ){ |
| 265 | const char *zDflt = db_get("default-skin", 0); |
| 266 | iSkinSource = SKIN_FROM_DEFAULT; |
| 267 | if( zDflt!=0 ){ |
| 268 | int i; |
| 269 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 270 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zDflt)==0 ){ |
| 271 | pAltSkin = &aBuiltinSkin[i]; |
| 272 | iSkinSource = SKIN_FROM_SETTING; |
| 273 | break; |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | if( pAltSkin ){ |
| 279 | z = mprintf("skins/%s/%s.txt", pAltSkin->zLabel, zWhat); |
| 280 | zOut = builtin_text(z); |
| 281 | fossil_free(z); |
| 282 | }else{ |
| @@ -718,13 +692,10 @@ | |
| 718 | break; |
| 719 | case SKIN_FROM_COOKIE: |
| 720 | @ the "skin" value of the |
| 721 | @ <a href='./fdscookie'>fossil_display_setting</a> cookie. |
| 722 | break; |
| 723 | case SKIN_FROM_SETTING: |
| 724 | @ the "default-skin" setting. |
| 725 | break; |
| 726 | default: |
| 727 | @ reasons unknown. (Fix me!) |
| 728 | break; |
| 729 | } |
| 730 | @ </tr> |
| @@ -1360,13 +1331,10 @@ | |
| 1360 | break; |
| 1361 | case SKIN_FROM_COOKIE: |
| 1362 | @ the "skin" property in the |
| 1363 | @ "%z(href("%R/fdscookie"))fossil_display_settings</a>" cookie. |
| 1364 | break; |
| 1365 | case SKIN_FROM_SETTING: |
| 1366 | @ the "default-skin" setting on the repository. |
| 1367 | break; |
| 1368 | } |
| 1369 | } |
| 1370 | style_finish_page(); |
| 1371 | fossil_free(zBase); |
| 1372 | } |
| 1373 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -19,17 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "skins.h" |
| 23 | |
| 24 | /* |
| 25 | ** An array of available built-in skins. |
| 26 | ** |
| 27 | ** To add new built-in skins: |
| 28 | ** |
| @@ -94,16 +87,14 @@ | |
| 87 | #define SKIN_FROM_DRAFT 0 /* The "draftN" prefix on the PATH_INFO */ |
| 88 | #define SKIN_FROM_CMDLINE 1 /* --skin option to server command-line */ |
| 89 | #define SKIN_FROM_CGI 2 /* skin: parameter in CGI script */ |
| 90 | #define SKIN_FROM_QPARAM 3 /* skin= query parameter */ |
| 91 | #define SKIN_FROM_COOKIE 4 /* skin= from fossil_display_settings cookie*/ |
| 92 | #define SKIN_FROM_CUSTOM 5 /* Skin values in CONFIG table */ |
| 93 | #define SKIN_FROM_DEFAULT 6 /* The built-in named "default" */ |
| 94 | #endif /* INTERFACE */ |
| 95 | static int iSkinSource = SKIN_FROM_DEFAULT; |
| 96 | |
| 97 | |
| 98 | /* |
| 99 | ** Skin details are a set of key/value pairs that define display |
| 100 | ** attributes of the skin that cannot be easily specified using CSS |
| @@ -162,17 +153,14 @@ | |
| 153 | ** 2) The "skin" display setting cookie or URL argument, in that |
| 154 | ** order. If the "skin" URL argument is provided and refers to a legal |
| 155 | ** skin then that will update the display cookie. If the skin name is |
| 156 | ** illegal it is silently ignored. |
| 157 | ** |
| 158 | ** 3) Skin properties (settings "css", "details", "footer", "header", |
| 159 | ** and "js") from the CONFIG db table |
| 160 | ** |
| 161 | ** 4) The built-in skin named "default" |
| 162 | ** |
| 163 | ** The iSource integer privides additional detail about where the skin |
| 164 | ** |
| 165 | ** As a special case, a NULL or empty name resets zAltSkinDir and |
| 166 | ** pAltSkin to 0 to indicate that the current config-side skin should |
| @@ -259,24 +247,10 @@ | |
| 247 | fossil_free(z); |
| 248 | return blob_str(&x); |
| 249 | } |
| 250 | fossil_free(z); |
| 251 | } |
| 252 | if( pAltSkin ){ |
| 253 | z = mprintf("skins/%s/%s.txt", pAltSkin->zLabel, zWhat); |
| 254 | zOut = builtin_text(z); |
| 255 | fossil_free(z); |
| 256 | }else{ |
| @@ -718,13 +692,10 @@ | |
| 692 | break; |
| 693 | case SKIN_FROM_COOKIE: |
| 694 | @ the "skin" value of the |
| 695 | @ <a href='./fdscookie'>fossil_display_setting</a> cookie. |
| 696 | break; |
| 697 | default: |
| 698 | @ reasons unknown. (Fix me!) |
| 699 | break; |
| 700 | } |
| 701 | @ </tr> |
| @@ -1360,13 +1331,10 @@ | |
| 1331 | break; |
| 1332 | case SKIN_FROM_COOKIE: |
| 1333 | @ the "skin" property in the |
| 1334 | @ "%z(href("%R/fdscookie"))fossil_display_settings</a>" cookie. |
| 1335 | break; |
| 1336 | } |
| 1337 | } |
| 1338 | style_finish_page(); |
| 1339 | fossil_free(zBase); |
| 1340 | } |
| 1341 |