From 16014207b04b839c56d374fa05b8153e144f67fc Mon Sep 17 00:00:00 2001 From: Karl Hasselbring Date: Wed, 27 Sep 2017 11:09:54 +0200 Subject: [PATCH 1/4] Ausklappbare Quicktips sind jetzt mit einem Pfeil gekennzeichnet --- resources/assets/js/scriptResultPage.js | 9 +++---- .../assets/less/metager/result-page.less | 24 ++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/resources/assets/js/scriptResultPage.js b/resources/assets/js/scriptResultPage.js index 8a85380f..21ec1eea 100644 --- a/resources/assets/js/scriptResultPage.js +++ b/resources/assets/js/scriptResultPage.js @@ -19,11 +19,11 @@ $(document).ready(function () { loadQuicktips(search, locale, sprueche); // load the quicktips }); -function readLocaleFromUrl(defaultLocale) { +function readLocaleFromUrl (defaultLocale) { return location.pathname.substr(1, location.pathname.indexOf('/meta', 0) - 1) || 'de'; } -function getURLParameter(name) { +function getURLParameter (name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null; } @@ -588,7 +588,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) { title: $(this).children('title').text(), text: $(this).children('text').text(), url: $(this).children('url').text() - } + }; }).toArray() }; }).toArray(); @@ -637,6 +637,7 @@ function createQuicktips (quicktips, sprueche) { } else { headlineElem.text(quicktip.title); } + headlineElem.append(''); summaryElem .append(headlineElem) .append('

' + quicktip.summary + '

'); @@ -652,7 +653,7 @@ function createQuicktips (quicktips, sprueche) { detailElem .append(detailHeadlineElem) .append('

' + detail.text + '

'); - mainElem.append(detailElem); + mainElem.append(detailElem); }); } else { mainElem = $('
'); diff --git a/resources/assets/less/metager/result-page.less b/resources/assets/less/metager/result-page.less index 7fbd4eef..968f84f1 100644 --- a/resources/assets/less/metager/result-page.less +++ b/resources/assets/less/metager/result-page.less @@ -640,10 +640,22 @@ a { * */ +@keyframes quicktip-extender-turn { + from { + transform: rotate(0deg); + } + to { + transform: rotate(180deg); + } +} + #quicktips { display: flex; - flex-direction: column; - // border: 2px solid #ccc; + flex-direction: column; // border: 2px solid #ccc; + details[open=""] .quicktip-extender { + animation-name: quicktip-extender-turn; + animation-fill-mode: forwards; + } .quicktip { margin: 10px 0px; padding-left: 10px; @@ -652,8 +664,14 @@ a { h1 { font-size: 16px; font-weight: bold; + display: flex; + justify-content: space-between; + .quicktip-extender { + margin-left: 10px; + color: #777; + font-size: 20px; + } } - p {} } .quicktip-detail { border-top: 1px solid #ddd; -- GitLab From 0f85483da241638cc033aa08a4b75e87c6cff979 Mon Sep 17 00:00:00 2001 From: Karl Hasselbring Date: Tue, 10 Oct 2017 08:47:52 +0200 Subject: [PATCH 2/4] Update result-page.less --- resources/assets/less/metager/result-page.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/less/metager/result-page.less b/resources/assets/less/metager/result-page.less index b4d788bd..81580746 100644 --- a/resources/assets/less/metager/result-page.less +++ b/resources/assets/less/metager/result-page.less @@ -651,7 +651,7 @@ a { #quicktips { display: flex; - flex-direction: column; // border: 2px solid #ccc; + flex-direction: column; details[open=""] .quicktip-extender { animation-name: quicktip-extender-turn; animation-fill-mode: forwards; -- GitLab From a8806d9726edb8a19cb1f9ad66facba955ef631c Mon Sep 17 00:00:00 2001 From: Karl Hasselbring Date: Tue, 10 Oct 2017 09:35:18 +0200 Subject: [PATCH 3/4] versteckter lang parameter der startseite wird jetzt durch die locale bestimmt --- app/Http/Controllers/StartpageController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 51d8dc60..6a6cb1f0 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,18 +16,12 @@ 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') { $focusPages[] = str_replace('param_', '', $key); @@ -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', $lang) ->with('resultCount', $request->input('param_resultCount', '20')) ->with('time', $request->input('param_time', '1500')) ->with('sprueche', $request->input('param_sprueche', 'on')) -- GitLab From 557c12942a58916403b9baa476caa53ccffb2208 Mon Sep 17 00:00:00 2001 From: Dominik Pfennig Date: Tue, 10 Oct 2017 11:29:49 +0200 Subject: [PATCH 4/4] Update StartpageController.php --- app/Http/Controllers/StartpageController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 6a6cb1f0..65cc6dab 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -23,7 +23,7 @@ class StartpageController extends Controller $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') { @@ -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', $lang) + ->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')) -- GitLab