Mwjames has uploaded a new change for review.
Change subject: SRF Eventcalendar Ajax update integration using SMWAPI
......................................................................
SRF Eventcalendar Ajax update integration using SMWAPI
This change implements a SMWAPI/Ajax refresh function for the event
calendar format.
## Features
+ Implements an auto update for when the page is browser refreshed
even though the page contents (and its stored objects) is coming
from the parser cache. It enables the calendar to be updated-to-date
even without a page purge process.
+ Adds an refresh button for which the update process can be
initiated individually.
## Changes
The JS needed a general overhaul to ensure proper singular methods
that can use separately during the update process.
As for the SMWAPI, there where two choices either to register a
seperated API class module that would allow to fetch data in
an appropriate array format( see Stefan's Slideshow ajax integration)
or to slightly adopt the SMWAPI interface in favour of running the
formatting within the same printer class.
I decided to add a new API parameter called 'serializer' which if used can
run call a specified static function. In case of the evencalendar
SRF\EventCalendar::getAPIData() is used to output the same structure
as it is done by SRF\EventCalendar::getEventData() but with the difference to
to use a serilized array($queryResult->serializeToArray()) instead of a
stateful result object( SMWQueryResult $result ).
## The SMW API
Calls are made through the standard SMWAPI but instead of using the
standard serilized object it uses a specified method instead. This
allows to render necessary objects on the server as oppose to
rendering the "standard" JSON object on the client side using JS.
$.ajax( {
...
'action': 'ask',
'format': 'json',
'query' : this.query( data ),
'serializer': 'SRF\\EventCalendar::getAPIData'
...
## Depends on
+ Change I0195704c SRF blockUI plugin
+ Change I92cc4637 SRF Util
+ Change Iec361959 SMW API
## Preview
http://youtu.be/SbRB11Bwv2o
Change-Id: I3f7407a1316d2b35a0fa047eb9da9724c4c28acb
---
M Resources.php
M SemanticResultFormats.i18n.php
M formats/calendar/EventCalendar.php
M formats/calendar/resources/ext.srf.eventcalendar.css
M formats/calendar/resources/ext.srf.eventcalendar.js
5 files changed, 626 insertions(+), 215 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticResultFormats
refs/changes/39/41939/1
--
To view, visit https://gerrit.wikimedia.org/r/41939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f7407a1316d2b35a0fa047eb9da9724c4c28acb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticResultFormats
Gerrit-Branch: master
Gerrit-Owner: Mwjames <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits