Fossil

Check-in [1975bfd279]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove the "default-skin" setting that was added by [24e015de71cfdc79].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1975bfd279759471d7aac8c83bf72500911b27f1e11b98f66ddd4e2966dd9f6f
User & Date: drh 2024-02-23 17:30:05.318
Context
2024-02-23
18:18
Revive the default-skin setting. I now think it will be useful after all, when used in combination with other changes that are planned. check-in: 18d76fffb1 user: drh tags: trunk
17:48
Reworked the handling of the three "selected" row cases in /timeline (current, first-in-range and last-in-range) so the borders and highlighting extend to the left margin. The "current" case (seen under "fossil ui" only, to indicate the ckout version) wasn't a problem, but the other two use background colors potentially confusable with branch colors. This makes the timelines more like that of the Fossil 2.23 and prior default skin (now called Étienne) but with rounded corners in the modern modes, matching the rest of the timeline. This occurs in all timeline modes, including the classic, compact, and verbose views. The result is that the corners for these selected row types are rounded, but because they tend to be compact, it gives a full-round look on the ends. Avoiding this would require considerably more verbose CSS, and it's plenty intricate as it is. check-in: 9568091a9b user: wyoung tags: trunk
17:30
Remove the "default-skin" setting that was added by [24e015de71cfdc79]. check-in: 1975bfd279 user: drh tags: trunk
17:25
Improvements to the Skin setup interface. check-in: 33cc83ffb8 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/skins.c.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
**
** Implementation of the Setup page for "skins".
*/
#include "config.h"
#include <assert.h>
#include "skins.h"

/*
** SETTING: default-skin width=16
**
** If the text value if this setting is the name of a built-in skin
** then the named skin becomes the default skin for the repository.
*/

/*
** An array of available built-in skins.
**
** To add new built-in skins:
**
**    1.  Pick a name for the new skin.  (Here we use "xyzzy").
**







<
<
<
<
<
<
<







17
18
19
20
21
22
23







24
25
26
27
28
29
30
**
** Implementation of the Setup page for "skins".
*/
#include "config.h"
#include <assert.h>
#include "skins.h"








/*
** An array of available built-in skins.
**
** To add new built-in skins:
**
**    1.  Pick a name for the new skin.  (Here we use "xyzzy").
**
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
*/
#if INTERFACE
#define SKIN_FROM_DRAFT     0   /* The "draftN" prefix on the PATH_INFO */
#define SKIN_FROM_CMDLINE   1   /* --skin option to server command-line */
#define SKIN_FROM_CGI       2   /* skin: parameter in CGI script */
#define SKIN_FROM_QPARAM    3   /* skin= query parameter */
#define SKIN_FROM_COOKIE    4   /* skin= from fossil_display_settings cookie*/
#define SKIN_FROM_SETTING   5   /* Built-in named by "default-skin" setting */
#define SKIN_FROM_CUSTOM    6   /* Skin values in CONFIG table */
#define SKIN_FROM_DEFAULT   7   /* The built-in named "default" */
#define SKIN_FROM_UNKNOWN   8   /* Do not yet know which skin to use */
#endif /* INTERFACE */
static int iSkinSource = SKIN_FROM_UNKNOWN;


/*
** Skin details are a set of key/value pairs that define display
** attributes of the skin that cannot be easily specified using CSS
** or that need to be known on the server-side.
**







<
|
|
<

|







85
86
87
88
89
90
91

92
93

94
95
96
97
98
99
100
101
102
*/
#if INTERFACE
#define SKIN_FROM_DRAFT     0   /* The "draftN" prefix on the PATH_INFO */
#define SKIN_FROM_CMDLINE   1   /* --skin option to server command-line */
#define SKIN_FROM_CGI       2   /* skin: parameter in CGI script */
#define SKIN_FROM_QPARAM    3   /* skin= query parameter */
#define SKIN_FROM_COOKIE    4   /* skin= from fossil_display_settings cookie*/

#define SKIN_FROM_CUSTOM    5   /* Skin values in CONFIG table */
#define SKIN_FROM_DEFAULT   6   /* The built-in named "default" */

#endif /* INTERFACE */
static int iSkinSource = SKIN_FROM_DEFAULT;


/*
** Skin details are a set of key/value pairs that define display
** attributes of the skin that cannot be easily specified using CSS
** or that need to be known on the server-side.
**
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
**    "fossil http", or  the "skin:" CGI config setting.
**
** 2) The "skin" display setting cookie or URL argument, in that
**    order. If the "skin" URL argument is provided and refers to a legal
**    skin then that will update the display cookie. If the skin name is
**    illegal it is silently ignored.
**
** 3) The built-in skin identfied by the "default-skin" setting, if such
**    a setting exists and matches one of the built-in skin names.
**
** 4) Skin properties (settings "css", "details", "footer", "header",
**    and "js") from the CONFIG db table
**
** 5) The built-in skin named "default"
**
** The iSource integer privides additional detail about where the skin
**
** As a special case, a NULL or empty name resets zAltSkinDir and
** pAltSkin to 0 to indicate that the current config-side skin should
** be used (rank 3, above), then returns 0.
*/







