Commit 73a14ebb authored by Aria Givi's avatar Aria Givi

First result jump is to ads, made additional option for jumping to focuses,...

First result jump is to ads, made additional option for jumping to focuses, had to change order of searchsettings because labels are not focusable with .focus() calls
parent 8ba9c14a
......@@ -5,7 +5,7 @@ var ctrlInfo = false;
$(document).ready(function () {
// Add entry point for tabbing to the first result
$('[data-index="1"').attr("id", "results-entry");
$('.result, .ad').first().attr("id", "results-entry");
// Initially focus the searchbar
$('div.search-input input').focus();
});
......@@ -16,6 +16,7 @@ $(document).ready(function () {
$('label').on('keydown', function(e) {
if(e.keyCode == '13') {
$(this).click();
$('a', this)
}
});
......@@ -60,10 +61,17 @@ function focusResults() {
/**
* Focuses the first <a> tag of the focus options
*/
function focusSettings() {
function focusFoki() {
$('#foki a').first().focus();
}
/**
* Focuses the search settings
*/
function focusSettings() {
$('#settings a').focus();
}
/**
* Focuses the first <tag> of the sidebar
*/
......
......@@ -3,6 +3,7 @@
return [
'keyboard-nav-title' => 'Tastatur-Navigation',
'focus-results' => 'Zu den Ergebnissen springen',
'focus-foki' => 'Zur Fokus-Auswahl springen',
'focus-settings' => 'Zu den Sucheinstellungen springen',
'focus-navigation' => 'Zu der Seitennavigation springen',
'keyboard-nav-hint' => 'Tipp: Drücken Sie die Escape-Taste um in diese Box zurückzugelangen und zum schließen aller ausklappbaren Menüs.'
......
......@@ -3,6 +3,7 @@
return [
'keyboard-nav-title' => 'Keyboard navigation',
'focus-results' => 'Jump to results',
'focus-foki' => 'Jump to focus selection',
'focus-settings' => 'Jump to search settings',
'focus-navigation' => 'Jump to page navigation',
'keyboard-nav-hint' => 'Hint: Press the escape key to return to this box and to collapse all menus.'
......
......@@ -11,7 +11,7 @@
<a class="ad-label" href="{{ $ad->gefVonLink }}" target="_blank" rel="noopener">{!! $ad->gefVon !!}</a>
</div>
<div class="result-subheadline">
<a class="result-link" href="{{ $ad->link }}" target="{{ $metager->getNewtab() }}">
<a class="result-link" href="{{ $ad->link }}" target="{{ $metager->getNewtab() }}" tabindex="-1">
<span class="advertisement-mark">Anzeige</span>
<span>{{ $ad->anzeigeLink }}</span>
</a>
......
<div id="keyboard-nav-info" tabindex="0">
<div id="keyboard-nav-info">
<div class="keyboard-nav-info-content">
<div class="keyboard-nav-info-header">
<h5 class="keyboard-nav-info-title">{{ trans('keyboard-navigation.keyboard-nav-title') }}</h5>
<div class="keyboard-nav-info-body">
<ul>
<li><a href="#" id="results-nav" onclick="focusResults()" tabindex="1">{{ trans('keyboard-navigation.focus-results') }}</a></li>
<li><a href="#" id="settings-nav" onclick="focusSettings()" tabindex="2">{{ trans('keyboard-navigation.focus-settings') }}</a></li>
<li><a href="#" id="site-nav" onclick="focusNavigation()" tabindex="3">{{ trans('keyboard-navigation.focus-navigation') }}</a></li>
<li><a href="#" onclick="focusResults()" tabindex="1">{{ trans('keyboard-navigation.focus-results') }}</a></li>
<li><a href="#" onclick="focusFoki()" tabindex="2">{{ trans('keyboard-navigation.focus-foki') }}</a></li>
<li><a href="#" onclick="focusSettings()" tabindex="2">{{ trans('keyboard-navigation.focus-settings') }}</a></li>
<li><a href="#" onclick="focusNavigation()" tabindex="3">{{ trans('keyboard-navigation.focus-navigation') }}</a></li>
</ul>
<p>{{ trans('keyboard-navigation.keyboard-nav-hint') }}</p>
</div>
......
......@@ -9,10 +9,10 @@
{!! $result->titel !!}
</a>
</h2>
<a class="result-hoster" href="{{ $result->gefVonLink }}" target="{{ $metager->getNewtab() }}" rel="noopener">{{ trans('result.gefVon') . " " . $result->gefVon }}</a>
<a class="result-hoster" href="{{ $result->gefVonLink }}" target="{{ $metager->getNewtab() }}" rel="noopener" tabindex="-1">{{ trans('result.gefVon') . " " . $result->gefVon }} </a>
</div>
<div class="result-subheadline">
<a class="result-link" href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" title="{{ $result->anzeigeLink }}" rel="noopener">
<a class="result-link" href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" title="{{ $result->anzeigeLink }}" rel="noopener" tabindex="-1">
{{ $result->anzeigeLink }}
</a>
@if( isset($result->partnershop) && $result->partnershop === TRUE)
......
<div id="options">
<div id="toggle-box">
<div id="settings">
<a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('settings', ["fokus" => $metager->getFokus(), "url" => url()->full()])) }}">
<i class="fas fa-cogs"></i>
@if($metager->getSavedSettingCount() > 0) <span class="badge badge-primary">{{ $metager->getSavedSettingCount() }}@endif</span>
@lang('metaGer.settings')&hellip;
</a>
</div>
<div id="filter-toggle">
@if(sizeof($metager->getAvailableParameterFilter()) > 0)
<div class="option-toggle">
<label class="navigation-element" for="options-toggle" tabindex="0">
<label class="navigation-element" id="filter-toggle-label" for="options-toggle" tabindex="0">
<i class="fas fa-filter"></i> Filter&hellip;
</label>
</div>
......@@ -14,13 +21,6 @@
</div>
@endif
</div>
<div id="settings">
<a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('settings', ["fokus" => $metager->getFokus(), "url" => url()->full()])) }}">
<i class="fas fa-cogs"></i>
@if($metager->getSavedSettingCount() > 0) <span class="badge badge-primary">{{ $metager->getSavedSettingCount() }}@endif</span>
@lang('metaGer.settings')&hellip;
</a>
</div>
@if($metager->getTotalResultCount() > 0)
<div id="result-count">
<nobr>~ {{$metager->getTotalResultCount()}}</nobr> {{ trans('metaGer.results') }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment