Add JS files
This commit is contained in:
8
jssource/src_files/include/javascript/yui3/build/attribute/attribute-base-min.js
vendored
Executable file
8
jssource/src_files/include/javascript/yui3/build/attribute/attribute-base-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1064
jssource/src_files/include/javascript/yui3/build/attribute/attribute-base.js
vendored
Executable file
1064
jssource/src_files/include/javascript/yui3/build/attribute/attribute-base.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
8
jssource/src_files/include/javascript/yui3/build/attribute/attribute-complex-min.js
vendored
Executable file
8
jssource/src_files/include/javascript/yui3/build/attribute/attribute-complex-min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add("attribute-complex",function(B){var A=B.Object,C=".";B.Attribute.Complex=function(){};B.Attribute.Complex.prototype={_normAttrVals:function(G){var I={},H={},J,D,F,E;if(G){for(E in G){if(G.hasOwnProperty(E)){if(E.indexOf(C)!==-1){J=E.split(C);D=J.shift();F=H[D]=H[D]||[];F[F.length]={path:J,value:G[E]};}else{I[E]=G[E];}}}return{simple:I,complex:H};}else{return null;}},_getAttrInitVal:function(K,I,M){var E=(I.valueFn)?I.valueFn.call(this):I.value,D,F,H,G,N,L,J;if(!I.readOnly&&M){D=M.simple;if(D&&D.hasOwnProperty(K)){E=D[K];}F=M.complex;if(F&&F.hasOwnProperty(K)){J=F[K];for(H=0,G=J.length;H<G;++H){N=J[H].path;L=J[H].value;A.setValue(E,N,L);}}}return E;}};B.mix(B.Attribute,B.Attribute.Complex,true,null,1);},"3.0.0",{requires:["attribute-base"]});
|
||||
120
jssource/src_files/include/javascript/yui3/build/attribute/attribute-complex.js
vendored
Executable file
120
jssource/src_files/include/javascript/yui3/build/attribute/attribute-complex.js
vendored
Executable file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 3.0.0
|
||||
build: 1549
|
||||
*/
|
||||
YUI.add('attribute-complex', function(Y) {
|
||||
|
||||
/**
|
||||
* Adds support for attribute providers to handle complex attributes in the constructor
|
||||
*
|
||||
* @module attribute
|
||||
* @submodule attribute-complex
|
||||
* @for Attribute
|
||||
*/
|
||||
|
||||
var O = Y.Object,
|
||||
DOT = ".";
|
||||
|
||||
Y.Attribute.Complex = function() {};
|
||||
Y.Attribute.Complex.prototype = {
|
||||
|
||||
/**
|
||||
* Utility method to split out simple attribute name/value pairs ("x")
|
||||
* from complex attribute name/value pairs ("x.y.z"), so that complex
|
||||
* attributes can be keyed by the top level attribute name.
|
||||
*
|
||||
* @method _normAttrVals
|
||||
* @param {Object} valueHash An object with attribute name/value pairs
|
||||
*
|
||||
* @return {Object} An object literal with 2 properties - "simple" and "complex",
|
||||
* containing simple and complex attribute values respectively keyed
|
||||
* by the top level attribute name, or null, if valueHash is falsey.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_normAttrVals : function(valueHash) {
|
||||
var vals = {},
|
||||
subvals = {},
|
||||
path,
|
||||
attr,
|
||||
v, k;
|
||||
|
||||
if (valueHash) {
|
||||
for (k in valueHash) {
|
||||
if (valueHash.hasOwnProperty(k)) {
|
||||
if (k.indexOf(DOT) !== -1) {
|
||||
path = k.split(DOT);
|
||||
attr = path.shift();
|
||||
v = subvals[attr] = subvals[attr] || [];
|
||||
v[v.length] = {
|
||||
path : path,
|
||||
value: valueHash[k]
|
||||
};
|
||||
} else {
|
||||
vals[k] = valueHash[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
return { simple:vals, complex:subvals };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the initial value of the given attribute from
|
||||
* either the default configuration provided, or the
|
||||
* over-ridden value if it exists in the set of initValues
|
||||
* provided and the attribute is not read-only.
|
||||
*
|
||||
* @param {String} attr The name of the attribute
|
||||
* @param {Object} cfg The attribute configuration object
|
||||
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
|
||||
*
|
||||
* @return {Any} The initial value of the attribute.
|
||||
*
|
||||
* @method _getAttrInitVal
|
||||
* @private
|
||||
*/
|
||||
_getAttrInitVal : function(attr, cfg, initValues) {
|
||||
|
||||
var val = (cfg.valueFn) ? cfg.valueFn.call(this) : cfg.value,
|
||||
simple,
|
||||
complex,
|
||||
i,
|
||||
l,
|
||||
path,
|
||||
subval,
|
||||
subvals;
|
||||
|
||||
if (!cfg.readOnly && initValues) {
|
||||
|
||||
// Simple Attributes
|
||||
simple = initValues.simple;
|
||||
if (simple && simple.hasOwnProperty(attr)) {
|
||||
val = simple[attr];
|
||||
}
|
||||
|
||||
// Complex Attributes (complex values applied, after simple, incase both are set)
|
||||
complex = initValues.complex;
|
||||
if (complex && complex.hasOwnProperty(attr)) {
|
||||
subvals = complex[attr];
|
||||
for (i = 0, l = subvals.length; i < l; ++i) {
|
||||
path = subvals[i].path;
|
||||
subval = subvals[i].value;
|
||||
O.setValue(val, path, subval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
};
|
||||
|
||||
Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);
|
||||
|
||||
|
||||
}, '3.0.0' ,{requires:['attribute-base']});
|
||||
9
jssource/src_files/include/javascript/yui3/build/attribute/attribute-min.js
vendored
Executable file
9
jssource/src_files/include/javascript/yui3/build/attribute/attribute-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1181
jssource/src_files/include/javascript/yui3/build/attribute/attribute.js
vendored
Executable file
1181
jssource/src_files/include/javascript/yui3/build/attribute/attribute.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user