This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.cacheset = function(owner, datarequest, object) { | |
// assigns object to webkitcache | |
YUI().use('cache', 'node', function(Y) { | |
if (!webkit.wkcache) { | |
webkit.wkcache = new Y.Cache({max:10}); | |
} | |
if (Y.one('#' + object)) { | |
// cache request sent as dom ID rather than node object | |
object = Y.one('#' + object); | |
} | |
webkit.wkcache.add(owner + '_' + datarequest, { | |
id:object.get('id'), | |
innerHTML:object.get('innerHTML') | |
}); | |
}) | |
} | |
this.cacheget = function(owner, datarequest) { | |
// checks to see if cache for datarequest exists | |
if (webkit.wkcache && webkit.wkcache.retrieve(owner + '_' + datarequest)) { | |
return true; | |
} | |
return false; | |
} | |
this.cacheoutput = function(owner, datarequest, object) { | |
var cacheObj = webkit.wkcache.retrieve(owner + '_' + datarequest); | |
webkit.Y.one('#' + cacheObj.response.id).set('innerHTML', cacheObj.response.innerHTML); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment