Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New description tag #90

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/monthly.css
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
}

.monthly-list-time-start,
.monthly-list-time-end {
.monthly-list-time-end .monthly-list-description {
font-size: .8em;
display: inline-block;
}
Expand Down
84 changes: 76 additions & 8 deletions events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,71 @@

<event>
<id>2</id>
<name>Another Event</name>
<startdate>2017-1-10</startdate>
<enddate></enddate>
<starttime></starttime>
<endtime></endtime>
<color>#28cbff</color>
<url></url>
</event>
<name>XML Events</name>
<startdate>2018-6-12</startdate>
<enddate>2018-6-15</enddate>
<description>
<![CDATA[
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #dddddd;
}
</style>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr>
<td>Magazzini Alimentari Riuniti</td>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
</table>
]]>
</description>
<starttime>12:00</starttime>
<endtime>2:00</endtime>
<color>#ffb128</color>
</event>

<event>
<id>3</id>
Expand Down Expand Up @@ -68,5 +125,16 @@
<url></url>
</event>

<event>
<id>7</id>
<name>XML Events</name>
<startdate>2018-6-5</startdate>
<starttime>12:00</starttime>
<endtime>2:00</endtime>
<description>This is a description of the event</description>
<color>#ffb128</color>
<url></url>
</event>


</monthly>
10 changes: 8 additions & 2 deletions js/monthly.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Monthly 2.2.2 by Kevin Thornbloom is licensed under a Creative Commons Attributi
timeHtml = "",
eventURL = _getEventDetail(event, "url"),
eventTitle = _getEventDetail(event, "name"),
eventDescription = _getEventDetail(event, "description"),
eventClass = _getEventDetail(event, "class"),
eventColor = _getEventDetail(event, "color"),
eventId = _getEventDetail(event, "id"),
Expand All @@ -227,6 +228,11 @@ Monthly 2.2.2 by Kevin Thornbloom is licensed under a Creative Commons Attributi
+ "</div>";
}

if(eventDescription) {
var descriptionHtml = '';
descriptionHtml = '<div><div class="monthly-list-description">' + eventDescription + "</div>" + "</div>";
}

if(options.linkCalendarToEventUrl && eventURL) {
dayStartTag = "<a" + attr("href", eventURL);
dayEndTags = "</span></a>";
Expand All @@ -243,7 +249,7 @@ Monthly 2.2.2 by Kevin Thornbloom is licensed under a Creative Commons Attributi
+ attr("data-eventid", eventId)
+ (eventColor ? attr("style", "background:" + eventColor) : "")
+ attr("title", eventTitle)
+ ">" + eventTitle + " " + timeHtml + "</a>";
+ ">" + eventTitle + " " + "</br>" + (descriptionHtml? descriptionHtml : "" ) + timeHtml + "</a>";
for(var index = startDayNumber; index <= endDayNumber; index++) {
var doShowTitle = index === showEventTitleOnDay;
// Add to calendar view
Expand All @@ -253,7 +259,7 @@ Monthly 2.2.2 by Kevin Thornbloom is licensed under a Creative Commons Attributi
// Include a class marking if this event continues from the previous day
+ (doShowTitle ? "" : " monthly-event-continued")
)
+ "><span>" + (doShowTitle ? eventTitle : "") + dayEndTags);
+ "><span>" + eventTitle + dayEndTags);
// Add to event list
$(parent + ' .monthly-list-item[data-number="' + index + '"]')
.addClass("item-has-event")
Expand Down