Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9442f7ec authored by Ronak Patel's avatar Ronak Patel
Browse files

webdav

parent 78fec7b2
Loading
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
--- /Users/ronak/Desktop/murena/nextcloud/ecloud_dev_example/volumes/nextcloud/html/custom_apps/snappymail/plugins/nextcloud/js/webdav.js	2023-09-20 08:34:31
+++ /Users/ronak/Desktop/murena/nextcloud/ecloud_dev_example/volumes/nextcloud/html/custom_apps/snappymail/plugins/nextcloud/js/webdav-new.js	2023-09-20 08:47:37
@@ -34,6 +34,7 @@
 		<resourcetype/>
 		<current-user-privilege-set/>
 		<displayname/>
+		<calendar-color />
 	</prop>
 </propfind>`,
 
@@ -343,17 +344,45 @@
 				const e = responseList.item(i);
 				if (getDavElementByTagName(e, 'resourcetype').getElementsByTagNameNS(nsCalDAV, 'calendar').length) {
 //				 && getDavElementsByTagName(getDavElementByTagName(e, 'current-user-privilege-set'), 'write').length) {
-					const li = document.createElement('li'),
-						btn = document.createElement('button');
-					li.dataset.icon = '📅';
-					li.textContent = getDavElementByTagName(e, 'displayname').textContent;
-					btn.href = getDavElementByTagName(e, 'href').textContent
-						.replace(pathRegex, '').replace(/\/$/, '');
-					btn.textContent = 'select';
-					btn.className = 'button-vue';
-					btn.style.marginLeft = '1em';
-					li.append(btn);
-					this.tree.append(li);
+					const li = document.createElement('li');
+					li.style.display = 'flex';
+					// Create the <span> element
+					const span = document.createElement('span');
+					span.setAttribute('role', 'img');
+					span.className = 'material-design-icon checkbox-blank-circle-icon';
+					span.style.fill = getDavElementByTagName(e, 'calendar-color').textContent;
+					span.style.width = '20px'; // Width
+					span.style.height = '20px'; // Height
+
+					// Create the <svg> element
+					const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+					svg.setAttribute('width', '20');
+					svg.setAttribute('height', '20');
+					svg.setAttribute('viewBox', '0 0 24 24');
+
+					// Create the <path> element within the <svg> element
+					const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+					path.setAttribute('d', 'M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z');
+					svg.appendChild(path);
+
+					// Append the <svg> element to the <span> element
+					span.appendChild(svg);
+					
+					const button = document.createElement('button');
+					button.className = 'button-vue';
+					button.style.backgroundColor = 'transparent';
+					button.style.border = '0';
+					button.style.fontSize = 'large';
+					button.style.padding = '0';
+					button.style.cursor = 'pointer';
+					button.textContent = getDavElementByTagName(e, 'displayname').textContent;
+					button.style.color = 'black';
+					
+					li.appendChild(span);
+					li.appendChild(button);
+					
+					// Assuming 'this.tree' is a reference to the parent element where you want to append the 'li' element.
+					this.tree.appendChild(li);
 				}
 			}
 		})
+0 −870

File deleted.

Preview size limit exceeded, changes collapsed.