<
<
<
|


|







151
152
153
154
155
156
157



158
159
160
161
162
163
164
165
166
167
168
**    "fossil http", or  the "skin:" CGI config setting.
**
** 2) The "skin" display setting cookie or URL argument, in that
**    order. If the "skin" URL argument is provided and refers to a legal
**    skin then that will update the display cookie. If the skin name is
**    illegal it is silently ignored.
**



** 3) Skin properties (settings "css", "details", "footer", "header",
**    and "js") from the CONFIG db table
**
** 4) The built-in skin named "default"
**
** The iSource integer privides additional detail about where the skin
**
** As a special case, a NULL or empty name resets zAltSkinDir and
** pAltSkin to 0 to indicate that the current config-side skin should
** be used (rank 3, above), then returns 0.
*/
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
      Blob x;
      blob_read_from_file(&x, z, ExtFILE);
      fossil_free(z);
      return blob_str(&x);
    }
    fossil_free(z);
  }
  if( iSkinSource==SKIN_FROM_UNKNOWN ){
    const char *zDflt = db_get("default-skin", 0);
    iSkinSource = SKIN_FROM_DEFAULT;
    if( zDflt!=0 ){
      int i;
      for(i=0; i<count(aBuiltinSkin); i++){
        if( fossil_strcmp(aBuiltinSkin[i].zLabel, zDflt)==0 ){
          pAltSkin = &aBuiltinSkin[i];
          iSkinSource = SKIN_FROM_SETTING;
          break;
        }
      }
    }
  }
  if( pAltSkin ){
    z = mprintf("skins/%s/%s.txt", pAltSkin->zLabel, zWhat);
    zOut = builtin_text(z);
    fossil_free(z);
  }else{
    zOut = db_get(zWhat, 0);
    if( zOut==0 ){







<
<
<
<
<
<
<
<
<
<
<
<
<
<







245
246
247
248
249
250
251














252
253
254
255
256
257
258
      Blob x;
      blob_read_from_file(&x, z, ExtFILE);
      fossil_free(z);
      return blob_str(&x);
    }
    fossil_free(z);
  }














  if( pAltSkin ){
    z = mprintf("skins/%s/%s.txt", pAltSkin->zLabel, zWhat);
    zOut = builtin_text(z);
    fossil_free(z);
  }else{
    zOut = db_get(zWhat, 0);
    if( zOut==0 ){
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
      case SKIN_FROM_QPARAM:
        @ the "skin=NAME" query parameter.
        break;
      case SKIN_FROM_COOKIE:
        @ the "skin" value of the 
        @ <a href='./fdscookie'>fossil_display_setting</a> cookie.
        break;
      case SKIN_FROM_SETTING:
        @ the "default-skin" setting.
        break;
      default:
        @ reasons unknown.  (Fix me!)
        break;
    }
    @ </tr>
  }
  db_prepare(&q,







<
<
<







690
691
692
693
694
695
696



697
698
699
700
701
702
703
      case SKIN_FROM_QPARAM:
        @ the "skin=NAME" query parameter.
        break;
      case SKIN_FROM_COOKIE:
        @ the "skin" value of the 
        @ <a href='./fdscookie'>fossil_display_setting</a> cookie.
        break;



      default:
        @ reasons unknown.  (Fix me!)
        break;
    }
    @ </tr>
  }
  db_prepare(&q,
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
      case SKIN_FROM_QPARAM:
         @ the "skin=NAME" query parameter on the URL.
         break;
      case SKIN_FROM_COOKIE:
         @ the "skin" property in the
         @ "%z(href("%R/fdscookie"))fossil_display_settings</a>" cookie.
         break;
      case SKIN_FROM_SETTING:
         @ the "default-skin" setting on the repository.
         break;
    }
  }
  style_finish_page();
  fossil_free(zBase);
}







<
<
<





1329
1330
1331
1332
1333
1334
1335



1336
1337
1338
1339
1340
      case SKIN_FROM_QPARAM:
         @ the "skin=NAME" query parameter on the URL.
         break;
      case SKIN_FROM_COOKIE:
         @ the "skin" property in the
         @ "%z(href("%R/fdscookie"))fossil_display_settings</a>" cookie.
         break;



    }
  }
  style_finish_page();
  fossil_free(zBase);
}