diff --git a/public/js/scriptSubPages.js b/public/js/scriptSubPages.js index c95bece6c2a76e7729867b59605cdb13e5498df7..2c1faffb7500b6189f8763a9104809ebda6b9318 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/layouts/staticPages.blade.php b/resources/views/layouts/staticPages.blade.php index 6b0ef09e5cbd0e8f9052ccef90489e7729287ba3..cdbf6492d440db5e7ca34c143b6876abfd9b91f7 100644 --- a/resources/views/layouts/staticPages.blade.php +++ b/resources/views/layouts/staticPages.blade.php @@ -1,7 +1,6 @@ <!DOCTYPE html> <html lang="{!! trans('staticPages.meta.language') !!}"> <head> - <script src="{{ elixir('js/lib.js') }}"></script> <meta charset="utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>@yield('title')</title> @@ -18,6 +17,8 @@ <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> + <script src="{{ elixir('js/lib.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>