WIP PWA support
This commit is contained in:
parent
c925ca2a41
commit
cba59e66c7
11 changed files with 84 additions and 10 deletions
|
|
@ -19,6 +19,7 @@ class SettingsController {
|
|||
}
|
||||
self::redirect();
|
||||
}
|
||||
|
||||
static public function api() {
|
||||
// TODO, ADD COUNT
|
||||
if (isset($_POST['api-test_endpoints'])) {
|
||||
|
|
@ -33,6 +34,14 @@ 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}");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class RSSTemplate {
|
||||
public string $title;
|
||||
public string $desc;
|
||||
|
|
|
|||
|
|
@ -6,14 +6,15 @@ use App\Helpers\Cookies;
|
|||
use TikScraper\Constants\DownloadMethods;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
* Settings model with all possible config items
|
||||
*/
|
||||
class SettingsTemplate extends BaseTemplate {
|
||||
public array $downloaders = [];
|
||||
public array $themes = [];
|
||||
public bool $isTestEndpoints = false;
|
||||
public string $currentDownloader;
|
||||
public string $currentTheme;
|
||||
public bool $isServiceWorker = false;
|
||||
|
||||
function __construct() {
|
||||
parent::__construct("Settings");
|
||||
|
|
@ -27,5 +28,6 @@ class SettingsTemplate extends BaseTemplate {
|
|||
$this->isTestEndpoints = Cookies::check('api-test_endpoints', 'yes');
|
||||
$this->currentDownloader = Cookies::downloader();
|
||||
$this->currentTheme = Cookies::theme();
|
||||
$this->isServiceWorker = Cookies::check('misc-sw', 'yes');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue