Commit 39df8348 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '1153-flip-some-bits-minor-style-fixes' into 'development'

Resolve "Flip some bits: minor style fixes"

Closes #1153

See merge request !1916
parents 34d9981e a53e95c4
......@@ -188,11 +188,11 @@ class RequestFetcher extends Command
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERAGENT => $job["useragent"],
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CONNECTTIMEOUT => 2,
CURLOPT_CONNECTTIMEOUT => 8,
CURLOPT_MAXCONNECTS => 500,
CURLOPT_LOW_SPEED_LIMIT => 50000,
CURLOPT_LOW_SPEED_TIME => 5,
CURLOPT_TIMEOUT => 7,
CURLOPT_LOW_SPEED_TIME => 10,
CURLOPT_TIMEOUT => 10,
));
if (!empty($job["curlopts"])) {
......@@ -201,7 +201,7 @@ class RequestFetcher extends Command
if (!empty($this->proxyhost) && !empty($this->proxyport)) {
curl_setopt($ch, CURLOPT_PROXY, $this->proxyhost);
if(!empty($this->proxyuser) && !empty($this->proxypassword)){
if (!empty($this->proxyuser) && !empty($this->proxypassword)) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxyuser . ":" . $this->proxypassword);
}
curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxyport);
......@@ -228,6 +228,6 @@ class RequestFetcher extends Command
public function sig_handler($sig)
{
$this->shouldRun = false;
echo("Terminating Process\n");
echo ("Terminating Process\n");
}
}
......@@ -6,6 +6,7 @@ namespace App\Models;
/* Die Klasse Result sammelt alle Informationen über ein einzelnes Suchergebnis.
* Die Results werden von den Suchmaschinenspezifischen Parser-Skripten erstellt.
*/
class Result
{
public $provider; # Die Engine von der das Suchergebnis kommt
......@@ -20,7 +21,7 @@ class Result
public $sourceRank; # Das Ranking für dieses Suchergebnis von der Seite, die es geliefert hat (implizit durch Ergebnisreihenfolge: 20 - Position in Ergebnisliste)
public $partnershop; # Ist das Ergebnis von einem Partnershop? (bool)
public $image; # Ein Vorschaubild für das Suchergebnis (als URL)
public $imageDimensions; # Ein Array in welchem wenn verfügbar Breite/Höhe des Bildes gespeichert sind ["width" => ..., "height" => ...]
public $proxyLink; # Der Link für die Seite über unseren Proxy-Service
public $engineBoost = 1; # Der Boost für den Provider des Suchergebnisses
public $valid = true; # Ob das Ergebnis noch gültig ist (bool)
......@@ -78,6 +79,7 @@ class Result
$this->rank = 0;
$this->partnershop = isset($additionalInformation["partnershop"]) ? $additionalInformation["partnershop"] : false;
$this->image = isset($additionalInformation["image"]) ? $additionalInformation["image"] : "";
$this->imageDimensions = isset($additionalInformation["imagedimensions"]) ? $additionalInformation["imagedimensions"] : [];
$this->price = isset($additionalInformation["price"]) ? $additionalInformation["price"] : 0;
$this->price_text = $this->price_to_text($this->price);
$this->additionalInformation = $additionalInformation;
......@@ -186,7 +188,8 @@ class Result
$tmpEingabe = preg_replace($regex, "", $tmpEingabe);
}
foreach (str_split($tmpEingabe) as $char) {
if (!$char
if (
!$char
|| !$tmpEingabe
|| strlen($tmpEingabe) === 0
|| strlen($char) === 0
......@@ -246,8 +249,10 @@ class Result
public function isValid(\App\MetaGer $metager)
{
# Perönliche Host und Domain Blacklist
if (in_array(strtolower($this->strippedHost), $metager->getUserHostBlacklist())
|| in_array(strtolower($this->strippedDomain), $metager->getUserDomainBlacklist())) {
if (
in_array(strtolower($this->strippedHost), $metager->getUserHostBlacklist())
|| in_array(strtolower($this->strippedDomain), $metager->getUserDomainBlacklist())
) {
return false;
}
......@@ -256,7 +261,6 @@ class Result
if (strpos(strtolower($this->link), $word)) {
return false;
}
}
# Allgemeine URL und Domain Blacklist
......@@ -273,7 +277,7 @@ class Result
}
// Possibly remove description
if($this->isDescriptionBlackListed($metager)){
if ($this->isDescriptionBlackListed($metager)) {
$this->descr = "";
}
......@@ -324,12 +328,12 @@ class Result
if (($this->strippedHost !== "" && (in_array($this->strippedHost, $metager->getDomainBlacklist()) ||
in_array($this->strippedLink, $metager->getUrlBlacklist()))) ||
($this->strippedHostAnzeige !== "" && (in_array($this->strippedHostAnzeige, $metager->getDomainBlacklist()) ||
in_array($this->strippedLinkAnzeige, $metager->getUrlBlacklist())))) {
in_array($this->strippedLinkAnzeige, $metager->getUrlBlacklist())))
) {
return true;
} else {
return false;
}
}
public function isDescriptionBlackListed(\App\MetaGer $metager)
......@@ -381,9 +385,9 @@ class Result
$proxyUrl = "https://proxy.metager.de/";
if(!empty($parts["host"])){
if (!empty($parts["host"])) {
$proxyUrl .= $parts["host"];
if(!empty($parts["path"])){
if (!empty($parts["path"])) {
$proxyUrl .= "/" . rawurlencode(trim($parts["path"], "/"));
}
}
......@@ -490,7 +494,8 @@ class Result
*
* @return Sanitized version of the text
*/
private function sanitizeText($text){
private function sanitizeText($text)
{
$target = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"];
$specialList = [
'serifBold' => ['𝐚', '𝐛', '𝐜', '𝐝', '𝐞', '𝐟', '𝐠', '𝐡', '𝐢', '𝐣', '𝐤', '𝐥', '𝐦', '𝐧', '𝐨', '𝐩', '𝐪', '𝐫', '𝐬', '𝐭', '𝐮', '𝐯', '𝐰', '𝐱', '𝐲', '𝐳', '𝐀', '𝐁', '𝐂', '𝐃', '𝐄', '𝐅', '𝐆', '𝐇', '𝐈', '𝐉', '𝐊', '𝐋', '𝐌', '𝐍', '𝐎', '𝐏', '𝐐', '𝐑', '𝐒', '𝐓', '𝐔', '𝐕', '𝐖', '𝐗', '𝐘', '𝐙', '𝟎', '𝟏', '𝟐', '𝟑', '𝟒', '𝟓', '𝟔', '𝟕', '𝟖', '𝟗', '❗', '❓', '.', ',', '"', "'"],
......
......@@ -34,13 +34,18 @@ class BingBilder extends Searchengine
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"}, $this->engine->homepage,
$this->engine->{"display-name"},
$this->engine->homepage,
$this->counter,
['image' => $image]
[
'image' => $image,
'imagedimensions' => [
"width" => $result->width,
"height" => $result->height
]
]
);
}
} catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:");
Log::error($e->getMessage());
......@@ -64,12 +69,50 @@ class BingBilder extends Searchengine
$newEngine->{"get-parameter"}->offset = $nextOffset;
$next = new BingBilder($this->name, $newEngine, $metager);
$this->next = $next;
} catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:");
Log::error($e->getMessage());
return;
}
}
public static function generateThumbnailUrl(\App\Models\Result $result)
{
$url = $result->image;
// all images get cropped to a width of 400 px
// We will calculate the height after cropping
// All Images in a row get 250px
// If the height after cropping is a multiple of that plus the gap between rows
// we will allow the image to span up to three rows
$newWidth = 400;
$newHeight = 250;
$heightMultiplier = 1; // Can be 1..3 in the end
$gapPixels = 8;
$width = $result->imageDimensions["width"];
$height = $result->imageDimensions["height"];
$heightAfterCrop = $height * (400 / $width);
$heightMultiplier = max(1, min(3, floor($heightAfterCrop / 250)));
$newHeight = $newHeight * $heightMultiplier + (($heightMultiplier - 1) * $gapPixels);
$requestDataBing = [
"w" => $newWidth,
"h" => $newHeight,
"c" => 7, // Smart Cropping
];
$requestDataBing = http_build_query($requestDataBing, "", "&", PHP_QUERY_RFC3986);
$url .= "&" . $requestDataBing;
$requestData = [];
$requestData["url"] = $url;
$link = action('Pictureproxy@get', $requestData);
return [
"link" => $link,
"height-multiplier" => $heightMultiplier
];
}
}
......@@ -2,7 +2,7 @@
return [
'head.1' => 'MetaGer Apps',
'disclaimer.1' => 'Aktuell können wir unsere Apps nur für Android Geräte zur Verfügung stellen. Apple macht es uns leider zu schwer. Wir bitten hierfür um Verständnis.',
'disclaimer.1' => 'Aktuell können wir unsere Apps nur für Android Geräte zur Verfügung stellen.',
'head.2' => 'MetaGer App',
'metager.1' => 'Diese App bringt die volle Power unserer Suchmaschine auf ihr Smartphone. Durchsuchen Sie das Internet unter Wahrung ihrer Privatsphäre mit nur einem Fingerwisch.',
'metager.2' => 'Sie können die App für unsere Suche entweder über F-Droid oder den Google Playstore installieren, oder sie datengeschützt manuell von unserem Server auf ihrem Smartphone installieren.',
......
<?php
return [
'headline.1' => 'Ihre Spende für SUMA-EV und MetaGer',
'headline.1' => 'Ihre Spende',
'headline.2' => 'Mit Ihrer Spende unterstützen Sie den Erhalt und die Weiterentwicklung der unabhängigen Suchmaschine metager.de und die Arbeit des gemeinnützigen Trägervereins SUMA-EV. <a href=":aboutlink" rel="noopener" target=_blank>Mehr erfahren</a> und <a href=":beitrittlink" target="_blank" rel="noopener">Mitglied werden.</a>.',
'headline.3' => 'Welchen Betrag möchten Sie spenden?',
......
......@@ -2,7 +2,7 @@
return [
"head.1" => "MetaGer Apps",
"disclaimer.1" => "At this time we only have an Android version of our App. Unfortunately Apple makes life difficult for us. Thank you for your understanding.",
"disclaimer.1" => "At this time we only have an Android version of our App.",
"head.2" => "MetaGer App",
"metager.1" => "This App brings the full Metager power to your smartphone. Search the web with one touch while preserving your privacy.",
"metager.2" => "There are two ways to get our App: install via the Google Playstore or (better for your privacy) get it directly from our server.",
......
<?php
return [
"headline.1" => "Your Donation for MetaGer to SUMA-EV",
"headline.1" => "Your Donation",
"headline.2" => 'With your donation: you support maintenance and development of the independent search engine metager.org and its supporting association SUMA-EV. <a href=":aboutlink" rel="noopener" target=_blank>Read more</a> and <a href=":beitrittlink" target="_blank" rel="noopener">become a member.</a>',
'headline.3' => 'How much would you like to donate?',
......
......@@ -2,7 +2,7 @@
return [
"head.1" => "Aplicaciones MetaGer",
"disclaimer.1" => "Actualmente solo podemos proporcionar nuestras aplicaciones para dispositivos Android. Desafortunadamente, Apple nos lo pone demasiado difícil. Rogamos su comprensión.",
"disclaimer.1" => "Actualmente solo podemos proporcionar nuestras aplicaciones para dispositivos Android.",
"head.2" => "Aplicación MetaGer",
"metager.1" => "Con esta aplicación, obtiene toda la potencia de nuestro motor de búsqueda en su smartphone.\r\nBusque en Internet con solo deslizar un dedo mientras que mantiene su privacidad.",
"metager.2" => "Puede instalar la aplicación para nuestra búsqueda a través de Google Playstore o instalarla manualmente desde nuestro servidor en su smartphone, protegida de datos.",
......
<?php
return [
"headline.1" => "Su donación para SUME-EV y MetaGer",
"headline.1" => "Su donación",
"headline.2" => "Con su donación, apoya el mantenimiento y desarrollo del motor de búsqueda independiente metager.de y la labor de la asociación patrocinadora sin fines de lucro SUMA-EV. \r\n<a href=\":aboutlink\" rel=\"noopener\" target=_blank>Obtenga más información</a> y <a href=\":beitrittlink\" target=\"_blank\" rel=\"noopener\"> conviértase en miembro. </a>.",
"headline.3" => "¿Qué cantidad desea donar?",
"headline.4" => "¿Con qué frecuencia desea donar?",
......
......@@ -5,7 +5,9 @@
@body-background-color-mobile: @background-color-mobile;
@a-hover-color: red;
html, body, * {
html,
body,
* {
font-family: @metager-font;
}
......@@ -36,7 +38,8 @@ body {
flex-direction: column;
margin: 0;
font-size: 1.0em;
@media(max-width: @screen-mobile){
@media(max-width: @screen-mobile) {
background-color: @body-background-color-mobile
}
}
......@@ -47,9 +50,15 @@ body {
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 50px;
margin-top: 5rem;
padding: 0px;
@media(min-width: @screen-mobile) {
padding: 0px 8px;
}
overflow: hidden;
main {
width: 100%;
max-width: 1000px;
......@@ -64,15 +73,18 @@ body {
/* Scrollbox Style */
@scrollfade-color: white;
.scrollbox {
position: relative;
width: 100%;
max-width: @results-width-max;
.scrollfade-right {
background: -webkit-gradient(linear, right top, left top, from(@scrollfade-color), color-stop(fade(@scrollfade-color, 80%)), to(fade(@scrollfade-color, 0%)));
background: linear-gradient(to left, @scrollfade-color, fade(@scrollfade-color, 80%), fade(@scrollfade-color, 0%));
right: 1px;
}
.search-option-frame {
position: relative;
}
......@@ -81,13 +93,11 @@ body {
/* General font sizing */
@default-font-size: 15px;
.first-last-child-margin-fix() {
&:first-child {
margin-top: 0px;
}
&:last-child {
margin-bottom: 0px;
}
}
h1 {
......@@ -105,7 +115,7 @@ h3 {
.first-last-child-margin-fix;
}
.static-page-header{
.static-page-header {
text-align: center;
}
......@@ -137,9 +147,11 @@ body {
a {
font-size: 1em;
color: @link-color;
&:visited {
color: @link-color;
}
&:hover {
text-decoration: none;
color: @a-hover-color;
......@@ -162,23 +174,28 @@ i.fa {
#startpage-logo {
.logo;
border: 0;
display: flex;
justify-content: center;
margin: 0px 0px 45px 0px;
white-space: nowrap;
text-align: center;
@media(max-width: @screen-mobile){
@media(max-width: @screen-mobile) {
margin-bottom: 25px;
}
&>a {
.logo;
display: block;
width: fit-content;
text-decoration: none;
font-size: 2.7em;
@media(max-width: @screen-mobile) {
font-size: 2em;
}
>img {
width: 4.6em;
}
......@@ -187,6 +204,7 @@ i.fa {
#subpage-logo {
padding: 16px 0 5px 0px;
.navbar-brand {
.noprint;
line-height: 100% !important;
......@@ -197,10 +215,13 @@ i.fa {
position: absolute;
z-index: 5;
left: 10px;
h1 {
border: 0;
.logo;
font-size: 1.6em;
margin: 0;
>img {
width: 4.8em;
}
......@@ -211,6 +232,7 @@ i.fa {
/* Links that look like text */
.mutelink {
&,
&:hover,
&:active,
......@@ -224,21 +246,27 @@ i.fa {
summary {
cursor: pointer;
&::-webkit-details-marker {
display: none;
}
&::-moz-details-marker {
display: none;
}
&::-ms-details-marker {
display: none;
}
&::-o-details-marker {
display: none;
}
&::details-marker {
display: none;
}
&:focus {
outline: none;
}
......@@ -252,11 +280,13 @@ summary {
*[data-tooltip] {
position: relative;
&:hover {
&:after {
opacity: 1;
}
}
&:after {
content: attr(data-tooltip);
position: absolute;
......@@ -279,19 +309,25 @@ summary {
transition: opacity 0.3s ease;
text-transform: initial; // Resets specific styles
}
&.hide-tooltip-on-resultpage:after {
/* Auf kleinen Bildschirmen wird der Tooltip nicht angezeigt */
@media (max-width: 700px) {
display: none;
}
}
&.delayed:after { text-align: center;
&.delayed:after {
text-align: center;
transition-delay: 0.5s;
}
&.delayed-soft:after {
transition-delay: 0.2s;
}
&.delayed-strong:after {
transition-delay: 1s;
}
......@@ -305,6 +341,7 @@ summary {
margin: 0;
padding: 0;
float: left;
@media (max-width: @screen-mobile) {
width: 100%;
}
......@@ -365,7 +402,8 @@ li.nodot {
button {
border: none;
background-color: transparent;
i{
i {
filter: invert(@icon-color);
}
}
......@@ -375,6 +413,7 @@ button {
.dotlist {
list-style-type: disc;
text-align: left;
li {
margin-bottom: 5px !important;
}
......@@ -398,6 +437,7 @@ address {
label a {
color: inherit;
&:hover {
text-decoration: none;
color: inherit;
......@@ -416,8 +456,15 @@ label a {
align-items: center;
}
#impressum, #kontakt, #team, #about {
.card-heavy {
#impressum,
#kontakt,
#team,
#about {
.card {
margin: 8px 0;
}
}
main {
row-gap: 8px;
}
\ No newline at end of file
.card,
.card-medium {
.card {
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.12), 0px 0px 1px 0px rgba(0, 0, 0, 0.24);
border: 1px solid @border-color;
background-color: @card-background-color;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
padding: 8px;
margin: 4px;
overflow: auto;
}
padding: .5rem;
.card-heavy {
.card;
box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.12), 4px 0px 5px 0px rgba(0, 0, 0, 0.24);
margin: 8px;
overflow: auto;
}
margin-top: 4px;
margin-bottom: 4px;
.card-light {
.card;
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.12), 0px 0px 1px 0px rgba(0, 0, 0, 0.24);
margin: 4px;
overflow: auto;
@media(min-width: @screen-mobile) {
padding: .8rem;
box-shadow: none;
background-color: inherit;
border: 0;
}
@media(min-width: @screen-small) {
padding: 1rem;
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
font-weight: bold;
}
.section {
.card-light;
.card;
margin: 0;
}
......
.hilfe,
.faq {
section {
.card-light;
@media(max-width: @screen-medium){
.card-medium;
.card;
@media(max-width: @screen-medium) {
.card;
}
@media(max-width: @screen-small){
.card-heavy;
@media(max-width: @screen-small) {
.card;
}
margin: 4px 0;
h3 {
border-bottom: 1px solid #aaa;
}
.search-example {
border: 1px solid #aaa;
background-color: @background-color;
border-radius: 5px;
padding: 10px;
}
div.image-container {
align-items: center;
justify-content: center;
img {
margin: 10px 0;
padding: 8px;
......@@ -29,14 +32,17 @@
}
}
}
.fake-result {
*:hover {
overflow: visible !important;
}
.result-footer {
overflow: hidden;
align-items: center;
}
.open-result-options label {
padding: 10px;
border: 2px dashed red;
......