Commit 79f87589 authored by Dominik Hebeler's avatar Dominik Hebeler

Revert "Revert "Merge branch...

Revert "Revert "Merge branch '449-einmalige-eigene-suche-ohne-ausgewahlte-suchmaschinen' into 'development'""

This reverts commit b1bb7448.
parent b7645179
......@@ -36,26 +36,23 @@ class StartpageController extends Controller
}
}
$maps = $request->input('param_maps', 'on');
$agent = new Agent();
$browser = $agent->browser();
return view('index')
->with('title', trans('titles.index'))
->with('homeIcon')
->with('focusPages', $focusPages)
->with('browser', (new Agent())->browser())
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('autocomplete', $request->input('param_autocomplete', 'on'))
->with('foki', $this->loadFoki())
->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('newtab', $request->input('param_newtab', 'on'))
->with('focusPages', $focusPages)
->with('browser', $browser)
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('maps', $maps)
->with('autocomplete', $request->input('param_autocomplete', 'on'));
->with('maps', $maps = $request->input('param_maps', 'on'));
}
public function loadPage($subpage)
......@@ -124,6 +121,35 @@ class StartpageController extends Controller
}
public function loadSettings(Request $request)
{
$foki = $this->loadFoki();
return view('settings')
->with('foki', $foki)
->with('title', 'Einstellungen')
->with('js', ['settings.js'])
->with('navbarFocus', 'suche');
die(var_dump($foki));
return $xml->saveXML();
}
public function berlin(Request $request)
{
$link = "";
$password = "";
if ($request->has('eingabe')) {
$password = getenv('berlin');
$password = md5($request->input('eingabe') . " -host:userpage.fu-berlin.de" . $password);
$link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style";
}
return view('berlin')
->with('title', 'Testseite für die FU-Berlin')
->with('link', $link)
->with('password', $password);
}
private function loadFoki()
{
$sumaFile = "";
if (App::isLocale('en')) {
......@@ -153,28 +179,6 @@ class StartpageController extends Controller
}
}
return view('settings')
->with('foki', $foki)
->with('title', 'Einstellungen')
->with('js', ['settings.js'])
->with('navbarFocus', 'suche');
die(var_dump($foki));
return $xml->saveXML();
}
public function berlin(Request $request)
{
$link = "";
$password = "";
if ($request->has('eingabe')) {
$password = getenv('berlin');
$password = md5($request->input('eingabe') . " -host:userpage.fu-berlin.de" . $password);
$link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style";
}
return view('berlin')
->with('title', 'Testseite für die FU-Berlin')
->with('link', $link)
->with('password', $password);
return $foki;
}
}
......@@ -567,7 +567,8 @@ class MetaGer
$engine->startSearch($this);
}
$this->adjustFocus($sumas, $enabledSearchengines);
// Derzeit deaktiviert, da es die eigene Suche gibt
// $this->adjustFocus($sumas, $enabledSearchengines);
/* Wir warten auf die Antwort der Suchmaschinen
* Die Verbindung steht zu diesem Zeitpunkt und auch unsere Requests wurden schon gesendet.
......
......@@ -12,7 +12,18 @@ require('laravel-elixir-vue-2');
*/
elixir(function(mix) {
mix.less('default.less', 'public/css/themes/default.css');
mix.scripts(['lib/jquery.js', 'lib/bootstrap.js', 'widgets.js', 'editLanguage.js', 'kontakt.js', 'lib/lightslider.js', 'lib/masonry.js', 'lib/imagesloaded.js', 'lib/openpgp.min.js', 'scriptResultPage.js', 'scriptStartPage.js', 'settings.js', 'lib/iframeResizer.min.js' /*, 'lib/vue/app.js', 'lib/vue/bootstrap.js'*/ ]);
/*
| Not mixed (specific pages only)
|
| widgets.js
| editLanguage.js
| kontakt.js
| scriptResultPage.js
| scriptStartPage.js
| settings.js
*/
mix.scripts(['lib/jquery.js', 'lib/bootstrap.js', 'lib/lightslider.js', 'lib/masonry.js', 'lib/imagesloaded.js', 'lib/openpgp.min.js', 'lib/iframeResizer.min.js'], 'public/js/lib.js');
mix.scripts(['lib/jquery.js', 'lib/iframeResizer.contentWindow.min.js'], 'public/js/quicktips.js');
mix.version(['css/themes/default.css', 'js/all.js', 'js/quicktips.js']);
mix.version(['css/themes/default.css', 'js/lib.js', 'js/quicktips.js']);
mix.version(['js/widgets.js', 'js/editLanguage.js', 'js/kontakt.js', 'js/scriptResultPage.js', 'js/scriptStartPage.js', 'js/settings.js']);
});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
$(document).ready(function() {
switch (getLanguage()) {
case "de":
$(".encrypt-btn").html("Verschlüsseln und senden");
break;
case "en":
$(".encrypt-btn").html("encrypt and send");
break;
case "es":
// $(".encrypt-btn").html(""); TODO
break;
}
$(".contact").submit(function() {
return encrypt(this);
});
});
//based on https://github.com/encrypt-to/secure.contactform.php
/* The MIT License (MIT)
Copyright (c) 2013 Jan Wiegelmann
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
function encrypt() {
if (window.crypto && window.crypto.getRandomValues) {
var message = document.getElementById("message");
if (message.value.indexOf("-----BEGIN PGP MESSAGE-----") !== -1 && message.value.indexOf("-----END PGP MESSAGE-----") !== -1) {
// encryption done
} else {
var pub_key = openpgp.key.readArmored(document.getElementById("pubkey").innerHTML).keys[0];
var plaintext = message.value;
var ciphertext = openpgp.encryptMessage([pub_key], plaintext);
message.value = ciphertext;
return true;
}
} else {
switch (getLanguage()) {
case "de":
alert("Fehler: Ihr Browser wird nicht unterstützt. Bitte installieren Sie einen aktuellen Browser wie z.B. Mozilla Firefox.");
break;
case "en":
alert("Error: Your browser is not supported. Please install an up to date browser like Mozilla Firefox.");
break;
case "es":
// alert(""); TODO
break;
}
return false;
}
}
function getLanguage() {
var metaData = document.getElementsByTagName('meta');
for (var m in metaData) {
if (metaData[m]["httpEquiv"] == "language") {
return metaData[m]["content"];
}
}
}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
$(document).ready(function() {
// Wenn LocalStorage verfügbar ist, geben wir die Möglichkeit die Einstellungen dort zu speichern
tickOptions();
if (localStorage) {
$("#save").removeClass("hidden");
$("#save").click(function() {
localStorage.setItem("pers", true);
$("input[type=checkbox]:checked, input[type=hidden]").each(function(el) {
localStorage.setItem($(this).attr("name"), $(this).val());
});
$("select").each(function(el) {
localStorage.setItem($(this).attr("name"), $(this).val());
});
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);
}
});
$("#unten").click(function() {
$("#settings-form").append("<input type=\"hidden\" name=\"usage\" value=\"once\">");
switch (getLanguage()) {
case "de":
alert("Auf der folgenden Startseite sind Ihre Einstellungen nun einmalig gespeichert. Nach Ihrer ersten Suche sind diese wieder verloren. Wenn Sie diese speichern möchten, können Sie sich allerdings ein Lesezeichen für die generierte Startseite einrichten.");
break;
case "en":
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.");
break;
case "es":
// alert(""); TODO
break;
}
});
$("#plugin").click(function() {
$("form").attr('action', $("#save").attr("data-href") + '#plugin-modal');
switch (getLanguage()) {
case "de":
alert("Ihr Browserplugin mit den persönlichen Sucheinstellungen wurde generiert. Folgen Sie bitte der Anleitung auf der folgenden Seite um es zu installieren. Beachten Sie: Zuvor sollten Sie ein eventuell bereits installiertes MetaGer-Plugin entfernen.");
break;
case "en":
alert("Your browser plugin with personal settings was generated. Please follow the instructions on the following page to install it. Notice that beforehand you might have to delete a former MetaGer plugin.");
break;
case "es":
// alert(""); TODO
break;
}
});
$("#settings-focus").val("angepasst");
});
function tickOptions() {
if (localStorage && localStorage.getItem("pers")) {
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
if (key.startsWith("param_")) {
if ($("input[name=" + key + "]").length) {
$("input[name=" + key + "]").attr("checked", "");
} else {
$("select[name=" + key + "] > option[value=" + value + "]").attr("selected", true);
}
}
}
} else {
$("div.web input").attr("checked", true);
}
}
function getLanguage() {
var metaData = document.getElementsByTagName('meta');
for (var m in metaData) {
if (metaData[m]["httpEquiv"] == "language") {
return metaData[m]["content"];
}
}
}
\ No newline at end of file
{
"css/themes/default.css": "css/themes/default-96c67ed5cb.css",
"js/all.js": "js/all-9800180b96.js",
"js/quicktips.js": "js/quicktips-34d41bc58a.js"
"js/editLanguage.js": "js/editLanguage-7a1cbfb2ba.js",
"js/kontakt.js": "js/kontakt-de49d68db3.js",
"js/scriptResultPage.js": "js/scriptResultPage-95d76cf16b.js",
"js/scriptStartPage.js": "js/scriptStartPage-aa04e8e4ae.js",
"js/settings.js": "js/settings-6ff0eab621.js",
"js/widgets.js": "js/widgets-866379dd63.js"
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ input[type=text]:focus, textarea:focus, input[type=email]:focus, input[type=tel]
-webkit-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
-moz-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
border: 1px solid <?=$colorRGBA?>;
// border-color: <?=$colorRGBA?>;
}
#mglogo > a {
background-image: linear-gradient(<?=$color?> 0%, <?=$color?> 250%);
......
......@@ -6983,28 +6983,6 @@ Mixed
#sponsors h2 {
font-size: 1.5em;
}
#foki label > span {
margin-right: 5px;
}
#foki label span {
background-color: transparent;
}
#foki input {
visibility: hidden;
}
#foki input:checked + label {
font-weight: bold;
background-color: #e3e3e3;
}
#foki input + label {
border-radius: 4px;
padding: 7px 20px;
font-weight: normal;
}
#foki input + label:hover {
cursor: pointer;
background-color: #f6f6f6;
}
#color-chooser a {
display: block;
width: 50px;
......@@ -7211,9 +7189,6 @@ By Class
.bold {
font-weight: bold;
}
.settings-btn {
margin-top: 25px;
}
.fokus-category {
font-size: 20px;
}
......@@ -7867,6 +7842,72 @@ footer a {
#anpassen-label a {
color: #333;
}
.focus {
margin: 0px;
}
.focus ~ .focus {
margin-left: 10px;
}
#foki input + .custom-focus-label {
border-radius: 7px 0px 0px 7px;
}
#foki input + .custom-focus-label + .custom-focus-edit {
margin-left: 5px;
display: inline-block;
border-radius: 0px 7px 7px 0px;
}
#foki {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
}
#foki label > span {
margin-right: 5px;
}
#foki label span {
background-color: transparent;
}
#foki input {
visibility: hidden;
}
.focus-radio:checked + .focus-label,
.focus-radio:checked + .focus-label + .focus-edit {
background-color: #e3e3e3;
}
.focus-label,
.focus-edit {
margin: 0px;
border-radius: 7px;
padding: 7px;
font-weight: normal;
}
.focus:hover .focus-label,
.focus:hover .focus-edit {
cursor: pointer;
background-color: #e3e3e3;
}
#addFocusBtn {
margin-left: 10px;
}
#settings-btn {
margin-left: auto;
}
#settings-btn > * {
vertical-align: middle;
}
#settingsButtons {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
}
#settingsButtons a,
#settingsButtons input {
margin-top: 25px;
}
#settings-abort-btn {
color: white;
margin-right: auto;
}
/*input[type=text]:focus, textarea:focus, input[type=email]:focus, input[type=tel]:focus {
outline-color: rgb(255, 128, 0);
-webkit-box-shadow: 0px 0px 2px 2px rgba(255, 128, 0, 1);
......
This diff is collapsed.
$(document).ready(function() {
botProtection();
});
function botProtection() {
if ($("meta[name=pqr]").length > 0) {
var link = atob($("meta[name=pqr]").attr("content"));
var hash = $("meta[name=pq]").attr("content");
document.location.href = link + "&bot=" + hash;
}
}
\ No newline at end of file
$(document).ready(function() {
$(".hint").tooltip();
$(".language-text-area").each(function() {
auto_grow(this);
});
$(".language-text-area").keyup(function() {
auto_grow(this);
});
});
function auto_grow(element) {
element.style.height = "5px";
element.style.height = (element.scrollHeight + 10) + "px";
}
\ No newline at end of file
$(document).ready(function() {
switch (getLanguage()) {
case "de":
$(".encrypt-btn").html("Verschlüsseln und senden");
break;
case "en":
$(".encrypt-btn").html("encrypt and send");
break;
case "es":
// $(".encrypt-btn").html(""); TODO
break;
}
$(".contact").submit(function() {
return encrypt(this);
});
});
//based on https://github.com/encrypt-to/secure.contactform.php
/* The MIT License (MIT)
Copyright (c) 2013 Jan Wiegelmann
......@@ -43,22 +59,6 @@ function encrypt() {
return false;
}
}
$(document).ready(function() {
switch (getLanguage()) {
case "de":
$(".encrypt-btn").html("Verschlüsseln und senden");
break;
case "en":
$(".encrypt-btn").html("encrypt and send");
break;
case "es":
// $(".encrypt-btn").html(""); TODO
break;
}
$(".contact").submit(function() {
return encrypt(this);
});
});
function getLanguage() {
var metaData = document.getElementsByTagName('meta');
......
This diff is collapsed.
$(document).ready(function() {
getDocumentReadyForUse($("#foki > li.active > a").attr("aria-controls"));
$('iframe').iFrameResize();
botProtection();
createCustomFocuses();
var focus = $("#foki > li.active > a").attr("aria-controls");
var custom = $("#foki > li.active").hasClass("custom-focus-tab-selector");
getDocumentReadyForUse(focus, custom);
});
function tabs() {
//return;
$("#foki > li.tab-selector > a").each(function() {
if($(this).attr("target") != "_blank") {
if ($(this).attr("target") != "_blank") {
$(this).attr("href", "#" + $(this).attr("aria-controls"));
$(this).attr("role", "tab");
$(this).attr("data-toggle", "tab");
......@@ -22,7 +22,6 @@ function tabs() {
$("#" + fokus + "TabSelector").attr("data-loaded", "1");
$("#" + fokus).html(data);
$("input[name=focus]").val($("#foki li.active a").attr("aria-controls"));
$('iframe').iFrameResize();
getDocumentReadyForUse(fokus);
});
} else {
......@@ -31,16 +30,19 @@ function tabs() {
});
}
function getDocumentReadyForUse(fokus) {
function getDocumentReadyForUse(fokus, custom = false) {
clickLog();
popovers();
if (fokus === "bilder") imageLoader();
if (custom) initialLoadContent(fokus);
//pagination();
tabs();
theme();
fokiChanger();
pluginInfo();
productWidget();
$('iframe:not(.resized)').iFrameResize();
$('iframe').addClass("resized");
}
function pluginInfo() {
......@@ -215,14 +217,6 @@ function fokiChanger() {
});
})(jQuery);
function botProtection() {
if ($("meta[name=pqr]").length > 0) {
var link = atob($("meta[name=pqr]").attr("content"));
var hash = $("meta[name=pq]").attr("content");
document.location.href = link + "&bot=" + hash;
}
}
function productWidget() {
var isMobile = false; //initiate as false
// device detection
......@@ -315,4 +309,192 @@ function productWidget() {
});
}
$(".lightSliderContainer").removeClass("hidden");
}
/**
* Creates focus tab and tab selector for every stored focus in local storage
*/
function createCustomFocuses() {
for (var key in localStorage) {
if (key.startsWith("focus_")) {
var focus = loadFocusById(key);
var active = false;
if (getActiveFocusId() === getIdFromName(focus.name)) {
active = true;
}
addFocus(focus, active);
addTab(focus, active);
}
}
}
/**
* Adds a focuses tab selector to the tab selector section
*
* @if( $metager->getFokus() === "produktsuche" )
* <li id="produktsucheTabSelector" class="active tab-selector" role="presentation" data-loaded="1">
* <a aria-controls="produktsuche" data-href="#produktsuche" href="#produktsuche">
* <span class='glyphicon glyphicon-shopping-cart'></span>
* <span class="hidden-xs">{{ trans('index.foki.produkte') }}</span>
* </a>
* </li>
* @else
* <li id="produktsucheTabSelector" class="tab-selector" role="presentation" data-loaded="0">
* <a aria-controls="produktsuche" data-href="{!! $metager->generateSearchLink('produktsuche') !!}" href="{!! $metager->generateSearchLink('produktsuche', false) !!}">
* <span class='glyphicon glyphicon-shopping-cart'></span>
* <span class="hidden-xs">{{ trans('index.foki.produkte') }}</span>
* </a>
* </li>
* @endif