diff -r d334a616c023 -r e16a97fb364a src/cm/media/js/lib/yui/yui3-3.15.0/build/datatable-datasource/datatable-datasource-debug.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui3-3.15.0/build/datatable-datasource/datatable-datasource-debug.js Mon Mar 10 15:19:48 2014 +0100 @@ -0,0 +1,180 @@ +YUI.add('datatable-datasource', function (Y, NAME) { + +/** + * Plugs DataTable with DataSource integration. + * + * @module datatable + * @submodule datatable-datasource + */ + +/** + * Adds DataSource integration to DataTable. + * @class Plugin.DataTableDataSource + * @extends Plugin.Base + */ +function DataTableDataSource() { + DataTableDataSource.superclass.constructor.apply(this, arguments); +} + +///////////////////////////////////////////////////////////////////////////// +// +// STATIC PROPERTIES +// +///////////////////////////////////////////////////////////////////////////// +Y.mix(DataTableDataSource, { + /** + * The namespace for the plugin. This will be the property on the host which + * references the plugin instance. + * + * @property NS + * @type String + * @static + * @final + * @value "datasource" + */ + NS: "datasource", + + /** + * Class name. + * + * @property NAME + * @type String + * @static + * @final + * @value "dataTableDataSource" + */ + NAME: "dataTableDataSource", + +///////////////////////////////////////////////////////////////////////////// +// +// ATTRIBUTES +// +///////////////////////////////////////////////////////////////////////////// + ATTRS: { + /** + * @attribute datasource + * @description Pointer to DataSource instance. + * @type {DataSource} + */ + datasource: { + setter: "_setDataSource" + }, + + /** + * @attribute initialRequest + * @description Request sent to DataSource immediately upon initialization. + * @type Object + */ + initialRequest: { + setter: "_setInitialRequest" + } + } +}); + +///////////////////////////////////////////////////////////////////////////// +// +// PROTOTYPE +// +///////////////////////////////////////////////////////////////////////////// +Y.extend(DataTableDataSource, Y.Plugin.Base, { + ///////////////////////////////////////////////////////////////////////////// + // + // ATTRIBUTE HELPERS + // + ///////////////////////////////////////////////////////////////////////////// + /** + * @method _setDataSource + * @description Creates new DataSource instance if one is not provided. + * @param ds {Object|DataSource} + * @return {DataSource} + * @private + */ + _setDataSource: function(ds) { + return ds || new Y.DataSource.Local(ds); + }, + + /** + * @method _setInitialRequest + * @description Sends request to DataSource. + * @param request {Object} DataSource request. + * @private + */ + _setInitialRequest: function(/* request */) { + }, + + ///////////////////////////////////////////////////////////////////////////// + // + // METHODS + // + ///////////////////////////////////////////////////////////////////////////// + /** + * Initializer. + * + * @method initializer + * @param config {Object} Config object. + * @private + */ + initializer: function(config) { + if(!Y.Lang.isUndefined(config.initialRequest)) { + this.load({request:config.initialRequest}); + } + }, + + //////////////////////////////////////////////////////////////////////////// + // + // DATA + // + //////////////////////////////////////////////////////////////////////////// + + /** + * Load data by calling DataSource's sendRequest() method under the hood. + * + * @method load + * @param config {object} Optional configuration parameters: + * + *