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,57 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
var myStore = {};
|
||||
var cache;
|
||||
var localData;
|
||||
|
||||
function updateCache() {
|
||||
|
||||
if (cache) {
|
||||
cache.put('data', new Response(JSON.stringify(localData)));
|
||||
}
|
||||
}
|
||||
|
||||
myStore.setItem = function (name, value) {
|
||||
localStorage.setItem(name, value);
|
||||
|
||||
if (localData) {
|
||||
var changed = localData[name] !== value;
|
||||
|
||||
if (changed) {
|
||||
localData[name] = value;
|
||||
updateCache();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
myStore.getItem = function (name) {
|
||||
return localStorage.getItem(name);
|
||||
};
|
||||
|
||||
myStore.removeItem = function (name) {
|
||||
localStorage.removeItem(name);
|
||||
|
||||
if (localData) {
|
||||
localData[name] = null;
|
||||
delete localData[name];
|
||||
updateCache();
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
if (self.caches) {
|
||||
|
||||
caches.open('embydata').then(function (result) {
|
||||
cache = result;
|
||||
localData = {};
|
||||
});
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log('Error opening cache: ' + err);
|
||||
}
|
||||
|
||||
return myStore;
|
||||
});
|
||||
define([],function(){"use strict";function updateCache(){cache&&cache.put("data",new Response(JSON.stringify(localData)))}var cache,localData,myStore={};myStore.setItem=function(name,value){if(localStorage.setItem(name,value),localData){var changed=localData[name]!==value;changed&&(localData[name]=value,updateCache())}},myStore.getItem=function(name){return localStorage.getItem(name)},myStore.removeItem=function(name){localStorage.removeItem(name),localData&&(localData[name]=null,delete localData[name],updateCache())};try{self.caches&&caches.open("embydata").then(function(result){cache=result,localData={}})}catch(err){console.log("Error opening cache: "+err)}return myStore});
|
Loading…
Add table
Add a link
Reference in a new issue