mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
minify
This commit is contained in:
parent
82bcca376f
commit
8a6884abef
494 changed files with 256 additions and 120180 deletions
|
@ -1,48 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
var myStore = {};
|
||||
var cache;
|
||||
var localData;
|
||||
|
||||
function updateCache() {
|
||||
cache.put('data', new Response(JSON.stringify(localData)));
|
||||
}
|
||||
|
||||
myStore.setItem = function (name, value) {
|
||||
|
||||
if (localData) {
|
||||
var changed = localData[name] !== value;
|
||||
|
||||
if (changed) {
|
||||
localData[name] = value;
|
||||
updateCache();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
myStore.getItem = function (name) {
|
||||
|
||||
if (localData) {
|
||||
return localData[name];
|
||||
}
|
||||
};
|
||||
|
||||
myStore.removeItem = function (name) {
|
||||
|
||||
if (localData) {
|
||||
localData[name] = null;
|
||||
delete localData[name];
|
||||
updateCache();
|
||||
}
|
||||
};
|
||||
|
||||
myStore.init = function () {
|
||||
return caches.open('embydata').then(function (result) {
|
||||
cache = result;
|
||||
localData = {};
|
||||
});
|
||||
};
|
||||
|
||||
return myStore;
|
||||
});
|
||||
define([],function(){"use strict";function updateCache(){cache.put("data",new Response(JSON.stringify(localData)))}var cache,localData,myStore={};return myStore.setItem=function(name,value){if(localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache())}},myStore.getItem=function(name){if(localData)return localData[name]},myStore.removeItem=function(name){localData&&(localData[name]=null,delete localData[name],updateCache())},myStore.init=function(){return caches.open("embydata").then(function(result){cache=result,localData={}})},myStore});
|
Loading…
Add table
Add a link
Reference in a new issue