Commit c3071d54 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'marudor-darkMode'

parents 3668c69d 2107c0bb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -64,3 +64,6 @@ tags
[._]*.un~

# End of https://www.gitignore.io/api/vim,perl

### theme stuff ###
sass/node_modules
+17 −0
Original line number Diff line number Diff line
@@ -93,6 +93,23 @@ sub startup {

	$self->defaults( layout => 'default' );

	$self->hook(
		before_dispatch => sub {
			my ($self) = @_;

          # The "theme" cookie is set client-side if the theme we delivered was
          # changed by dark mode detection or by using the theme switcher). It's
          # not part of Mojolicious' session data (and can't be, due to
          # signing and HTTPOnly), so we need to add it here.
			for my $cookie ( @{ $self->req->cookies } ) {
				if ( $cookie->name eq 'theme' ) {
					$self->session( theme => $cookie->value );
					return;
				}
			}
		}
	);

	$self->attr(
		cache_iris_main => sub {
			my ($self) = @_;
+13 −12
Original line number Diff line number Diff line
const CACHE_NAME = 'static-cache-v20';
const CACHE_NAME = 'static-cache-v21';
const FILES_TO_CACHE = [
  '/favicon.ico',
  '/offline.html',
  '/static/v20/css/materialize.min.css',
  '/static/v20/css/material-icons.css',
  '/static/v20/css/local.css',
  '/static/v20/fonts/MaterialIcons-Regular.woff2',
  '/static/v20/fonts/MaterialIcons-Regular.woff',
  '/static/v20/fonts/MaterialIcons-Regular.ttf',
  '/static/v20/js/jquery-3.4.1.min.js',
  '/static/v20/js/materialize.min.js',
  '/static/v20/js/travelynx-actions.min.js',
  '/static/v20/js/autocomplete.min.js',
  '/static/v20/js/geolocation.min.js',
  '/static/v21/css/light.min.css',
  '/static/v21/css/dark.min.css',
  '/static/v21/css/material-icons.css',
  '/static/v21/css/local.css',
  '/static/v21/fonts/MaterialIcons-Regular.woff2',
  '/static/v21/fonts/MaterialIcons-Regular.woff',
  '/static/v21/fonts/MaterialIcons-Regular.ttf',
  '/static/v21/js/jquery-3.4.1.min.js',
  '/static/v21/js/materialize.min.js',
  '/static/v21/js/travelynx-actions.min.js',
  '/static/v21/js/autocomplete.min.js',
  '/static/v21/js/geolocation.min.js',
];

self.addEventListener('install', (evt) => {
+12 −0

File added.

Preview size limit exceeded, changes collapsed.

+12 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading