Changes for page Home

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

From version 72.76
edited by Benjamin Fischer
on 2024/11/07 13:41
Change comment: There is no comment for this version
To version 72.56
edited by Benjamin Fischer
on 2024/11/07 12:14
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -35,12 +35,10 @@
35 35   const ye = this.end;
36 36   const yv = events.slice().sort((a,b) => a.start.diff(b.start) || a.end.diff(b.end));
37 37  
38 - const cols = [];
39 39   const head = [];
40 40   const days = Array(31).fill().map(_ => []);
41 41  
42 42   if (rf) {
43 - cols.push(E("col", {class: "fc-fitCol"}));
44 44   head.push(E("th"));
45 45   days.forEach((arr, day) => arr.push(E("th", {class: "fc-axis"}, ys.clone().add({day}).format(rf))));
46 46   }
... ... @@ -49,11 +49,8 @@
49 49   const ms = ys.clone().add({month})
50 50   const me = ms.clone().add({month: 1});
51 51   const md = me.diff(ms, "days");
52 - const mv = yv.filter(t => ms.isBefore(t.end) && t.start.isBefore(me));
50 + const mv = yv.filter(t => ms.isBefore(t.end) || t.start.isBefore(me));
53 53  
54 - if (df) cols.push(E("col", {class: "fc-fitCol fc-fade fc-borderLeft"}));
55 - cols.push(E("col", {class: df ? null : "fc-borderLeft"}));
56 - if (wf) cols.push(E("col", {class: "fc-fitCol fc-fade"}));
57 57   head.push(E("th", {colspan}, ms.format(cf)));
58 58  
59 59   const bgc = new Array(md);
... ... @@ -66,27 +66,26 @@
66 66   const oc = [];
67 67   while(mv[0]?.start.isBefore(de)) {
68 68   const v = mv.shift();
69 - const d = Math.ceil(v.end.max(me).diff(ds, "days", true));
70 - if (v.rendering == "background") {
71 - if (v.color)
64 + const d = Math.ceil(v.end.min(me).diff(ds, "days", true));
65 + if (t.rendering == "background")
66 + if (t.color)
72 72   for (const i of range(d))
73 - bgc[day + i] = v.color;
74 - } else {
75 - const e = E("div", v.title);
68 + bgc[day + i] = t.color;
69 + else {
70 + const e = E("div", t.title);
76 76   e.style.height = `${100 * d}%`;
77 - if (v.color) e.style.borderColor = e.style.backgroundColor = v.color;
78 - if (v.textColor) e.style.color = v.textColor;
72 + if (t.color) e.style.borderColor = e.style.backgroundColor = t.color;
73 + if (t.textColor) e.style.color = t.textColor;
79 79   oc.push(e);
80 80   // TODO: soft-columns
81 81   }
82 82   }
83 83  
84 - const style = bgc[day] && `background-color: ${bgc[day]};`;
85 - const dc = this.getDayClasses(ds);
86 - const da = sub => ({class: dc.concat(sub).join(" "), style});
87 - if (df) days[day].push(E("td", da("fc-dayVal"), ds.format(df)));
88 - days[day].push(E("td", da("fc-mainVal"), oc));
89 - if (wf) days[day].push(E("td", da("fc-weekVal"), ds.weekday() ? "" : ds.format(wf)));
79 + const da = {class: this.getDayClasses(ds).join(" ")};
80 + if (df) days[day].push(E("td", da, ds.format(df)));
81 + if (bgc[day]) da.style = `background-color: ${bgc[day]};`;
82 + days[day].push(E("td", da, oc));
83 + if (wf) days[day].push(E("td", da, ds.weekday() ? "" : ds.format(wf)));
90 90   } else
91 91   days[day].push(E("td", {colspan}));
92 92   }
... ... @@ -96,7 +96,6 @@
96 96   this.el.addClass("fc-month-cols-view").html(
97 97   E(
98 98   "table",
99 - E("colgroup", cols),
100 100   E("thead", {class: "fc-head"}, E("tr", head)),
101 101   E("tbody", {class: "fc-body"}, days.map(d => E("tr", d))),
102 102   )
... ... @@ -116,7 +116,6 @@
116 116   },
117 117   monthCols: {
118 118   columnFormat: "MMM",
119 - weekFormat: "W",
120 120   titleFormat: "YYYY",
121 121   buttonText: "year",
122 122   },
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,32 +1,5 @@
1 -#calendarCustom.fc {
1 +#calendarCustom {
2 2   td.fc-sat, td.fc-sun {
3 3   background-color: #f5f5f5;
4 4   }
5 - .fc-month-cols-view > table {
6 - table-layout: auto;
7 - td, th {
8 - border-width: 0px;
9 - }
10 - col.fc-fitCol {
11 - width: 1px;
12 - }
13 - col.fc-borderLeft {
14 - border-left-width: 1px;
15 - }
16 - .fc-body {
17 - td {
18 - position: relative;
19 - & > div {
20 - position: absolute;
21 - width: 100%;
22 - }
23 - }
24 - td.fc-weekVal {
25 - text-align: right;
26 - }
27 - .fc-fade {
28 - opacity: 0.3;
29 - }
30 - }
31 - }
32 32  }