diff --git a/app/client/src/js/app.js b/app/client/src/js/app.js index 09a4a5f..f4db8ab 100644 --- a/app/client/src/js/app.js +++ b/app/client/src/js/app.js @@ -83,6 +83,16 @@ import '@a2nt/meta-lightbox/src/js/index'; import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_main'; import './_layout'; +// Register service worker +if ('serviceWorker' in navigator) { + var baseHref = (document.getElementsByTagName('base')[0] || {}).href; + if (baseHref) { + navigator.serviceWorker.register(`${baseHref}sw.js`).then(() => { + console.log('Service Worker Registered'); + }); + } +} + function importAll(r) { return r.keys().map(r); } diff --git a/app/templates/Includes/MetaHead.ss b/app/templates/Includes/MetaHead.ss index 73d15ee..8bc3a10 100644 --- a/app/templates/Includes/MetaHead.ss +++ b/app/templates/Includes/MetaHead.ss @@ -1,14 +1,13 @@ <% base_tag %> $MetaTags - <%-- OpenGraph --%> - + @@ -23,13 +22,9 @@ $MetaTags <% if $MetaDescription %> <% end_if %> - <% if $MetaImage %> -<% else_if $MetaImageLink %> - <% end_if %> - <% if $FacebookAppID %> <% end_if %> @@ -41,23 +36,10 @@ $MetaTags - - - - - - - - - - - - - - - + + @@ -66,7 +48,6 @@ $MetaTags - @@ -78,6 +59,6 @@ $MetaTags - + <% include Prestyling %> diff --git a/app/templates/Includes/SiteWideMessage.ss b/app/templates/Includes/SiteWideMessage.ss index cb54ee1..c38b0dc 100644 --- a/app/templates/Includes/SiteWideMessage.ss +++ b/app/templates/Includes/SiteWideMessage.ss @@ -1,3 +1,7 @@ +
+ The Internet connection is missing right now, but you're able to browse previously opened pages offline. +
+ <% if $SiteWideMessage %>
{$Message} @@ -6,4 +10,4 @@ <% with $SiteConfig %> <% include Site\Objects\NotificationsList %> -<% end_with %> \ No newline at end of file +<% end_with %> diff --git a/composer.json b/composer.json index 4c622c9..547a05b 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,10 @@ "name": "a2nt/silverstripe-webpack", "type": "silverstripe-recipe", "description": "SilverStripe WebPack boilerplate + Basics of JS/CSS UI", - "keywords": ["silverstripe", "webpack"], + "keywords": [ + "silverstripe", + "webpack" + ], "license": "BSD-3-Clause", "require": { "php": ">=7.1.0", @@ -37,19 +40,23 @@ "silverstripe/widgets": "^2.0", "a2nt/silverstripe-font-awesome-field": "dev-master", "a2nt/silverstripe-mapboxfield": "dev-master", + "a2nt/silverstripe-progressivewebapp": "dev-master", "bummzack/sortablefile": "*" }, "require-dev": { "phpunit/phpunit": "^5.7", "lekoala/silverstripe-debugbar": "dev-master" }, - "repositories": [{ - "type": "vcs", - "url": "https://github.com/a2nt/silverstripe-font-awesome" - }, { - "type": "vcs", - "url": "https://github.com/a2nt/silverstripe-mapboxfield" - }], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/a2nt/silverstripe-font-awesome" + }, + { + "type": "vcs", + "url": "https://github.com/a2nt/silverstripe-mapboxfield" + } + ], "extra": { "expose": [ "app/client/dist" diff --git a/package.json b/package.json index f4da7a4..9b2735c 100755 --- a/package.json +++ b/package.json @@ -30,20 +30,20 @@ "ie>=11" ], "dependencies": { - "@a2nt/meta-lightbox": "^1.2.2", - "@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^1.7.6", - "browserslist": "^4.8.6", - "caniuse-lite": "^1.0.30001025", - "inputmask": "^5.0.3", + "@a2nt/meta-lightbox": "^1.2.4", + "@a2nt/ss-bootstrap-ui-webpack-boilerplate": "^1.8.7", + "browserslist": "^4.11.1", + "caniuse-lite": "^1.0.30001038", "font-awesome": "^4.7.0", - "yarn": "^1.22.0" + "inputmask": "^5.0.3", + "yarn": "^1.22.4" }, "devDependencies": { "@a2nt/image-sprite-webpack-plugin": "^0.2.5", "@babel/core": "^7.8.4", "@babel/plugin-proposal-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-react-jsx": "^7.8.3", - "@babel/preset-env": "^7.8.4", + "@babel/plugin-transform-react-jsx": "^7.9.4", + "@babel/preset-env": "^7.9.0", "@google/markerclusterer": "^1.0.3", "animate.css": "^3.7.0", "autoprefixer": "^9.7.4", @@ -53,7 +53,7 @@ "bootstrap-confirmation2": "^4.1.0", "bootstrap-datepicker": "^1.9.0", "bootstrap-offcanvas": "^1.0.0", - "bootstrap-table": "^1.15.3", + "bootstrap-table": "^1.16.0", "bootstrap-timepicker": "^0.5.2", "browser-sync": "^2.24.5", "browser-sync-webpack-plugin": "^2.2.2", @@ -62,22 +62,24 @@ "core-util-is": "^1.0.2", "croppie": "^2.6.4", "cross-env": "^5.2.1", + "css-loader": "^3.4.2", "eslint": "^4.18.1", - "eslint-plugin-import": "^2.20.1", + "eslint-plugin-import": "^2.20.2", "eslint-plugin-jquery": "^1.5.1", - "eslint-plugin-react": "^7.18.3", + "eslint-plugin-react": "^7.19.0", "exif-js": "^2.3.0", "exports-loader": "^0.7.0", "favicons-webpack-plugin": "0.0.9", + "file-loader": "^5.1.0", "font-awesome": "^4.7.0", "foundation-emails": "^2.2.1", "gijgo": "^1.9.13", "hard-source-webpack-plugin": "^0.13.1", - "html-webpack-plugin": "^4.0.0-beta.11", + "html-webpack-plugin": "^4.0.3", "imagemin-gifsicle": "^7.0.0", "imagemin-jpegtran": "^6.0.0", "imagemin-optipng": "^7.1.0", - "imagemin-svgo": "^7.0.0", + "imagemin-svgo": "^7.1.0", "imagemin-webpack": "^5.1.1", "jquery": "^3.4.1", "jquery-hammerjs": "^2.0.0", @@ -87,45 +89,41 @@ "laravel-mix": "^4.1.2", "loglevel": "^1.6.7", "lost": "^8.3.1", - "mapbox-gl": "^1.6.1", + "mapbox-gl": "^1.9.0", "material-design-color": "^2.3.2", + "mini-css-extract-plugin": "^0.9.0", + "node-sass": "^4.13.1", "object-assign": "^4.1.1", "offcanvas-bootstrap": "^2.5.2", "optimize-css-assets-webpack-plugin": "^5.0.3", "popper.js": "^1.16.0", + "postcss-loader": "^3.0.0", "pouchdb": "^6.4.3", "quill": "^1.3.7", - "react": "^16.12.0", + "react": "^16.13.1", "react-bootstrap4-form-validation": "^1.0.10", - "react-dom": "^16.12.0", + "react-dom": "^16.13.1", "react-hot-loader": "^3.1.3", "redux": "^3.7.2", "redux-devtools-extension": "^2.13.8", + "resolve-url-loader": "^3.1.1", "rimraf": "^2.7.1", "routie": "0.0.1", "sass-lint": "^1.13.1", "sass-lint-fix": "^1.12.1", + "sass-loader": "^8.0.2", "script-ext-html-webpack-plugin": "^2.1.4", "select2": "^4.0.8", "smooth-scroll": "^14.2.1", "style-loader": "^0.19.0", "svg-url-loader": "^2.3.3", - "terser-webpack-plugin": "^2.3.2", + "terser-webpack-plugin": "^2.3.5", "url-loader": "^0.6.2", - "webpack": "^4.41.5", - "webpack-cli": "^3.3.10", + "webpack": "^4.42.1", + "webpack-cli": "^3.3.11", "webpack-dev-server": "^3.10.3", "webpack-manifest-plugin": "^1.3.2", - "webpack-merge": "^4.2.2", - "@a2nt/image-sprite-webpack-plugin": "^0.2.5", - "css-loader": "^3.4.2", - "file-loader": "^5.1.0", - "mini-css-extract-plugin": "^0.9.0", - "node-sass": "^4.13.1", - "postcss-loader": "^3.0.0", - "resolve-url-loader": "^3.1.1", - "sass-loader": "^8.0.2", - "hard-source-webpack-plugin": "^0.13.1" + "webpack-merge": "^4.2.2" }, "stylelint": { "rules": {