Skip to content

Commit 2042521

Browse files
Merge Issue#20 bugfix
Issue#20 bugfix
2 parents 9f00e07 + 253a4d6 commit 2042521

File tree

5 files changed

+47
-44
lines changed

5 files changed

+47
-44
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "ical-obsidian-sync",
33
"name": "iCalSync",
4-
"version": "1.1.4",
4+
"version": "1.1.5",
55
"minAppVersion": "0.15.0",
66
"description": "Synchronize iCalendar with your notes",
77
"author": "Vaccarini Lorenzo",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-sample-plugin",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
55
"main": "main.js",
66
"scripts": {

src/plugin/calendarView.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ export class CalendarView extends MarkdownRenderChild {
1919

2020
onload() {
2121
const wrapper = this.containerEl.createEl("div");
22-
wrapper.addClass("tableWrapper")
22+
wrapper.addClass("icalTableWrapper")
2323
const table = wrapper.createEl("table");
24+
table.addClass("icalTable");
2425
this.generateHeaders(table);
2526
this.generateRows(table)
2627
this.generateHeaders(table);
2728
this.containerEl.replaceWith(table);
2829
}
2930

3031
private generateHeaders(table: HTMLTableElement){
31-
table.createEl("th")
32+
table.createEl("th").addClass("icalTh");
3233
for (let column = 0; column < this.calendarViewData.numOfCols; column++){
33-
table.createEl("th")
34+
table.createEl("th").addClass("icalTh")
3435
}
3536
}
3637

@@ -48,6 +49,7 @@ export class CalendarView extends MarkdownRenderChild {
4849
private initRow(table: HTMLElement, date: Date, needsLabel: boolean): HTMLElement{
4950
const row = table.createEl("tr");
5051
const leftLabel = row.createEl("td");
52+
leftLabel.addClass("icalTd");
5153
if (!needsLabel) return row;
5254
leftLabel.innerText = date.toLocaleDateString();
5355
date.setDate(date.getDate() + 1);
@@ -63,19 +65,20 @@ export class CalendarView extends MarkdownRenderChild {
6365

6466
calendarEventDetails.forEach(event => {
6567
for (let i = columnIndex; i < event.fromCol; i++){
66-
row.createEl("td");
68+
row.createEl("td").addClass("icalTd");
6769
}
6870
const eventView = row.createEl("td");
6971
eventView.innerText = event.title;
7072
eventView.addClass(this.getPaletteClass());
71-
eventView.addClass("eventBox")
73+
eventView.addClass("icalEventBox");
74+
eventView.addClass("icalTd");
7275
eventView.setAttr("colspan", event.toCol - event.fromCol)
7376
columnIndex = event.toCol;
7477
})
7578
}
7679

7780
for (let i = columnIndex; i < this.calendarViewData.numOfCols; i++){
78-
row.createEl("td");
81+
row.createEl("td").addClass("icalTd");
7982
}
8083
}
8184

src/plugin/highlightWidget.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,63 +16,63 @@ export class HighlightWidget extends WidgetType {
1616
}
1717

1818
toDOM(view: EditorView): HTMLElement {
19-
const navUl = document.createElement("ul");
20-
navUl.addClass("navUL");
19+
const icalNavUL = document.createElement("ul");
20+
icalNavUL.addClass("icalNavUL");
2121

22-
const mark = navUl.createEl("span");
22+
const mark = icalNavUL.createEl("span");
2323
mark.addClass(this.markClass);
2424
mark.innerText = this.sentenceValue;
2525

2626
const bubble = mark.createEl("div");
27-
bubble.addClass("bubblePosition");
28-
bubble.addClass("hoverBubble");
27+
bubble.addClass("icalBubblePosition");
28+
bubble.addClass("icalHoverBubble");
2929

3030
const grid = bubble.createEl("div")
31-
grid.addClass("gridContainer");
31+
grid.addClass("icalGridContainer");
3232

3333
const titleIcon = grid.createEl("span");
34-
titleIcon.addClass("iconBar");
34+
titleIcon.addClass("icalIconBar");
3535
titleIcon.innerText = " 📕 ";
3636

3737
const titleContent = grid.createEl("span");
38-
titleContent.addClass("eventDataBar");
38+
titleContent.addClass("icalEventDataBar");
3939
titleContent.innerText = ` ${this.eventDetails.title} `;
4040

4141
const dateIcon = grid.createEl("span");
42-
dateIcon.addClass("iconBar");
42+
dateIcon.addClass("icalIconBar");
4343
dateIcon.innerText = " 📅 ";
4444

4545
const dateContent = grid.createEl("span");
46-
dateContent.addClass("eventDataBar");
46+
dateContent.addClass("icalEventDataBar");
4747
dateContent.innerText = ` ${this.eventDetails.dateString} `;
4848

4949
if (this.eventDetails.hasTimeDetails){
5050
const timeIcon = grid.createEl("span");
51-
timeIcon.addClass("iconBar");
51+
timeIcon.addClass("icalIconBar");
5252
timeIcon.innerText = " 🕑 ";
5353

5454
const timeContent = grid.createEl("span");
55-
timeContent.addClass("eventDataBar");
55+
timeContent.addClass("icalEventDataBar");
5656
timeContent.innerText = ` ${this.eventDetails.timeString} `;
5757
}
5858

5959
const row = bubble.createEl("div");
60-
row.addClass("gridRow");
60+
row.addClass("icalGridRow");
6161

6262
const buttonSync = row.createEl("button")
6363
buttonSync.innerText = "Sync";
64-
buttonSync.addClass("syncButton");
64+
buttonSync.addClass("icalSyncButton");
6565
buttonSync.onClickEvent(() => {
6666
this.syncCallback(true);
6767
})
6868

6969
const buttonNoSync = row.createEl("button")
70-
buttonNoSync.addClass("syncButton");
70+
buttonNoSync.addClass("icalSyncButton");
7171
buttonNoSync.innerText = "Ignore";
7272
buttonNoSync.onClickEvent(() => {
7373
this.syncCallback(false);
7474
})
7575

76-
return navUl;
76+
return icalNavUL;
7777
}
7878
}

styles.css

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@
6060
}
6161

6262
/* Navigation list */
63-
ul.navUL {
63+
ul.icalNavUL {
6464
margin: 0;
6565
padding: 0;
6666
display: inline-block;
6767
}
6868

69-
ul.navUL span {
69+
ul.icalNavUL span {
7070
display: block;
7171
position: relative;
7272
text-decoration: none;
7373
}
7474

75-
.hoverBubble {
75+
.icalHoverBubble {
7676
font-size: 70%;
7777
width: max-content;
7878
background: #d5d5d5;
@@ -89,28 +89,28 @@ ul.navUL span {
8989
justify-content: center;
9090
}
9191

92-
.hoverBubble p {
92+
.icalHoverBubble p {
9393
text-align: center;
9494
display: flex;
9595
flex-direction: column;
9696
padding: 5px;
9797
}
9898

99-
.hoverBubble button {
99+
.icalHoverBubble button {
100100
display: block;
101101
margin: 0 auto;
102102
text-align: center;
103103
}
104104

105-
.bubblePosition {
105+
.icalBubblePosition {
106106
top: 100%;
107107
height: inherit;
108108
left: 0;
109109
bottom: auto;
110110
}
111111

112-
.hoverBubble:after,
113-
.bubblePosition:after {
112+
.icalHoverBubble:after,
113+
.icalBubblePosition:after {
114114
border: 9px solid transparent;
115115
border-top-color: #d5d5d5;
116116
top: -15px;
@@ -124,56 +124,56 @@ ul.navUL span {
124124
rotate: 180deg;
125125
}
126126

127-
.gridContainer {
127+
.icalGridContainer {
128128
/*border:1px solid #000;*/
129129
display: grid;
130130
grid-template-columns: auto auto;
131131
grid-gap: 10px;
132132
}
133133

134134
/* Bubble hover */
135-
ul.navUL span:hover .hoverBubble {
135+
ul.icalNavUL span:hover .icalHoverBubble {
136136
opacity: 1;
137137
visibility: visible;
138138
transition: all 0.25s;
139139
z-index: 5;
140140
}
141141

142-
.gridRow {
142+
.icalGridRow {
143143
/* border:1px solid #000; */
144144
display: grid;
145145
grid-template-columns: auto auto;
146146
padding: 10px 0 0 0;
147147
}
148148

149-
.syncButton.syncButton {
149+
.icalSyncButton.icalSyncButton {
150150
padding: 0;
151151
text-align: center;
152152
background-color: #1c1c1c;
153153
color: #d5d5d5;
154154
margin: 5%;
155155
}
156156

157-
.iconBar {
157+
.icalIconBar {
158158
/*border:1px solid #000;*/
159159
font-size: 170%;
160160
margin: -5px;
161161
align-self: center;
162162
}
163163

164-
.eventDataBar {
164+
.icalEventDataBar {
165165
font-size: 85%;
166166
align-self: center;
167167
white-space: initial;
168168
}
169169

170-
.tableWrapper {
170+
.icalTableWrapper {
171171
width: 100rem;
172172
overflow: auto;
173173
}
174174

175175

176-
table {
176+
.icalTable {
177177
border-top: transparent;
178178
border-bottom: white;
179179
border-left: transparent;
@@ -182,7 +182,7 @@ table {
182182
max-width: 100px;
183183
}
184184

185-
th {
185+
.icalTh {
186186
border-top: transparent;
187187
border-bottom: white;
188188
border-left: transparent!important;
@@ -191,7 +191,7 @@ th {
191191
font-weight: normal;
192192
}
193193

194-
td {
194+
.icalTd {
195195
border-top: transparent!important;
196196
border-bottom: white;
197197
border-left: transparent!important;
@@ -201,11 +201,11 @@ td {
201201
transition: transform .5s ease;
202202
}
203203

204-
td:hover {
204+
.icalTd:hover {
205205
transform: scale(1.12);
206206
}
207207

208-
.eventBox {
208+
.icalEventBox {
209209
box-shadow: 0 2.5rem 2rem -2rem hsl(200 50% 20% / 40%);
210210
}
211211

0 commit comments

Comments
 (0)