~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/yui/rls.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.2.0
 
6
build: 2676
 
7
*/
 
8
YUI.add('rls', function(Y) {
 
9
 
 
10
/**
 
11
 * Implentation for building the remote loader service url.
 
12
 * @method _rls
 
13
 * @param what {Array} the requested modules
 
14
 * @since 3.2.0
 
15
 */
 
16
Y._rls = function(what) {
 
17
 
 
18
    var config = Y.config,
 
19
 
 
20
        // the configuration
 
21
        rls = config.rls || {
 
22
            m:       1, // required in the template
 
23
            v:       Y.version,
 
24
            gv:      config.gallery,
 
25
            env:     1, // required in the template
 
26
            lang:    config.lang,
 
27
            '2in3v': config['2in3'],
 
28
            '2v':    config.yui2,
 
29
            filt:    config.filter,
 
30
            filts:   config.filters,
 
31
            tests:   1 // required in the template
 
32
        },
 
33
 
 
34
        // The rls base path
 
35
        rls_base = config.rls_base || 'load?',
 
36
 
 
37
        // the template
 
38
        rls_tmpl = config.rls_tmpl || function() {
 
39
            var s = '', param;
 
40
            for (param in rls) {
 
41
                if (param in rls && rls[param]) {
 
42
                    s += param + '={' + param + '}&';
 
43
                }
 
44
            }
 
45
            // console.log('rls_tmpl: ' + s);
 
46
            return s;
 
47
        }(), 
 
48
        
 
49
        url;
 
50
 
 
51
    // update the request
 
52
    rls.m     = what;
 
53
    rls.env   = Y.Object.keys(YUI.Env.mods);
 
54
    rls.tests = Y.Features.all('load', [Y]);
 
55
 
 
56
    url = Y.Lang.sub(rls_base + rls_tmpl, rls);
 
57
 
 
58
    config.rls = rls;
 
59
    config.rls_tmpl = rls_tmpl;
 
60
 
 
61
    // console.log(url);
 
62
    return url;
 
63
};
 
64
 
 
65
 
 
66
 
 
67
}, '3.2.0' ,{requires:['yui-base','get','features']});