~lutostag/ubuntu/utopic/maas/1.5.2

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/querystring-stringify-simple/querystring-stringify-simple-debug.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-03-15 18:14:08 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120315181408-zgl94hzo0x4n99an
Tags: 0.1+bzr295+dfsg-0ubuntu2
* debian/patches:
  - 01-fix-database-settings.patch: Update to set PSERV_URL.
  - 02-pserv-config.patch: Set port to 8001.
* debian/maas.postinst: Run maas-import-isos on install.
* debian/control: Depends on rabbitmq-server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.4.1 (build 4118)
 
3
Copyright 2011 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('querystring-stringify-simple', function(Y) {
 
8
 
 
9
/*global Y */
 
10
/**
 
11
 * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings.
 
12
 * This is a subset implementation of the full querystring-stringify.</p>
 
13
 * <p>This module provides the bare minimum functionality (encoding a hash of simple values),
 
14
 * without the additional support for nested data structures.  Every key-value pair is
 
15
 * encoded by encodeURIComponent.</p>
 
16
 * <p>This module provides a minimalistic way for io to handle  single-level objects
 
17
 * as transaction data.</p>
 
18
 *
 
19
 * @module querystring
 
20
 * @submodule querystring-stringify-simple
 
21
 * @for QueryString
 
22
 * @static
 
23
 */
 
24
 
 
25
var QueryString = Y.namespace("QueryString"),
 
26
    EUC = encodeURIComponent;
 
27
 
 
28
/**
 
29
 * <p>Converts a simple object to a Query String representation.</p>
 
30
 * <p>Nested objects, Arrays, and so on, are not supported.</p>
 
31
 *
 
32
 * @method stringify
 
33
 * @for QueryString
 
34
 * @public
 
35
 * @submodule querystring-stringify-simple
 
36
 * @param obj {Object} A single-level object to convert to a querystring.
 
37
 * @param cfg {Object} (optional) Configuration object.  In the simple
 
38
 *                                module, only the arrayKey setting is
 
39
 *                                supported.  When set to true, the key of an
 
40
 *                                array will have the '[]' notation appended
 
41
 *                                to the key;.
 
42
 * @static
 
43
 */
 
44
QueryString.stringify = function (obj, c) {
 
45
    var qs = [],
 
46
        // Default behavior is false; standard key notation.
 
47
        s = c && c.arrayKey ? true : false,
 
48
        key, i, l;
 
49
 
 
50
    for (key in obj) {
 
51
        if (obj.hasOwnProperty(key)) {
 
52
            if (Y.Lang.isArray(obj[key])) {
 
53
                for (i = 0, l = obj[key].length; i < l; i++) {
 
54
                    qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i]));
 
55
                }
 
56
            }
 
57
            else {
 
58
                qs.push(EUC(key) + '=' + EUC(obj[key]));
 
59
            }
 
60
        }
 
61
    }
 
62
 
 
63
    return qs.join('&');
 
64
};
 
65
 
 
66
 
 
67
}, '3.4.1' ,{requires:['yui-base']});