Commit 462494eb authored by Karl's avatar Karl
Browse files

Merged newest Development Branch

parents b4c560db 23d5829e
......@@ -45,7 +45,7 @@ class MetaGerSearch extends Controller
->with('r', $redirect);
}
public function quicktips(Request $request)
public function quicktips(Request $request, MetaGer $metager)
{
$q = $request->input('q', '');
......@@ -90,34 +90,44 @@ class MetaGerSearch extends Controller
# Wetter
try {
if (App::isLocale('en')) {
$url = "http://api.openweathermap.org/data/2.5/weather?type=like&units=metric&lang=en&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
$url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=en&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
} else {
$url = "http://api.openweathermap.org/data/2.5/weather?type=like&units=metric&lang=de&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
$url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=de&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap");
}
$result = json_decode($this->get($url), true);
$weather = [];
$weather["title"] = "Wetter in " . $result["name"];
$weather["URL"] = "http://openweathermap.org/city/" . $result["id"];
$summary = '<b class="detail-short">' . $result["main"]["temp"] . " °C, " . $result["weather"][0]["description"] . "</b>";
$details = '<table class="table table-condensed"><tr><td>Temperatur</td><td>' . $result["main"]["temp_min"] . " bis " . $result["main"]["temp_max"] . " °C</td></tr>";
$details .= "<tr><td>Druck</td><td>" . $result["main"]["pressure"] . " hPa</td></tr>";
$details .= "<tr><td>Luftfeuchtigkeit</td><td>" . $result["main"]["humidity"] . " %</td></tr>";
$details .= "<tr><td>Wind</td><td>" . $result["wind"]["speed"] . " m/s, " . $result["wind"]["deg"] . "°</td></tr>";
$details .= "<tr><td>Bewölkung</td><td>" . $result["clouds"]["all"] . " %</td></tr>";
if (isset($result->rain)) {
$details .= " | Regen letzte drei Stunden: " . $result["rain"]["3h"] . " h";
$result = json_decode($this->get($url), true);
$searchWords = explode(' ', $q);
$within = false;
foreach ($searchWords as $word) {
if (stripos($result["name"], $word) !== false) {
$within = true;
}
}
if ($within) {
$weather = [];
$weather["title"] = "Wetter in " . $result["name"];
$weather["URL"] = "http://openweathermap.org/city/" . $result["id"];
$summary = '<b class="detail-short">' . $result["main"]["temp"] . " °C, " . $result["weather"][0]["description"] . "</b>";
$details = '<table class="table table-condensed"><tr><td>Temperatur</td><td>' . $result["main"]["temp_min"] . " bis " . $result["main"]["temp_max"] . " °C</td></tr>";
$details .= "<tr><td>Druck</td><td>" . $result["main"]["pressure"] . " hPa</td></tr>";
$details .= "<tr><td>Luftfeuchtigkeit</td><td>" . $result["main"]["humidity"] . " %</td></tr>";
$details .= "<tr><td>Wind</td><td>" . $result["wind"]["speed"] . " m/s, " . $result["wind"]["deg"] . "°</td></tr>";
$details .= "<tr><td>Bewölkung</td><td>" . $result["clouds"]["all"] . " %</td></tr>";
if (isset($result->rain)) {
$details .= " | Regen letzte drei Stunden: " . $result["rain"]["3h"] . " h";
}
$details .= "</table>";
$weather["summary"] = $summary;
$weather["details"] = $details;
$weather["gefVon"] = "von <a href = \"https://openweathermap.org\" target=\"_blank\" rel=\"noopener\">Openweathermap</a>";
$requestData = [];
$requestData["url"] = "http://openweathermap.org/img/w/";
$weather["image"] = action('Pictureproxy@get', $requestData) . $result["weather"][0]["icon"] . ".png";
$weather["image-alt"] = $result["weather"][0]["main"];
$mquicktips[] = $weather;
}
$details .= "</table>";
$weather["summary"] = $summary;
$weather["details"] = $details;
$weather["gefVon"] = "von <a href = \"https://openweathermap.org\" target=\"_blank\" rel=\"noopener\">Openweathermap</a>";
$requestData = [];
$requestData["url"] = "http://openweathermap.org/img/w/";
$weather["image"] = action('Pictureproxy@get', $requestData) . $result["weather"][0]["icon"] . ".png";
$weather["image-alt"] = $result["weather"][0]["main"];
$mquicktips[] = $weather;
} catch (\ErrorException $e) {
}
......@@ -177,7 +187,7 @@ class MetaGerSearch extends Controller
}
# Spendenaufruf:
$mquicktips[] = ['title' => trans('quicktip.spende.title'), 'summary' => trans('quicktip.spende.descr'), 'URL' => LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "spendenaufruf")];
//$mquicktips[] = ['title' => trans('quicktip.spende.title'), 'summary' => trans('quicktip.spende.descr'), 'URL' => LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "spendenaufruf")];
return view('quicktip')
->with('spruch', $spruch)
......
......@@ -28,7 +28,7 @@ class StartpageController extends Controller
$focusPages = [];
$theme = "default";
foreach ($request->all() as $key => $value) {
if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_tab') {
if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_tab' && $key !== 'param_maps') {
$focusPages[] = str_replace('param_', '', $key);
}
if ($key === 'param_theme') {
......@@ -36,6 +36,8 @@ class StartpageController extends Controller
}
}
$maps = $request->input('param_maps', 'on');
$agent = new Agent();
$browser = $agent->browser();
......@@ -51,7 +53,8 @@ class StartpageController extends Controller
->with('focusPages', $focusPages)
->with('browser', $browser)
->with('navbarFocus', 'suche')
->with('theme', $theme);
->with('theme', $theme)
->with('maps', $maps);
}
public function loadPage($subpage)
......@@ -158,4 +161,19 @@ class StartpageController extends Controller
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);
}
}
......@@ -44,6 +44,8 @@ class MetaGer
protected $mobile;
protected $resultCount;
protected $sprueche;
protected $maps;
protected $newtab;
protected $domainsBlacklisted = [];
protected $urlsBlacklisted = [];
protected $url;
......@@ -236,13 +238,16 @@ class MetaGer
if (isset($this->password)) {
# Wir bieten einen bezahlten API-Zugriff an, bei dem dementsprechend die Werbung ausgeblendet wurde:
# Aktuell ist es nur die Uni-Mainz. Deshalb überprüfen wir auch nur diese.
$password = getenv('mainz');
$eingabe = $this->eingabe;
$password = md5($eingabe . $password);
if ($this->password === $password) {
$password = getenv('mainz');
$passwordBerlin = getenv('berlin');
$eingabe = $this->eingabe;
$password = md5($eingabe . $password);
$passwordBerlin = md5($eingabe . $passwordBerlin);
if ($this->password === $password || $this->password === $passwordBerlin) {
$this->ads = [];
$this->products = [];
$this->validated = true;
$this->maps = false;
}
}
......@@ -824,6 +829,7 @@ class MetaGer
public function parseFormData(Request $request)
{
$this->request = $request;
# Sichert, dass der request in UTF-8 formatiert ist
if ($request->input('encoding', '') !== "utf8") {
# In früheren Versionen, als es den Encoding Parameter noch nicht gab, wurden die Daten in ISO-8859-1 übertragen
......@@ -871,15 +877,28 @@ class MetaGer
if ($this->lang !== "de" && $this->lang !== "en" && $this->lang !== "all") {
$this->lang = "all";
}
$this->agent = new Agent();
$this->mobile = $this->agent->isMobile();
# Sprüche
$this->sprueche = $request->input('sprueche', 'off');
if ($this->sprueche === "off") {
$this->sprueche = $request->input('sprueche', 'on');
if ($this->sprueche === "on") {
$this->sprueche = true;
} else {
$this->sprueche = false;
}
$this->maps = $request->input('maps', 'off');
if ($this->maps === "on") {
$this->maps = true;
} else {
$this->maps = false;
}
$this->newtab = $request->input('tab', 'on');
if ($this->newtab === "on") {
$this->newtab = "_blank";
} else {
$this->newtab = "_self";
}
# Theme
$this->theme = preg_replace("/[^[:alnum:][:space:]]/u", '', $request->input('theme', 'default'));
# Ergebnisse pro Seite:
......@@ -912,15 +931,6 @@ class MetaGer
$this->time = 5000;
$this->cache = "cache";
}
if ($request->has('tab')) {
if ($request->input('tab') === "off") {
$this->tab = "_blank";
} else {
$this->tab = "_self";
}
} else {
$this->tab = "_blank";
}
if ($request->has('password')) {
$this->password = $request->input('password');
}
......@@ -934,7 +944,6 @@ class MetaGer
if ($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style") {
$this->out = "html";
}
$this->request = $request;
}
public function checkSpecialSearches(Request $request)
......@@ -1219,6 +1228,14 @@ class MetaGer
return $link;
}
public function getUnFilteredLink()
{
$requestData = $this->request->except(['lang']);
$requestData['lang'] = "all";
$link = action('MetaGerSearch@search', $requestData);
return $link;
}
# Komplexe Getter
public function getHostCount($host)
......@@ -1252,9 +1269,9 @@ class MetaGer
return $this->site;
}
public function getTab()
public function getNewtab()
{
return $this->tab;
return $this->newtab;
}
public function getResults()
......@@ -1306,6 +1323,11 @@ class MetaGer
return $this->sprueche;
}
public function getMaps()
{
return $this->maps;
}
public function getCategory()
{
return $this->category;
......
......@@ -208,7 +208,6 @@ class Result
if (strpos($text, $phrase) === false) {
return false;
}
}
/* Der Host-Filter der sicherstellt,
......
......@@ -12,5 +12,7 @@ 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', 'iframeResizer.min.js' /*, 'lib/vue/app.js', 'lib/vue/bootstrap.js'*/ ]);
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'*/ ]);
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']);
});
\ No newline at end of file
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Mon, 1 Jan 2010 01:00:00 GMT"
</IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"css/themes/default.css": "css/themes/default-a9062cf83c.css",
"js/all.js": "js/all-c6c7e6229e.js",
"js/quicktips.js": "js/quicktips-34d41bc58a.js"
}
\ No newline at end of file
......@@ -254,8 +254,8 @@ th {
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../../fonts/glyphicons-halflings-regular.eot');
src: url('../../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
src: url('/fonts/glyphicons-halflings-regular.eot');
src: url('/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('/fonts/glyphicons-halflings-regular.woff') format('woff'), url('/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
......@@ -1435,7 +1435,7 @@ dt {
dd {
margin-left: 0;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.dl-horizontal dt {
float: left;
width: 160px;
......@@ -1576,12 +1576,12 @@ pre code {
}
@media (min-width: 992px) {
.container {
width: 970px;
width: 950px;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.container {
width: 1170px;
width: 1400px;
}
}
.container-fluid {
......@@ -2072,7 +2072,7 @@ pre code {
margin-left: 0%;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
......@@ -3593,7 +3593,7 @@ tbody.collapse.in {
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
......@@ -4128,12 +4128,12 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-header {
float: left;
}
......@@ -4149,7 +4149,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-collapse {
width: auto;
border-top: 0;
......@@ -4188,7 +4188,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
......@@ -4201,7 +4201,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-static-top {
border-radius: 0;
}
......@@ -4213,7 +4213,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
left: 0;
z-index: 1030;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
......@@ -4242,7 +4242,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
.navbar-brand > img {
display: block;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
......@@ -4272,7 +4272,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-toggle {
display: none;
}
......@@ -4285,7 +4285,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
@media (max-width: 864px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
......@@ -4307,7 +4307,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
background-image: none;
}
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-nav {
float: left;
margin: 0;
......@@ -4380,7 +4380,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
top: 0;
}
}
@media (max-width: 767px) {
@media (max-width: 864px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
......@@ -4388,7 +4388,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
margin-bottom: 0;
}
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-form {
width: auto;
border: 0;
......@@ -4427,14 +4427,14 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-text {
float: left;
margin-left: 15px;
margin-right: 15px;
}
}
@media (min-width: 768px) {
@media (min-width: 865px) {
.navbar-left {
float: left !important;
}
......@@ -4501,7 +4501,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
background-color: #e7e7e7;
color: #555;
}
@media (max-width: 767px) {
@media (max-width: 864px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777;
}
......@@ -4597,7 +4597,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
background-color: #080808;
color: #fff;
}
@media (max-width: 767px) {
@media (max-width: 864px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
......@@ -6545,7 +6545,7 @@ button.close {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
@media (min-width: 992px) and (max-width: 1439px) {
.visible-md {
display: block !important;
}
......@@ -6560,22 +6560,22 @@ button.close {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
@media (min-width: 992px) and (max-width: 1439px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
@media (min-width: 992px) and (max-width: 1439px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
@media (min-width: 992px) and (max-width: 1439px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.visible-lg {
display: block !important;
}
......@@ -6590,17 +6590,17 @@ button.close {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.visible-lg-inline-block {
display: inline-block !important;
}
......@@ -6615,12 +6615,12 @@ button.close {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
@media (min-width: 992px) and (max-width: 1439px) {
.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
@media (min-width: 1440px) {
.hidden-lg {
display: none !important;
}
......@@ -6690,6 +6690,52 @@ summary::details-marker {
summary {
cursor: pointer;
}
.quicktip.aufruf-winter {
border-left: 3px solid #AB2121 !important;
}
.aufruf-winter h1 {
font-size: 32px;
}
.aufruf-winter a,
.aufruf-winter a:visited {
color: #AB2121;
}
.aufruf-winter .aufruf-action-btn {
color: white!important;
background-color: #AB2121 !important;
border-color: #953535;
}
.aufruf-winter .aufruf-action-btn:hover {
background-color: #BD0D0D !important;
border-color: #953535;
}
.aufruf-winter.mg-panel {
background-image: url("/img/snowflake.svg");
background-repeat: no-repeat;
background-position: right top;
background-size: 100px 100px;
}
.new-feature.badge {
background-color: #ff8000;
}
@media (max-width: 991px) {
.aufruf-winter.mg-panel {
background-size: 60px 60px;
}