Commit b02dddef authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '433-angepasst-einstellungen-falsch-ubernommen' into 'development'

Resolve "Angepasst Einstellungen falsch übernommen"

Closes #433

See merge request !725
parents 13a67f62 0e220073
......@@ -15,13 +15,6 @@ class StartpageController extends Controller
* @param int $id
* @return Response
*/
/* public function loadStartPage($locale = "de")
{
\App::setLocale($locale);
return view('index', [
'title' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen',
'homeIcon']);
} */
public function loadStartPage(Request $request)
{
......
......@@ -35,6 +35,7 @@ class MetaGer
protected $addedHosts = [];
protected $startCount = 0;
protected $canCache = false;
protected $canCustomSearch = false;
# Daten über die Abfrage
protected $ip;
protected $language;
......@@ -902,6 +903,7 @@ class MetaGer
} else {
$this->sprueche = false;
}
# Maps
$this->maps = $request->input('maps', 'off');
if ($this->maps === "on") {
$this->maps = true;
......@@ -914,6 +916,13 @@ class MetaGer
} else {
$this->newtab = "_self";
}
# Custom Search
$this->canCustomSearch = $request->input('canCustomSearch', 'false');
if ($this->canCustomSearch === "true") {
$this->canCustomSearch = true;
} else {
$this->canCustomSearch = false;
}
# Theme
$this->theme = preg_replace("/[^[:alnum:][:space:]]/u", '', $request->input('theme', 'default'));
# Ergebnisse pro Seite:
......@@ -1228,7 +1237,7 @@ class MetaGer
}
}
# Generators
# Generators
public function generateSearchLink($fokus, $results = true)
{
......@@ -1289,6 +1298,11 @@ class MetaGer
# Komplexe Getter
public function canCustomSearch()
{
return $this->canCustomSearch;
}
public function getHostCount($host)
{
$hash = md5($host);
......
......@@ -6890,7 +6890,7 @@ Mixed
}
#foki input + label:hover {
cursor: pointer;
background-color: #f6f6f6;
background-color: #e3e3e3;
}
#color-chooser a {
display: block;
......
This diff is collapsed.
......@@ -3909,7 +3909,6 @@ function productWidget() {
$(".lightSliderContainer").removeClass("hidden");
}
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
......@@ -3947,12 +3946,19 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
softResetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (canCustomSearch()) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
$("#searchForm").append("<input type=\"hidden\" name=\"canCustomSearch\" value=\"true\">");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
......@@ -3960,21 +3966,17 @@ function setSettings() {
key = key.substring(key.indexOf("param_") + 6);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
if (localStorage.getItem("param_lang") !== null) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
if (localStorage.getItem("param_autocomplete") !== null) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
$("input[name=eingabe]").attr("autocomplete", value);
}
if ($("fieldset#foki.mobile").length) {
$("fieldset.mobile input#bilder").val("angepasst");
$("fieldset.mobile input#bilder").prop("checked", true);
......@@ -3985,7 +3987,7 @@ function setSettings() {
$("fieldset.mobile label#anpassen-label span.content").html("angepasst");
}
}
//Polyfill for form attribute
// Polyfill for form attribute
(function($) {
/**
* polyfill for html5 form attr
......@@ -3999,7 +4001,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -4017,7 +4018,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -4073,9 +4073,63 @@ function isUseOnce() {
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function softResetOptions() {
// localStorage.removeItem("pers");
localStorage.removeItem("focus");
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (metaParams.indexOf(key) === -1) {
localStorage.removeItem(key);
}
}
}
}
function canCustomSearch() {
if (localStorage.key("focus") === "angepasst") {
return true;
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_")) {
if (metaParams.indexOf(key) === -1) {
return true;
}
}
}
return false;
}
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
pageCanJS(); // Einige Inhalte der Seite sollen mit Javascript anders aussehen
tickOptions();
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
// Checker listener
$(".checker").click(function() {
var selector = "." + $(this).attr("data-type");
if ($(selector + " input:checked").length) {
$(selector + " input").prop("checked", false);
} else {
$(selector + " input").prop("checked", true);
}
});
$(".allUnchecker").click(function() {
$(".focusCheckbox").prop("checked", false);
});
// Button listener
if (localStorage) {
$("#save").removeClass("hidden");
if (localStorage.getItem("pers")) {
......@@ -4097,18 +4151,7 @@ $(document).ready(function() {
document.location.href = $("#save").attr("data-href");
});
}
$(".checker").click(function() {
var selector = "." + $(this).attr("data-type");
if ($(selector + " input:checked").length) {
$(selector + " input").prop("checked", false);
} else {
$(selector + " input").prop("checked", true);
}
});
$(".allUnchecker").click(function() {
$(".focusCheckbox").prop("checked", false);
});
$("#unten").click(function() {
$("#save-once").click(function() {
$("#settings-form").append("<input type=\"hidden\" name=\"usage\" value=\"once\">");
switch (getLanguage()) {
case "de":
......@@ -4152,7 +4195,7 @@ function tickOptions() {
}
}
} else {
$("div.web input").attr("checked", true);
// $("div.web input").attr("checked", true);
}
}
......@@ -4163,10 +4206,13 @@ function resetOptions() {
var key = localStorage.key(i)
keys.push(key);
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
if (metaParams.indexOf(key) === -1) {
localStorage.removeItem(key);
}
}
}
}
......@@ -4179,6 +4225,11 @@ function getLanguage() {
}
}
}
function pageCanJS() {
$("#collapse-engines-div").removeClass("in");
$("#collapse-engines-btn").removeClass("hide");
}
/*! iFrame Resizer (iframeSizer.min.js ) - v3.5.5 - 2016-06-16
* Desc: Force cross domain iframes to size to content.
* Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
......
This diff is collapsed.
{
"css/themes/default.css": "css/themes/default-932aa22ca4.css",
"js/all.js": "js/all-70e38f5f5e.js",
"css/themes/default.css": "css/themes/default-46073189e4.css",
"js/all.js": "js/all-5ecffcf961.js",
"js/quicktips.js": "js/quicktips-34d41bc58a.js"
}
\ No newline at end of file
......@@ -6890,7 +6890,7 @@ Mixed
}
#foki input + label:hover {
cursor: pointer;
background-color: #f6f6f6;
background-color: #e3e3e3;
}
#color-chooser a {
display: block;
......
This diff is collapsed.
......@@ -3909,7 +3909,6 @@ function productWidget() {
$(".lightSliderContainer").removeClass("hidden");
}
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
......@@ -3947,12 +3946,19 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
softResetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (canCustomSearch()) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
$("#searchForm").append("<input type=\"hidden\" name=\"canCustomSearch\" value=\"true\">");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
......@@ -3960,21 +3966,17 @@ function setSettings() {
key = key.substring(key.indexOf("param_") + 6);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
if (localStorage.getItem("param_lang") !== null) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
if (localStorage.getItem("param_autocomplete") !== null) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
$("input[name=eingabe]").attr("autocomplete", value);
}
if ($("fieldset#foki.mobile").length) {
$("fieldset.mobile input#bilder").val("angepasst");
$("fieldset.mobile input#bilder").prop("checked", true);
......@@ -3985,7 +3987,7 @@ function setSettings() {
$("fieldset.mobile label#anpassen-label span.content").html("angepasst");
}
}
//Polyfill for form attribute
// Polyfill for form attribute
(function($) {
/**
* polyfill for html5 form attr
......@@ -3999,7 +4001,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -4017,7 +4018,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -4073,9 +4073,63 @@ function isUseOnce() {
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function softResetOptions() {
// localStorage.removeItem("pers");
localStorage.removeItem("focus");
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (metaParams.indexOf(key) === -1) {
localStorage.removeItem(key);
}
}
}
}
function canCustomSearch() {
if (localStorage.key("focus") === "angepasst") {
return true;
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_")) {
if (metaParams.indexOf(key) === -1) {
return true;
}
}
}
return false;
}
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
pageCanJS(); // Einige Inhalte der Seite sollen mit Javascript anders aussehen
tickOptions();
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
// Checker listener
$(".checker").click(function() {
var selector = "." + $(this).attr("data-type");
if ($(selector + " input:checked").length) {
$(selector + " input").prop("checked", false);
} else {
$(selector + " input").prop("checked", true);
}
});
$(".allUnchecker").click(function() {
$(".focusCheckbox").prop("checked", false);
});
// Button listener
if (localStorage) {
$("#save").removeClass("hidden");
if (localStorage.getItem("pers")) {
......@@ -4097,18 +4151,7 @@ $(document).ready(function() {
document.location.href = $("#save").attr("data-href");
});
}
$(".checker").click(function() {
var selector = "." + $(this).attr("data-type");
if ($(selector + " input:checked").length) {
$(selector + " input").prop("checked", false);
} else {
$(selector + " input").prop("checked", true);
}
});
$(".allUnchecker").click(function() {
$(".focusCheckbox").prop("checked", false);
});
$("#unten").click(function() {
$("#save-once").click(function() {
$("#settings-form").append("<input type=\"hidden\" name=\"usage\" value=\"once\">");
switch (getLanguage()) {
case "de":
......@@ -4152,7 +4195,7 @@ function tickOptions() {
}
}
} else {
$("div.web input").attr("checked", true);
// $("div.web input").attr("checked", true);
}
}
......@@ -4163,10 +4206,13 @@ function resetOptions() {
var key = localStorage.key(i)
keys.push(key);
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
if (metaParams.indexOf(key) === -1) {
localStorage.removeItem(key);
}
}
}
}
......@@ -4179,6 +4225,11 @@ function getLanguage() {
}
}
}
function pageCanJS() {
$("#collapse-engines-div").removeClass("in");
$("#collapse-engines-btn").removeClass("hide");
}
/*! iFrame Resizer (iframeSizer.min.js ) - v3.5.5 - 2016-06-16
* Desc: Force cross domain iframes to size to content.
* Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
......
This diff is collapsed.
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
......@@ -37,12 +36,19 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
softResetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (canCustomSearch()) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
$("#searchForm").append("<input type=\"hidden\" name=\"canCustomSearch\" value=\"true\">");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
......@@ -50,21 +56,17 @@ function setSettings() {
key = key.substring(key.indexOf("param_") + 6);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
if (localStorage.getItem("param_lang") !== null) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
if (localStorage.getItem("param_autocomplete") !== null) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
$("input[name=eingabe]").attr("autocomplete", value);
}
if ($("fieldset#foki.mobile").length) {
$("fieldset.mobile input#bilder").val("angepasst");
$("fieldset.mobile input#bilder").prop("checked", true);
......@@ -75,7 +77,7 @@ function setSettings() {
$("fieldset.mobile label#anpassen-label span.content").html("angepasst");
}
}
//Polyfill for form attribute
// Polyfill for form attribute
(function($) {
/**
* polyfill for html5 form attr
......@@ -89,7 +91,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -107,7 +108,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -162,4 +162,44 @@ function isUseOnce() {
var pos = url.indexOf("usage=");
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function softResetOptions() {
// localStorage.removeItem("pers");
localStorage.removeItem("focus");
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (metaParams.indexOf(key) === -1) {
localStorage.removeItem(key);
}
}
}
}
function canCustomSearch() {
if (localStorage.key("focus") === "angepasst") {
return true;
}
var metaParams = ["param_sprueche", "param_maps", "param_newtab", "param_lang", "param_autocomplete"];
var keys = [];
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i)
keys.push(key);
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_")) {
if (metaParams.indexOf(key) === -1) {
return true;
}
}
}
return false;
}
\ No newline at end of file
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
pageCanJS(); // Einige Inhalte der Seite sollen mit Javascript anders aussehen
tickOptions();
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
// Checker listener
$(".checker").click(function() {
var selector = "." + $(this).attr("data-type");
if ($(selector + " input:checked").length) {
$(selector + " input").prop("checked", false);
} else {
$(selector + " input").prop("checked", true);
}
});
$(".allUnchecker").click(function() {
$(".focusCheckbox").prop("checked", false);
});
// Button listener
if (localStorage) {
$("#save").removeClass("hidden");