From c130539c4731ff06f74e42959eb31f666c58e94c Mon Sep 17 00:00:00 2001
From: Aria <aria@suma-ev.de>
Date: Wed, 6 Sep 2017 09:47:45 +0200
Subject: [PATCH] laden des themes ohne jquery, stylesheet link wird nun direkt
 angepasst bevor die seite geladen ist

---
 public/js/scriptSubPages.js                   | 5 ++---
 resources/views/index.blade.php               | 2 +-
 resources/views/layouts/staticPages.blade.php | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/public/js/scriptSubPages.js b/public/js/scriptSubPages.js
index c95bece6c..2c1faffb7 100644
--- a/public/js/scriptSubPages.js
+++ b/public/js/scriptSubPages.js
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+
   if (localStorage) {
     var theme = localStorage.getItem('theme');
     if (theme != null) {
@@ -6,8 +6,7 @@ $(document).ready(function () {
         localStorage.removeItem('theme');
       } else {
         theme = theme.split(',');
-        $('#theme').attr('href', '/css/theme.css.php?r=' + theme[0] + '&g=' + theme[1] + '&b=' + theme[2] + '&a=' + theme[3]);
+        document.getElementById('theme').setAttribute('href', '/css/theme.css.php?r=' + theme[0] + '&g=' + theme[1] + '&b=' + theme[2] + '&a=' + theme[3]);
       }
     }
   }
-});
\ No newline at end of file
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php
index 5e24514c5..dd1258bdf 100644
--- a/resources/views/index.blade.php
+++ b/resources/views/index.blade.php
@@ -318,7 +318,7 @@
 			</li>
 			@endif
 		</ul>
-	<script src="{{ elixir('js/scriptStartPage.js') }}"></script>
+		<script src="{{ elixir('js/scriptStartPage.js') }}"></script>
 @endsection
 
 @section('optionalContent')
diff --git a/resources/views/layouts/staticPages.blade.php b/resources/views/layouts/staticPages.blade.php
index 6b0ef09e5..b32b5ba15 100644
--- a/resources/views/layouts/staticPages.blade.php
+++ b/resources/views/layouts/staticPages.blade.php
@@ -18,6 +18,7 @@
 		<link type="text/css" rel="stylesheet" href="/font-awesome/css/font-awesome.min.css" />
 		<link type="text/css" rel="stylesheet" href="{{ elixir('css/themes/default.css') }}" />
 		<link id="theme" type="text/css" rel="stylesheet" href="/css/theme.css.php" />
+		<script src="{{ elixir('js/scriptSubPages.js') }}"></script>
 		@if (isset($css))
 			@if(is_array($css))
 				@foreach($css as $el)
@@ -220,5 +221,4 @@
 			<img src="{{ action('ImageController@generateImage')}}?site={{ urlencode(url()->current()) }}" class="hidden" />
 		</div>
 	</body>
-	<script src="{{ elixir('js/scriptSubPages.js') }}"></script>
 </html>
-- 
GitLab