MDL-45445 events: trivial changes
[moodle.git] / lib / yuilib / 3.15.0 / yql-jsonp / yql-jsonp.js
blob216f5775fca81544d5dad077b18b6d74c6fc1b6e
1 /*
2 YUI 3.15.0 (build 834026e)
3 Copyright 2014 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('yql-jsonp', function (Y, NAME) {
10 /**
11 * Plugin for YQL to use JSONP to make YQL requests. This is the default method,
12 * when loaded in nodejs or winjs this will not load. The new module is needed
13 * to make sure that JSONP is not loaded in the environments that it is not needed.
14 * @module yql
15 * @submodule yql-jsonp
18 //Over writes Y.YQLRequest._send to use IO instead of JSONP
19 Y.YQLRequest.prototype._send = function (url, o) {
20     if (o.allowCache !== false) {
21         o.allowCache = true;
22     }
23     if (!this._jsonp) {
24         this._jsonp = Y.jsonp(url, o);
25     } else {
26         this._jsonp.url = url;
27         if (o.on && o.on.success) {
28             this._jsonp._config.on.success = o.on.success;
29         }
30         this._jsonp.send();
31     }
36 }, '3.15.0', {"requires": ["jsonp", "jsonp-url"]});