Commit bb8090c4 authored by Karl's avatar Karl
Browse files

Die Einstellungen mischen sich jetzt nicht mehr

parent 09ee785d
......@@ -3888,7 +3888,9 @@ function productWidget() {
}
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) $("#plugin-modal").modal("show");
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
$("button").popover();
if (localStorage) {
var theme = localStorage.getItem("theme");
......@@ -3900,7 +3902,7 @@ $(document).ready(function() {
$("#theme").attr("href", "/css/theme.css.php?r=" + theme[0] + "&g=" + theme[1] + "&b=" + theme[2] + "&a=" + theme[3]);
}
}
if (localStorage.getItem("pers")) {
if (localStorage.getItem("pers") && !isUseOnce()) {
setSettings();
}
}
......@@ -4030,12 +4032,21 @@ var isEdge = !isIE && !!window.StyleMedia;
var isChrome = !!window.chrome && !!window.chrome.webstore;
// Blink engine detection
var isBlink = (isChrome || isOpera) && !!window.CSS;
// Prüft, ob der URL-Parameter "usage" auf "once" gesetzt ist.
function isUseOnce() {
var url = document.location.search;
var pos = url.indexOf("usage=");
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
tickOptions();
if (localStorage) {
$("#save").removeClass("hidden");
if (localStorage.getItem("pers")) $("#reset").removeClass("hidden");
if (localStorage.getItem("pers")) {
$("#reset").removeClass("hidden");
}
$("#save").click(function() {
resetOptions();
localStorage.setItem("pers", true);
......@@ -4064,6 +4075,7 @@ $(document).ready(function() {
$(".focusCheckbox").prop("checked", false);
});
$("#unten").click(function() {
$("#settings-form").append("<input type=\"hidden\" name=\"usage\" value=\"once\">");
if (isEnglish()) {
alert("On the following startpage your settings are saved one-time. They will be lost after your first search. Though if you want to save them, you can create a bookmark for the generated startpage.");
} else {
......
This diff is collapsed.
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) $("#plugin-modal").modal("show");
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
$("button").popover();
if (localStorage) {
var theme = localStorage.getItem("theme");
......@@ -12,7 +14,7 @@ $(document).ready(function() {
$("#theme").attr("href", "/css/theme.css.php?r=" + theme[0] + "&g=" + theme[1] + "&b=" + theme[2] + "&a=" + theme[3]);
}
}
if (localStorage.getItem("pers")) {
if (localStorage.getItem("pers") && !isUseOnce()) {
setSettings();
}
}
......@@ -141,4 +143,11 @@ var isEdge = !isIE && !!window.StyleMedia;
// Chrome 1+
var isChrome = !!window.chrome && !!window.chrome.webstore;
// Blink engine detection
var isBlink = (isChrome || isOpera) && !!window.CSS;
\ No newline at end of file
var isBlink = (isChrome || isOpera) && !!window.CSS;
// Prüft, ob der URL-Parameter "usage" auf "once" gesetzt ist.
function isUseOnce() {
var url = document.location.search;
var pos = url.indexOf("usage=");
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
\ No newline at end of file
......@@ -3,7 +3,9 @@ $(document).ready(function() {
tickOptions();
if (localStorage) {
$("#save").removeClass("hidden");
if (localStorage.getItem("pers")) $("#reset").removeClass("hidden");
if (localStorage.getItem("pers")) {
$("#reset").removeClass("hidden");
}
$("#save").click(function() {
resetOptions();
localStorage.setItem("pers", true);
......@@ -32,6 +34,7 @@ $(document).ready(function() {
$(".focusCheckbox").prop("checked", false);
});
$("#unten").click(function() {
$("#settings-form").append("<input type=\"hidden\" name=\"usage\" value=\"once\">");
if (isEnglish()) {
alert("On the following startpage your settings are saved one-time. They will be lost after your first search. Though if you want to save them, you can create a bookmark for the generated startpage.");
} else {
......
......@@ -3,7 +3,7 @@
@section('title', $title )
@section('content')
<form action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}" method="get">
<form id="settings-form" action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}" method="get">
<h1>{!! trans('settings.head.1') !!}</h1>
<p id="lead">{!! trans('settings.head.2') !!}</p>
<h2>{!! trans('settings.allgemein.1') !!}</h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment