community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1682614 - /comdev/site/trunk/content/calendars/index.mdtext
Date Sat, 30 May 2015 15:10:27 GMT
Author: nick
Date: Sat May 30 15:10:26 2015
New Revision: 1682614

URL: http://svn.apache.org/r1682614
Log:
New events listing JS

Modified:
    comdev/site/trunk/content/calendars/index.mdtext

Modified: comdev/site/trunk/content/calendars/index.mdtext
URL: http://svn.apache.org/viewvc/comdev/site/trunk/content/calendars/index.mdtext?rev=1682614&r1=1682613&r2=1682614&view=diff
==============================================================================
--- comdev/site/trunk/content/calendars/index.mdtext (original)
+++ comdev/site/trunk/content/calendars/index.mdtext Sat May 30 15:10:26 2015
@@ -32,70 +32,9 @@ style="border: 0" width="800" height="60
 
 This Calendar is also available as an [iCal feed][3]
 
-<script type="text/javascript">
-function handleContents(li, text) {
-   if(text == undefined || text.length == 0) {
-      return;
-   }
-   parts = text.split("\n");
-   for(var i=0; i<parts.length; i++) {
-      li.appendChild(document.createElement("br"));
-      li.appendChild(document.createTextNode(parts[i]));
-   }
-}
-
-var dateRegExp = new RegExp("^(\\d{4})-(\\d{2})-(\\d{2})$");
-function handleDates(li, when) {
-   var from = when['startTime'];
-   var to = when['endTime'];
-   if(from.match(dateRegExp) && to.match(dateRegExp)) {
-      var fp = from.split(dateRegExp);
-      var tp = to.split(dateRegExp);
-      var fromDate = new Date(fp[1],fp[2]-1,fp[3]);
-      var toDate = new Date(tp[1],tp[2]-1,tp[3]);
-      var realToDate = new Date(toDate.getTime() - 24*60*60*1000);
-
-      var text;
-      if(fromDate.getTime() == realToDate.getTime()) {
-         // Single day
-         text = from;
-      } else {
-         // Really multi day
-         text = from + " to " + realToDate.getFullYear() + "-" + 
-                (realToDate.getMonth()+1) + "-"  + realToDate.getDate();
-      }
-      li.appendChild(document.createTextNode(" - " + text))
-   } else {
-      li.appendChild(document.createTextNode(" - " + from))
-   }
-}
-
-function render(data) {
-   var ev = document.getElementById("events");
-   if(ev.hasChildNodes()) {
-      while(ev.childNodes.length >= 1) {
-         ev.removeChild(ev.firstChild);       
-      } 
-   }
-
-   var feed = data.feed;
-   for(var i=0; i<feed.entry.length; i++) {
-      var entry = feed.entry[i];
-      var title = entry.title.$t;
-      var text = entry.content.$t;
-      var when = entry['gd$when'][0];
-
-      var li = document.createElement("li");
-      var li_b = document.createElement("b");
-      li_b.appendChild(document.createTextNode(title));
-      li.appendChild(li_b);
-      handleDates(li, when);
-      handleContents(li, text);
-      ev.appendChild(li);
-   }
-}
-</script>
-<script src="http://www.google.com/calendar/feeds/nerseigospses068jd57bk5ar8@group.calendar.google.com/public/full?alt=json-in-script&callback=render&orderby=starttime&max-results=30&singleevents=true&sortorder=ascending&futureevents=true"></script>
+<script src="/js/jquery-1.9.1.min.js"></script>
+<script src="https://events.apache.org/js/events-calendar.js"></script>
+<script src="https://apis.google.com/js/client.js"></script>
 
   [1]: mailto:dev@community.apache.org
   [2]: http://www.apache.org/foundation/marks/events.html



Mime
View raw message