mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🔧 Chore: add logo fixit.svg to cache
This commit is contained in:
@@ -3,13 +3,15 @@ const CACHE_VERSION = 1;
|
||||
const BASE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest'
|
||||
'/site.webmanifest',
|
||||
'/images/fixit.svg'
|
||||
];
|
||||
|
||||
const OFFLINE_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/images/fixit.svg',
|
||||
'/offline/'
|
||||
];
|
||||
|
||||
@@ -17,6 +19,7 @@ const NOT_FOUND_CACHE_FILES = [
|
||||
'/css/style.min.css',
|
||||
'/js/theme.min.js',
|
||||
'/site.webmanifest',
|
||||
'/images/fixit.svg',
|
||||
'/404.html'
|
||||
];
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1"><defs><style>.fixit-ban{opacity:.9;}</style></defs><path d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z" fill="#358C3C" class="fixit-bug"/><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z" fill="#FF6347" class="fixit-ban"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1" width="64" height="64"><defs><style>.fixit-ban{opacity:.9;}</style></defs><path d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z" fill="#358C3C" class="fixit-bug"/><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z" fill="#FF6347" class="fixit-ban"/></svg>
|
||||
|
Before Width: | Height: | Size: 968 B After Width: | Height: | Size: 991 B |
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
"use strict";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}var CACHE_VERSION=1,BASE_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest"],OFFLINE_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest","/offline/"],NOT_FOUND_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest","/404.html"],OFFLINE_PAGE="/offline/",NOT_FOUND_PAGE="/404.html",CACHE_VERSIONS={assets:"assets-v1",content:"content-v1",offline:"offline-v1",notFound:"404-v1"},MAX_TTL={"/":3600,html:3600,json:86400,js:86400,css:86400},CACHE_BLACKLIST=[function(a){return!a.startsWith("http://localhost")}],SUPPORTED_METHODS=["GET"];function isBlacklisted(a){return!!(0<CACHE_BLACKLIST.length)&&!CACHE_BLACKLIST.filter(function(b){return!("function"!=typeof b)&&!b(a)}).length}function getFileExtension(a){var b=a.split(".").reverse()[0].split("?")[0];return b.endsWith("/")?"/":b}function getTTL(a){if("string"==typeof a){var b=getFileExtension(a);return"number"==typeof MAX_TTL[b]?MAX_TTL[b]:null}return null}function installServiceWorker(){return Promise.all([caches.open(CACHE_VERSIONS.assets).then(function(a){return a.addAll(BASE_CACHE_FILES)}),caches.open(CACHE_VERSIONS.offline).then(function(a){return a.addAll(OFFLINE_CACHE_FILES)}),caches.open(CACHE_VERSIONS.notFound).then(function(a){return a.addAll(NOT_FOUND_CACHE_FILES)})]).then(function(){return self.skipWaiting()})}function cleanupLegacyCache(){var a=Object.keys(CACHE_VERSIONS).map(function(a){return CACHE_VERSIONS[a]});return new Promise(function(b,c){caches.keys().then(function(b){return b.filter(function(b){return!~a.indexOf(b)})}).then(function(a){a.length?Promise.all(a.map(function(a){return caches.delete(a)})).then(function(){b()}).catch(function(a){c(a)}):b()}).catch(function(a){c(a)})})}self.addEventListener("install",function(a){a.waitUntil(Promise.all([installServiceWorker(),self.skipWaiting()]))}),self.addEventListener("activate",function(a){a.waitUntil(Promise.all([cleanupLegacyCache(),self.clients.claim(),self.skipWaiting()]).catch(function(a){console.log(a),self.skipWaiting()}))}),self.addEventListener("fetch",function(a){a.respondWith(caches.open(CACHE_VERSIONS.content).then(function(b){return b.match(a.request).then(function(c){if(c){var d,e=c.headers.entries(),f=null,g=_createForOfIteratorHelper(e);try{for(g.s();!(d=g.n()).done;){var j=d.value;"date"===j[0]&&(f=new Date(j[1]))}}catch(a){g.e(a)}finally{g.f()}if(f){var h=parseInt((new Date().getTime()-f.getTime())/1e3),i=getTTL(a.request.url);return i&&h>i?new Promise(function(d){return fetch(a.request.clone()).then(function(e){e?(b.put(a.request,e.clone()),d(e)):d(c)}).catch(function(){d(c)})}).catch(function(a){return console.log(a),c}):c}return c}return null}).then(function(c){return c?c:fetch(a.request.clone()).then(function(c){return 400>c.status?(~SUPPORTED_METHODS.indexOf(a.request.method)&&!isBlacklisted(a.request.url)&&"http"===a.request.url.slice(0,4)&&b.put(a.request,c.clone()),c):caches.open(CACHE_VERSIONS.notFound).then(function(a){return a.match(NOT_FOUND_PAGE)})}).then(function(a){if(a)return a}).catch(function(){return caches.open(CACHE_VERSIONS.offline).then(function(a){return a.match(OFFLINE_PAGE)})})}).catch(function(a){throw console.error(" Error in fetch handler:",a),a})}))});
|
||||
"use strict";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}var CACHE_VERSION=1,BASE_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest","/images/fixit.svg"],OFFLINE_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest","/images/fixit.svg","/offline/"],NOT_FOUND_CACHE_FILES=["/css/style.min.css","/js/theme.min.js","/site.webmanifest","/images/fixit.svg","/404.html"],OFFLINE_PAGE="/offline/",NOT_FOUND_PAGE="/404.html",CACHE_VERSIONS={assets:"assets-v1",content:"content-v1",offline:"offline-v1",notFound:"404-v1"},MAX_TTL={"/":3600,html:3600,json:86400,js:86400,css:86400},CACHE_BLACKLIST=[function(a){return!a.startsWith("http://localhost")}],SUPPORTED_METHODS=["GET"];function isBlacklisted(a){return!!(0<CACHE_BLACKLIST.length)&&!CACHE_BLACKLIST.filter(function(b){return!("function"!=typeof b)&&!b(a)}).length}function getFileExtension(a){var b=a.split(".").reverse()[0].split("?")[0];return b.endsWith("/")?"/":b}function getTTL(a){if("string"==typeof a){var b=getFileExtension(a);return"number"==typeof MAX_TTL[b]?MAX_TTL[b]:null}return null}function installServiceWorker(){return Promise.all([caches.open(CACHE_VERSIONS.assets).then(function(a){return a.addAll(BASE_CACHE_FILES)}),caches.open(CACHE_VERSIONS.offline).then(function(a){return a.addAll(OFFLINE_CACHE_FILES)}),caches.open(CACHE_VERSIONS.notFound).then(function(a){return a.addAll(NOT_FOUND_CACHE_FILES)})]).then(function(){return self.skipWaiting()})}function cleanupLegacyCache(){var a=Object.keys(CACHE_VERSIONS).map(function(a){return CACHE_VERSIONS[a]});return new Promise(function(b,c){caches.keys().then(function(b){return b.filter(function(b){return!~a.indexOf(b)})}).then(function(a){a.length?Promise.all(a.map(function(a){return caches.delete(a)})).then(function(){b()}).catch(function(a){c(a)}):b()}).catch(function(a){c(a)})})}self.addEventListener("install",function(a){a.waitUntil(Promise.all([installServiceWorker(),self.skipWaiting()]))}),self.addEventListener("activate",function(a){a.waitUntil(Promise.all([cleanupLegacyCache(),self.clients.claim(),self.skipWaiting()]).catch(function(a){console.log(a),self.skipWaiting()}))}),self.addEventListener("fetch",function(a){a.respondWith(caches.open(CACHE_VERSIONS.content).then(function(b){return b.match(a.request).then(function(c){if(c){var d,e=c.headers.entries(),f=null,g=_createForOfIteratorHelper(e);try{for(g.s();!(d=g.n()).done;){var j=d.value;"date"===j[0]&&(f=new Date(j[1]))}}catch(a){g.e(a)}finally{g.f()}if(f){var h=parseInt((new Date().getTime()-f.getTime())/1e3),i=getTTL(a.request.url);return i&&h>i?new Promise(function(d){return fetch(a.request.clone()).then(function(e){e?(b.put(a.request,e.clone()),d(e)):d(c)}).catch(function(){d(c)})}).catch(function(a){return console.log(a),c}):c}return c}return null}).then(function(c){return c?c:fetch(a.request.clone()).then(function(c){return 400>c.status?(~SUPPORTED_METHODS.indexOf(a.request.method)&&!isBlacklisted(a.request.url)&&"http"===a.request.url.slice(0,4)&&b.put(a.request,c.clone()),c):caches.open(CACHE_VERSIONS.notFound).then(function(a){return a.match(NOT_FOUND_PAGE)})}).then(function(a){if(a)return a}).catch(function(){return caches.open(CACHE_VERSIONS.offline).then(function(a){return a.match(OFFLINE_PAGE)})})}).catch(function(a){throw console.error(" Error in fetch handler:",a),a})}))});
|
||||
|
||||
//# sourceMappingURL=service-worker.min.js.map
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user