Web Share Target 実装(のためにPWA対応)

This commit is contained in:
unarist 2019-02-16 22:52:27 +09:00
parent b961956b63
commit c229947080
3 changed files with 35 additions and 0 deletions

30
public/manifest.json Normal file
View File

@ -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"
}
]
}

1
public/sw.js vendored Normal file
View File

@ -0,0 +1 @@
self.addEventListener('fetch', function() {});

View File

@ -12,6 +12,7 @@
<title>{{ config('app.name', 'Tissue') }}</title> <title>{{ config('app.name', 'Tissue') }}</title>
@endif @endif
<link href="{{ asset('manifest.json') }}" rel="manifest">
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet"> <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/open-iconic-bootstrap.min.css') }}" rel="stylesheet"> <link href="{{ asset('css/open-iconic-bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/tissue.css') }}" rel="stylesheet"> <link href="{{ asset('css/tissue.css') }}" rel="stylesheet">
@ -236,6 +237,9 @@
}); });
} }
@endguest @endguest
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/sw.js');
}
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$('.alert').alert(); $('.alert').alert();
$('.tis-page-selector').pageSelector(); $('.tis-page-selector').pageSelector();