✨ Add user register mutation
🔥 Remove a bunch of legacy code
This commit is contained in:
1 parent
a47de48243
commit
b5c9094b64
34 files changed
+46
-7544
No files matched your search
Vendored
-1
@@ -1 +0,0 @@
|
||||
function enable_all_customers(){$("li.customer").each(function(t){$(this).removeClass("marked"),$(this).show()})}function filter_customers(t){setTimeout(function(){$("li.customer").each(function(e){var i=new RegExp(t,"i"),n=$(this).children("span.name").text();if(i.test(n)){$(this).show();var r=n.toLowerCase()==t.toLowerCase(),o=1==$("li.customer:visible").length;console.log(r,o),r?$(this).addClass("marked"):$(this).removeClass("marked")}else $(this).hide(),$(this).removeClass("marked")})},50)}function enable_all_products(){$("li.product").each(function(t){$(this).removeClass("marked"),$(this).show()})}function reset_qtys(){$(".qty").each(function(t){$(this).html("0")}),$("input[name$=amount]").each(function(t){$(this).val("0")})}function update_total(){var t=0;$("li.product").each(function(){var e=Number($(this).find("[name$=amount]").val()),i=".sale_price_int";"Ekstern"===$("#id_customer_typeahead").val()&&(i=".sale_price_ext");var n=Number($(this).find(i).text());t+=e*n}),0===t&&(t=""),$("span.total_text").html(t)}function productFormatter(){return"<b>"+this.point.name+"</b>: "+Highcharts.numberFormat(this.percentage,1)+" %"}function parse_products_realtime_data(t,e){for(var i in t.products){null===e.get(i)&&e.addSeries({data:[],id:i,name:i});var n=e.get(i);_.each(t.products[i],function(t){null===e.get(t[0])&&n.addPoint({id:t[0],x:t[0],y:t[1]})})}}function get_products_realtime_data(){$.ajax({url:products_realtime_url,dataType:"json",success:function(t){parse_products_realtime_data(t,products_realtime_chart),setTimeout(function(){get_products_realtime_data()},15e3)},cache:!1})}function renderProductCharts(t){for(var e in t){var i="product_chart"+t[e].id,n=t[e].counts;n=_.map(n,function(t){return[t.full_name,t.amount_total]}),new Highcharts.Chart({chart:{renderTo:i,plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:t[e].name},tooltip:{formatter:productFormatter},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+this.y}}}},series:[{type:"pie",name:"Orders",data:n}]})}}function renderOrdersGroupedChart(t){var e=t.grouping,i="order_chart_"+e;new Highcharts.Chart({chart:{renderTo:i,type:"column"},title:{text:"Ordre - "+e},tooltip:{formatter:function(){return this.y+" stk"}},yAxis:{title:{text:"Ordre"}},xAxis:{title:{text:"Tid"},labels:{formatter:orderFormatters[e]}},plotOptions:{column:{minPointLength:3,colorByPoint:!0},series:{groupPadding:0,pointPadding:.05}},series:[{name:"Ordre",data:t.orders}]})}!function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";function i(t,e){var i=(e=e||et).createElement("script");i.text=t,e.head.appendChild(i).parentNode.removeChild(i)}function n(t){var e=!!t&&"length"in t&&t.length,i=ft.type(t);return"function"!==i&&!ft.isWindow(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function r(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function o(t,e,i){return ft.isFunction(e)?ft.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?ft.grep(t,function(t){return t===e!==i}):"string"!=typeof e?ft.grep(t,function(t){return st.call(e,t)>-1!==i}):Mt.test(e)?ft.filter(e,t,i):(e=ft.filter(e,t),ft.grep(t,function(t){return st.call(e,t)>-1!==i&&1===t.nodeType}))}function s(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function a(t){var e={};return ft.each(t.match(Lt)||[],function(t,i){e[i]=!0}),e}function l(t){return t}function h(t){throw t}function c(t,e,i,n){var r;try{t&&ft.isFunction(r=t.promise)?r.call(t).done(e).fail(i):t&&ft.isFunction(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}function u(){et.removeEventListener("DOMContentLoaded",u),t.removeEventListener("load",u),ft.ready()}function d(){this.expando=ft.expando+d.uid++}function p(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:zt.test(t)?JSON.parse(t):t)}function f(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(Rt,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=p(i)}catch(t){}_t.set(t,e,i)}else i=void 0;return i}function g(t,e,i,n){var r,o=1,s=20,a=n?function(){return n.cur()}:function(){return ft.css(t,e,"")},l=a(),h=i&&i[3]||(ft.cssNumber[e]?"":"px"),c=(ft.cssNumber[e]||"px"!==h&&+l)&&Ft.exec(ft.css(t,e));if(c&&c[3]!==h){h=h||c[3],i=i||[],c=+l||1;do{o=o||".5",c/=o,ft.style(t,e,c+h)}while(o!==(o=a()/l)&&1!==o&&--s)}return i&&(c=+c||+l||0,r=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=h,n.start=c,n.end=r)),r}function m(t){var e,i=t.ownerDocument,n=t.nodeName,r=Gt[n];return r||(e=i.body.appendChild(i.createElement(n)),r=ft.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),Gt[n]=r,r)}function v(t,e){for(var i,n,r=[]Line truncated
|
||||
Vendored
-270
@@ -1,270 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT THIS GENERATED OUTPUT DIRECTLY!
|
||||
// This file should be overwritten as part of your build process.
|
||||
// If you need to extend the behavior of the generated service worker, the best approach is to write
|
||||
// additional code and include it using the importScripts option:
|
||||
// https://github.com/GoogleChrome/sw-precache#importscripts-arraystring
|
||||
//
|
||||
// Alternatively, it's possible to make changes to the underlying template file and then use that as the
|
||||
// new base for generating output, via the templateFilePath option:
|
||||
// https://github.com/GoogleChrome/sw-precache#templatefilepath-string
|
||||
//
|
||||
// If you go that route, make sure that whenever you update your sw-precache dependency, you reconcile any
|
||||
// changes made to this original template file with your modified copy.
|
||||
|
||||
// This generated service worker JavaScript will precache your site's resources.
|
||||
// The code needs to be saved in a .js file at the top-level of your site, and registered
|
||||
// from your pages in order to be used. See
|
||||
// https://github.com/googlechrome/sw-precache/blob/master/demo/app/js/service-worker-registration.js
|
||||
// for an example of how you can register this script and handle various service worker events.
|
||||
|
||||
/* eslint-env worker, serviceworker */
|
||||
/* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */
|
||||
'use strict';
|
||||
|
||||
var precacheConfig = [["/static/dist/images/edb_brick.png","75041f9210c3ea1acba1803f084554c2"],["/static/dist/images/glyphicons-halflings-white.png","9bbc6e9602998a385c2ea13df56470fd"],["/static/dist/images/glyphicons-halflings.png","180b8ed9ed811c62d74be57249bcb023"],["/static/dist/images/grid.png","f0fc02ae7a6a36a27a25070ea6e1be99"],["/static/dist/images/product.png","5f928b37e652601f70b8218c1203c24d"],["/static/dist/images/unknown_person.png","e35b26c92725c362cd4f9ed477e9ad4f"],["/static/dist/js/app.min.js","2666821d79b38505ea623c0f9bd182f5"],["/static/dist/styles/screen.css","6325d1c5d658d523d65e8c3ed86a215d"]];
|
||||
var cacheName = 'sw-precache-v3--' + (self.registration ? self.registration.scope : '');
|
||||
|
||||
|
||||
var ignoreUrlParametersMatching = [/^utm_/];
|
||||
|
||||
|
||||
|
||||
var addDirectoryIndex = function (originalUrl, index) {
|
||||
var url = new URL(originalUrl);
|
||||
if (url.pathname.slice(-1) === '/') {
|
||||
url.pathname += index;
|
||||
}
|
||||
return url.toString();
|
||||
};
|
||||
|
||||
var cleanResponse = function (originalResponse) {
|
||||
// If this is not a redirected response, then we don't have to do anything.
|
||||
if (!originalResponse.redirected) {
|
||||
return Promise.resolve(originalResponse);
|
||||
}
|
||||
|
||||
// Firefox 50 and below doesn't support the Response.body stream, so we may
|
||||
// need to read the entire body to memory as a Blob.
|
||||
var bodyPromise = 'body' in originalResponse ?
|
||||
Promise.resolve(originalResponse.body) :
|
||||
originalResponse.blob();
|
||||
|
||||
return bodyPromise.then(function(body) {
|
||||
// new Response() is happy when passed either a stream or a Blob.
|
||||
return new Response(body, {
|
||||
headers: originalResponse.headers,
|
||||
status: originalResponse.status,
|
||||
statusText: originalResponse.statusText
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var createCacheKey = function (originalUrl, paramName, paramValue,
|
||||
dontCacheBustUrlsMatching) {
|
||||
// Create a new URL object to avoid modifying originalUrl.
|
||||
var url = new URL(originalUrl);
|
||||
|
||||
// If dontCacheBustUrlsMatching is not set, or if we don't have a match,
|
||||
// then add in the extra cache-busting URL parameter.
|
||||
if (!dontCacheBustUrlsMatching ||
|
||||
!(url.pathname.match(dontCacheBustUrlsMatching))) {
|
||||
url.search += (url.search ? '&' : '') +
|
||||
encodeURIComponent(paramName) + '=' + encodeURIComponent(paramValue);
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
};
|
||||
|
||||
var isPathWhitelisted = function (whitelist, absoluteUrlString) {
|
||||
// If the whitelist is empty, then consider all URLs to be whitelisted.
|
||||
if (whitelist.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Otherwise compare each path regex to the path of the URL passed in.
|
||||
var path = (new URL(absoluteUrlString)).pathname;
|
||||
return whitelist.some(function(whitelistedPathRegex) {
|
||||
return path.match(whitelistedPathRegex);
|
||||
});
|
||||
};
|
||||
|
||||
var stripIgnoredUrlParameters = function (originalUrl,
|
||||
ignoreUrlParametersMatching) {
|
||||
var url = new URL(originalUrl);
|
||||
// Remove the hash; see https://github.com/GoogleChrome/sw-precache/issues/290
|
||||
url.hash = '';
|
||||
|
||||
url.search = url.search.slice(1) // Exclude initial '?'
|
||||
.split('&') // Split into an array of 'key=value' strings
|
||||
.map(function(kv) {
|
||||
return kv.split('='); // Split each 'key=value' string into a [key, value] array
|
||||
})
|
||||
.filter(function(kv) {
|
||||
return ignoreUrlParametersMatching.every(function(ignoredRegex) {
|
||||
return !ignoredRegex.test(kv[0]); // Return true iff the key doesn't match any of the regexes.
|
||||
});
|
||||
})
|
||||
.map(function(kv) {
|
||||
return kv.join('='); // Join each [key, value] array into a 'key=value' string
|
||||
})
|
||||
.join('&'); // Join the array of 'key=value' strings into a string with '&' in between each
|
||||
|
||||
return url.toString();
|
||||
};
|
||||
|
||||
|
||||
var hashParamName = '_sw-precache';
|
||||
var urlsToCacheKeys = new Map(
|
||||
precacheConfig.map(function(item) {
|
||||
var relativeUrl = item[0];
|
||||
var hash = item[1];
|
||||
var absoluteUrl = new URL(relativeUrl, self.location);
|
||||
var cacheKey = createCacheKey(absoluteUrl, hashParamName, hash, false);
|
||||
return [absoluteUrl.toString(), cacheKey];
|
||||
})
|
||||
);
|
||||
|
||||
function setOfCachedUrls(cache) {
|
||||
return cache.keys().then(function(requests) {
|
||||
return requests.map(function(request) {
|
||||
return request.url;
|
||||
});
|
||||
}).then(function(urls) {
|
||||
return new Set(urls);
|
||||
});
|
||||
}
|
||||
|
||||
self.addEventListener('install', function(event) {
|
||||
event.waitUntil(
|
||||
caches.open(cacheName).then(function(cache) {
|
||||
return setOfCachedUrls(cache).then(function(cachedUrls) {
|
||||
return Promise.all(
|
||||
Array.from(urlsToCacheKeys.values()).map(function(cacheKey) {
|
||||
// If we don't have a key matching url in the cache already, add it.
|
||||
if (!cachedUrls.has(cacheKey)) {
|
||||
var request = new Request(cacheKey, {credentials: 'same-origin'});
|
||||
return fetch(request).then(function(response) {
|
||||
// Bail out of installation unless we get back a 200 OK for
|
||||
// every request.
|
||||
if (!response.ok) {
|
||||
throw new Error('Request for ' + cacheKey + ' returned a ' +
|
||||
'response with status ' + response.status);
|
||||
}
|
||||
|
||||
return cleanResponse(response).then(function(responseToCache) {
|
||||
return cache.put(cacheKey, responseToCache);
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
}).then(function() {
|
||||
|
||||
// Force the SW to transition from installing -> active state
|
||||
return self.skipWaiting();
|
||||
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('activate', function(event) {
|
||||
var setOfExpectedUrls = new Set(urlsToCacheKeys.values());
|
||||
|
||||
event.waitUntil(
|
||||
caches.open(cacheName).then(function(cache) {
|
||||
return cache.keys().then(function(existingRequests) {
|
||||
return Promise.all(
|
||||
existingRequests.map(function(existingRequest) {
|
||||
if (!setOfExpectedUrls.has(existingRequest.url)) {
|
||||
return cache.delete(existingRequest);
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
}).then(function() {
|
||||
|
||||
return self.clients.claim();
|
||||
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
self.addEventListener('fetch', function(event) {
|
||||
if (event.request.method === 'GET') {
|
||||
// Should we call event.respondWith() inside this fetch event handler?
|
||||
// This needs to be determined synchronously, which will give other fetch
|
||||
// handlers a chance to handle the request if need be.
|
||||
var shouldRespond;
|
||||
|
||||
// First, remove all the ignored parameters and hash fragment, and see if we
|
||||
// have that URL in our cache. If so, great! shouldRespond will be true.
|
||||
var url = stripIgnoredUrlParameters(event.request.url, ignoreUrlParametersMatching);
|
||||
shouldRespond = urlsToCacheKeys.has(url);
|
||||
|
||||
// If shouldRespond is false, check again, this time with 'index.html'
|
||||
// (or whatever the directoryIndex option is set to) at the end.
|
||||
var directoryIndex = 'index.html';
|
||||
if (!shouldRespond && directoryIndex) {
|
||||
url = addDirectoryIndex(url, directoryIndex);
|
||||
shouldRespond = urlsToCacheKeys.has(url);
|
||||
}
|
||||
|
||||
// If shouldRespond is still false, check to see if this is a navigation
|
||||
// request, and if so, whether the URL matches navigateFallbackWhitelist.
|
||||
var navigateFallback = '';
|
||||
if (!shouldRespond &&
|
||||
navigateFallback &&
|
||||
(event.request.mode === 'navigate') &&
|
||||
isPathWhitelisted([], event.request.url)) {
|
||||
url = new URL(navigateFallback, self.location).toString();
|
||||
shouldRespond = urlsToCacheKeys.has(url);
|
||||
}
|
||||
|
||||
// If shouldRespond was set to true at any point, then call
|
||||
// event.respondWith(), using the appropriate cache key.
|
||||
if (shouldRespond) {
|
||||
event.respondWith(
|
||||
caches.open(cacheName).then(function(cache) {
|
||||
return cache.match(urlsToCacheKeys.get(url)).then(function(response) {
|
||||
if (response) {
|
||||
return response;
|
||||
}
|
||||
throw Error('The cached response that was expected is missing.');
|
||||
});
|
||||
}).catch(function(e) {
|
||||
// Fall back to just fetch()ing the request if some unexpected error
|
||||
// prevented the cached response from being valid.
|
||||
console.warn('Couldn\'t serve response for "%s" from cache: %O', event.request.url, e);
|
||||
return fetch(event.request);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
importScripts("/static/dist/sw/sw-toolbox.js","/static/dist/sw/sw-toolbox-config.js");
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
toolbox.router.get('/(.*)/picture/', toolbox.fastest, {
|
||||
origin: /^https:\/\/graph\.facebook\.com$/
|
||||
});
|
||||
|
||||
//var MISSING_IMAGE = '/static/dist/images/unknown_person.png';
|
||||
//toolbox.cache(MISSING_IMAGE);
|
||||
//
|
||||
//function imageHandler(request, values, options) {
|
||||
// return toolbox.cacheFirst(request, values, options).catch(function () {
|
||||
// return caches.match(MISSING_IMAGE);
|
||||
// });
|
||||
//}
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
Copyright 2016 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.toolbox=e()}}(function(){return function e(t,n,r){function o(c,s){if(!n[c]){if(!t[c]){var a="function"==typeof require&&require;if(!s&&a)return a(c,!0);if(i)return i(c,!0);var u=new Error("Cannot find module '"+c+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[c]={exports:{}};t[c][0].call(f.exports,function(e){var n=t[c][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[c].exports}for(var i="function"==typeof require&&require,c=0;c<r.length;c++)o(r[c]);return o}({1:[function(e,t,n){"use strict";function r(e,t){t=t||{};var n=t.debug||m.debug;n&&console.log("[sw-toolbox] "+e)}function o(e){var t;return e&&e.cache&&(t=e.cache.name),t=t||m.cache.name,caches.open(t)}function i(e,t){t=t||{};var n=t.successResponses||m.successResponses;return fetch(e.clone()).then(function(r){return"GET"===e.method&&n.test(r.status)&&o(t).then(function(n){n.put(e,r).then(function(){var r=t.cache||m.cache;(r.maxEntries||r.maxAgeSeconds)&&r.name&&c(e,n,r)})}),r.clone()})}function c(e,t,n){var r=s.bind(null,e,t,n);d=d?d.then(r):r()}function s(e,t,n){var o=e.url,i=n.maxAgeSeconds,c=n.maxEntries,s=n.name,a=Date.now();return r("Updating LRU order for "+o+". Max entries is "+c+", max age is "+i),g.getDb(s).then(function(e){return g.setTimestampForUrl(e,o,a)}).then(function(e){return g.expireEntries(e,c,i,a)}).then(function(e){r("Successfully updated IDB.");var n=e.map(function(e){return t.delete(e)});return Promise.all(n).then(function(){r("Done with cache cleanup.")})}).catch(function(e){r(e)})}function a(e,t,n){return r("Renaming cache: ["+e+"] to ["+t+"]",n),caches.delete(t).then(function(){return Promise.all([caches.open(e),caches.open(t)]).then(function(t){var n=t[0],r=t[1];return n.keys().then(function(e){return Promise.all(e.map(function(e){return n.match(e).then(function(t){return r.put(e,t)})}))}).then(function(){return caches.delete(e)})})})}function u(e,t){return o(t).then(function(t){return t.add(e)})}function f(e,t){return o(t).then(function(t){return t.delete(e)})}function h(e){e instanceof Promise||p(e),m.preCacheItems=m.preCacheItems.concat(e)}function p(e){var t=Array.isArray(e);if(t&&e.forEach(function(e){"string"==typeof e||e instanceof Request||(t=!1)}),!t)throw new TypeError("The precache method expects either an array of strings and/or Requests or a Promise that resolves to an array of strings and/or Requests.");return e}function l(e,t,n){if(!e)return!1;if(t){var r=e.headers.get("date");if(r){var o=new Date(r);if(o.getTime()+1e3*t<n)return!1}}return!0}var d,m=e("./options"),g=e("./idb-cache-expiration");t.exports={debug:r,fetchAndCache:i,openCache:o,renameCache:a,cache:u,uncache:f,precache:h,validatePrecacheInput:p,isResponseFresh:l}},{"./idb-cache-expiration":2,"./options":4}],2:[function(e,t,n){"use strict";function r(e){return new Promise(function(t,n){var r=indexedDB.open(u+e,f);r.onupgradeneeded=function(){var e=r.result.createObjectStore(h,{keyPath:p});e.createIndex(l,l,{unique:!1})},r.onsuccess=function(){t(r.result)},r.onerror=function(){n(r.error)}})}function o(e){return e in d||(d[e]=r(e)),d[e]}function i(e,t,n){return new Promise(function(r,o){var i=e.transaction(h,"readwrite"),c=i.objectStore(h);c.put({url:t,timestamp:n}),i.oncomplete=function(){r(e)},i.onabort=function(){o(i.error)}})}function c(e,t,n){return t?new Promise(function(r,o){var i=1e3*t,c=[],s=e.transaction(h,"readwrite"),a=s.objectStore(h),u=a.index(l);u.openCursor().onsuccess=function(e){var t=e.target.result;if(t&&n-i>t.value[l]){var r=t.value[p];c.push(r),a.delete(r),t.continue()}},s.oncomplete=function(){r(c)},s.onabort=o}):Promise.resolve([])}function s(e,t){return t?new Promise(function(n,r){var o=[],i=e.transaction(h,"readwrite"),c=i.objectStore(h),s=c.index(l),a=s.count();s.count().onsuccess=function(){var e=a.result;e>t&&(s.openCursor().onsuccess=function(n){var r=n.target.result;if(r){var i=r.value[p];o.push(i),c.delete(i),e-o.length>t&&r.continue()}})},i.oncomplete=function(){n(o)},i.onabort=r}):Promise.resolve([])}function a(e,t,n,r){return c(e,n,r).then(function(n){return s(e,t).then(function(e){return n.concat(e)})})}var u="sw-toolbox-",f=1,h="store",p="url",l="timestamp",d={};t.exports={getDb:o,setTimestampForUrl:i,expireEntries:a}},{}],3:[function(e,t,n){"use strict";function r(e){var t=a.match(e.request);t?e.respondWith(t(e.request)):a.default&&"GET"===e.request.method&&0===e.request.url.indexOf("http")&&e.respondWith(a.default(e.request))}function o(e){s.debug("activate event fired");var t=u.cache.name+"$$$inactive$$$";e.waitUntil(s.renameCache(t,u.cache.name))}function i(e){return e.reduce(function(e,t){return e.concat(t)},[])}function c(e){var t=u.cache.name+"$$$inactive$$$";s.debug("install event fired"),s.debug("creating cache ["+t+"]"),e.waitUntil(s.opeLine truncated
|
||||
//# sourceMappingURL=sw-toolbox.js.map
|
||||
Reference in new issue
Block a user