autocomplete-plugin-debug.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. YUI 3.4.1 (build 4118)
  3. Copyright 2011 Yahoo! Inc. All rights reserved.
  4. Licensed under the BSD License.
  5. http://yuilibrary.com/license/
  6. */
  7. YUI.add('autocomplete-plugin', function(Y) {
  8. /**
  9. * Binds an AutoCompleteList instance to a Node instance.
  10. *
  11. * @module autocomplete
  12. * @submodule autocomplete-plugin
  13. */
  14. /**
  15. * <p>
  16. * Binds an AutoCompleteList instance to a Node instance.
  17. * </p>
  18. *
  19. * <p>
  20. * Example:
  21. * </p>
  22. *
  23. * <pre>
  24. * Y.one('#my-input').plug(Y.Plugin.AutoComplete, {
  25. * &nbsp;&nbsp;source: 'select * from search.suggest where query="{query}"'
  26. * });
  27. * &nbsp;
  28. * // You can now access the AutoCompleteList instance at Y.one('#my-input').ac
  29. * </pre>
  30. *
  31. * @class Plugin.AutoComplete
  32. * @extends AutoCompleteList
  33. */
  34. var Plugin = Y.Plugin;
  35. function ACListPlugin(config) {
  36. config.inputNode = config.host;
  37. // Render by default.
  38. if (!config.render && config.render !== false) {
  39. config.render = true;
  40. }
  41. ACListPlugin.superclass.constructor.apply(this, arguments);
  42. }
  43. Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {
  44. NAME : 'autocompleteListPlugin',
  45. NS : 'ac',
  46. CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')
  47. });
  48. Plugin.AutoComplete = ACListPlugin;
  49. Plugin.AutoCompleteList = ACListPlugin;
  50. }, '3.4.1' ,{requires:['autocomplete-list', 'node-pluginhost']});