NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / cache-plugin / cache-plugin.js
bloba0097580a358e795406fef259c9a37d6cdbcfcf5
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('cache-plugin', function (Y, NAME) {
10 /**
11  * Provides support to use Cache as a Plugin to a Base-based class.
12  *
13  * @module cache
14  * @submodule cache-plugin
15  */
17 /**
18  * Plugin.Cache adds pluginizability to Cache.
19  * @class Plugin.Cache
20  * @extends Cache
21  * @uses Plugin.Base
22  */
23 function CachePlugin(config) {
24     var cache = config && config.cache ? config.cache : Y.Cache,
25         tmpclass = Y.Base.create("dataSourceCache", cache, [Y.Plugin.Base]),
26         tmpinstance = new tmpclass(config);
27     tmpclass.NS = "tmpClass";
28     return tmpinstance;
31 Y.mix(CachePlugin, {
32     /**
33      * The namespace for the plugin. This will be the property on the host which
34      * references the plugin instance.
35      *
36      * @property NS
37      * @type String
38      * @static
39      * @final
40      * @value "cache"
41      */
42     NS: "cache",
44     /**
45      * Class name.
46      *
47      * @property NAME
48      * @type String
49      * @static
50      * @final
51      * @value "dataSourceCache"
52      */
53     NAME: "cachePlugin"
54 });
57 Y.namespace("Plugin").Cache = CachePlugin;
60 }, '3.13.0', {"requires": ["plugin", "cache-base"]});