From 8f83a278857566e0f459a710a6858269d8a1a3c5 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Fri, 4 Nov 2022 17:14:21 +0100 Subject: [PATCH] autoregister sw --- app/Controllers/SettingsController.php | 8 -------- app/Helpers/UrlBuilder.php | 1 - components/head.latte | 4 +--- components/settings/misc.latte | 18 ------------------ components/sw.latte | 3 --- views/settings.latte | 5 ----- 6 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 components/settings/misc.latte delete mode 100644 components/sw.latte diff --git a/app/Controllers/SettingsController.php b/app/Controllers/SettingsController.php index 68707d9..f3fb979 100644 --- a/app/Controllers/SettingsController.php +++ b/app/Controllers/SettingsController.php @@ -34,14 +34,6 @@ class SettingsController { self::redirect(); } - static public function misc() { - if (isset($_POST['misc-sw'])) { - $sw = $_POST['misc-sw']; - Cookies::set("misc-sw", $sw); - } - self::redirect(); - } - static private function redirect() { $url = Misc::url('/settings'); header("Location: {$url}"); diff --git a/app/Helpers/UrlBuilder.php b/app/Helpers/UrlBuilder.php index 62bff30..5a36ca3 100644 --- a/app/Helpers/UrlBuilder.php +++ b/app/Helpers/UrlBuilder.php @@ -7,7 +7,6 @@ class UrlBuilder { } static public function download(string $url, string $username, string $id, bool $watermark): string { - // {path('/download?url=' . urlencode($playAddr) . '&id=' . $id . '&user=' . $uniqueId) . '&watermark=1'} $down_url = Misc::url('/download?url=' . urlencode($url) . '&id=' . $id . '&user=' . $username); if ($watermark) $down_url .= '&watermark=1'; return $down_url; diff --git a/components/head.latte b/components/head.latte index cce56a1..ef6a9dc 100644 --- a/components/head.latte +++ b/components/head.latte @@ -16,8 +16,6 @@ {$title} - ProxiTok - {*/ Handles optional Service Worker /*} - {if \App\Helpers\Cookies::check('misc-sw', 'yes')} + {*/ Handles Service Worker /*} - {/if} diff --git a/components/settings/misc.latte b/components/settings/misc.latte deleted file mode 100644 index 4ba494e..0000000 --- a/components/settings/misc.latte +++ /dev/null @@ -1,18 +0,0 @@ -{embed '../form.latte', path: '/settings/misc', method: 'POST', submit: true} -{block fields} -
- -
- - -
-

This can be used to install the PWA version of ProxiTok

-
-{/block} -{/embed} diff --git a/components/sw.latte b/components/sw.latte deleted file mode 100644 index 43eaa3a..0000000 --- a/components/sw.latte +++ /dev/null @@ -1,3 +0,0 @@ -{if \App\Helpers\Cookies::check('misc-sw', 'yes')} - -{/if} diff --git a/views/settings.latte b/views/settings.latte index b6e1c01..c578cd0 100644 --- a/views/settings.latte +++ b/views/settings.latte @@ -14,9 +14,4 @@

Api

{include '../components/settings/api.latte'} -
-
-

Misc

- {include '../components/settings/misc.latte'} -
{/block}