Commit 66b219f6 authored by Karl's avatar Karl
Browse files

WIP: Trennung von Meta und Engine Settings

parent c23c4d70
......@@ -15,28 +15,27 @@ 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)
{
$focusPages = [];
$theme = "default";
foreach ($request->all() as $key => $value) {
if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_tab' && $key !== 'param_maps' && $key !== 'param_autocomplete') {
$focusPages[] = str_replace('param_', '', $key);
if ($value === 'on'
&& $key !== 'meta_sprueche'
&& $key !== 'meta_maps'
&& $key !== 'meta_newtab'
&& $key !== 'meta_lang'
&& $key !== 'request'
&& $key !== 'meta_autocomplete') {
$focusPages[] = str_replace('meta_', '', $key);
}
if ($key === 'param_theme') {
$theme = str_replace('param_', '', $key);
if ($key === 'meta_theme') {
$theme = str_replace('meta_', '', $key);
}
}
$maps = $request->input('param_maps', 'on');
$maps = $request->input('meta_maps', 'on');
$agent = new Agent();
$browser = $agent->browser();
......@@ -45,17 +44,17 @@ class StartpageController extends Controller
->with('title', trans('titles.index'))
->with('homeIcon')
->with('focus', $request->input('focus', 'web'))
->with('lang', $request->input('param_lang', 'all'))
->with('resultCount', $request->input('param_resultCount', '20'))
->with('time', $request->input('param_time', '1000'))
->with('sprueche', $request->input('param_sprueche', 'off'))
->with('tab', $request->input('param_tab', 'off'))
->with('lang', $request->input('meta_lang', 'all'))
->with('resultCount', $request->input('meta_resultCount', '20'))
->with('time', $request->input('meta_time', '1000'))
->with('sprueche', $request->input('meta_sprueche', 'off'))
->with('tab', $request->input('meta_tab', 'off'))
->with('focusPages', $focusPages)
->with('browser', $browser)
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('maps', $maps)
->with('autocomplete', $request->input('param_autocomplete', 'on'));
->with('autocomplete', $request->input('meta_autocomplete', 'on'));
}
public function loadPage($subpage)
......
......@@ -6751,7 +6751,7 @@ ul.startpage {
<
By ID
......@@ -6873,7 +6873,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,34 +3946,38 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
resetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (localStorage.length > 0) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("param_") + 6);
if (key.startsWith("engine_")) {
key = key.substring(key.indexOf("engine_") + 7);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
if (key.startsWith("meta_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("meta_") + 5);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_lang") !== null) {
var value = localStorage.getItem("meta_lang");
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_autocomplete") !== null) {
var value = localStorage.getItem("meta_autocomplete");
$("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 +3988,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 +4002,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -4017,7 +4019,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -4073,9 +4074,37 @@ function isUseOnce() {
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function resetOptions() {
localStorage.removeItem("pers");
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("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
}
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
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 +4126,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":
......@@ -4143,12 +4161,12 @@ function tickOptions() {
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_")) {
if (key.startsWith("engine_")) {
if ($("input[name=" + key + "]").length) {
$("input[name=" + key + "]").attr("checked", "");
} else {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
} else if (key.startsWith("meta_")) {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
}
} else {
......@@ -4165,7 +4183,7 @@ function resetOptions() {
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (key.startsWith("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
......
This diff is collapsed.
{
"css/themes/default.css": "css/themes/default-a9062cf83c.css",
"js/all.js": "js/all-70e38f5f5e.js",
"css/themes/default.css": "css/themes/default-3d930e48d2.css",
"js/all.js": "js/all-7acad910d2.js",
"js/quicktips.js": "js/quicktips-34d41bc58a.js"
}
\ No newline at end of file
......@@ -6751,7 +6751,7 @@ ul.startpage {
<
By ID
......@@ -6873,7 +6873,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,34 +3946,38 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
resetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (localStorage.length > 0) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("param_") + 6);
if (key.startsWith("engine_")) {
key = key.substring(key.indexOf("engine_") + 7);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
if (key.startsWith("meta_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("meta_") + 5);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_lang") !== null) {
var value = localStorage.getItem("meta_lang");
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_autocomplete") !== null) {
var value = localStorage.getItem("meta_autocomplete");
$("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 +3988,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 +4002,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -4017,7 +4019,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -4073,9 +4074,37 @@ function isUseOnce() {
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function resetOptions() {
localStorage.removeItem("pers");
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("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
}
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
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 +4126,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":
......@@ -4143,12 +4161,12 @@ function tickOptions() {
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_")) {
if (key.startsWith("engine_")) {
if ($("input[name=" + key + "]").length) {
$("input[name=" + key + "]").attr("checked", "");
} else {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
} else if (key.startsWith("meta_")) {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
}
} else {
......@@ -4165,7 +4183,7 @@ function resetOptions() {
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (key.startsWith("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
......
This diff is collapsed.
$(document).ready(function() {
// checkPlugin();
if (location.href.indexOf("#plugin-modal") > -1) {
$("#plugin-modal").modal("show");
}
......@@ -37,34 +36,38 @@ $(document).ready(function() {
window.location = "./settings/";
});
}
$("#anpassen-label").click(function() {
window.location = "./settings/";
$("#reset-settings-btn").click(function() {
resetOptions();
document.location.href = $("#reset-settings-btn").attr("data-href");
});
});
function setSettings() {
if (localStorage.length > 0) {
$("#foki input[type=radio]#angepasst").attr("checked", true);
$("#foki label#anpassen-label").removeClass("hide");
$("#foki button#reset-settings-btn").removeClass("hide");
}
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("param_") + 6);
if (key.startsWith("engine_")) {
key = key.substring(key.indexOf("engine_") + 7);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
if (key.startsWith("meta_") && !key.endsWith("lang") && !key.endsWith('autocomplete')) {
key = key.substring(key.indexOf("meta_") + 5);
$("#searchForm").append("<input type=\"hidden\" name=\"" + key + "\" value=\"" + value + "\">");
}
$("#foki input[type=radio]#angepasst").attr("checked", true);
}
if( localStorage.getItem("param_lang") !== null ) {
var value = localStorage.getItem("param_lang");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_lang") !== null) {
var value = localStorage.getItem("meta_lang");
$("input[name=lang]").val(value);
}
if( localStorage.getItem("param_autocomplete") !== null ) {
var value = localStorage.getItem("param_autocomplete");
// Change the value of the lang input field to the given parameter
if (localStorage.getItem("meta_autocomplete") !== null) {
var value = localStorage.getItem("meta_autocomplete");
$("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 +78,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 +92,6 @@ function setSettings() {
}
/**
* Append a field to a form
*
*/
$.fn.appendField = function(data) {
// for form only
......@@ -107,7 +109,6 @@ function setSettings() {
};
/**
* Find all input fields with form attribute point to jQuery object
*
*/
$('form[id]').submit(function(e) {
var $form = $(this);
......@@ -162,4 +163,19 @@ function isUseOnce() {
var pos = url.indexOf("usage=");
if (pos >= 0 && url.substring(pos + 6, pos + 11) == "once") return true;
return false;
}
function resetOptions() {
localStorage.removeItem("pers");
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("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
}
\ No newline at end of file
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
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")) {
......@@ -22,18 +35,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":
......@@ -68,12 +70,12 @@ function tickOptions() {
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_")) {
if (key.startsWith("engine_")) {
if ($("input[name=" + key + "]").length) {
$("input[name=" + key + "]").attr("checked", "");
} else {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
} else if (key.startsWith("meta_")) {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
}
} else {
......@@ -90,7 +92,7 @@ function resetOptions() {
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.startsWith("param_" || key.startsWith("focus"))) {
if (key.startsWith("engine_" || key.startsWith("focus"))) {
localStorage.removeItem(key);
}
}
......
......@@ -167,7 +167,7 @@ Mixed
#foki input + label:hover {