Commit Graph

6 Commits

Author SHA1 Message Date
Damyon Wiese
28de777199 MDL-51222 Javascript: Trigger events for filters on DOM insertion
When nodes are added to the dom, they may need to be re-processed by a JS based
filter. To do this we need to trigger the legacy YUI event filter-content-updated.

To make this easier I added some wrappers to template that will insert the node, run any
JS and trigger the event.

I also changed existing yui code to call the amd function to trigger the event. This way
all jquery and yui listeners will always be notified.
2015-09-22 15:40:51 +08:00
Damyon Wiese
ba224fb42c MDL-50783 Ajax: Configure how to call a webservice through db/service.php
Now the db/service.php array can contain these extra keys to provide information
on how a webservice may be called:

    'ajax' => true (Default is false)

Replaces the xx_is_allowed_from_ajax callback.

    'loginrequired' => false (Default is true)

Means that this webservice can be called through lib/ajax/service-nosession.php
which sets NO_MOODLE_COOKIES to true (faster). This is only safe for webservices returning
static public data (e.g. get_string).
2015-09-14 15:10:21 +08:00
Damyon Wiese
e0d08bfa5d MDL-51116 Mustache: Caching issue exists with mustache templates
The first ajax load fetches the template and puts it in localstorage + a js var

The second load gets it from local storage, but does not put it in the js var.

The pix_icon helper expects it to be in the js var always.
2015-08-24 10:50:40 +08:00
Jetha Chan
e37d53dac1 MDL-50520 templates: fix helpers not firing inside pix helper 2015-06-09 15:23:04 +08:00
Damyon Wiese
4b9e532633 MDL-49604 Javascript: Add a localstorage cache for strings and templates 2015-04-08 12:31:48 +08:00
Damyon Wiese
9bdcf57951 MDL-49152 output: Templates for renderers (JS and PHP)
Mustache support for rendering templates from either php or js.
2015-03-14 22:48:40 +08:00