Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cache-plugin-debug.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. Copyright (c) 2010, Yahoo! Inc. All rights reserved.
  3. Code licensed under the BSD License:
  4. http://developer.yahoo.com/yui/license.html
  5. version: 3.4.0
  6. build: nightly
  7. */
  8. YUI.add('cache-plugin', function(Y) {
  9. /**
  10. * Provides support to use Cache as a Plugin to a Base-based class.
  11. *
  12. * @module cache
  13. * @submodule cache-plugin
  14. */
  15. /**
  16. * Plugin.Cache adds pluginizability to Cache.
  17. * @class Plugin.Cache
  18. * @extends Cache
  19. * @uses Plugin.Base
  20. */
  21. function CachePlugin(config) {
  22. var cache = config && config.cache ? config.cache : Y.Cache,
  23. tmpclass = Y.Base.create("dataSourceCache", cache, [Y.Plugin.Base]),
  24. tmpinstance = new tmpclass(config);
  25. tmpclass.NS = "tmpClass";
  26. return tmpinstance;
  27. }
  28. Y.mix(CachePlugin, {
  29. /**
  30. * The namespace for the plugin. This will be the property on the host which
  31. * references the plugin instance.
  32. *
  33. * @property NS
  34. * @type String
  35. * @static
  36. * @final
  37. * @value "cache"
  38. */
  39. NS: "cache",
  40. /**
  41. * Class name.
  42. *
  43. * @property NAME
  44. * @type String
  45. * @static
  46. * @final
  47. * @value "dataSourceCache"
  48. */
  49. NAME: "cachePlugin"
  50. });
  51. Y.namespace("Plugin").Cache = CachePlugin;
  52. }, '3.4.0' ,{requires:['plugin','cache-base']});