io-xdr.js revision 7cb892db705e16b9b453b4e777bb39f6eb880a11
/*
* Extends the IO base class to provide an alternate, Flash transport, for making
* cross-domain requests.
* @module io-base
* @submodule io-xdr
*/
/**
* @event io:xdrReady
* @description This event is fired by YUI.io when the specified transport is
* ready for use.
* @type Event Custom
*/
var E_XDR_READY = 'io:xdrReady';
/**
* @description Method that creates the Flash transport swf.
*
* @method _swf
* @private
* @static
* @param {string} uri - location of IO.swf.
* @param {string} yid - YUI instance id.
* @return void
*/
var XDR_SWF = '<object id="yuiIoSwf" type="application/x-shockwave-flash" data="' + uri + '" width="0" height="0">' +
'<param name="allowScriptAccess" value="sameDomain">' +
'</object>';
};
/**
* @description Map of IO transports.
*
* @property _transportMap
* @private
* @static
* @type object
*/
_transportMap: {},
/**
* @description Object that stores callback handlers for cross-domain requests
* when using Flash as the transport.
*
* @property _fn
* @private
* @static
* @type object
*/
_fn: {},
/**
* @description Method for accessing the transport's interface for making a
* cross-domain transaction.
*
* @method _xdr
* @private
* @static
* @param {string} uri - qualified path to transaction resource.
* @param {object} o - Transaction object generated by _create() in io-base.
* @param {object} c - configuration object for the transaction.
* @return object
*/
if (c.on) {
}
return o;
},
/**
* @description Fires event "io:xdrReady"
*
* @method xdrReady
* @private
* @static
* @param {number} id - transaction id
* @param {object} c - configuration object for the transaction.
*
* @return void
*/
},
/**
* @description Method to initialize the desired transport.
*
* @method transport
* @public
* @static
* @param {object} o - object of transport configurations.
* @return void
*/
transport: function(o) {
switch (o.id) {
case 'flash':
break;
}
}
});