From 23d7e8632b59e065aa81ac0f3d0bd062b7047550 Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Thu, 17 Nov 2022 18:49:25 +0100 Subject: [PATCH] javascript improvements use `const` instead of `var`/`let` use `$(function () { ... })` instead of `$(document).ready(function () { ... })` unify codestyle --- includes/pages/user_shifts.php | 6 +-- includes/sys_form.php | 8 ++-- includes/view/PublicDashboard_view.php | 4 +- includes/view/UserDriverLicenses_view.php | 10 ++--- resources/assets/js/countdown.js | 52 +++++++++++------------ resources/assets/js/forms.js | 22 +++++----- resources/assets/js/sticky-headers.js | 12 +++--- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index c2922a76..468120d4 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -278,7 +278,7 @@ function view_user_shifts() __('Angeltypes') . '1', [ button( - 'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')', + 'javascript:checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')', __('Own'), 'd-print-none' ), @@ -365,8 +365,8 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons } $buttons = []; - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'), 'd-print-none'); - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'), 'd-print-none'); + $buttons[] = button('javascript:checkAll(\'selection_' . $name . '\', true)', __('All'), 'd-print-none'); + $buttons[] = button('javascript:checkAll(\'selection_' . $name . '\', false)', __('None'), 'd-print-none'); $buttons = array_merge($buttons, $additionalButtons); $html .= buttons($buttons); diff --git a/includes/sys_form.php b/includes/sys_form.php index 06f72f45..735d03a7 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -38,12 +38,12 @@ function form_spinner($name, $label, $value) diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php index a4a9944a..c5822f0a 100644 --- a/includes/view/PublicDashboard_view.php +++ b/includes/view/PublicDashboard_view.php @@ -42,8 +42,8 @@ function public_dashboard_view($stats, $free_shifts) stats(__('Angels currently working'), $stats['angels-working'], 'default'), stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'), '