diff --git a/.gitignore b/.gitignore index 31ef0b58ceb1b067d07a9830007a1008239b977f..a43552418fdae52a0a64d542f70739c8d9719e26 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ langfiles.zip /public/js/utility.js **/*.map +/.buildpath +/.project diff --git a/.settings/.gitignore b/.settings/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f0f7c9f22d715ac10ca5a978ec67434a7183af5d --- /dev/null +++ b/.settings/.gitignore @@ -0,0 +1,2 @@ +/org.eclipse.core.resources.prefs +/org.eclipse.wst.validation.prefs diff --git a/app/Http/Controllers/MetaGerSearch.php b/app/Http/Controllers/MetaGerSearch.php index fa10a798568806bdf3aaf63fe0eb6f206bc75d49..df3a682e68532bada8d505ac3d0568685b749ab7 100644 --- a/app/Http/Controllers/MetaGerSearch.php +++ b/app/Http/Controllers/MetaGerSearch.php @@ -51,222 +51,6 @@ class MetaGerSearch extends Controller ->with('r', $redirect); } - public function quicktips(Request $request, MetaGer $metager) - { - $q = $request->input('q', ''); - $mquicktips = []; - $quicktips = []; - $spruch = ""; - - # DuckDuckGo-!bangs - try { - $placeholder = "0X0plchldr0X0"; - $searchWords = explode(" ", $q); - $dummyQuery = ""; - $realQuery = ""; - foreach ($searchWords as $index => $word) { - if ($word[0] === "!") { - $dummyQuery .= $word . " "; - } else { - $realQuery .= $word . " "; - } - } - $realQuery = rtrim($realQuery); - - if ($dummyQuery !== "") { - $dummyQuery .= $placeholder; - $url = "https://api.duckduckgo.com/?format=json&no_redirect=1&t=MetaGerDE&q=" . urlencode($dummyQuery); - - $result = json_decode($this->get($url), true); - - if (isset($result["Redirect"])) { - $bang = []; - $bang["title"] = trans('metaGerSearch.quicktips.bang.title'); - $bang["URL"] = str_replace($placeholder, urlencode(trim($realQuery)), $result["Redirect"]); - $bang["summary"] = '' . trans('metaGerSearch.quicktips.bang.buttonlabel') . " " . parse_url($bang["URL"], PHP_URL_HOST) . '…'; - $bang["gefVon"] = trans('metaGerSearch.quicktips.bang.from') . " DuckDuckGo"; - $mquicktips[] = $bang; - } - - } - } catch (\ErrorException $e) { - } - - if (APP::getLocale() === "de") { - # Spruch - $spruecheFile = storage_path() . "/app/public/sprueche.txt"; - if (file_exists($spruecheFile) && $request->has('sprueche')) { - $sprueche = file($spruecheFile); - $spruch = $sprueche[array_rand($sprueche)]; - } else { - $spruch = ""; - } - - # manuelle Quicktips: - $file = storage_path() . "/app/public/qtdata.csv"; - - if (file_exists($file) && $q !== '') { - $file = fopen($file, 'r'); - while (($line = fgetcsv($file)) !== false) { - $words = array_slice($line, 3); - $isIn = false; - foreach ($words as $word) { - $word = strtolower($word); - if (strpos($q, $word) !== false) { - $isIn = true; - break; - } - } - if ($isIn === true) { - $quicktip = array('QT_Type' => "MQT"); - $quicktip["URL"] = $line[0]; - $quicktip["title"] = $line[1]; - $quicktip["summary"] = $line[2]; - $mquicktips[] = $quicktip; - } - } - fclose($file); - } - - # Wetter - /* Derzeit Deaktiviert, da bei unseren Abfragezahlen nicht kostenlos */ - /* - try { - $url = "http://api.openweathermap.org/data/2.5/weather?type=accurate&units=metric&lang=" . APP::getLocale() . "&q=" . urlencode($q) . "&APPID=" . getenv("openweathermap"); - - $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 = '' . $result["main"]["temp"] . " °C, " . $result["weather"][0]["description"] . ""; - $details = '"; - $details .= ""; - $details .= ""; - $details .= ""; - $details .= ""; - if (isset($result->rain)) { - $details .= " | Regen letzte drei Stunden: " . $result["rain"]["3h"] . " h"; - } - $details .= "
Temperatur' . $result["main"]["temp_min"] . " bis " . $result["main"]["temp_max"] . " °C
Druck" . $result["main"]["pressure"] . " hPa
Luftfeuchtigkeit" . $result["main"]["humidity"] . " %
Wind" . $result["wind"]["speed"] . " m/s, " . $result["wind"]["deg"] . "°
Bewölkung" . $result["clouds"]["all"] . " %
"; - $weather["summary"] = $summary; - $weather["details"] = $details; - $weather["gefVon"] = "von Openweathermap"; - $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) { - - } - */ - } - - # Wikipedia Quicktip - $url = "https://" . APP::getLocale() . ".wikipedia.org/w/api.php?action=opensearch&search=" . urlencode($q) . "&limit=10&namespace=0&format=json&redirects=resolve"; - try{ - $content = $this->get($url); - }catch(\ErrorException $e){ - $content = ""; - } - $decodedResponse = json_decode($content, true); - if (isset($decodedResponse[1][0]) && isset($decodedResponse[2][0]) && isset($decodedResponse[3][0])) { - $quicktip = []; - $firstSummary = $decodedResponse[2][0]; - // Wenn es mehr als ein Ergebnis gibt - if (isset($decodedResponse[1][1])) { - // Solange noch zusätzliche Seiten vorhanden sind, füge sie der Tabelle hinzu - $details = ''; - for ($i = 1;isset($decodedResponse[1][$i]) && isset($decodedResponse[2][$i]) && isset($decodedResponse[3][$i]); $i++) { - $details .= ''; - } - $details .= '
' . $decodedResponse[1][$i] . '
'; - $quicktip["title"] = $decodedResponse[1][0]; - $quicktip["URL"] = $decodedResponse[3][0]; - $quicktip["summary"] = $decodedResponse[2][0]; - $quicktip["details"] = $details; - $quicktip['gefVon'] = trans('metaGerSearch.quicktips.wikipedia.adress'); - } else { - $quicktip["title"] = $decodedResponse[1][0]; - $quicktip["URL"] = $decodedResponse[3][0]; - $quicktip["summary"] = $decodedResponse[2][0]; - $quicktip['gefVon'] = trans('metaGerSearch.quicktips.wikipedia.adress'); - } - $quicktips[] = $quicktip; - } - $mquicktips = array_merge($mquicktips, $quicktips); - - if (APP::getLocale() === "de") { - # Dict.cc Quicktip - if (count(explode(' ', $q)) < 3) { - $url = "http://www.dict.cc/metager.php?s=" . urlencode($q); - $decodedResponse = json_decode($this->get($url), true); - if ($decodedResponse["headline"] != "" && $decodedResponse["link"] != "") { - $quicktip = []; - $quicktip["title"] = $decodedResponse["headline"]; - $quicktip["URL"] = $decodedResponse["link"]; - $quicktip["summary"] = implode(", ", $decodedResponse["translations"]); - $quicktip['gefVon'] = trans('metaGerSearch.quicktips.dictcc.adress'); - - if (App::isLocale('de')) { - array_unshift($mquicktips, $quicktip); - } else { - $mquicktips[] = $quicktip; - } - } - } - - # wussten Sie schon - $file = storage_path() . "/app/public/tips.txt"; - if (file_exists($file)) { - $tips = file($file); - $tip = $tips[array_rand($tips)]; - - $mquicktips[] = ['title' => trans('metaGerSearch.quicktips.tips.title'), 'summary' => $tip, 'URL' => '/tips']; - } - - # Werbelinks - $file = storage_path() . "/app/public/ads.txt"; - if (file_exists($file)) { - $ads = json_decode(file_get_contents($file), true); - $ad = $ads[array_rand($ads)]; - if (isset($ads['details'])) { - $mquicktips[] = ['title' => $ad['title'], 'summary' => $ad['summary'], 'details' => $ad['details'], 'URL' => $ad['URL']]; - } else { - $mquicktips[] = ['title' => $ad['title'], 'summary' => $ad['summary'], 'URL' => $ad['URL']]; - } - } - } - - return view('quicktip') - ->with('spruch', $spruch) - ->with('mqs', $mquicktips); - - } - - public function tips() - { - $file = storage_path() . "/app/public/tips.txt"; - $tips = []; - if (file_exists($file)) { - $tips = file($file); - } - return view('tips') - ->with('title', 'MetaGer - Tipps & Tricks') - ->with('tips', $tips); - } - public function get($url) { $ctx = stream_context_create(array('http'=>array('timeout' => 2,))); diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 51d8dc60135b927b18cf322c91b9e8ac2aeb9920..65cc6dab750986e93d84a55e1de35a4ad20a90e1 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -6,6 +6,7 @@ use App; use Illuminate\Http\Request; use Jenssegers\Agent\Agent; use Response; +use LaravelLocalization; class StartpageController extends Controller { @@ -15,20 +16,14 @@ 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_newtab' && $key !== 'param_maps' && $key !== 'param_autocomplete') { + if ($value === 'on' && $key != 'param_sprueche' && $key != 'param_newtab' && $key !== 'param_maps' && $key !== 'param_autocomplete' && $key !== 'param_lang') { $focusPages[] = str_replace('param_', '', $key); } if ($key === 'param_theme') { @@ -36,6 +31,11 @@ class StartpageController extends Controller } } + $lang = LaravelLocalization::getCurrentLocale(); + if ($lang === 'de') { + $lang = 'all'; + } + return view('index') ->with('title', trans('titles.index')) ->with('homeIcon') @@ -46,7 +46,7 @@ class StartpageController extends Controller ->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('lang', $request->input('param_lang', $lang)) ->with('resultCount', $request->input('param_resultCount', '20')) ->with('time', $request->input('param_time', '1500')) ->with('sprueche', $request->input('param_sprueche', 'on')) diff --git a/app/Models/Result.php b/app/Models/Result.php index 4da2b07ae78f405bec5c4c00665e85c92be1cb74..7ffc3150945cd4944986eebe3bf62a92e64f75f7 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -264,7 +264,7 @@ class Result * dass von jedem Host maximal 3 Links angezeigt werden. * Diese Überprüfung führen wir unter bestimmten Bedingungen nicht durch. */ - if ($metager->getSite() === "" && + if (($metager->getSite() === "" || $metager->getSite() === null) && strpos($this->strippedHost, "ncbi.nlm.nih.gov") === false && strpos($this->strippedHost, "twitter.com") === false && strpos($this->strippedHost, "www.ladenpreis.net") === false && diff --git a/app/Models/parserSkripte/Bing.php b/app/Models/parserSkripte/Bing.php index b31946faae7fa990fbacf7a053d97631f40560a7..5d94c4dc086a1c01fb4b3b16f23f87c66ff8cd46 100644 --- a/app/Models/parserSkripte/Bing.php +++ b/app/Models/parserSkripte/Bing.php @@ -4,6 +4,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; +use Log; class Bing extends Searchengine { diff --git a/app/Models/parserSkripte/Blogsearch.php b/app/Models/parserSkripte/Blogsearch.php index 3f6f16edb1728e598e1ada71ff438436d98ebc57..b35df83218003fa6fd24333f3f5cd8b5d2a5bf0d 100644 --- a/app/Models/parserSkripte/Blogsearch.php +++ b/app/Models/parserSkripte/Blogsearch.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Blogsearch extends Searchengine { diff --git a/app/Models/parserSkripte/Dailymotion.php b/app/Models/parserSkripte/Dailymotion.php index b5f1d408637779e40222c5806226dbf13045ed3b..2cc36d8d660542d253205db4de78d01e6ba78efa 100644 --- a/app/Models/parserSkripte/Dailymotion.php +++ b/app/Models/parserSkripte/Dailymotion.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Dailymotion extends Searchengine { diff --git a/app/Models/parserSkripte/Fernsehsuche.php b/app/Models/parserSkripte/Fernsehsuche.php index a1edd284cb1a4b3d7eccd1fb59e2c334345d4d6e..1c9d7045760b3810869bdecafced642a5bb08eea 100644 --- a/app/Models/parserSkripte/Fernsehsuche.php +++ b/app/Models/parserSkripte/Fernsehsuche.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Fernsehsuche extends Searchengine { diff --git a/app/Models/parserSkripte/Fess.php b/app/Models/parserSkripte/Fess.php new file mode 100644 index 0000000000000000000000000000000000000000..a691422439a4a0e263fd0f2e4bae4c43dd4ca6b9 --- /dev/null +++ b/app/Models/parserSkripte/Fess.php @@ -0,0 +1,53 @@ +response->result; + foreach ($results as $result) { + try { + $title = $result->content_title; + $link = $result->url; + $anzeigeLink = $link; + $descr = $result->content_description; + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } catch (\ErrorException $e) { + + } + } + } catch (\Exception $e) { + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); + return; + } + } +} diff --git a/app/Models/parserSkripte/Opencrawlastronomie.php b/app/Models/parserSkripte/Opencrawlastronomie.php index 4667e241ab01dbbeb1d118939ba940154bda0a26..0ffc5439c45476152effa7d08458ca9e1ded4696 100644 --- a/app/Models/parserSkripte/Opencrawlastronomie.php +++ b/app/Models/parserSkripte/Opencrawlastronomie.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Opencrawlastronomie extends Searchengine { diff --git a/app/Models/parserSkripte/Opencrawlregengergie.php b/app/Models/parserSkripte/Opencrawlregengergie.php index 92dee253ca03e4dc32ad2b4fcbf05be1417333fc..726d0fe388b3a9c7ba6d148821a0fb5f3af1b3ae 100644 --- a/app/Models/parserSkripte/Opencrawlregengergie.php +++ b/app/Models/parserSkripte/Opencrawlregengergie.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Opencrawlregengergie extends Searchengine { diff --git a/app/Models/parserSkripte/OvertureAds.php b/app/Models/parserSkripte/OvertureAds.php index dcca4fa386259957037415f489a77532d43d6e2d..386330eee74a9224558489370eca5e53b02bea4d 100644 --- a/app/Models/parserSkripte/OvertureAds.php +++ b/app/Models/parserSkripte/OvertureAds.php @@ -3,6 +3,7 @@ namespace App\Models\parserSkripte; use App\Models\Searchengine; +use Log; class OvertureAds extends Searchengine { diff --git a/app/Models/parserSkripte/Qip.php b/app/Models/parserSkripte/Qip.php index 7e818042aee0d01ef8222cf9d0b0839993af040c..0fd5f08734d2c31b5b9184e2569f8cb1513b4915 100644 --- a/app/Models/parserSkripte/Qip.php +++ b/app/Models/parserSkripte/Qip.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Qip extends Searchengine { diff --git a/app/Models/parserSkripte/Tuhh.php b/app/Models/parserSkripte/Tuhh.php index 75cf37c5921d3717612639825a81e9bfed98046c..568a71aa9d518bc655c35f0ec7b2d5054ebbbe6c 100644 --- a/app/Models/parserSkripte/Tuhh.php +++ b/app/Models/parserSkripte/Tuhh.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Tuhh extends Searchengine { diff --git a/app/Models/parserSkripte/Yacyunih.php b/app/Models/parserSkripte/Yacyunih.php index 58c5531acb7e96de11bbcba3a4b3bc1e21dbe49e..ed8fe9595a0d42d0a9b07fe7a9db054526d54521 100644 --- a/app/Models/parserSkripte/Yacyunih.php +++ b/app/Models/parserSkripte/Yacyunih.php @@ -3,6 +3,7 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use Log; class Yacyunih extends Searchengine { diff --git a/gulpfile.js b/gulpfile.js index 5e95aaae3c291c7209adbe28870436c8a3770168..b38621034828fd386dba94a48152756323c8c231 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -23,7 +23,6 @@ elixir(function (mix) { | settings.js */ mix.scripts(['lib/jquery.js', 'lib/jquery-ui.min.js', 'lib/bootstrap.js', 'lib/lightslider.js', 'lib/masonry.js', 'lib/imagesloaded.js', 'lib/openpgp.min.js', 'lib/iframeResizer.min.js', 'lib/md5.js'], 'public/js/lib.js') - mix.scripts(['lib/jquery.js', 'lib/iframeResizer.contentWindow.min.js'], 'public/js/quicktips.js') mix.scripts(['scriptStartPage.js', 'results.js'], 'public/js/scriptStartPage.js'); mix.scripts(['scriptResultPage.js', 'results.js'], 'public/js/scriptResultPage.js'); //mix.scripts(['scriptSubpages.js'], 'public/js/scriptSubpages.js'); @@ -31,6 +30,6 @@ elixir(function (mix) { // utility mix.scripts(['utility.js'], 'public/js/utility.js'); mix.less('utility.less', 'public/css/utility.css'); - mix.version(['css/themes/default.css', 'js/lib.js', 'js/quicktips.js', 'js/utility.js', 'css/utility.css', 'js/widgets.js', 'js/editLanguage.js', 'js/kontakt.js', 'js/scriptResultPage.js', 'js/scriptStartPage.js', 'js/settings.js', 'css/beitritt.css']); + mix.version(['css/themes/default.css', 'js/lib.js', 'js/utility.js', 'css/utility.css', 'js/widgets.js', 'js/editLanguage.js', 'js/kontakt.js', 'js/scriptResultPage.js', 'js/scriptStartPage.js', 'js/settings.js', 'css/beitritt.css']); }) diff --git a/resources/assets/js/scriptResultPage.js b/resources/assets/js/scriptResultPage.js index b5e90c7f15ce030ba6cd7a12c2d862390196d0ac..866e49bd41089563e8b6d7f69d8c9cfcd0c0c2bf 100644 --- a/resources/assets/js/scriptResultPage.js +++ b/resources/assets/js/scriptResultPage.js @@ -9,8 +9,35 @@ $(document).ready(function () { if (document.location.href.indexOf('focus=container') !== -1) { $($('#foki > li#savedFokiTabSelector').get(0)).find('>a').tab('show'); } + + if (localStorage.hasOwnProperty('param_sprueche')) { + var sprueche = localStorage.getItem('param_sprueche') === 'on'; // check for sprueche local storage parameter + } else { + var sprueche = getURLParameter('sprueche') === 'on'; // load the sprueche url parameter + } + var search = getMetaTag('q') || ''; + var locale = getMetaTag('l') || 'de'; + loadQuicktips(search, locale, sprueche); // load the quicktips }); +/* +function readLocaleFromUrl (defaultLocale) { + return location.pathname.substr(1, location.pathname.indexOf('/meta', 0) - 1) || 'de' +} +*/ + +function getURLParameter (name) { + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null; +} + +function getMetaTag (name) { + if (typeof $('meta[name="' + name + '"')[0] !== 'undefined') { + return $('meta[name="' + name + '"')[0].content || null; + } else { + return null; + } +} + function activateJSOnlyContent () { $('#searchplugin').removeClass('hide'); $('.js-only').removeClass('js-only'); @@ -533,3 +560,131 @@ function resultSaver (index) { $('div.tab-pane.active .result[data-count=' + index + ']').transfer({to: to, duration: 1000}); new Results().updateResultPageInterface(); } + +function loadQuicktips (search, locale, sprueche) { + var blacklist = []; + if (!sprueche) { + blacklist.push('sprueche'); + } + getQuicktips(search, locale, blacklist, createQuicktips); +} + +const QUICKTIP_SERVER = 'https://quicktips.metager3.de'; +//const QUICKTIP_SERVER = 'http://localhost:63825'; + +/** + * Requests quicktips from the quicktip server and passes them to the loadedHandler + * + * @param {String} search search term + * @param {String} locale 2 letter locale identifier + * @param {Array} blacklist excluded loaders + * @param {Function} loadedHandler handler for loaded quicktips + */ +function getQuicktips (search, locale, blacklist, loadedHandler) { + var getString = QUICKTIP_SERVER + '/quicktips.xml?search=' + search + '&locale=' + locale; + blacklist.forEach(function (value) { + getString += '&loader_' + value + '=false'; + }); + $.get(getString, function (data, status) { + if (status === 'success') { + var quicktips = $(data).children('feed').children('entry').map(function () { + console.log(this); + return quicktip = { + type: $(this).children('mg\\:type').text(), + title: $(this).children('title').text(), + summary: $(this).children('content').text(), + url: $(this).children('link').text(), + gefVon: $(this).children('mg\\:gefVon').text(), + score: $(this).children('relevance\\:score').text(), + details: $(this).children('mg\\:details').children('entry').map(function () { + return { + title: $(this).children('title').text(), + text: $(this).children('text').text(), + url: $(this).children('url').text() + }; + }).toArray() + }; + }).toArray(); + console.log(quicktips); + loadedHandler(quicktips); + } else { + console.error('Loading quicktips failed with status ' + status); + } + }, 'xml'); +} + +/** + *
+ *
+ *
+ * + *

TITLE

+ *

SUMMARY

+ *
+ *
+ *

DETAILTITLE

+ *

DETAILSUMMARY

+ *
+ *
+ * ... + *
+ * ... + *
+ * GEFVON + *
+ *
+ * + * @param {Object} quicktips + */ +function createQuicktips (quicktips, sprueche) { + var quicktipsDiv = $('#quicktips'); + quicktips.sort(function (a, b) { + return b.score - a.score; + }).forEach(function (quicktip) { + var mainElem; + if (quicktip.details.length > 0) { + mainElem = $('
'); + var summaryElem = $(''); + var headlineElem = $('

'); + if (quicktip.url.length > 0) { + headlineElem.append('' + quicktip.title + ''); + } else { + headlineElem.text(quicktip.title); + } + headlineElem.append(''); + summaryElem + .append(headlineElem) + .append('

' + quicktip.summary + '

'); + mainElem.append(summaryElem); + quicktip.details.forEach(function (detail) { + var detailElem = $('
'); + var detailHeadlineElem = $('

'); + if (detail.url.length > 0) { + detailHeadlineElem.append('' + detail.title + ''); + } else { + detailHeadlineElem.text(detail.title); + } + detailElem + .append(detailHeadlineElem) + .append('

' + detail.text + '

'); + mainElem.append(detailElem); + }); + } else { + mainElem = $('
'); + var headlineElem = $('

'); + if (quicktip.url.length > 0) { + headlineElem.append('' + quicktip.title + ''); + } else { + headlineElem.text(quicktip.title); + } + mainElem + .append(headlineElem) + .append('

' + quicktip.summary + '

'); + } + var quicktipDiv = $('
'); + quicktipDiv + .append(mainElem) + .append('' + quicktip.gefVon + ''); + quicktipsDiv.append(quicktipDiv); + }); +} diff --git a/resources/assets/less/metager/result-page.less b/resources/assets/less/metager/result-page.less index 1c6e9478332c213947e14eac14d709bd2dd34a63..8d51eb6353ae3d3c6ec6a57a45591415baac6187 100644 --- a/resources/assets/less/metager/result-page.less +++ b/resources/assets/less/metager/result-page.less @@ -130,7 +130,7 @@ footer { } } -.fa.fa-twitter{ +.fa.fa-twitter { color: #6faedc } @@ -425,7 +425,10 @@ a { li:not(.option-title):hover { background-color: #e0e0e0; } - a, a:hover, a:focus, a:visited { + a, + a:hover, + a:focus, + a:visited { color: black; display: block; } @@ -620,4 +623,116 @@ a { padding-left: 0; padding-right: 0; } +} + + +/* + *
+ *
+ *
+ * + *

TITLE + *

SUMMARY + *

+ *

DETAILTITLE + *

DETAILSUMMARY + * GEFVON + * + */ + +@keyframes quicktip-extender-turn { + from { + transform: rotate(0deg); + } + to { + transform: rotate(180deg); + } +} + +#quicktips { + display: flex; + flex-direction: column; + details[open=""] .quicktip-extender { + animation-name: quicktip-extender-turn; + animation-fill-mode: forwards; + } + .quicktip { + margin: 10px 0px; + padding-left: 10px; + border-left: 3px solid #fb0; + details:not([open=""]) { + .quicktip-summary p { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + .quicktip-summary { + h1 { + font-size: 16px; + font-weight: bold; + display: flex; + justify-content: space-between; + .quicktip-extender { + margin-left: 10px; + color: #777; + font-size: 20px; + } + } + } + .quicktip-detail { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + h2 { + margin: 10px 0px; + font-size: 14px; + font-weight: bold; + } + p { + display: none; + font-size: 12px; + } + } + .gefVon { + float: right; + font-size: 14px; + } + &[type=spruch] { + border-left: 3px solid #070; + p { + color: #070; + .author { + color: #404040; + font-style: italic; + } + } + } + &[type=spendenaufruf] { + border-left: #ddd; + color: #ff8000; + .quicktip-summary { + display: flex; + justify-content: space-between; + align-items: center; + h1 { + margin: 0px; + } + p { + margin: 5px; + .spendenaufruf-btn { + color: white; + background-color: #ff8000; + font-size: 16px; + } + } + } + } + &[type=dictCC] { + .quicktip-summary { + p { + font-weight: bold; + } + } + } + } } \ No newline at end of file diff --git a/resources/assets/less/metager/static-pages.less b/resources/assets/less/metager/static-pages.less index 00ced814d2b502aa91edc9e9bf25eb2eb96cae5b..be6c1889a9f220034987d3a3cb146b3133bc2804 100644 --- a/resources/assets/less/metager/static-pages.less +++ b/resources/assets/less/metager/static-pages.less @@ -413,24 +413,6 @@ textarea#message { margin-bottom: 5px; } -.quicktip { - margin-bottom: 15px; - padding: 10px; - line-height: 1.2 !important; - font-family: Georgia, "Times New Roman", Palatino, Times, serif; - color: @quicktip-color; - border-left: 3px solid @quicktip-border-left-color; - font-size: 14px; - h1 { - font-size: 22px; - margin-top: 0px; - } - &.aufruf { - color: @quicktip-aufruf-color; - border-left: 3px solid @quicktip-aufruf-border-left-color; - } -} - .wikiqtextract { font-family: Georgia, "Times New Roman", Palatino, Times, serif; } diff --git a/resources/lang/de/settings.php b/resources/lang/de/settings.php index 620046d3dbf0477a084456b1235303bde91fd410..467168e614b9b7bec2681e2761c400d92f4fc24d 100644 --- a/resources/lang/de/settings.php +++ b/resources/lang/de/settings.php @@ -7,9 +7,6 @@ return [ "quotes.label" => "Sprüche", "quotes.on" => "anzeigen", "quotes.off" => "nicht anzeigen", - "maps.label" => "Maps", - "maps.on" => "anzeigen", - "maps.off" => "nicht anzeigen", "tab.label" => "Ergebnisse öffnen:", "tab.new" => "In einem neuen Tab", "tab.same" => "Im gleichen Tab", diff --git a/resources/lang/en/languages.php b/resources/lang/en/languages.php index b1bee6bcab2fb30d643bbc83158af73ef7c7c339..583d8564aae88c1ce8f414c0be18ee27cb99b329 100644 --- a/resources/lang/en/languages.php +++ b/resources/lang/en/languages.php @@ -8,5 +8,8 @@ return [ "hinweis.1" => "Please click \"Submit data\" when finished. You don't have to translate all items.", "hinweis.2" => "Hint: You won't see your translations until we checked and inserted it. Save your work by setting a bookmark.", "hinweis.3" => "Note: We publish the hole content of your work on aPublication. This is subject to a AGPL-v3-License. You agree with clicking the \"Submit data\" button.", - "email" => "Email address for possible inquiries (optional):" + "email" => "Email address for possible inquiries (optional):", + "synoptic" => [ + "hinweis" => "Last modified:" + ] ]; \ No newline at end of file diff --git a/resources/views/layouts/atom10ad.blade.php b/resources/views/layouts/atom10ad.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..064403d6f324657e8dd296e632f057de729784e3 --- /dev/null +++ b/resources/views/layouts/atom10ad.blade.php @@ -0,0 +1,8 @@ +@if(isset($ad)) + + {!! trans('ad.von') !!} {!! $ad->gefVon !!} + {{ $ad->titel }} + {{ $ad->anzeigeLink }} + + +@endif \ No newline at end of file diff --git a/resources/views/layouts/resultPage.blade.php b/resources/views/layouts/resultPage.blade.php index c2d31c96968c7f54a6945157ba93cc6727263927..ed7d1f8134a7278282ada7e5484fff7666b4ba70 100644 --- a/resources/views/layouts/resultPage.blade.php +++ b/resources/views/layouts/resultPage.blade.php @@ -5,8 +5,9 @@ - - + + + diff --git a/resources/views/layouts/utility.blade.php b/resources/views/layouts/utility.blade.php index 17817e3a7841348df00bc1efd5cc73e24e25cef7..749f74335934f71df6dfb0c3ac6a1413cbc8e05b 100644 --- a/resources/views/layouts/utility.blade.php +++ b/resources/views/layouts/utility.blade.php @@ -1,4 +1,4 @@ {{-- Verwendung: @include('layouts.utility') --}} - + diff --git a/resources/views/metager3.blade.php b/resources/views/metager3.blade.php index cd41558e1a0e13a7aff22b2bc929e9ae90535644..df2bdf664e9435c56b25d079e921ee862c59cf88 100644 --- a/resources/views/metager3.blade.php +++ b/resources/views/metager3.blade.php @@ -34,14 +34,6 @@ @include('layouts.ad', ['ad' => $metager->popAd()]) @endfor @endif - @if($metager->getMaps()) -

- -
- -
-
- @endif @foreach($metager->getResults() as $result) @if($result->number % 7 === 0) @include('layouts.ad', ['ad' => $metager->popAd()]) @@ -56,8 +48,6 @@

@if( $metager->showQuicktips() ) - + @endif @endsection diff --git a/resources/views/metager3results.blade.php b/resources/views/metager3results.blade.php index a1f66a4e879a8efa4c2d411b885931555b76bc77..d16d1304ad49dbe3c7ab3ff8e8eaf1896acbf9ad 100644 --- a/resources/views/metager3results.blade.php +++ b/resources/views/metager3results.blade.php @@ -26,14 +26,6 @@ @include('layouts.ad', ['ad' => $metager->popAd()]) @endfor @endif - @if($metager->getMaps()) -
- -
- -
-
- @endif @foreach($metager->getResults() as $result) @if($result->number % 7 === 0) @include('layouts.ad', ['ad' => $metager->popAd()]) @@ -48,8 +40,6 @@

@if( $metager->showQuicktips() ) - + @endif
diff --git a/resources/views/metager3resultsatom10.blade.php b/resources/views/metager3resultsatom10.blade.php index 55468b929fd750fd03c2c7402ff6b4773e316e6c..674cac4f574d5ec2354ec453f04bc987db5379b0 100644 --- a/resources/views/metager3resultsatom10.blade.php +++ b/resources/views/metager3resultsatom10.blade.php @@ -1,24 +1,27 @@ + xmlns:mg="http://metager.de/opensearch/" + xmlns:ad="http://a9.com/-/opensearch/extensions/advertisement/1.0/"> {!! htmlspecialchars($eingabe, ENT_XML1, 'UTF-8'); !!} - MetaGer {{ date('c') }} {{ $resultcount }} - + urn:uuid:1d634a8c-2764-424f-b082-6c96494b7240 - @foreach($metager->getResults() as $result) - - {!! htmlspecialchars($result->titel, ENT_XML1, 'UTF-8'); !!} - - {!! htmlspecialchars($result->anzeigeLink, ENT_XML1, 'UTF-8'); !!} - - {!! htmlspecialchars($result->longDescr, ENT_XML1, 'UTF-8'); !!} - - - @endforeach - - - + @include('layouts.atom10ad', ['ad' => $metager->popAd()]) + @foreach($metager->getResults() as $result) + @if($result->number % 5 === 0) + @include('layouts.atom10ad', ['ad' => $metager->popAd()]) + @endif + + {!! htmlspecialchars($result->titel, ENT_XML1, 'UTF-8'); !!} + + {!! htmlspecialchars($result->anzeigeLink, ENT_XML1, 'UTF-8'); !!} + + {!! htmlspecialchars($result->longDescr, ENT_XML1, 'UTF-8'); !!} + + + @endforeach + \ No newline at end of file diff --git a/resources/views/settings.blade.php b/resources/views/settings.blade.php index 1bfa47e08f967f27c414406038b291cb2dbb3386..b2c8c24c8b939881401e1fdad420e97ba2db998a 100644 --- a/resources/views/settings.blade.php +++ b/resources/views/settings.blade.php @@ -16,13 +16,6 @@
-
- - -