Let icons load lazily

main
Marian Steinbach 4 years ago
parent abe7173d86
commit bb01576d42
  1. 4
      docs/asset-manifest.json
  2. 2
      docs/index.html
  3. 2
      docs/service-worker.js
  4. 2
      docs/static/js/main.33902852.js
  5. 2
      docs/static/js/main.f8c4b37a.js
  6. 2
      docs/static/js/main.f8c4b37a.js.map
  7. 3
      package.json
  8. 9
      src/ResultsTable.js
  9. 21
      yarn.lock

@ -1,6 +1,6 @@
{
"main.css": "static/css/main.20975575.css",
"main.css.map": "static/css/main.20975575.css.map",
"main.js": "static/js/main.33902852.js",
"main.js.map": "static/js/main.33902852.js.map"
"main.js": "static/js/main.f8c4b37a.js",
"main.js.map": "static/js/main.f8c4b37a.js.map"
}

@ -1 +1 @@
<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/icon32.png"><link rel="stylesheet" href="https://netzbegruenung.github.io/webfonts/style.css"><link rel="stylesheet" href="https://unpkg.com/ionicons@4.1.2/dist/css/ionicons.min.css"><title>Green Spider: Websites von Bündnis 90/Die Grünen besser machen</title><link href="/static/css/main.20975575.css" rel="stylesheet"></head><body><noscript>JavaScript muss aktiviert sein, um diese Anwendung nutzen zu können.</noscript><div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 header border-bottom box-shadow"><h5 class="my-0 mr-md-auto">Green Spider</h5><nav class="my-2 my-md-0 mr-md-3"><a class="p-2 text-light" href="https://github.com/netzbegruenung/green-spider/">GitHub</a> <a class="p-2 text-light" href="https://blog.netzbegruenung.de/projekte/green-spider/">Über</a></nav></div><div class="container-fluid"></div><div id="root"></div><script type="text/javascript" src="/static/js/main.33902852.js"></script></body></html>
<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/icon32.png"><link rel="stylesheet" href="https://netzbegruenung.github.io/webfonts/style.css"><link rel="stylesheet" href="https://unpkg.com/ionicons@4.1.2/dist/css/ionicons.min.css"><title>Green Spider: Websites von Bündnis 90/Die Grünen besser machen</title><link href="/static/css/main.20975575.css" rel="stylesheet"></head><body><noscript>JavaScript muss aktiviert sein, um diese Anwendung nutzen zu können.</noscript><div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 header border-bottom box-shadow"><h5 class="my-0 mr-md-auto">Green Spider</h5><nav class="my-2 my-md-0 mr-md-3"><a class="p-2 text-light" href="https://github.com/netzbegruenung/green-spider/">GitHub</a> <a class="p-2 text-light" href="https://blog.netzbegruenung.de/projekte/green-spider/">Über</a></nav></div><div class="container-fluid"></div><div id="root"></div><script type="text/javascript" src="/static/js/main.f8c4b37a.js"></script></body></html>

@ -1 +1 @@
"use strict";var precacheConfig=[["/index.html","0eb9437272ad22c16b59e99ed5d8fcdd"],["/static/css/main.20975575.css","617d0c7611465335c80699fb462660c6"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(r){return setOfCachedUrls(r).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return r.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),r="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,r),e=urlsToCacheKeys.has(n));var a="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(a,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});
"use strict";var precacheConfig=[["/index.html","b9e7d651c82d335e4f8a530ca35d92c2"],["/static/css/main.20975575.css","617d0c7611465335c80699fb462660c6"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(r){return setOfCachedUrls(r).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return r.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),r="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,r),e=urlsToCacheKeys.has(n));var a="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(a,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -6,7 +6,8 @@
"bootstrap": "4.1.3",
"punycode": "^2.1.1",
"react": "^16.5.1",
"react-dom": "^16.5.1"
"react-dom": "^16.5.1",
"react-lazy-load": "^3.0.13"
},
"devDependencies": {
"react-scripts": "1.1.5"

@ -7,6 +7,7 @@ import punycode from 'punycode';
import './ResultsTable.css';
import results from './spider_result.json';
import screenshots from './screenshots.json';
import LazyLoad from 'react-lazy-load';
class IconGood extends Component {
render() {
@ -65,7 +66,13 @@ class FaviconField extends Component {
}
if (this.props.data.value && icons.length) {
return <td key='favicon' className='good'><img src={'/siteicons/' + icons[0]} width='32' height='32' alt='Icon' /></td>;
return (
<td key='favicon' className='good'>
<LazyLoad width={32} height={32}>
<img src={'/siteicons/' + icons[0]} width={32} height={32} alt='Icon' />
</LazyLoad>
</td>
);
}
return <CriteriumField keyProp='favicon' type='negative' title='Die Site hat kein Icon' />;
}

@ -2435,6 +2435,10 @@ eventemitter3@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
eventlistener@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/eventlistener/-/eventlistener-0.0.1.tgz#ed2baabb852227af2bcf889152c72c63ca532eb8"
events@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
@ -4165,7 +4169,7 @@ lodash.cond@^4.3.0:
version "4.5.2"
resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5"
lodash.debounce@^4.0.8:
lodash.debounce@^4.0.0, lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@ -4190,6 +4194,10 @@ lodash.templatesettings@^4.0.0:
dependencies:
lodash._reinterpolate "~3.0.0"
lodash.throttle@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@ -5329,7 +5337,7 @@ promise@8.0.1:
dependencies:
asap "~2.0.3"
prop-types@^15.5.10, prop-types@^15.6.2:
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
dependencies:
@ -5493,6 +5501,15 @@ react-error-overlay@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.1.tgz#417addb0814a90f3a7082eacba7cee588d00da89"
react-lazy-load@^3.0.13:
version "3.0.13"
resolved "https://registry.yarnpkg.com/react-lazy-load/-/react-lazy-load-3.0.13.tgz#3b0a92d336d43d3f0d73cbe6f35b17050b08b824"
dependencies:
eventlistener "0.0.1"
lodash.debounce "^4.0.0"
lodash.throttle "^4.0.0"
prop-types "^15.5.8"
react-scripts@1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-1.1.5.tgz#3041610ab0826736b52197711a4c4e3756e97768"

Loading…
Cancel
Save