Merge pull request #103 from unarist/feat/web-share-target

Web Share Target 実装(のためにPWA対応)
This commit is contained in:
shibafu 2019-03-02 22:00:29 +09:00 committed by GitHub
commit 70fed1ddf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();