/* YUI 3.4.1 (build 4118) Copyright 2011 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('autocomplete-sources', function(Y) { /** * Mixes support for JSONP and YQL result sources into AutoCompleteBase. * * @module autocomplete * @submodule autocomplete-sources */ var ACBase = Y.AutoCompleteBase, Lang = Y.Lang, _SOURCE_SUCCESS = '_sourceSuccess', MAX_RESULTS = 'maxResults', REQUEST_TEMPLATE = 'requestTemplate', RESULT_LIST_LOCATOR = 'resultListLocator'; // Add prototype properties and methods to AutoCompleteBase. Y.mix(ACBase.prototype, { /** * Regular expression used to determine whether a String source is a YQL * query. * * @property _YQL_SOURCE_REGEX * @type RegExp * @protected * @for AutoCompleteBase */ _YQL_SOURCE_REGEX: /^(?:select|set|use)\s+/i, /** * Runs before AutoCompleteBase's _createObjectSource() method * and augments it to support additional object-based source types. * * @method _beforeCreateObjectSource * @param {String} source * @protected * @for AutoCompleteBase */ _beforeCreateObjectSource: function (source) { // If the object is a