WIP PWA support
This commit is contained in:
parent
c925ca2a41
commit
cba59e66c7
11 changed files with 84 additions and 10 deletions
|
|
@ -6,7 +6,8 @@
|
|||
<link rel="icon" type="image/png" sizes="32x32" href="{path('/favicon-32x32.png')}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{path('/favicon-16x16.png')}">
|
||||
<link rel="manifest" href="{path('/site.webmanifest')}">
|
||||
<meta property="og:title" content="ProxiTok" />
|
||||
<meta property="og:site_name" content="ProxiTok" />
|
||||
<meta property="og:title" content="{$title}" />
|
||||
<meta property="og:description" content="Alternative frontend for TikTok" />
|
||||
<meta property="og:type" content="website" />
|
||||
{if isset($has_rss)}
|
||||
|
|
@ -15,4 +16,8 @@
|
|||
<link rel="stylesheet" href="{path('/styles/vendor/cssgg.min.css')}">
|
||||
<link rel="stylesheet" href="{path('/styles/vendor/bulma.min.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
{*/ Handles optional Service Worker /*}
|
||||
{if \App\Helpers\Cookies::check('misc-sw', 'yes')}
|
||||
<script src="{path('/scripts/setup_sw.js')}"></script>
|
||||
{/if}
|
||||
</head>
|
||||
|
|
|
|||
18
components/settings/misc.latte
Normal file
18
components/settings/misc.latte
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{embed '../form.latte', path: '/settings/misc', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
<div class="field">
|
||||
<label class="label">Enable service worker</label>
|
||||
<div class="control">
|
||||
<label class="radio">
|
||||
<input type="radio" name="misc-sw" value="yes" n:attr="checked => $isServiceWorker" />
|
||||
<span>Yes</span>
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="misc-sw" value="no" n:attr="checked => !$isServiceWorker" />
|
||||
<span>No</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="help">This can be used to install the PWA version of ProxiTok</p>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
3
components/sw.latte
Normal file
3
components/sw.latte
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{if \App\Helpers\Cookies::check('misc-sw', 'yes')}
|
||||
<script src="{path('/scripts/setup_sw.js')}"></script>
|
||||
{/if}
|
||||
Loading…
Add table
Add a link
Reference in a new issue