@@ -29,7 +29,7 @@ export default function({ event, el }) {
29
29
const dotElement = el . querySelector ( '.fc-list-event-dot' )
30
30
dotElement . classList . remove ( 'fc-list-event-dot' )
31
31
dotElement . classList . add ( 'fc-list-event-checkbox' )
32
- dotElement . style . color = dotElement . style . borderColor
32
+ dotElement . style . color = 'var(--color-main-text)'
33
33
34
34
if ( event . extendedProps . percent === 100 ) {
35
35
dotElement . classList . add ( 'calendar-grid-checkbox-checked' )
@@ -41,7 +41,7 @@ export default function({ event, el }) {
41
41
const dotElement = el . querySelector ( '.fc-daygrid-event-dot' )
42
42
dotElement . classList . remove ( 'fc-daygrid-event-dot' )
43
43
dotElement . classList . add ( 'fc-daygrid-event-checkbox' )
44
- dotElement . style . color = dotElement . style . borderColor
44
+ dotElement . style . color = 'var(--color-main-text)'
45
45
46
46
if ( event . extendedProps . percent === 100 ) {
47
47
dotElement . classList . add ( 'calendar-grid-checkbox-checked' )
@@ -91,4 +91,80 @@ export default function({ event, el }) {
91
91
descriptionContainer . appendChild ( description )
92
92
}
93
93
}
94
+
95
+ if (
96
+ el . classList . contains ( 'fc-event-nc-all-declined' )
97
+ || el . classList . contains ( 'fc-event-nc-needs-action' )
98
+ || el . classList . contains ( 'fc-event-nc-declined' )
99
+ ) {
100
+ const titleElement = el . querySelector ( '.fc-event-title' )
101
+ const dotElement = el . querySelector ( '.fc-daygrid-event-dot' )
102
+
103
+ if ( dotElement ) {
104
+ dotElement . style . borderWidth = '2px'
105
+ dotElement . style . background = 'transparent'
106
+ dotElement . style . minWidth = '10px'
107
+ dotElement . style . minHeight = '10px'
108
+ }
109
+
110
+ titleElement . style . color = 'var(--color-main-text)'
111
+ el . style . background = 'transparent'
112
+ el . title = t ( 'calendar' , 'All participants declined' )
113
+
114
+ if ( el . classList . contains ( 'fc-event-nc-needs-action' ) ) {
115
+ el . title = t ( 'calendar' , 'Please confirm your participation' )
116
+ }
117
+
118
+ if ( el . classList . contains ( 'fc-event-nc-declined' ) ) {
119
+ el . title = t ( 'calendar' , 'You declined this event' )
120
+ titleElement . style . textDecoration = 'line-through'
121
+ }
122
+ }
123
+
124
+ if ( el . classList . contains ( 'fc-event-nc-all-declined' ) ) {
125
+ const titleElement = el . querySelector ( '.fc-event-title' )
126
+
127
+ const svgString = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m40-120 440-760 440 760H40Zm440-120q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Z"/></svg>'
128
+ titleElement . innerHTML = svgString + titleElement . innerHTML
129
+
130
+ const svgElement = titleElement . querySelector ( 'svg' )
131
+ svgElement . style . fill = el . style . borderColor
132
+ svgElement . style . width = '1em'
133
+ svgElement . style . marginBottom = '0.2em'
134
+ svgElement . style . verticalAlign = 'middle'
135
+ }
136
+
137
+ if ( el . classList . contains ( 'fc-event-nc-tentative' ) ) {
138
+ const dotElement = el . querySelector ( '.fc-daygrid-event-dot' )
139
+
140
+ const bgColor = el . style . backgroundColor ? el . style . backgroundColor : dotElement . style . borderColor
141
+ const bgStripeColor = darkenColor ( bgColor )
142
+
143
+ let backgroundStyling = `repeating-linear-gradient(45deg, ${ bgStripeColor } , ${ bgStripeColor } 1px, ${ bgColor } 1px, ${ bgColor } 10px)`
144
+
145
+ if ( dotElement ) {
146
+ dotElement . style . borderWidth = '2px'
147
+ backgroundStyling = `repeating-linear-gradient(45deg, ${ bgColor } , ${ bgColor } 1px, transparent 1px, transparent 3.5px)`
148
+
149
+ dotElement . style . background = backgroundStyling
150
+ dotElement . style . minWidth = '10px'
151
+ dotElement . style . minHeight = '10px'
152
+ } else {
153
+ el . style . background = backgroundStyling
154
+ }
155
+
156
+ el . title = t ( 'calendar' , 'Your participation is tentative' )
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Create a slightly darker color for background stripes
162
+ *
163
+ * @param {string } color The color to darken
164
+ */
165
+ function darkenColor ( color ) {
166
+ const rgb = color . match ( / \d + / g)
167
+ if ( ! rgb ) return color
168
+ const [ r , g , b ] = rgb . map ( c => Math . max ( 0 , Math . min ( 255 , c - ( c * 0.3 ) ) ) )
169
+ return `rgb(${ r } , ${ g } , ${ b } )`
94
170
}
0 commit comments