Commit 7d4c699e authored by Dominik Hebeler's avatar Dominik Hebeler

Foki Leiste halb fertig

Kurzer Push des Zwischenstands
parent 620bf053
......@@ -131,7 +131,8 @@ class MetaGer
->with('errors', $this->errors)
->with('apiAuthorized', $this->apiAuthorized)
->with('metager', $this)
->with('browser', (new Agent())->browser());
->with('browser', (new Agent())->browser())
->with('fokus', $this->fokus);
break;
case 'results-with-style':
return view('metager3')
......@@ -143,7 +144,8 @@ class MetaGer
->with('apiAuthorized', $this->apiAuthorized)
->with('metager', $this)
->with('suspendheader', "yes")
->with('browser', (new Agent())->browser());
->with('browser', (new Agent())->browser())
->with('fokus', $this->fokus);
break;
case 'rich':
return view('metager3rich')
......@@ -154,7 +156,8 @@ class MetaGer
->with('errors', $this->errors)
->with('apiAuthorized', $this->apiAuthorized)
->with('metager', $this)
->with('browser', (new Agent())->browser());
->with('browser', (new Agent())->browser())
->with('fokus', $this->fokus);
break;
case 'rss20':
return view('metager3resultsrss20')
......@@ -162,7 +165,8 @@ class MetaGer
->with('eingabe', $this->eingabe)
->with('apiAuthorized', $this->apiAuthorized)
->with('metager', $this)
->with('resultcount', sizeof($viewResults));
->with('resultcount', sizeof($viewResults))
->with('fokus', $this->fokus);
break;
case 'atom10':
return response()->view('metager3resultsatom10', ['results' => $viewResults,'eingabe' => $this->eingabe,'metager' => $this,'resultcount' => sizeof($viewResults)])
......@@ -1322,11 +1326,7 @@ class MetaGer
{
$requestData = $this->request->except(['page', 'next']);
$requestData['focus'] = $fokus;
if ($results) {
$requestData['out'] = "results";
} else {
$requestData['out'] = "";
}
$requestData['out'] = "";
$link = action('MetaGerSearch@search', $requestData);
return $link;
......
......@@ -80,7 +80,7 @@ function showFocusEditDialog (id) {
}
function getCurrentFocus () {
return document.getElementById('focus-select').value;
return $("#foki > div.active").attr("id");
}
/**
......@@ -224,7 +224,11 @@ function alreadyInUse (name) {
*/
function addFocus (name) {
var id = getIdFromName(name);
$('#focus-select').append('<option value="' + id + '" style="font-family: FontAwesome, sans-serif;">&#xf2c0; ' + name + '</option>');
var customFocus = $('<div id="' + id +'"><a href="#" target="_self">' + name + '</a><a class="edit-focus" data-id="' + id + '" href="#"><i class="fa fa-wrench"></i></div>');
$(customFocus).find(".edit-focus").click(function(){
showFocusEditDialog($(this).attr("data-id"));
});
$("#foki .search-option-frame").before(customFocus);
}
/**
......@@ -315,6 +319,11 @@ function disableEditFocusBtn () {
function loadFocusForSearch (focus) {
var focus = loadFocusById(focus);
var url ="/meta/meta.ger3?eingabe=x&focus=";
console.log(focus, url);
clearCustomSearch();
for (var key in focus) {
if (key.startsWith('engine_') && focus[key] == 'on') {
......@@ -323,14 +332,6 @@ function loadFocusForSearch (focus) {
}
}
function clearCustomSearch () {
$('.search-custom-hidden').empty();
}
function addSumaToCustomSearch (sumaId) {
$('.search-custom-hidden').append('<input type="hidden" name="' + sumaId + '" value="on">');
}
function getFocusInUrl () {
var url = window.location;
var focReg = /focus=(focus_\w+)/.exec(url);
......
......@@ -276,6 +276,7 @@ header {
margin-left: 50px;
padding-top: 10px;
display:flex;
flex-direction: column;
position: fixed;
z-index: 100;
max-width: 700px;
......@@ -287,28 +288,65 @@ header {
justify-content: center;
max-width: 799px;
}
}
#research-bar {
max-width: 700px;
width:100%;
padding: 0px 30px 0px 10px;
background-color: white;
border: 1px solid #ccc;
border-bottom: 2px solid rgb(255, 128, 0);
display: flex;
align-items: center;
justify-content: center;
@media (max-width: 799px) {
margin: 0px 8px;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
#research-bar {
max-width: 700px;
width: auto;
padding: 0px 30px 0px 10px;
background-color: white;
border: 1px solid #ccc;
border-bottom: 2px solid rgb(255, 128, 0);
display: flex;
align-items: center;
justify-content: center;
@media (max-width: 799px) {
margin: 0px 8px;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
}
}
}
#foki {
display: flex;
width: auto;
max-width: 700px;
background-color: white;
border: 1px solid #ccc;
margin-top:10px;
padding: 10px;
margin-left: 50px;
overflow-x: auto;
&::-webkit-scrollbar {
height: 0px; /* remove scrollbar space */
background: transparent; /* optional: just make scrollbar invisible */
}
@media (max-width: 799px) {
margin: 10px 8px 0px 8px;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
}
&>div {
padding: 0px 10px;
&>a {
color: black;
}
&.active>a{
border-bottom: 1px solid rgb(255,128,0);
color: rgb(255,128,0);
}
}
.edit-focus{
margin-left: 7px;
}
}
#research-bar-placeholder {
width: 100%;
height: 60px;
@media (max-width: @screen-xs-max) {
height: 65px;
width: 100%;
height: 60px;
}
}
\ No newline at end of file
......@@ -20,6 +20,9 @@
</div>
</header>
<div id="research-bar-placeholder"></div>
<div id="foki">
@include('parts.foki')
</div>
<div id="resultpage-container">
<div id="results-container">
@yield('results')
......
<div id="web" @if($metager->getFokus() === "web")class="active"@endif>
<a href="@if($metager->getFokus() === "web")#@else{!!$metager->generateSearchLink('web')!!}@endif" target="_self">@lang('index.foki.web')</a>
</div>
<div id="nachrichten" @if($metager->getFokus() === "nachrichten")class="active"@endif>
<a href="@if($metager->getFokus() === "nachrichten")#@else{!!$metager->generateSearchLink('nachrichten')!!}@endif" target="_self">@lang('index.foki.nachrichten')</a>
</div>
<div id="wissenschaft" @if($metager->getFokus() === "wissenschaft")class="active"@endif>
<a href="@if($metager->getFokus() === "wissenschaft")#@else{!!$metager->generateSearchLink('wissenschaft')!!}@endif" target="_self">@lang('index.foki.wissenschaft')</a>
</div>
<div id="produkte" @if($metager->getFokus() === "produktsuche")class="active"@endif>
<a href="@if($metager->getFokus() === "produktsuche")#@else{!!$metager->generateSearchLink('produktsuche')!!}@endif" target="_self">@lang('index.foki.produkte')</a>
</div>
<div id="maps">
<a href="https://maps.metager.de/map/{{ $metager->getQ() }}/9.7380161,52.37119740000003,12" target="_self">@lang('index.foki.maps')</a>
</div>
<div class="search-option-frame">
<div class="searchbar-options-arrow"></div>
<div class="search-button-container">
<div class="search-add-focus js-only">
<div class="search-option-descriptor">
<label for="addFocusBtn">{{{ trans('index.tooltips.add-focus') }}}</label>
</div>
<button type="button" id="addFocusBtn">
<i class="fa fa-plus"></i>
</button>
<div class="searchbar-tooltip">
<div class="searchbar-tooltip-arrow"></div>
<div class="searchbar-tooltip-content">
<p>{{{ trans('index.tooltips.add-focus') }}}</p>
</div>
</div>
</div>
</div>
</div>
......@@ -78,7 +78,7 @@
</div>-->
<div class="search-input-submit">
<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') }}">
<input type="text" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" required="" autofocus="" autocomplete="{{$autocomplete or 'off'}}" class="form-control" placeholder="{{ trans('index.placeholder') }}">
</div>
<div class="search-submit" id="submit-inputgroup">
<button type="submit">
......
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