From dfd0c2dc939c3c95d17fd698d0da00a02ec9a0bd Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 12 Oct 2022 19:45:05 +0200 Subject: [PATCH] Refactor --- src/assets/js/home.js | 2 +- src/assets/js/wishlists.js | 1 - src/classes/page.php | 21 ++++++++++----------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/assets/js/home.js b/src/assets/js/home.js index 8e126cef..fa2d2524 100644 --- a/src/assets/js/home.js +++ b/src/assets/js/home.js @@ -56,7 +56,7 @@ $(function() { /** * News */ - fetch('/src/api/blog.php', { + fetch('/src/api/blog.php', { method: 'GET' }) .then(handleFetchError) diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index b608a83f..e38f0f28 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -176,7 +176,6 @@ $(function () { var wishlist_href = window.location.origin + $(event.currentTarget).attr('href'); - navigator.clipboard.writeText(wishlist_href).then(function() { $('body').toast({ message: text.toast_clipboard_success }); }, function() { diff --git a/src/classes/page.php b/src/classes/page.php index 5d4a1e30..dba1b419 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -50,22 +50,22 @@ class Page switch ($type) { case 'error': $containerClasses[] = 'error icon'; - $iconClasses[] = 'exclamation triangle'; + $iconClasses[] = 'exclamation triangle'; break; case 'warning': $containerClasses[] = 'warning icon'; - $iconClasses[] = 'exclamation circle'; + $iconClasses[] = 'exclamation circle'; break; case 'info': $containerClasses[] = 'info icon'; - $iconClasses[] = 'info circle'; + $iconClasses[] = 'info circle'; break; case 'success': $containerClasses[] = 'success icon'; - $iconClasses[] = 'check circle'; + $iconClasses[] = 'check circle'; break; } @@ -142,7 +142,6 @@ class Page 'home', 'blog', 'post', - 'install', 'login', 'maintenance', 'register', @@ -290,7 +289,7 @@ class Page */ /** Fomantic UI */ - $stylesheetFomantic = 'semantic/dist/semantic.min.css'; + $stylesheetFomantic = 'semantic/dist/semantic.min.css'; $stylesheetFomanticModified = filemtime($stylesheetFomantic); ?> @@ -534,7 +533,7 @@ class Page 'icon' => 'sign out alternate', ); } else { - $pages[$login] = array( + $pages[$login] = array( 'text' => __('Login'), 'alignment' => 'right', 'items' => array(