Toggle navigation
Log-in
Languages
English
Wiki Index
Page Index
User Index
Home
Timeline
Wiki source code of
Timeline
Last modified by
Ricardo Rodríguez Fernández
on 2015/09/03 09:22
Export
Print preview
View Source
Siblings
Content
Comments (7)
Attachments
History
Information
×
Export
Export as PDF
Export as HTML
Cancel
Show line numbers
Maximize »
{{velocity}} #set($void = $xwiki.ssx.use('Home.WebHome', {'sourceAction' : $xcontext.action})) {{/velocity}} {{groovy}} xcontext.put("sTimezone", java.util.TimeZone.getTimeZone("GMT")) {{/groovy}} {{velocity}} #set($sLocale = $datetool.getLocale()) #set($changesNb="200") #if("$!request.changesNb" != "") #set($changesNb=$request.changesNb) #end #if("$!request.action" == "xml") $response.setContentType('text/xml') <?xml version="1.0" encoding="$xwiki.encoding"?> <data> #set($hqlQuery = ", XWikiRCSNodeInfo as ni where doc.id=ni.id.docId and ni.author <> 'XWiki.Admin' and ni.author <> 'superadmin' group by doc.space, doc.name order by max(ni.date) desc") #set($recentlyChangedDocuments = $services.query.hql($hqlQuery).setLimit($changesNb).execute()) #set($openLi = $escapetool.xml("<li>")) #set($closeLi = $escapetool.xml("</li>")) #foreach($rcName in $recentlyChangedDocuments) #set($rcDoc = $xwiki.getDocument($rcName)) #if("$!rcDoc" != "") #set($rcUrl = $rcDoc.getURL('view')) #set($date = $datetool.format('d MMM yyyy hh:mm:ss z', $rcDoc.date, $sLocale, $xcontext.sTimezone)) <event start="$date" end="$date" isDuration="false" title="$escapetool.xml($rcDoc.getDisplayTitle())"> $escapetool.xml("<ul>") ${openLi}Last modification: $xwiki.formatDate($rcDoc.date, "MMMM dd, hh:mm")${closeLi} ${openLi}Author: $xwiki.getLocalUserName($rcDoc.author, false)${closeLi} ${openLi}Goto $escapetool.xml("<a href='$rcUrl'>$rcDoc.getDisplayTitle()</a>")${closeLi} $escapetool.xml("</ul>") </event> #end #end </data> #else {{html}} <div id="wiki-timeline" style="height: 500px; border: 1px solid #aaa"></div> <script type="text/javascript"> var tl; function onLoad() { var today = new Date(); var eventSource = new Timeline.DefaultEventSource(); var bandInfos = [ Timeline.createBandInfo({ timeZone: -2, eventSource: eventSource, date: today.toUTCString(), width: "75%", intervalUnit: Timeline.DateTime.DAY, intervalPixels: 100 }), Timeline.createBandInfo({ timeZone: -2, eventSource: eventSource, showEventText: false, trackHeight: 0.5, trackGap: 0.2, date: today.toUTCString(), width: "25%", intervalUnit: Timeline.DateTime.MONTH, intervalPixels: 200 }) ]; bandInfos[1].syncWith = 0; bandInfos[1].highlight = true; bandInfos[1].eventPainter.setLayout(bandInfos[0].eventPainter.getLayout()); tl = Timeline.create(document.getElementById("wiki-timeline"), bandInfos); Timeline.loadXML("$doc.getURL("view", "action=xml&xpage=plain&outputSyntax=plain&changesNb=${changesNb}")", function(xml, url) { eventSource.loadXML(xml, url); }); } var resizeTimerID = null; function onResize() { if (resizeTimerID == null) { resizeTimerID = window.setTimeout(function() { resizeTimerID = null; tl.layout(); }, 500); } } Event.observe(window, "load", onLoad); Event.observe($('wiki-timeline'), "resize", onResize); </script> {{/html}} #end {{/velocity}}
Applications
Blog
Dashboard
User Index
More applications
Quick Links
Sandbox
Jump to any page in the wiki (Meta+G)