diff --git a/app/MetaGer.php b/app/MetaGer.php index 86ba2ba623be7ffd316b24998738c5668c4752d0..8dc7d9a920e62fc1d9fe3a85a047598008a1a08d 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -197,7 +197,8 @@ class MetaGer ->with('apiAuthorized', $this->apiAuthorized) ->with('metager', $this) ->with('browser', (new Agent())->browser()) - ->with('quicktips', $quicktipResults); + ->with('quicktips', $quicktipResults) + ->with('resultcount', count($this->results)); break; } } @@ -385,7 +386,6 @@ class MetaGer $this->ads[] = $ad; } } - } public function parseAdgoal($results) @@ -1284,8 +1284,8 @@ class MetaGer if ($result->isValid($this)) { $results[] = $result; } - } + $this->results = $results; } public function atLeastOneSearchengineSelected(Request $request) diff --git a/app/Models/Searchengine.php b/app/Models/Searchengine.php index 99985b494fe67fea76728740c3b72d57d7901643..dff637a18b9a9f2f4a5a9ed61f5f530c1e98eaa0 100644 --- a/app/Models/Searchengine.php +++ b/app/Models/Searchengine.php @@ -93,7 +93,7 @@ abstract class Searchengine abstract public function loadResults($result); - # ??? + # Standardimplementierung der getNext Funktion, damit diese immer verwendet werden kann public function getNext(MetaGer $metager, $result) { diff --git a/resources/assets/js/searchbar.js b/resources/assets/js/searchbar.js index 16e3a4dd26abe58fa2d8856193fe5bcac9657910..f04e61b93af0baf36515b7c73eeb439345f31a25 100644 --- a/resources/assets/js/searchbar.js +++ b/resources/assets/js/searchbar.js @@ -1,17 +1,49 @@ $(function () { loadLocalStorage(); + setActionListenersSearchbar(); }); +function setActionListenersSearchbar() { + $('#input-key').change(saveKey); + $('#input-lang').change(saveLang); +} + +function saveKey() { + var key = $('#input-key').val(); + localStorage.setItem('key', key); +} + +function loadKey() { + var key = localStorage.getItem('key'); + if (key != null) { + $('#input-key').val(key); + } +} + +function saveLang() { + var key = $('#input-lang').val(); + localStorage.setItem('lang', key); +} + +function loadLang() { + var key = localStorage.getItem('lang'); + if (key != null) { + $('#input-lang').val(key); + } +} + /** * Loads the user theme and stored settings from local storage */ -function loadLocalStorage () { +function loadLocalStorage() { if (localStorage) { setSettings(); + loadKey(); + loadLang(); } } -function setSettings () { +function setSettings() { var acceptedParams = ['autocomplete', 'key', 'lang', 'newtab', 'sprueche']; for (var key in localStorage) { var value = localStorage.getItem(key); diff --git a/resources/assets/less/metager/general.less b/resources/assets/less/metager/general.less index 5d52a4044c9a30c22d3c3561ea8dea47725776b4..73b97a3439e5e7dbea1926be3d036b5d9b7eee63 100644 --- a/resources/assets/less/metager/general.less +++ b/resources/assets/less/metager/general.less @@ -109,12 +109,15 @@ p { #startpage-logo { .logo; + display: flex; + justify-content: center; margin: 0px 0px 45px 0px; white-space: nowrap; text-align: center; &>a { .logo; display: block; + width: fit-content; text-decoration: none; font-size: 75px; @media(max-width: @screen-xs-max) { @@ -175,8 +178,8 @@ summary { */ *[data-tooltip] { + position: relative; &:hover { - position: relative; &:after { opacity: 1; } diff --git a/resources/assets/less/metager/result.less b/resources/assets/less/metager/result.less index 6539a0cc046245c3974276be99c96d076dd78034..bd17965d92746ebf4028c430b63c449aec7a0fd0 100644 --- a/resources/assets/less/metager/result.less +++ b/resources/assets/less/metager/result.less @@ -92,7 +92,6 @@ margin-top: 10px; display: flex; flex-wrap: wrap; - overflow: auto; &>*:not(:first-child) { margin-left: 20px; } diff --git a/resources/assets/less/metager/searchbar.less b/resources/assets/less/metager/searchbar.less index 16fcef31acf3b5e8c657aba42b063a2b96a57146..4f470d6cef76270bc4d6c95f491d4120360f6028 100644 --- a/resources/assets/less/metager/searchbar.less +++ b/resources/assets/less/metager/searchbar.less @@ -27,9 +27,17 @@ display: -ms-flexbox; display: flex; max-width: 600px; - .search-key { + #search-lang { + #input-lang { + background-color: transparent; + border: none; + } + } + #search-lang, + #search-key { display: flex; z-index: 1; + #input-lang, #input-key { margin: 0; padding: 0px; @@ -37,6 +45,9 @@ box-shadow: none; height: 40px; width: 0px; + outline-color: green; + transition: width 0.5s, padding 0.5s, outline-color 0s, border-color 0s, box-shadow 0s; + transition-delay: 0.3s; &:focus { width: 200px; padding: 6px 10px 6px 10px; @@ -45,11 +56,14 @@ box-shadow: 0px 0px 2px 2px rgba(255, 128, 0, 1); border-color: rgba(255, 128, 0, 1); border-radius: 4px; + +#lang-label, +#key-label { - display: none; + visibility: hidden; + width: 0px; } } } + #lang-label, #key-label { cursor: pointer; height: 40px; @@ -58,6 +72,8 @@ display: flex; align-items: center; justify-content: center; + transition: width 0s, visibility 0s; + transition-delay: 0.3s; } } .search-input { @@ -115,11 +131,8 @@ @media (max-width: @screen-xs-max) { max-width: initial; } - .search-key { - border-right: 1px solid @startpage-border-color; - } - .search-submit { - border-left: 1px solid #aaa; + >:not(:first-child) { + border-left: 1px solid @startpage-border-color; } } @media (max-width: @screen-xs-max) { diff --git a/resources/assets/less/metager/specific.less b/resources/assets/less/metager/specific.less index 1fa80db14a4623f1ac293dcba155d8539b9395b2..ae47409df9913609642a6cb07d28f19d73ea4ca0 100644 --- a/resources/assets/less/metager/specific.less +++ b/resources/assets/less/metager/specific.less @@ -180,6 +180,7 @@ main { overflow: visible !important; } .result-footer { + overflow: hidden; align-items: center; } .open-result-options label { diff --git a/resources/lang/de/index.php b/resources/lang/de/index.php index 7062602dc65b5c5203143b745fcd2de1d142ad52..92912a3e558d4f9c45b34d104311af5f567b1502 100644 --- a/resources/lang/de/index.php +++ b/resources/lang/de/index.php @@ -41,7 +41,9 @@ return [ 'about.2.1' => 'Wir arbeiten nicht gewinnorientiert, wir sind ein <a href="/spende">gemeinnütziger Verein</a>: <a href="/beitritt">Werden Sie Mitglied!</a>', 'about.3.1' => '', + 'lang.tooltip' => 'Ergebnissprache wählen', 'key.placeholder' => 'Mitglieder Key eingeben', + 'key.tooltip' => 'Mitglieder Key eingeben', 'placeholder' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen', 'plugin.head.1' => 'MetaGer zum Firefox hinzufügen', diff --git a/resources/views/layouts/researchandtabs.blade.php b/resources/views/layouts/researchandtabs.blade.php index f972da40f2852d20b08cb9b778527f592221789e..142049b56bcb121f01d62b212c31fd3c625f153e 100644 --- a/resources/views/layouts/researchandtabs.blade.php +++ b/resources/views/layouts/researchandtabs.blade.php @@ -31,9 +31,6 @@ @include('parts.errors') @include('parts.warnings') @yield('results') - @if( $metager->showQuicktips() ) - <div id="quicktips"></div> - @endif </div> <div id="additions-container"> <div id="search-settings"> diff --git a/resources/views/parts/searchbar.blade.php b/resources/views/parts/searchbar.blade.php index 3936bd0d48aa0036eee7bdc936f4e5a1f4c20bf4..55fbf7c68f9a2c078df249d8ac38033eb6f1d581 100644 --- a/resources/views/parts/searchbar.blade.php +++ b/resources/views/parts/searchbar.blade.php @@ -4,14 +4,25 @@ <form id="searchForm" method={{ $request }} action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/meta/meta.ger3 ") }}" accept-charset="UTF-8"> <div class="searchbar {{$class or ''}}"> <div class="search-input-submit"> - <div class="search-key"> - <input id="input-key" type="text" name="key" placeholder="{{ trans ('index.key.placeholder') }}"> - <label id="key-label" for="input-key"> + <div id="search-lang"> + <select id="input-lang" name="lang"> + <option value="all">Alle Sprachen</option> + @foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties) + <option value="{{$localeCode}}">{{{ $properties['native'] }}}</option> + @endforeach + </select> + <label id="lang-label" for="input-lang" data-tooltip="{{ trans ('index.lang.tooltip') }}"> + <i class="fa fa-globe" aria-hidden="true"></i> + </label> + </div> + <div id="search-key"> + <input id="input-key" type="text" name="key" placeholder="{{ trans ('index.key.placeholder') }}" tabindex="1"> + <label id="key-label" for="input-key" data-tooltip="{{ trans ('index.key.tooltip') }}"> <i class="fa fa-key" aria-hidden="true"></i> </label> </div> <div class="search-input"> - <input type="text" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" required="" autocomplete="{{$autocomplete or 'off'}}" class="form-control" placeholder="{{ trans('index.placeholder') }}" tabindex="1"> + <input type="text" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" required="" autocomplete="{{$autocomplete or 'off'}}" class="form-control" placeholder="{{ trans('index.placeholder') }}" tabindex="2"> <button class="hidden" id="search-delete-btn" type="button"> × </button>