Lines Matching +refs:val +refs:obj
1953 * var obj = document.createElement("object");
1954 * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
2423 @param {Object} obj Object to test.
2432 YArray.test = function (obj) {
2435 if (Lang.isArray(obj)) {
2437 } else if (Lang.isObject(obj)) {
2442 if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
2814 * @param {Object} obj Prototype object.
2818 O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
2824 return Object.create(obj);
2830 return function (obj) {
2831 F.prototype = obj;
2885 * `obj.hasOwnProperty()`.
2888 * @param {Object} obj Object to test.
2893 owns = O.owns = function (obj, key) {
2894 return !!obj && hasOwn.call(obj, key);
2901 * @param {Object} obj Object to test.
2925 * @param {Object} obj An object.
2929 O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {
2930 if (!Lang.isObject(obj)) {
2937 if (hasProtoEnumBug && typeof obj === 'function') {
2938 for (key in obj) {
2939 if (owns(obj, key) && key !== 'prototype') {
2944 for (key in obj) {
2945 if (owns(obj, key)) {
2955 if (owns(obj, key)) {
2977 * @param {Object} obj An object.
2981 O.values = function (obj) {
2982 var keys = O.keys(obj),
2988 values.push(obj[keys[i]]);
2998 * @param {Object} obj An object.
3002 O.size = function (obj) {
3004 return O.keys(obj).length;
3015 * @param {Object} obj An object.
3020 O.hasValue = function (obj, value) {
3021 return Y.Array.indexOf(O.values(obj), value) > -1;
3033 * @param {Object} obj Object to enumerate.
3037 * @param {Object} fn.obj Object being enumerated.
3044 O.each = function (obj, fn, thisObj, proto) {
3047 for (key in obj) {
3048 if (proto || owns(obj, key)) {
3049 fn.call(thisObj || Y, obj[key], key, obj);
3065 * @param {Object} obj Object to enumerate.
3069 * @param {Object} fn.obj Object being enumerated.
3076 O.some = function (obj, fn, thisObj, proto) {
3079 for (key in obj) {
3080 if (proto || owns(obj, key)) {
3081 if (fn.call(thisObj || Y, obj[key], key, obj)) {
3129 * @param val {Any} The new value for the sub-attribute.
3133 O.setValue = function(o, path, val) {
3145 ref[p[i]] = val;
3158 * @param {Object} obj An object.
3163 O.isEmpty = function (obj) {
3164 return !O.keys(Object(obj)).length;
6468 isWindow: function(obj) {
6469 return !!(obj && obj.alert && obj.document);
6672 * @param {String} val The value of the attribute.
6674 setAttribute: function(el, attr, val, ieAttr) {
6677 el.setAttribute(attr, val, ieAttr);
6732 setValue: function(node, val) {
6739 setter(node, val);
6741 node.value = val;
6759 Y_DOM.VALUE_SETTERS.select = function(node, val) {
6762 if (Y_DOM.getValue(option) === val) {
6779 button: function(node, val) {
6786 attr.value = val;
6798 var val = node.value,
6806 val = Y_DOM.getValue(options[node.selectedIndex]);
6810 return val;
7271 _setSize: function(node, prop, val) {
7272 val = (val > 0) ? val : 0;
7275 node.style[prop] = val + 'px';
7278 if (size > val) {
7279 val = val - (size - val);
7281 if (val < 0) {
7282 val = 0;
7285 node.style[prop] = val + 'px';
7329 Y.Array.each(VENDOR_TRANSFORM, function(val) {
7330 if (val in DOCUMENT[DOCUMENT_ELEMENT].style) {
7331 TRANSFORM = val;
7347 * @param {String|Number} val The value.
7349 setStyle: function(node, att, val, style) {
7354 if (val === null || val === '') { // normalize unsetting
7355 val = '';
7356 } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit
7357 val += Y_DOM.DEFAULT_UNIT;
7362 CUSTOM_STYLES[att].set(node, val, style);
7369 val = '';
7371 style[att] = val;
7384 val = '';
7394 val = style[att];
7395 if (val === '') { // TODO: is empty string sufficient?
7396 val = Y_DOM[GET_COMPUTED_STYLE](node, att);
7400 return val;
7424 var val = '',
7431 val = computed[att];
7434 return val;
7449 val = view[GET_COMPUTED_STYLE](node, '')[att];
7452 val = Y.Color.toRGB(val);
7455 return val;
7464 val = view[GET_COMPUTED_STYLE](node, '')[att];
7466 if (val === 'rgba(0, 0, 0, 0)') {
7467 val = TRANSPARENT;
7470 return val;
7476 var val = Y.DOM[GET_COMPUTED_STYLE](node, attr),
7482 if (val === 'auto') {
7485 val = 0;
7490 val = offset - parentOffset;
7492 val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr];
7497 return val;
7531 set: function(node, val, style) {
7532 style[TRANSFORM] = val;
7570 toRGB: function(val) {
7571 if (!Y.Color.re_RGB.test(val)) {
7572 val = Y.Color.toHex(val);
7575 if(Y.Color.re_hex.exec(val)) {
7576 val = 'rgb(' + [
7582 return val;
7585 toHex: function(val) {
7586 val = Y.Color.KEYWORDS[val] || val;
7587 if (Y.Color.re_RGB.exec(val)) {
7588 val = [
7594 for (var i = 0; i < val.length; i++) {
7595 if (val[i].length < 2) {
7596 val[i] = '0' + val[i];
7600 val = val.join('');
7603 if (val.length < 6) {
7604 val = val.replace(Y.Color.re_hex3, '$1$1');
7607 if (val !== 'transparent' && val.indexOf('#') < 0) {
7608 val = '#' + val;
7611 return val.toUpperCase();
7749 var val = null,
7755 val = node.style.pixelRight;
7758 return val;
7762 var val,
7766 val = 0;
7768 val = ComputedStyle.getPixel(node, att);
7770 return val + PX;
7799 val = current[att] || current.color;
7800 return Y.Color.toRGB(Y.Color.toHex(val));
7829 var val = 100;
7831 val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY];
7835 val = node[FILTERS]('alpha')[OPACITY];
7840 return val / 100;
7843 set: function(node, val, style) {
7849 if (val === '') { // normalize inline style behavior
7851 val = current;
7856 ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : '');
7874 set: function(node, val, style) {
7875 var floatVal = parseFloat(val);
7876 if (floatVal >= 0 || val === 'auto' || val === '') {
7877 style.height = val;
7879 Y.log('invalid style value for height: ' + val, 'warn', 'dom-style');
7885 set: function(node, val, style) {
7886 var floatVal = parseFloat(val);
7887 if (floatVal >= 0 || val === 'auto' || val === '') {
7888 style.width = val;
7890 Y.log('invalid style value for width: ' + val, 'warn', 'dom-style');
8976 * @param obj the object hosting the method to displace
8984 before: function(fn, obj, sFn, c) {
8992 return this._inject(DO_BEFORE, f, obj, sFn);
9015 * @param obj the object hosting the method to displace
9022 after: function(fn, obj, sFn, c) {
9029 return this._inject(DO_AFTER, f, obj, sFn);
9039 * @param obj the object hosting the method to displace
9046 _inject: function(when, fn, obj, sFn) {
9049 var id = Y.stamp(obj), o, sid;
9052 // create a map entry for the obj if it doesn't exist
9060 o[sFn] = new Y.Do.Method(obj, sFn);
9063 obj[sFn] =
9128 * @param obj The object to operate on
9131 DO.Method = function(obj, sFn) {
9132 this.obj = obj;
9134 this.method = obj[sFn];
9192 ret = bf[i].apply(this.obj, args);
9211 ret = this.method.apply(this.obj, args);
9220 newRet = af[i].apply(this.obj, args);
10002 * This is wrapped by Y.rbind if obj was supplied.
10111 * Returns true if the fn and obj match this objects properties.
11790 Y_Node.scrubVal = function(val, node) {
11791 if (val) { // only truthy values are risky
11792 if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function
11793 if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window
11794 val = Y.one(val);
11795 } else if ((val.item && !val._nodes) || // dom collection or Node instance
11796 (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes
11797 val = Y.all(val);
11800 } else if (typeof val === 'undefined') {
11801 val = node; // for chaining
11802 } else if (val === null) {
11803 val = null; // IE: DOM null not the same as null
11806 return val;
11939 * @param {any} val The value to be set
11942 Y_Node.DEFAULT_SETTER = function(name, val) {
11950 Y.Object.setValue(node, name, val);
11952 node[name] = val;
11955 return val;
11968 val;
11971 val = Y.Object.getValue(node, name.split(DOT));
11973 val = node[name];
11976 return val;
12022 var val;
12025 val = this._getAttr(attr);
12027 val = this._get(attr);
12030 if (val) {
12031 val = Y_Node.scrubVal(val, this);
12032 } else if (val === null) {
12033 val = null; // IE: DOM null is not true null (even though they ===)
12035 return val;
12047 val;
12050 val = attrConfig.getter.call(this);
12052 val = this._node.getAttribute(attr, 2);
12054 val = Y_Node.DEFAULT_GETTER.apply(this, arguments);
12057 return val;
12068 * @param {any} val The value to set the attribute to.
12071 set: function(attr, val) {
12078 attrConfig.setter.call(this, val, attr);
12080 this._node.setAttribute(attr, val);
12585 var val = node[method].apply(node, args);
12587 ret.push(val);
12846 val;
12850 val = instance._get(attr);
12851 if (val && val.nodeType) {
12863 val = instance._get(attr);
12865 val = Y.Node.scrubVal(val, instance);
12868 ret.push(val);
13574 setter: function(val) {
13575 Y_DOM.setAttribute(this._node, 'for', val);
13576 return val;
13617 setter: function(val) {
13618 Y_DOM.setValue(this._node, val);
13619 return val;
14119 setter: function(val) {
14120 if (val === 'hidden') {
14129 this._node.type = val;
14131 Y.log('error setting type: ' + val, 'info', 'node');
14134 return val;
14242 * @param {any} val The value to be assigned to the field.
14245 setData: function(name, val) {
14248 this._data[name] = val;
14298 * @param {any} val The value to be assigned to the field.
14301 setData: function(name, val) {
14302 var args = (arguments.length > 1) ? [name, val] : [name];
14923 obj: p_obj,
14972 * @param {object} obj an optional object to be passed back as
14982 onContentReady: function(id, fn, obj, override, compat) {
14983 return Event.onAvailable(id, fn, obj, override, true, compat);
15212 detach: function(type, fn, el, obj) {
15392 context = item.obj;
15399 item.fn.call(context, item.obj);
15401 context = item.obj || Y.one(el);
16514 setter: function(val) {
16518 node.scrollLeft = val;
16520 Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc
16534 setter: function(val) {
16538 node.scrollTop = val;
16540 Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc
16697 * @param {String|Number} val The value.
16700 setStyle: function(attr, val) {
16701 Y.DOM.setStyle(this._node, attr, val);
16767 * @param {String|Number} val The value.
16817 * @param obj {Object} A single-level object to convert to a querystring.
16825 QueryString.stringify = function (obj, c) {
16831 for (key in obj) {
16832 if (obj.hasOwnProperty(key)) {
16833 if (Y.Lang.isArray(obj[key])) {
16834 for (i = 0, l = obj[key].length; i < l; i++) {
16835 qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i]));
16839 qs.push(EUC(key) + '=' + EUC(obj[key]));
18148 Y.Array.each(VENDORS, function(val) { // then vendor specific
18149 var property = val + TRANSITION_CAMEL;
18151 CAMEL_VENDOR_PREFIX = val;
18152 VENDOR_PREFIX = Transition._toHyphen(val) + '-';
18156 Transition._VENDOR_PREFIX = val;
18224 val;
18234 val = config.value;
18236 val = config;
18240 if (typeof val === 'function') {
18241 val = val.call(nodeInstance, nodeInstance);
18258 value: val,
18270 // val may be a string or number (height: 0, etc), but computedStyle is always string
18272 compareVal = (typeof val === 'string') ? computed : parseFloat(computed);
18274 if (Transition.useNative && compareVal === val) {
18824 '~=': '(?:^|\\s+){val}(?:\\s+|$)', // space-delimited
18825 '|=': '^{val}-?' // optional hyphen-delimited
19022 test = new RegExp(test.replace('{val}', match[3]));
19361 '^=': '^{val}', // Match starts with value
19362 '$=': '{val}$', // Match ends with value
19363 '*=': '{val}' // Match contains value as substring
19708 val,
19719 val = attribute.value;
19727 mTo = Transition.RE_UNITS.exec(val);
19730 end = mTo ? mTo[1] : val;
19817 val = Transition.cubicBezier(fn, elapsed / duration);
19819 val = from + val[0] * (to - from);
19824 Y.DOM.setStyle(node, att, val + unit);
19839 val = '';
19842 val = Y.DOM.getComputedStyle(node, att);
19845 return val;