Skip to content

Firefly III: a personal finances manager

Try to fix dark mode / light mode.

James Cole6e10c8dba1e6
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 7c20ac9d52..f7d3a23ca3 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -69,7 +69,7 @@ final class HomeController extends Controller
try {
$stringStart = e((string) $request->input('start'));
- $start = Carbon::createFromFormat('Y-m-d', $stringStart);
+ $start = Carbon::createFromFormat('!Y-m-d', $stringStart);
} catch (InvalidFormatException) {
Log::error(sprintf('Start: could not parse date string "%s" so ignore it.', $stringStart));
$start = Carbon::now()->startOfMonth();
@@ -77,7 +77,7 @@ final class HomeController extends Controller
try {
$stringEnd = e((string) $request->input('end'));
- $end = Carbon::createFromFormat('Y-m-d', $stringEnd);
+ $end = Carbon::createFromFormat('!Y-m-d', $stringEnd);
} catch (InvalidFormatException) {
Log::error(sprintf('End could not parse date string "%s" so ignore it.', $stringEnd));
$end = Carbon::now()->endOfMonth();
@@ -88,7 +88,8 @@ final class HomeController extends Controller
if (null === $end) {
$end = Carbon::now()->endOfMonth();
}
-
+ $end->endOfDay();
+ $end->setMilli(0);
$label = $request->input('label');
$isCustomRange = false;
@@ -106,6 +107,7 @@ final class HomeController extends Controller
$request->session()->flash('warning', (string) trans('firefly.warning_much_data', ['days' => (int) $diff]));
}
+
$request->session()->put('is_custom_range', $isCustomRange);
Log::debug(sprintf('Set is_custom_range to %s', var_export($isCustomRange, return: true)));
$request->session()->put('start', $start);
diff --git a/package-lock.json b/package-lock.json
index a090abfb71..9d50cdcb0c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1755,23 +1755,6 @@
"tslib": "^2.4.0"
}
},
- "node_modules/@eonasdan/tempus-dominus": {
- "version": "6.10.4",
- "resolved": "https://registry.npmjs.org/@eonasdan/tempus-dominus/-/tempus-dominus-6.10.4.tgz",
- "integrity": "sha512-aR1QkKUEFyfpqKuRs3ZnIfMhhB4aAS6WO3CpHn4FTLABe2ia3tm4pb7w+ium3w5b/d+mIKSi6VcbDukU+dtnYA==",
- "license": "MIT",
- "funding": {
- "url": "https://ko-fi.com/eonasdan"
- },
- "peerDependencies": {
- "@popperjs/core": "^2.11.6"
- },
- "peerDependenciesMeta": {
- "@popperjs/core\"": {
- "optional": true
- }
- }
- },
"node_modules/@epic-web/invariant": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
@@ -7000,6 +6983,12 @@
"node": ">= 0.10"
}
},
+ "node_modules/intro.js": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/intro.js/-/intro.js-8.3.2.tgz",
+ "integrity": "sha512-+QsuU8P7Z/O7stAwZ8Uj6CPyKsY6xVx/7hKTVLjlIEPYHaT43XnEUUYHCln6Ehr7GlDuwczh6I8PD/HGf4EG0A==",
+ "license": "AGPL-3.0"
+ },
"node_modules/ipaddr.js": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.4.0.tgz",
@@ -12394,12 +12383,12 @@
},
"resources/assets/v3": {
"dependencies": {
- "@eonasdan/tempus-dominus": "^6.10.4",
"@popperjs/core": "^2.11.8",
"admin-lte": "^4.0.0",
"alpinejs": "^3.15.12",
"bootstrap-icons": "^1.13.1",
- "cally": "^0.9.2"
+ "cally": "^0.9.2",
+ "intro.js": "^8.3.2"
},
"devDependencies": {
"concurrently": "^9.0.1",
diff --git a/public/v1/js/ff/firefly.js b/public/v1/js/ff/firefly.js
index 4093f43f2e..abf5fc0a1e 100644
--- a/public/v1/js/ff/firefly.js
+++ b/public/v1/js/ff/firefly.js
@@ -58,7 +58,7 @@ $(function () {
// save sidebar collapsed state when page loads.
$('[data-lte-toggle="sidebar"]').click(function () {
- localStorage.setItem('ff3_sidebar_collapsed', (!$('body').hasClass('sidebar-collapse')).toString());
+ localStorage.setItem('ff3_sidebar_collapsed', ($('body').hasClass('sidebar-collapse')));
});
diff --git a/public/v1/js/ff/help.js b/public/v1/js/ff/help.js
index 086e6f5d0c..1955d74eef 100644
--- a/public/v1/js/ff/help.js
+++ b/public/v1/js/ff/help.js
@@ -20,7 +20,7 @@
/** global: token, helpPageTitle, anonymous */
$(function () {
"use strict";
- // $('#help').click(showHelp);
+ $('#help').click(showHelp);
$('#anonymous').click(changeAnonymity)
});
@@ -55,13 +55,17 @@ function changeAnonymity(e) {
function showHelp(e) {
"use strict";
- var target = $(e.target);
+ console.log('showHelp');
+ var target = $(e.currentTarget);
var route = target.data('route');
var specialPage = target.data('extra');
+ console.log('route', route);
if (typeof specialPage === 'undefined') {
specialPage = '';
}
+ console.log('route', route);
+ console.log('special page', specialPage);
$('#helpBody').html('<span class="fa fa-refresh fa-spin"></span>');
$('#helpModal').modal('show');
$('#helpTitle').html(helpPageTitle);
diff --git a/public/v1/js/ff/intro/intro.js b/public/v1/js/ff/intro/intro.js
index 713e409ab7..25f835df95 100644
--- a/public/v1/js/ff/intro/intro.js
+++ b/public/v1/js/ff/intro/intro.js
@@ -20,14 +20,18 @@
$(function () {
"use strict";
+ console.log('Start introJS.');
if (!forceDemoOff) {
+ console.log('Mark as done.');
$.getJSON(routeStepsUrl).done(setupIntro)
}
});
-function setupIntro(steps) {
- var intro = introJs();
+function setupIntro(steps) {
+ console.log('setupIntro().');
+ return;
+ var intro = introJs;
intro.setOptions({
nextLabel: nextLabel,
prevLabel: prevLabel,
@@ -40,10 +44,10 @@ function setupIntro(steps) {
});
intro.oncomplete(reportIntroFinished);
intro.onexit(reportIntroFinished);
- intro.start();
+ intro.tour().start();
}
function reportIntroFinished() {
console.log('Route for finished intro: ' + routeForFinishedTour);
$.post(routeForFinishedTour, {_token: token});
-}
\ No newline at end of file
+}
diff --git a/resources/assets/v3/css/app.css b/resources/assets/v3/css/app.css
deleted file mode 100644
index ad013d9513..0000000000
--- a/resources/assets/v3/css/app.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * app.css
- * Copyright (c) 2026 [email protected]
- *
- * This file is part of Firefly III (https://github.com/firefly-iii).
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
-
-/** here **/
diff --git a/resources/assets/v3/js/boot/bootstrap.js b/resources/assets/v3/js/boot/bootstrap.js
index d8de7a57ce..021a771269 100644
--- a/resources/assets/v3/js/boot/bootstrap.js
+++ b/resources/assets/v3/js/boot/bootstrap.js
@@ -24,13 +24,14 @@ import "admin-lte"
import Alpine from 'alpinejs'
import store from "store";
import axios from 'axios';
+import introJs from "intro.js";
+import "intro.js/introjs.css";
import "cally";
import observePlugin from 'store/plugins/observe';
import {getFreshVariable} from "v2/src/store/get-fresh-variable.js";
import {getVariable} from "v2/src/store/get-variable.js";
import {getViewRange} from "v2/src/support/get-viewrange.js";
import {loadTranslations} from "v2/src/support/load-translations.js";
-
store.addPlugin(observePlugin);
window.bootstrapped = false;
@@ -76,6 +77,34 @@ getFreshVariable('lastActivity').then((serverValue) => {
window.bootstrapped = true;
console.log('Bootstrapped!');
});
+
+ // page may have an introduction necessary to be played.
+ const url = '/';
+ let site = axios.create({baseURL: url, withCredentials: true});
+ axios.defaults.withCredentials = true;
+ axios.defaults.baseURL = url;
+
+ // console.log('setupIntro().');
+ site.get(routeStepsUrl).then(function(data) {
+ console.log('Done with axios');
+ console.log(data.data);
+ introJs.tour().setOptions({
+ nextLabel: nextLabel,
+ prevLabel: prevLabel,
+ skipLabel: skipLabel,
+ doneLabel: doneLabel,
+ steps: data.data,
+ exitOnEsc: true,
+ exitOnOverlayClick: true,
+ keyboardNavigation: true
+ });
+ introJs.tour().onComplete(reportIntroFinished);
+ introJs.tour().onExit(reportIntroFinished);
+ });
+ // introJs.tour().start();
+
+
+
});
}).catch((error) => {
console.error('Error while bootstrapping: ' + error);
diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js
index 1e14d2b3d0..5d37e10b37 100644
--- a/resources/assets/v3/js/pages/dashboard/dashboard.js
+++ b/resources/assets/v3/js/pages/dashboard/dashboard.js
@@ -19,13 +19,6 @@
*/
// CSS
-// import "admin-lte/dist/css/adminlte.min.css"
-// Plus Bootstrap and dependency CSS
-import "bootstrap-icons/font/bootstrap-icons.css"
-// import "overlayscrollbars/styles/overlayscrollbars.css"
-
-
-
import '../../boot/bootstrap.js';
import sidebar from '../../pages/shared/sidebar.js';
import boxes from './boxes.js';
@@ -35,7 +28,7 @@ let index = function () {
return {
foo2: 'bar2',
init() {
- console.log('init op index')
+ console.log('init op index xxx');
}
}
};
@@ -49,9 +42,11 @@ const comps = {
};
function loadPage(comps) {
+ console.log('loadPage');
Object.keys(comps).forEach(comp => {
let data = comps[comp]();
Alpine.data(comp, () => data);
+ console.log(comp);
});
Alpine.start();
}
diff --git a/resources/assets/v3/js/pages/shared/dates.js b/resources/assets/v3/js/pages/shared/dates.js
index 3124254983..b67e519b70 100644
--- a/resources/assets/v3/js/pages/shared/dates.js
+++ b/resources/assets/v3/js/pages/shared/dates.js
@@ -18,29 +18,33 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {
- addMonths,
- endOfDay,
- endOfMonth,
- endOfQuarter,
- endOfWeek,
- startOfDay,
- startOfMonth,
- startOfQuarter,
- startOfWeek,
- startOfYear,
- subDays,
- subMonths
-} from "date-fns";
+import {addMonths, endOfMonth, startOfMonth, startOfYear, subDays, subMonths} from "date-fns";
import format from '../../util/format'
-import i18next from "i18next";
-import { TempusDominus } from '@eonasdan/tempus-dominus';
export default () => ({
range: {
start: null, end: null
},
+ eventListeners: {
+ ['@CustomEvents.change'](event) {
+ console.log('I heard that! (dashboard/dates)');
+ }
+ },
+ updateDates(e) {
+ console.log('updateDates (e.originalTarget._props.value)');
+ console.log(e.originalTarget._props.value);
+ let split = e.originalTarget._props.value.split('/');
+ document.getElementById('customStart').value = split[0];
+ document.getElementById('customEnd').value = split[1];
+ // this.range.start = split[0];
+ // this.range.end = split[1];
+ console.log('Start is now ' + split[0]);
+ console.log('End is now ' + split[1]);
+ window.store.set('start', split[0]);
+ window.store.set('end', split[1]);
+ document.getElementById('daterange-form').submit();
+ },
defaultRange: {
start: null, end: null
},
@@ -67,7 +71,7 @@ export default () => ({
});
window.store.observe('end', (newValue) => {
this.range.end = new Date(newValue);
- this.buildDateRange();
+ this.buildDateRange();
});
},
diff --git a/resources/assets/v3/package.json b/resources/assets/v3/package.json
index edfbb6a79a..2525960398 100644
--- a/resources/assets/v3/package.json
+++ b/resources/assets/v3/package.json
@@ -7,7 +7,8 @@
"admin-lte": "^4.0.0",
"alpinejs": "^3.15.12",
"bootstrap-icons": "^1.13.1",
- "cally": "^0.9.2"
+ "cally": "^0.9.2",
+ "intro.js": "^8.3.2"
},
"type": "module",
"scripts": {
diff --git a/resources/assets/v3/sass/app.scss b/resources/assets/v3/sass/app.scss
index 22dcce4cce..08f6b690c3 100644
--- a/resources/assets/v3/sass/app.scss
+++ b/resources/assets/v3/sass/app.scss
@@ -18,82 +18,172 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-$color-mode-type: media-query;
-$link-decoration: none !default;
-$font-family-sans-serif: "Roboto", sans-serif;
-
-$danger: #CD5029 !default;
-$primary: #1E6581 !default;
-$success: #64B624 !default;
-
-// admin LTE
-@use "../../../../node_modules/admin-lte/src/scss/adminlte" with (
- $color-mode-type: $color-mode-type,
- $link-decoration: $link-decoration,
- $font-family-sans-serif: $font-family-sans-serif,
- $danger: $danger,
- $primary: $primary,
- $success: $success
-);
-
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/variables' with (
-// $font-path: "@fortawesome/fontawesome-free/webfonts"
-//);
-
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome';
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/fa' as fa;
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/solid' as fa-solid;
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/brands' as fa-brands;
-//@use '../../../../node_modules/@fortawesome/fontawesome-free/scss/regular' as fa-regular;
-
-
-// some local CSS
-.skip-links {display: none;}
-
-/*
-Remove bottom margin from unstyled lists
- */
-.list-no-margin {margin-bottom: 0;}
-.list-no-margin li.list-indent {margin-left:1.6em;}
-
-.hover-footer {
- overflow-x:hidden;
- width:100%;
- text-align:right;
- white-space: nowrap;
- text-overflow: ellipsis
-}
-.hover-footer:hover {
- overflow: auto;
- text-overflow: unset;
- white-space: normal;
-}
-h3.hover-expand {
- overflow-x: hidden;
- text-overflow: ellipsis
-}
-h3.hover-expand:hover {
- overflow-x: auto;
-}
-
-.form-control {
- appearance: auto;
-}
-
-// edit buttons
-.hidden-edit-button {
- cursor: pointer;
-}
-td:not(:hover) .hidden-edit-button {
- visibility: hidden;
-}
-
-// Bootstrap
-// @import "bootstrap/scss/bootstrap";
-
-
-// @import "~bootstrap-sass/assets/stylesheets/bootstrap";
-
-// hover buttons
+/*!
+ * AdminLTE v4.0.0
+ * Author: Colorlib
+ * Website: AdminLTE.io <https://adminlte\.io>
+ * License: Open source - MIT <https://opensource.org/licenses/MIT>
+ */
+// Bootstrap Configuration
+// ---------------------------------------------------
+@import "bootstrap/scss/functions";
+@import "bootstrap-icons/font/bootstrap-icons.css";
+
+// AdminLTE Configuration
+// ---------------------------------------------------
+@import "admin-lte/src/scss/bootstrap-variables"; // little modified are here
+
+
+
+// Bootstrap Configuration
+// ---------------------------------------------------
+@import "bootstrap/scss/variables";
+@import "bootstrap/scss/variables-dark";
+@import "bootstrap/scss/maps";
+@import "bootstrap/scss/mixins";
+@import "bootstrap/scss/utilities";
+
+// Bootstrap Layout & components
+@import "bootstrap/scss/root";
+@import "bootstrap/scss/reboot";
+@import "bootstrap/scss/type";
+@import "bootstrap/scss/images";
+@import "bootstrap/scss/containers";
+@import "bootstrap/scss/grid";
+@import "bootstrap/scss/tables";
+@import "bootstrap/scss/forms";
+@import "bootstrap/scss/buttons";
+@import "bootstrap/scss/transitions";
+@import "bootstrap/scss/dropdown";
+@import "bootstrap/scss/button-group";
+@import "bootstrap/scss/nav";
+@import "bootstrap/scss/navbar";
+@import "bootstrap/scss/card";
+@import "bootstrap/scss/accordion";
+@import "bootstrap/scss/breadcrumb";
+@import "bootstrap/scss/pagination";
+@import "bootstrap/scss/badge";
+@import "bootstrap/scss/alert";
+@import "bootstrap/scss/progress";
+@import "bootstrap/scss/list-group";
+@import "bootstrap/scss/close";
+@import "bootstrap/scss/toasts";
+@import "bootstrap/scss/modal";
+@import "bootstrap/scss/tooltip";
+@import "bootstrap/scss/popover";
+@import "bootstrap/scss/carousel";
+@import "bootstrap/scss/spinners";
+@import "bootstrap/scss/offcanvas";
+@import "bootstrap/scss/placeholders";
+
+// Bootstrap Helpers
+@import "bootstrap/scss/helpers";
+
+// Bootstrap Utilities
+@import "bootstrap/scss/utilities/api";
+
+// AdminLTE Configuration
+// ---------------------------------------------------
+@import "admin-lte/src/scss/variables";
+@import "admin-lte/src/scss/variables-dark";
+@import "admin-lte/src/scss/mixins";
+
+// AdiminLTE Parts
+// ---------------------------------------------------
+@import "admin-lte/src/scss/parts/core";
+@import "admin-lte/src/scss/parts/components";
+@import "admin-lte/src/scss/parts/extra-components";
+@import "admin-lte/src/scss/parts/pages";
+@import "admin-lte/src/scss/parts/miscellaneous";
+
+// AdminLTE Accessibility Styles - WCAG 2.1 AA Compliance
+@import "admin-lte/src/scss/accessibility";
+
+// AdminLTE Documentation Styles (only applies to pages with body.docs-page)
+// @import "docs";
+
+
+
+
+
+
+//
+//
+////// Plus Bootstrap and dependency CSS
+////// import "overlayscrollbars/styles/overlayscrollbars.css"
+//
+//// $color-mode-type: media-query;
+//$link-decoration: none !default;
+//$font-family-sans-serif: "Roboto", sans-serif;
+//
+//$danger: #CD5029 !default;
+//$primary: #1E6581 !default;
+//$success: #64B624 !default;
+//
+//@use "admin-lte/dist/css/adminlte.min.css";
+//// @use "admin-lte/src/scss/adminlte";
+//
+//
+//// admin LTE
+//// @use "admin-lte/src/scss/adminlte";
+////@use "admin-lte/src/scss/adminlte" with (
+//// // $color-mode-type: $color-mode-type,
+//// $link-decoration: $link-decoration,
+//// $font-family-sans-serif: $font-family-sans-serif,
+//// $danger: $danger,
+//// $primary: $primary,
+//// $success: $success
+////);
+//
+//// some local CSS
+//.skip-links {display: none;}
+//
+///*
+//Remove bottom margin from unstyled lists
+// */
+//.list-no-margin {margin-bottom: 0;}
+//.list-no-margin li.list-indent {margin-left:1.6em;}
+//
+//.hover-footer {
+// overflow-x:hidden;
+// width:100%;
+// text-align:right;
+// white-space: nowrap;
+// text-overflow: ellipsis
+//}
+//.hover-footer:hover {
+// overflow: auto;
+// text-overflow: unset;
+// white-space: normal;
+//}
+//h3.hover-expand {
+// overflow-x: hidden;
+// text-overflow: ellipsis
+//}
+//h3.hover-expand:hover {
+// overflow-x: auto;
+//}
+//
+//.form-control {
+// appearance: auto;
+//}
+//
+//// edit buttons
+//.hidden-edit-button {
+// cursor: pointer;
+//}
+//td:not(:hover) .hidden-edit-button {
+// visibility: hidden;
+//}
+//
+//// Bootstrap
+//// @import "bootstrap/scss/bootstrap";
+//
+//
+//// @import "~bootstrap-sass/assets/stylesheets/bootstrap";
+//
+//// hover buttons
+//
+//
diff --git a/resources/views/accounts/index.twig b/resources/views/accounts/index.twig
index e6953a389b..eb1b7b7ea3 100644
--- a/resources/views/accounts/index.twig
+++ b/resources/views/accounts/index.twig
@@ -1,3 +1,4 @@
+
{% extends './layout/default' %}
{% block breadcrumbs %}
diff --git a/resources/views/components/dashboard/boxes.blade.php b/resources/views/components/dashboard/boxes.blade.php
index b014d9e9f1..f9b89f3b1d 100644
--- a/resources/views/components/dashboard/boxes.blade.php
+++ b/resources/views/components/dashboard/boxes.blade.php
@@ -1,4 +1,4 @@
-<div class="row mb-2" x-data="boxes" x-bind="eventListeners">
+<div class="row mb-2" x-data="boxes">
<div class="col-xl-3 col-lg-6 col-md-12 col-sm-12">
<div class="small-box text-bg-primary">
<div class="inner balance-box">
diff --git a/resources/views/components/layout/range.blade.php b/resources/views/components/layout/range.blade.php
index 6b4ae36c5a..dbb325850e 100644
--- a/resources/views/components/layout/range.blade.php
+++ b/resources/views/components/layout/range.blade.php
@@ -1,4 +1,4 @@
-<li class="nav-item dropdown" x-data="dates">
+<li class="nav-item dropdown">
<a
href="#"
class="nav-link"
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php
index 1b3a78be35..f1e33494bd 100644
--- a/resources/views/index.blade.php
+++ b/resources/views/index.blade.php
@@ -1,11 +1,12 @@
@extends('layout.v3.session')
@section('content')
- X TODO internals modal voor pagina settings
- X TODO wizard modal voor weet ik veel
- XTODO dark mode ook onthouden en dat script in het template
- XTODO date picker
+ <!-- TODO internals modal voor pagina settings -->
+ <!-- TODO wizard modal voor weet ik veel -->
TODO intro js
-
+ <span data-intro='Hello step one!'>XTODO dark mode ook onthouden en dat script in het template</span>
+ @if('light' === $darkMode)
+ LIGHT
+ @endif
<x-dashboard.boxes :start="$start" :end="$end" />
<div class="row" x-data="index">
@@ -189,7 +190,6 @@
@section('scripts')
@vite(['js/pages/dashboard/dashboard.js'])
-
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var lineColor = 'red';
var lineTextColor = '#000';
diff --git a/resources/views/layout/v3/session.blade.php b/resources/views/layout/v3/session.blade.php
index e4e004c676..2ad8532421 100644
--- a/resources/views/layout/v3/session.blade.php
+++ b/resources/views/layout/v3/session.blade.php
@@ -26,9 +26,37 @@
Firefly III
</title>
+ <!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
+ <script nonce="{{ $JS_NONCE }}">
+ (() => {
+ 'use strict';
+ console.log('Init for dark/light.');
+ const STORAGE_KEY = 'lte-theme';
+ let stored = null;
+ try {
+ console.log('Init for thing.');
+ stored = localStorage.getItem(STORAGE_KEY);
+ } catch {
+ // localStorage may be unavailable (private mode, sandboxed iframe).
+ }
+ const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
+ // Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
+ // otherwise ("auto" or unset) fall back to the OS preference.
+ let resolved = 'light';
+ if (stored === 'dark' || stored === 'light') {
+ resolved = stored;
+ } else if (prefersDark) {
+ resolved = 'dark';
+ }
+ console.log(resolved);
+ document.documentElement.setAttribute('data-bs-theme', resolved);
+ document.documentElement.style.colorScheme = resolved;
+ })();
+ </script>
+ <!--end::Theme Init-->
+
<!--begin::Accessibility Meta Tags-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
- <meta name="color-scheme" content="light dark"/>
<meta name="theme-color" content="#007bff" media="(prefers-color-scheme: light)"/>
<meta name="theme-color" content="#1a1a1a" media="(prefers-color-scheme: dark)"/>
<!--end::Accessibility Meta Tags-->
@@ -39,10 +67,12 @@
<meta name="color-scheme" content="light dark">
@endif
@if('dark' === $darkMode)
- <meta name="color-scheme" content="dark">
+ <!-- <meta name="color-scheme" content="dark"> -->
+ <meta name="color-scheme" content="light dark" />
@endif
@if('light' === $darkMode)
- <meta name="color-scheme" content="light">
+ <!-- <meta name="color-scheme" content="light"> -->
+ <meta name="color-scheme" content="light dark" />
@endif
@vite(['sass/app.scss'])
@@ -53,7 +83,7 @@
</head>
<!--end::Head-->
<!--begin::Body-->
-<body class="layout-fixed sidebar-mini sidebar-expand-lg bg-body-tertiary">
+<body class="layout-fixed sidebar-mini sidebar-expand-lg bg-body-tertiary">
{{-- this entry is in the header so it's loaded early --}}
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var forceDemoOff = false;
@@ -115,7 +145,7 @@
<!-- help button -->
<li class="nav-item hidden-sm hidden-xs">
- <a href="#" class="nav-link" data-extra="{{ $objectType ?? '' }}"
+ <a href="#" class="nav-link" id="help" data-extra="{{ $objectType ?? '' }}"
data-route="{{ $original_route_name }}" data-bs-toggle="modal" data-bs-target="#helpModal">
<em class="bi bi-question-circle"></em>
</a>
@@ -349,8 +379,19 @@
{{-- Base script: jquery and bootstrap --}}
<script src="v1/js/app.js?v={{ $FF_BUILD_TIME }}" type="text/javascript" nonce="{{ $JS_NONCE }}"></script>
+{{-- introduction --}}
+<!-- intro -->
+<script type="text/javascript" nonce="{{ $JS_NONCE }}">
+ var routeForTour = "{{ $current_route_name }}";
+ var routeStepsUrl = "{{ route('json.intro', [$current_route_name, $objectType ?? '']) }}";
+ var routeForFinishedTour = "{{ route('json.intro.finished', [$current_route_name, $objectType ?? '']) }}";
+</script>
+@if(!$shownDemo)
+<script type="text/javascript" src="v1/js/ff/intro/intro.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+@endif
{{-- date range picker, current template, etc. --}}
+
<script src="v1/js/lib/daterangepicker.js?v={{ $FF_BUILD_TIME }}" type="text/javascript"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/accounting.min.js?v={{ $FF_BUILD_TIME }}"
@@ -362,6 +403,13 @@
@yield('scripts')
+
+<!-- start: previous color mode -->
+
+
+
+<!-- end: previous color mode -->
+
<!--begin::Color Mode Toggle (#6010)-->
<script>
(() => {
@@ -446,9 +494,11 @@
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
</form>
-<div class="modal fade" tabindex="-1" role="dialog" id="customDateRangeModal" aria-hidden="true" x-data="dates">
+<div class="modal fade" tabindex="-1" role="dialog" id="customDateRangeModal" aria-hidden="true" x-data="dates" x-bind="eventListeners">
<div class="modal-dialog modal-lg">
- <form action="{{ route('daterange') }}?redirect=true" method="POST">
+ <form action="{{ route('daterange') }}?redirect=true" method="POST" id="daterange-form">
+ <input type="hidden" name="start" value="" id="customStart" />
+ <input type="hidden" name="end" value="" id="customEnd" />
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ __('firefly.customRange') }}</h4>
@@ -484,12 +534,12 @@
}
&::part(button):focus-visible {
- outline: 2px solid #7048e8;
+ outline: 2px solid #1E6581;
}
}
calendar-month {
- --color-accent: #7048e8;
+ --color-accent: #1E6581;
--color-text-on-accent: #ffffff;
&::part(button) {
@@ -498,7 +548,7 @@
&::part(range-inner) {
border-radius: 0;
- background-color: #845ef7;
+ background-color: #2885AA;
}
&::part(range-start) {
@@ -518,7 +568,7 @@
</style>
<div class="row">
<div class="col" style="width:100%;display:flex;justify-content:center;">
- <calendar-range months="2" @change="updateDates($event.detail.value)">
+ <calendar-range months="2" x-on:change="updateDates">
<svg
aria-label="Previous"
slot="previous"