From c229947080fc2ca3b0315bdec617267096c06f47 Mon Sep 17 00:00:00 2001 From: unarist Date: Sat, 16 Feb 2019 22:52:27 +0900 Subject: [PATCH] =?UTF-8?q?Web=20Share=20Target=20=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=EF=BC=88=E3=81=AE=E3=81=9F=E3=82=81=E3=81=ABPWA=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/manifest.json | 30 ++++++++++++++++++++++++++ public/sw.js | 1 + resources/views/layouts/base.blade.php | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 public/manifest.json create mode 100644 public/sw.js diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..96c8fe0 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,30 @@ +{ + "name": "Tissue", + "short_name": "Tissue", + "description": "気持ちよくティッシュを使った、そのあとの感想戦。", + "display": "minimal-ui", + "start_url": "/", + "share_target": { + "action": "/checkin", + "method": "GET", + "enctype": "application/x-www-form-urlencoded", + "url_template": "/checkin?link={url}", + "params": { + "title": "", + "text": "link", + "url": "link" + } + }, + "icons": [ + { + "src": "apple-touch-icon.png", + "type": "image/png", + "sizes": "180x180" + }, + { + "src": "chrome-touch-icon-192x192.png", + "type": "image/png", + "sizes": "192x192" + } + ] +} \ No newline at end of file diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..5e52397 --- /dev/null +++ b/public/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', function() {}); \ No newline at end of file diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 6367385..685232e 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -12,6 +12,7 @@ {{ config('app.name', 'Tissue') }} @endif + @@ -236,6 +237,9 @@ }); } @endguest + if (navigator.serviceWorker) { + navigator.serviceWorker.register('/sw.js'); + } $('[data-toggle="tooltip"]').tooltip(); $('.alert').alert(); $('.tis-page-selector').pageSelector();