Lines Matching +refs:val +refs:transaction

3129  * @param val {Any}     The new value for the sub-attribute.
3133 O.setValue = function(o, path, val) {
3145 ref[p[i]] = val;
3689 transaction level.
3693 transaction object as a parameter. See `Y.Get.Transaction` for details on
3716 callback functions. Defaults to the transaction object.
3729 @property {Function} [options.onEnd] Callback to execute after a transaction
3733 transaction fails, times out, or is aborted.
3736 individual request in a transaction either succeeds or fails.
3739 transaction completes successfully with no errors. Note that in browsers
3746 transaction times out.
3757 aborting a transaction. When a timeout occurs, the `onTimeout` callback
3830 Information about the currently pending transaction, if any.
3833 optional callback passed to `css()`, `load()`, or `js()`; and `transaction`,
3834 containing the actual transaction instance.
3869 Aborts the specified transaction.
3871 This will cause the transaction's `onFailure` callback to be called and
3877 future version of YUI. Use the transaction-level `abort()` method instead.
3880 @param {Get.Transaction} transaction Transaction to abort.
3881 @deprecated Use the `abort()` method on the transaction instead.
3884 abort: function (transaction) {
3887 Y.log('`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.', 'warn', 'get');
3889 if (!transaction.abort) {
3890 id = transaction;
3892 transaction = null;
3894 if (pending && pending.transaction.id === id) {
3895 transaction = pending.transaction;
3899 item = this._queue[i].transaction;
3902 transaction = item;
3910 transaction && transaction.abort();
3921 Request-specific options take priority over transaction-level options and
3953 // Specify transaction-level options, which will apply to all requests
3954 // within the transaction.
3960 // Specify per-request options, which override transaction-level and
3970 @param {Object} [options] Options for this transaction. See the
3978 the transaction, or `null` on success.
3979 @param {Get.Transaction} callback.transaction Transaction object.
3996 Request-specific options take priority over transaction-level options and
4032 // Specify transaction-level options, which will apply to all requests
4033 // within the transaction.
4039 // Specify per-request options, which override transaction-level and
4049 @param {Object} [options] Options for this transaction. See the
4057 the transaction, or `null` on success.
4058 @param {Get.Transaction} callback.transaction Transaction object.
4069 Loads one or more CSS and/or JavaScript resources in the same transaction.
4072 transaction and be notified when all requested URLs have finished loading,
4076 a resource type isn't specified in per-request options or transaction-level
4084 // Load both CSS and JS files in a single transaction, and log a message
4097 @param {Object} [options] Options for this transaction. See the
4105 transaction, or `null` on success.
4257 var transaction;
4272 transaction = this._getTransaction(urls, options);
4276 transaction: transaction
4281 return transaction;
4296 item.transaction.execute(function () {
4312 // since this can hang the transaction.
4319 // If this is a transaction-level purge and this node also exists in
4345 Represents a Get transaction, which may contain requests for one or more JS or
4375 Arbitrary data object associated with this transaction.
4384 Array of errors that have occurred during this transaction, if any.
4393 Numeric id for this transaction, unique among all transactions within the same
4402 during the current transaction.
4408 Options associated with this transaction.
4417 Request objects contained in this transaction. Each request object represents
4425 Id of the most recent transaction.
4438 Current state of this transaction. One of "new", "executing", or "done".
4449 Aborts this transaction.
4451 This will cause the transaction's `onFailure` callback to be called and
4458 array describing why the transaction was aborted.
4472 Begins execting the transaction.
4476 want to execute your transaction before Get does, you can, but be aware that
4477 this transaction's scripts may end up executing before the scripts in other
4480 If the transaction is already executing, the specified callback (if any)
4481 will be queued and called after execution finishes. If the transaction has
4482 already finished, the callback will be called immediately (the transaction
4487 in the transaction are complete, or after the transaction is aborted.
4530 Manually purges any `<script>` or `<link>` nodes this transaction has
4533 Be careful when purging a transaction that contains CSS requests, since
4755 // fail after a timeout to avoid blocking the transaction queue.
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');
10030 * Custom events for a given fire transaction.
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];
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.
16798 * as transaction data.</p>
16893 * A counter that increments for each transaction.
16902 * Object of IO HTTP headers sent with each transaction.
16913 * Object that stores timeout values for any transaction with a defined
16937 // Publish IO transaction events with configurations, if
16944 * Method that creates a unique transaction object for each request.
16949 * the transaction is an XDR or file upload,
16952 * @return {Object} The transaction object
16956 transaction = {
16971 transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) :
16972 Y.merge(Y.IO.defaultTransport(), transaction);
16974 if (transaction.notify) {
16980 transaction.c.upload.onprogress = function (e) {
16981 io.progress(transaction, e, config);
16983 transaction.c.onload = function (e) {
16984 io.load(transaction, e, config);
16986 transaction.c.onerror = function (e) {
16987 io.error(transaction, e, config);
16989 transaction.upload = true;
16993 return transaction;
16996 _destroy: function(transaction) {
16997 if (win && !transaction.notify && !transaction.xdr) {
16998 if (XHR && !transaction.upload) {
16999 transaction.c.onreadystatechange = null;
17000 } else if (transaction.upload) {
17001 transaction.c.upload.onprogress = null;
17002 transaction.c.onload = null;
17003 transaction.c.onerror = null;
17004 } else if (Y.UA.ie && !transaction.e) {
17007 transaction.c.abort();
17011 transaction = transaction.c = null;
17020 * @param {Object} transaction Transaction object.
17023 _evt: function(eventName, transaction, config) {
17033 if (transaction.e) {
17034 transaction.c = { status: 0, statusText: transaction.e };
17040 id: transaction.id,
17041 data: transaction.c,
17045 transaction.id
17054 if (transaction.evt) {
17055 params.push(transaction.evt);
17057 params.push(transaction.c);
17068 // Fire transaction events, if receivers are defined.
17077 * Fires event "io:start" and creates, fires a transaction-specific
17081 * @param {Object} transaction Transaction object.
17082 * @param {Object} config Configuration object for the transaction.
17084 start: function(transaction, config) {
17089 this._evt(EVENTS[0], transaction, config);
17094 * transaction-specific "complete" event, if config.on.complete is
17098 * @param {Object} transaction Transaction object.
17099 * @param {Object} config Configuration object for the transaction.
17101 complete: function(transaction, config) {
17104 * transaction. Response status and data are accessible, if
17108 this._evt(EVENTS[1], transaction, config);
17112 * Fires event "io:end" and creates, fires a transaction-specific "end"
17116 * @param {Object} transaction Transaction object.
17117 * @param {Object} config Configuration object for the transaction.
17119 end: function(transaction, config) {
17121 * Signals the end of the transaction lifecycle.
17124 this._evt(EVENTS[2], transaction, config);
17125 this._destroy(transaction);
17129 * Fires event "io:success" and creates, fires a transaction-specific
17133 * @param {Object} transaction Transaction object.
17134 * @param {Object} config Configuration object for the transaction.
17136 success: function(transaction, config) {
17142 this._evt(EVENTS[3], transaction, config);
17143 this.end(transaction, config);
17147 * Fires event "io:failure" and creates, fires a transaction-specific
17151 * @param {Object} transaction Transaction object.
17152 * @param {Object} config Configuration object for the transaction.
17154 failure: function(transaction, config) {
17160 this._evt(EVENTS[4], transaction, config);
17161 this.end(transaction, config);
17165 * Fires event "io:progress" and creates, fires a transaction-specific
17170 * @param {Object} transaction Transaction object.
17172 * @param {Object} config Configuration object for the transaction.
17174 progress: function(transaction, e, config) {
17176 * Signals the interactive state during a file upload transaction.
17180 transaction.evt = e;
17181 this._evt(EVENTS[5], transaction, config);
17185 * Fires event "io:complete" and creates, fires a transaction-specific
17190 * @param {Object} transaction Transaction object.
17192 * @param {Object} config Configuration object for the transaction.
17194 load: function (transaction, e, config) {
17195 transaction.evt = e.target;
17196 this._evt(EVENTS[1], transaction, config);
17200 * Fires event "io:failure" and creates, fires a transaction-specific
17205 * @param {Object} transaction Transaction object.
17207 * @param {Object} config Configuration object for the transaction.
17209 error: function (transaction, e, config) {
17210 transaction.evt = e;
17211 this._evt(EVENTS[4], transaction, config);
17215 * Retry an XDR transaction, using the Flash tranport, if the native
17220 * @param {Object} transaction Transaction object.
17221 * @param {String} uri Qualified path to transaction resource.
17222 * @param {Object} config Configuration object for the transaction.
17224 _retry: function(transaction, uri, config) {
17225 this._destroy(transaction);
17227 return this.send(uri, config, transaction.id);
17261 * Method that sets all HTTP headers to be sent in a transaction.
17265 * @param {Object} transaction - XHR instance for the specific transaction.
17266 * @param {Object} headers - HTTP headers for the specific transaction, as
17269 _setHeaders: function(transaction, headers) {
17273 transaction.setRequestHeader(name, headers[name]);
17284 * @param {Object} transaction Transaction object generated by _create().
17287 _startTimeout: function(transaction, timeout) {
17290 io._timeout[transaction.id] = setTimeout(function() {
17291 io._abort(transaction, 'timeout');
17308 * Method that determines if a transaction response qualifies as success
17315 * @param {Object} transaction Transaction object generated by _create().
17318 _result: function(transaction, config) {
17323 status = transaction.c.status;
17330 this.success(transaction, config);
17332 this.failure(transaction, config);
17341 * @param {Object} transaction Transaction object generated by _create().
17344 _rS: function(transaction, config) {
17347 if (transaction.c.readyState === 4) {
17349 io._clearTimeout(transaction.id);
17354 io.complete(transaction, config);
17355 io._result(transaction, config);
17361 * Terminates a transaction due to an explicit abort or timeout.
17365 * @param {Object} transaction Transaction object generated by _create().
17366 * @param {String} type Identifies timed out or aborted transaction.
17368 _abort: function(transaction, type) {
17369 if (transaction && transaction.c) {
17370 transaction.e = type;
17371 transaction.c.abort();
17376 * Requests a transaction. `send()` is implemented as `Y.io()`. Each
17377 * transaction may include a configuration object. Its properties are:
17386 * transaction data. If the request is HTTP GET, the data become
17392 * By setting this property, the transaction will use the specified
17414 * <dd>Assigns transaction event subscriptions. Available events are:
17419 * <dd>Fires when the transaction is complete.</dd>
17426 * or if the transaction exceeds a configured `timeout`.</dd>
17428 * <dd>Fires at the conclusion of the transaction
17433 * transaction as a first argument. For `complete`, `success`, and
17442 * <dd>Pass `true` to make a same-domain transaction synchronous.
17453 * <dd>Object map of transaction headers to send to the server. The
17458 * <dd>Millisecond threshold for the transaction before being
17466 * this property name in the transaction configuration as
17473 * @param {String} uri Qualified path to transaction resource.
17474 * @param {Object} config Configuration object for the transaction.
17479 var transaction, method, i, len, sync, data,
17485 transaction = io._create(config, id);
17492 if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) {
17498 // This is a file upload transaction, calling
17500 return io.upload(transaction, uri, config);
17528 if (transaction.xdr) {
17530 return io.xdr(u, transaction, config);
17532 else if (transaction.notify) {
17534 return transaction.c.send(transaction, uri, config);
17537 if (!sync && !transaction.upload) {
17538 transaction.c.onreadystatechange = function() {
17539 io._rS(transaction, config);
17546 transaction.c.open(method, u, !sync, config.username || null, config.password || null);
17547 io._setHeaders(transaction.c, config.headers || {});
17548 io.start(transaction, config);
17554 transaction.c.withCredentials = true;
17560 transaction.c.send(data);
17567 response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]];
17571 return transaction.c.getAllResponseHeaders();
17575 return transaction.c.getResponseHeader(name);
17578 io.complete(transaction, config);
17579 io._result(transaction, config);
17584 if (transaction.xdr) {
17589 // initialized or available, the transaction
17591 return io._retry(transaction, uri, config);
17593 io.complete(transaction, config);
17594 io._result(transaction, config);
17601 io._startTimeout(transaction, config.timeout);
17606 id: transaction.id,
17608 return transaction.c ? io._abort(transaction, 'abort') : false;
17611 return transaction.c ? (transaction.c.readyState % 4) : false;
17621 transaction and attach event subscriptions. The configuration object
17631 transaction data. If the request is HTTP GET, the data become
17637 By setting this property, the transaction will use the specified
17659 <dd>Assigns transaction event subscriptions. Available events are:
17664 <dd>Fires when the transaction is complete.</dd>
17671 or if the transaction exceeds a configured `timeout`.</dd>
17673 <dd>Fires at the conclusion of the transaction
17678 transaction as a first argument. For `complete`, `success`, and
17687 <dd>Pass `true` to make a same-domain transaction synchronous.
17698 <dd>Object map of transaction headers to send to the server. The
17703 <dd>Millisecond threshold for the transaction before being
17711 this property name in the transaction configuration as
17718 @param {String} url qualified path to transaction resource.
17719 @param {Object} config configuration object for the transaction.
17726 var transaction = Y.io._map['io:0'] || new IO();
17727 return transaction.send.apply(transaction, [url, config]);
17744 var transaction = Y.io._map['io:0'] || new IO();
17745 transaction.setHeader(name, value);
17822 * @param {Object} transaction The transaction object
17823 * @param {Object} config The configuration object for this transaction
17825 notify: function(event, transaction, config) {
17832 transaction.c = { status: 0, statusText: event };
17835 io[event].apply(io, [transaction, config]);
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;