Changes for page Home

Last modified by Benjamin Fischer on 2025/06/04 14:20

From version 72.93
edited by Benjamin Fischer
on 2024/11/07 15:38
Change comment: There is no comment for this version
To version 72.73
edited by Benjamin Fischer
on 2024/11/07 13:35
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -9,6 +9,12 @@
9 9   const range = num => Array(num).fill().map((_, i) => i);
10 10   FC.defineView('monthCols', {
11 11   class: FC.View.extend({
12 + render() {
13 + console.debug("render");
14 + },
15 + renderSkeleton() {
16 + console.debug("renderSkeleton");
17 + },
12 12   renderEvents(events) {
13 13   console.debug("renderEvents", events);
14 14   debugger;
... ... @@ -29,6 +29,7 @@
29 29   const ye = this.end;
30 30   const yv = events.slice().sort((a,b) => a.start.diff(b.start) || a.end.diff(b.end));
31 31  
38 +
32 32   const cols = [];
33 33   const head = [];
34 34   const days = Array(31).fill().map(_ => []);
... ... @@ -46,7 +46,7 @@
46 46   const mv = yv.filter(t => ms.isBefore(t.end) && t.start.isBefore(me));
47 47  
48 48   if (df) cols.push(E("col", {class: "fc-fitCol fc-fade fc-borderLeft"}));
49 - cols.push(E("col", {class: df ? null : "fc-borderLeft"}));
56 + cols.push(E("col"), {class: df ? null : "fc-borderLeft"});
50 50   if (wf) cols.push(E("col", {class: "fc-fitCol fc-fade"}));
51 51   head.push(E("th", {colspan}, ms.format(cf)));
52 52  
... ... @@ -66,24 +66,23 @@
66 66   for (const i of range(d))
67 67   bgc[day + i] = v.color;
68 68   } else {
69 - const href = v.html.match(/<span class="wikiexternallink"><a href="([^"]+)">\1</)?.[1] ?? v.url;
70 - const e = E("div", E("a", {href}, v.title));
76 + const e = E("div", v.title);
71 71   e.style.height = `${100 * d}%`;
72 72   if (v.color) e.style.borderColor = e.style.backgroundColor = v.color;
73 73   if (v.textColor) e.style.color = v.textColor;
74 - if (v.start.isBefore(ms)) e.classList.add("fc-cut-start");
75 - if (me.isBefore(v.end)) e.classList.add("fc-cut-end");
76 76   oc.push(e);
77 77   // TODO: soft-columns
78 78   }
79 79   }
80 80  
81 - const style = bgc[day] && `background-color: ${bgc[day]};`;
82 - const dc = this.getDayClasses(ds);
83 - const da = sub => ({class: dc.concat(sub).join(" "), style});
84 - if (df) days[day].push(E("td", da("fc-dayVal"), ds.format(df)));
85 - days[day].push(E("td", da("fc-mainVal"), oc));
86 - if (wf) days[day].push(E("td", da("fc-weekVal"), ds.weekday() ? "" : ds.format(wf)));
85 + const da = {class: this.getDayClasses(ds).join(" ")};
86 + if (df) days[day].push(E("td", da, ds.format(df)));
87 + if (bgc[day]) da.style = `background-color: ${bgc[day]};`;
88 + days[day].push(E("td", da, oc));
89 + if (wf) {
90 + da.class += " fc-weekVal";
91 + days[day].push(E("td", da, ds.weekday() ? "" : ds.format(wf)));
92 + }
87 87   } else
88 88   days[day].push(E("td", {colspan}));
89 89   }
... ... @@ -130,7 +130,7 @@
130 130   right: "month,monthCols",
131 131   },
132 132   timeFormat: "H:mm",
133 - defaultView: "monthCols",
139 + defaultView: "month",
134 134   firstDay: "1",
135 135   minTime: "8:00",
136 136   maxTime: "23:00",
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,9 +1,6 @@
1 1  #calendarCustom.fc {
2 2   td.fc-sat, td.fc-sun {
3 3   background-color: #f5f5f5;
4 - &.fc-dayVal {
5 - background-color: #f5f5f5 !important;
6 - }
7 7   }
8 8   .fc-month-cols-view > table {
9 9   table-layout: auto;
... ... @@ -13,51 +13,23 @@
13 13   col.fc-fitCol {
14 14   width: 1px;
15 15   }
13 + col.fc-borderLeft {
14 + border-left-width: 1px;
15 + }
16 16   .fc-body {
17 - tr:nth-child(4n+3) > * {
18 - border-top: 1px solid #ddd;
19 - }
20 - tr:nth-child(4n+5) > * {
21 - border-top: 1px solid #bbb;
22 - }
23 - tr:hover {
24 - filter: brightness(0.95);
25 - }
26 - td.fc-mainVal {
17 + td {
27 27   position: relative;
28 28   & > div {
29 - z-index: 5;
30 30   position: absolute;
31 31   width: 100%;
32 - overflow: hidden;
33 - border-radius: 4px;
34 - &.fc-cut-start {
35 - border-top-left-radius: 0px;
36 - border-top-right-radius: 0px;
37 - }
38 - &.fc-cut-end {
39 - border-bottom-left-radius: 0px;
40 - border-bottom-right-radius: 0px;
41 - }
42 - &:hover {
43 - width: auto;
44 - max-width: 10vw;
45 - height: auto !important;
46 - z-index: 10;
47 - }
48 - & > a {
49 - display: block;
50 - color: inherit;
51 - background-color: inherit;
52 - }
53 53   }
54 54   }
55 55   td.fc-weekVal {
56 56   text-align: right;
57 57   }
58 - .fc-fade2 {
27 + .fc-fade {
59 59   opacity: 0.3;
60 60   }
61 - }
62 - }
30 + }
31 + }
63 63  }