diff --git a/app/Http/Controllers/MetaGerSearch.php b/app/Http/Controllers/MetaGerSearch.php index cbb47ad124a78744f250814f922c1c9a5263f799..107246539467222596f5a091cecbeb80b0fcad97 100644 --- a/app/Http/Controllers/MetaGerSearch.php +++ b/app/Http/Controllers/MetaGerSearch.php @@ -15,6 +15,9 @@ class MetaGerSearch extends Controller public function search(Request $request, MetaGer $metager, $timing = false) { + if ($request->filled("chrome-plugin")) { + return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/plugin")); + } $timings = null; if ($timing) { $timings = ['starttime' => microtime(true)]; diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 55364eb843c62393d056cc57409b1f20b6a8dd08..d38be544d90d51cdb86b1b06d9e010e43203914e 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -45,7 +45,7 @@ class StartpageController extends Controller return view('index') ->with('title', trans('titles.index')) ->with('homeIcon') - ->with('browser', (new Agent())->browser()) + ->with('agent', new Agent()) ->with('navbarFocus', 'suche') ->with('focus', $request->input('focus', 'web')) ->with('time', $request->input('param_time', '1500')) diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index fe90db69edee374bcda816a9d8f2c9efd9252b8e..26968e8eb0393786fe6039113597689866b656ce 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -13,7 +13,12 @@ <input type="hidden" name="key" value="{{ Request::input('key','') }}" form="searchForm"> @endif <div id="plugin-btn-div"> + @if($agent->isMobile() && $agent->browser() === "Chrome") + <input type="hidden" name="eingabe" value="chrome" /> + <button type="submit" id="plugin-btn" form="searchForm" title="{{ trans('index.plugin-title') }}" name="chrome-plugin" value="true"><i class="fa fa-plug" aria-hidden="true"></i> {{ trans('index.plugin') }}</a> + @else <a id="plugin-btn" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/plugin") }}" title="{{ trans('index.plugin-title') }}"><i class="fa fa-plug" aria-hidden="true"></i> {{ trans('index.plugin') }}</a> + @endif </div> <div id="about-us"> <div class="m-row"> diff --git a/resources/views/parts/searchbar.blade.php b/resources/views/parts/searchbar.blade.php index af89e43e96135a9399b113e1817861ac815fb7b6..a04e14c38de8a5ace2e35aa627655edb7b074bbf 100644 --- a/resources/views/parts/searchbar.blade.php +++ b/resources/views/parts/searchbar.blade.php @@ -8,7 +8,7 @@ </a> </div> <div class="search-input"> - <input type="search" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" required="" @if(\Request::is('/') && !\Request::filled('mgapp')) autofocus @endif autocomplete="off" class="form-control" placeholder="{{ trans('index.placeholder') }}" tabindex="0"> + <input type="search" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" @if(\Request::is('/') && !\Request::filled('mgapp')) autofocus @endif autocomplete="off" class="form-control" placeholder="{{ trans('index.placeholder') }}" tabindex="0"> <button id="search-delete-btn" name="delete-search-input" type="button" tabindex="-1"> × </button>