]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/yui/rls.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / yui / rls.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('rls', function(Y) {
9
10 /**
11  * Implentation for building the remote loader service url.
12  * @method _rls
13  * @param {Array} what the requested modules.
14  * @since 3.2.0
15  * @return {string} the url for the remote loader service call.
16  */
17 Y._rls = function(what) {
18
19     var config = Y.config,
20
21         // the configuration
22         rls = config.rls || {
23             m: 1, // required in the template
24             v: Y.version,
25             gv: config.gallery,
26             env: 1, // required in the template
27             lang: config.lang,
28             '2in3v': config['2in3'],
29             '2v': config.yui2,
30             filt: config.filter,
31             filts: config.filters,
32             tests: 1 // required in the template
33         },
34
35         // The rls base path
36         rls_base = config.rls_base || 'load?',
37
38         // the template
39         rls_tmpl = config.rls_tmpl || function() {
40             var s = '', param;
41             for (param in rls) {
42                 if (param in rls && rls[param]) {
43                     s += param + '={' + param + '}&';
44                 }
45             }
46             // console.log('rls_tmpl: ' + s);
47             return s;
48         }(),
49
50         url;
51
52     // update the request
53     rls.m = what;
54     rls.env = Y.Object.keys(YUI.Env.mods);
55     rls.tests = Y.Features.all('load', [Y]);
56
57     url = Y.Lang.sub(rls_base + rls_tmpl, rls);
58
59     config.rls = rls;
60     config.rls_tmpl = rls_tmpl;
61
62     // console.log(url);
63     return url;
64 };
65
66
67
68 }, '3.3.0' ,{requires:['get','features']});