diff -r d334a616c023 -r e16a97fb364a src/cm/media/js/lib/yui/yui3-3.15.0/build/querystring-stringify/querystring-stringify.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/media/js/lib/yui/yui3-3.15.0/build/querystring-stringify/querystring-stringify.js Mon Mar 10 15:19:48 2014 +0100
@@ -0,0 +1,106 @@
+YUI.add('querystring-stringify', function (Y, NAME) {
+
+/**
+ * Provides Y.QueryString.stringify method for converting objects to Query Strings.
+ *
+ * @module querystring
+ * @submodule querystring-stringify
+ */
+
+var QueryString = Y.namespace("QueryString"),
+ stack = [],
+ L = Y.Lang;
+
+/**
+ * Provides Y.QueryString.escape method to be able to override default encoding
+ * method. This is important in cases where non-standard delimiters are used, if
+ * the delimiters would not normally be handled properly by the builtin
+ * (en|de)codeURIComponent functions.
+ * Default: encodeURIComponent
+ *
+ * @method escape
+ * @for QueryString
+ * @static
+ **/
+QueryString.escape = encodeURIComponent;
+
+/**
+ *
Converts an arbitrary value to a Query String representation.
+ *
+ * Objects with cyclical references will trigger an exception.
+ *
+ * @method stringify
+ * @for QueryString
+ * @public
+ * @param obj {Any} any arbitrary value to convert to query string
+ * @param cfg {Object} (optional) Configuration object. The three
+ * supported configurations are:
+ * - sep: When defined, the value will be used as the key-value
+ * separator. The default value is "&".
+ * - eq: When defined, the value will be used to join the key to
+ * the value. The default value is "=".
+ * - arrayKey: When set to true, the key of an array will have the
+ * '[]' notation appended to the key. The default value is false.
+ *
+ * @param name {String} (optional) Name of the current key, for handling children recursively.
+ * @static
+ */
+QueryString.stringify = function (obj, c, name) {
+ var begin, end, i, l, n, s,
+ sep = c && c.sep ? c.sep : "&",
+ eq = c && c.eq ? c.eq : "=",
+ aK = c && c.arrayKey ? c.arrayKey : false;
+
+ if (L.isNull(obj) || L.isUndefined(obj) || L.isFunction(obj)) {
+ return name ? QueryString.escape(name) + eq : '';
+ }
+
+ if (L.isBoolean(obj) || Object.prototype.toString.call(obj) === '[object Boolean]') {
+ obj =+ obj;
+ }
+
+ if (L.isNumber(obj) || L.isString(obj)) {
+ return QueryString.escape(name) + eq + QueryString.escape(obj);
+ }
+
+ if (L.isArray(obj)) {
+ s = [];
+ name = aK ? name + '[]' : name;
+ l = obj.length;
+ for (i = 0; i < l; i++) {
+ s.push( QueryString.stringify(obj[i], c, name) );
+ }
+
+ return s.join(sep);
+ }
+ // now we know it's an object.
+
+ // Check for cyclical references in nested objects
+ for (i = stack.length - 1; i >= 0; --i) {
+ if (stack[i] === obj) {
+ throw new Error("QueryString.stringify. Cyclical reference");
+ }
+ }
+
+ stack.push(obj);
+ s = [];
+ begin = name ? name + '[' : '';
+ end = name ? ']' : '';
+ for (i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ n = begin + i + end;
+ s.push(QueryString.stringify(obj[i], c, n));
+ }
+ }
+
+ stack.pop();
+ s = s.join(sep);
+ if (!s && name) {
+ return name + "=";
+ }
+
+ return s;
+};
+
+
+}, '@VERSION@', {"requires": ["yui-base"]});