Commit d08bc5b4 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Die Felder wurden in die Suchleiste eingebaut, ein gewählter eigener Fokus ist...

Die Felder wurden in die Suchleiste eingebaut, ein gewählter eigener Fokus ist aber noch nicht funktional und man kann eigene Foki nicht entfernen
parent 57e74f1d
......@@ -341,79 +341,20 @@ function alreadyInUse (name) {
return localStorage.hasOwnProperty(getIdFromName(name));
}
/**
* Adds a focus html-element to the focus selection
*
* <input id="NAME" class="hide" type="radio" name="focus" value="NAME" form="searchForm" checked required>
* <label id="NAME-label" for="NAME">
* <i class="fa fa-star" aria-hidden="true"></i>
* <span class="content">NAME</span>
* <button class="btn btn-default">
* <i class="fa fa-pencil" aria-hidden="true"></i>
* </button>
* </label>
* Adds an option to the focus selector
*/
function addFocus (name) {
var id = getIdFromName(name);
var foki = document.getElementById('foki');
// create <div> to wrap all Elements
var wrapper = document.createElement('div');
wrapper.classList.add('focus');
// create <input>
var newFocus = document.createElement('input');
newFocus.id = id;
newFocus.classList.add('focus-radio');
newFocus.classList.add('custom-focus');
newFocus.classList.add('hide');
newFocus.type = 'radio';
newFocus.name = 'focus';
newFocus.value = id;
newFocus.setAttribute('Form', 'searchForm');
newFocus.checked = true;
newFocus.required = true;
// create <label>
var newFocusLabel = document.createElement('label');
newFocusLabel.id = id + '-label';
newFocusLabel.classList.add('focus-label');
newFocusLabel.classList.add('custom-focus-label');
newFocusLabel.htmlFor = id;
// create <i> icon
var newFocusIcon = document.createElement('i');
newFocusIcon.classList.add('fa');
newFocusIcon.classList.add('fa-star');
newFocusIcon.setAttribute('aria-hidden', 'true');
// create content
var newFocusContent = document.createElement('span');
newFocusIcon.classList.add('content');
newFocusContent.textContent = ' ' + name;
// create edit button
var newFocusEditLink = document.createElement('a');
newFocusEditLink.classList.add('focus-edit');
newFocusEditLink.classList.add('custom-focus-edit');
newFocusEditLink.classList.add('mutelink');
newFocusEditLink.href = '#';
newFocusEditLink.onclick = function () {
showFocusEditDialog(id);
};
var newFocusEditLinkIcon = document.createElement('i');
newFocusEditLinkIcon.classList.add('fa');
newFocusEditLinkIcon.classList.add('fa-pencil');
newFocusEditLinkIcon.setAttribute('aria-hidden', 'true');
// add new elements
var addFocusBtn = document.getElementById('addFocusBtnDiv');
foki.insertBefore(wrapper, addFocusBtn);
wrapper.appendChild(newFocus);
wrapper.appendChild(newFocusLabel);
newFocusLabel.appendChild(newFocusIcon);
newFocusLabel.appendChild(newFocusContent);
wrapper.appendChild(newFocusEditLink);
newFocusEditLink.appendChild(newFocusEditLinkIcon);
$('#focus-select').append('<option value="' + id + '" style="font-family: FontAwesome, sans-serif;">&#xf2c0; ' + name + '</option>')
}
/**
* Remove the focuses html-elements
*/
function removeFocus (name) {
removeFocusById(getIdFromName(name));
}
/**
* Remove the focuses html-elements
*/
......@@ -421,11 +362,9 @@ function removeFocusById (id) {
if(id == '') {
return;
}
var focusRadio = document.getElementById(id);
var focus = focusRadio.parentNode;
var parent = focus.parentNode;
parent.removeChild(focus);
var focus = $('#focus-select option[value="' + id + '"]').remove();
}
/**
* Turns a name into an id
* Converts special characters and spaces
......@@ -438,18 +377,21 @@ function getIdFromName (name) {
name = name.split('ü').join('ue');
return 'focus_' + name;
}
/**
* Loads the focus object for the given id from local storage
*/
function loadFocusById (id) {
return JSON.parse(localStorage.getItem(id));
}
/**
* Unchecks all focuses from the focus creator dialog
*/
function uncheckAll () {
$('.focusCheckbox').prop('checked', false);
}
/**
* Resets all settings
*/
......
.settings-btn {
margin: 5px;
#settings-buttons {
margin-top: 10px;
display: flex;
flex-wrap: wrap;
justify-content: end;
>* {
margin: 10px;
}
}
#settingsButtons {
#settings-selectors {
display: flex;
flex-wrap: wrap;
a,
input {
margin-top: 25px;
>* {
margin: 10px;
}
}
......
......@@ -13,9 +13,16 @@
display: flex;
align-items: stretch;
font-size: 16px;
background-color: white;
> * {
border: 1px solid #aaa;
background-color: transparent;
&:not(:first-child) {
border-left: none;
}
}
.search-focus-selector {
background-color: transparent;
border: 1px solid #aaa;
border-radius: 5px 0px 0px 5px;
select {
width: 100%;
......@@ -27,11 +34,30 @@
padding-right: 35px;
}
}
.search-add-focus {
display: flex;
button {
background-color: white;
border: none;
padding: 0px 8px;
font-size: 16px;
&:hover {
background-color: #e6e6e6;
}
}
}
.search-settings {
display: flex;
a.btn {
border: none;
padding: 0px 8px;
display: flex;
align-items: center;
font-size: 16px;
}
}
.search-input-submit {
flex-grow: 1;
border-left: none;
border: 1px solid #aaa;
border-left: none;
border-radius: 0px 5px 5px 0px;
display: flex;
}
......
......@@ -462,10 +462,6 @@ select[name=focus]>option {
font-size: 12px;
}
.settings-btn+.settings-btn {
margin-left: 10px;
}
.wikiqtextract p {
margin-bottom: 0;
}
......
......@@ -204,69 +204,11 @@
</div>
</div>
<h1 id="mglogo"><a class="hidden-xs" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">MetaGer</a></h1>
<!-- Create the focus selection and options -->
<!-- <div id="foki" class="startpage-foki">
<div class="focus">
<input id="web" class="focus-radio hide" type="radio" name="focus" value="web" form="searchForm" @if ($focus === 'web') checked @endif required="">
<label id="web-label" class="focus-label" for="web">
<i class="fa fa-globe" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.web') }}</span>
</label>
</div>
<div class="focus">
<input id="nachrichten" class="focus-radio hide" type="radio" name="focus" value="nachrichten" form="searchForm" @if ($focus === 'nachrichten') checked @endif required="">
<label id="nachrichten-label" class="focus-label" for="nachrichten">
<i class="fa fa-bullhorn" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.nachrichten') }}</span>
</label>
</div>
<div class="focus">
<input id="wissenschaft" class="focus-radio hide" type="radio" name="focus" value="wissenschaft" form="searchForm" @if ($focus === 'wissenschaft') checked @endif required="">
<label id="wissenschaft-label" class="focus-label" for="wissenschaft">
<i class="fa fa-file-text" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.wissenschaft') }}</span>
</label>
</div>
<div class="focus">
<input id="produkte" class="focus-radio hide" type="radio" name="focus" value="produktsuche" form="searchForm" @if ($focus === 'produkte') checked @endif required="">
<label id="produkte-label" class="focus-label" for="produkte">
<i class="fa fa-shopping-cart" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.produkte') }}</span>
</label>
</div>
<div class="focus">
<input id="maps" class="focus-radio hide" type="radio" name="focus" value="maps" form="searchForm" @if ($focus === 'maps') checked @endif required="">
<label id="maps-label" class="focus-label" for="maps">
<i class="fa fa-map" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.maps') }}</span>
</label>
</div>
{{-- Fix for older Versions --}}
@if ($focus === 'angepasst')
<div class="focus">
<input id="angepasst" class="focus-radio hide" type="radio" name="focus" value="angepasst" form="searchForm" checked required="">
<label id="anpassen-label" class="focus-label" for="angepasst">
<i class="fa fa-cog" aria-hidden="true"></i>
<span class="content">{{ trans('index.foki.angepasst') }}</span>
</label>
</div>
@endif
<div id="addFocusBtnDiv">
<button id="addFocusBtn" class="btn btn-default hide">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</div>
<div id="settingsBtnDiv">
<a id="settings-btn" class="mutelink btn btn-default" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "settings") }}">
<i class="fa fa-cog" aria-hidden="true"></i>
</a>
</div>
</div>-->
<fieldset>
<form id="searchForm" method={{ $request }} action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/meta/meta.ger3") }}" accept-charset="UTF-8">
<div class="search-bar">
<div class="search-focus-selector">
<select name="focus" style="font-family: FontAwesome, sans-serif;">
<select id="focus-select" name="focus" style="font-family: FontAwesome, sans-serif;">
<option value="web" style="font-family: FontAwesome, sans-serif;" selected >&#xf0ac; Websuche</option>
<option value="nachrichten" style="font-family: FontAwesome, sans-serif;" >&#xf0a1; Nachrichtensuche</option>
<option value="wissenschaft" style="font-family: FontAwesome, sans-serif;" >&#xf15c; Wissenschaftssuche</option>
......@@ -274,6 +216,14 @@
<option value="maps" style="font-family: FontAwesome, sans-serif;" >&#xf279; Kartensuche</option>
</select>
</div>
<div class="search-add-focus">
<button id="addFocusBtn"><i class="fa fa-plus"></i></button>
</div>
<div class="search-settings">
<a id="settings-btn" class="mutelink btn btn-default" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "settings") }}">
<i class="fa fa-cog" aria-hidden="true"></i>
</a>
</div>
<div class="search-input-submit">
<div class="search-input">
<input type="text" name="eingabe" required="" autofocus="" autocomplete="{{$autocomplete}}" class="form-control" placeholder="{{ trans('index.placeholder') }}">
......
......@@ -7,62 +7,59 @@
<h1>{!! trans('settings.head.1') !!}</h1>
<p id="lead">{!! trans('settings.head.2') !!}</p>
<h2>{!! trans('settings.allgemein.1') !!}</h2>
<container>
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">@lang("settings.quotes.label")</label>
<select class="form-control settings-form-control" name="param_sprueche">
<option value="on" selected>@lang("settings.quotes.on")</option>
<option value="off">@lang("settings.quotes.off")</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">@lang("settings.maps.label")</label>
<select class="form-control settings-form-control" name="param_maps">
<option value="on" selected>@lang("settings.maps.on")</option>
<option value="off">@lang("settings.maps.off")</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">@lang("settings.tab.label")</label>
<select class="form-control settings-form-control" name="param_newtab">
<option value="on" selected>@lang("settings.tab.new")</option>
<option value="off">@lang("settings.tab.same")</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">{!! trans('settings.language.label') !!}</label>
<select class="form-control settings-form-control" name="param_lang">
<option value="all" @if(App::isLocale('de')) selected @endif >{!! trans('settings.language.all') !!}</option>
<option value="de">{!! trans('settings.language.de') !!}</option>
<option value="en" @if(App::isLocale('en')) selected @endif>{!! trans('settings.language.en') !!}</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">{{ trans('settings.request') }}:</label>
<select class="form-control settings-form-control" name="request">
<option value="GET" selected>GET</option>
<option value="POST">POST</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">@lang('settings.autocomplete.label'):</label>
<select class="form-control settings-form-control" name="param_autocomplete">
<option value="on" selected>@lang('settings.autocomplete.on')</option>
<option value="off">@lang('settings.autocomplete.off')</option>
</select>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<label class="select-label">@lang('settings.key.label'):</label>
<input type="text" class="form-control settings-form-control" name="param_key" placeholder="@lang('settings.key.placeholder')">
</div>
<div id="settings-selectors">
<div>
<label class="select-label">@lang("settings.quotes.label")</label>
<select class="form-control settings-form-control" name="param_sprueche">
<option value="on" selected>@lang("settings.quotes.on")</option>
<option value="off">@lang("settings.quotes.off")</option>
</select>
</div>
</container>
<div id="settingsButtons">
<a id="settings-abort-btn" class="btn btn-danger mutelink settings-btn" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">@lang('settings.abort') <i class="fa fa-times" aria-hidden="true"></i></a>
<input id="unten" class="btn btn-primary settings-btn" type="submit" value="{!! trans('settings.speichern.1') !!}">
<input id="save" class="btn btn-primary settings-btn hidden" type="button" data-href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}" value="{!! trans('settings.speichern.2') !!}">
<input id="plugin" class="btn btn-primary settings-btn" type="submit" value="{!! trans('settings.speichern.3') !!}">
<div>
<label class="select-label">@lang("settings.maps.label")</label>
<select class="form-control settings-form-control" name="param_maps">
<option value="on" selected>@lang("settings.maps.on")</option>
<option value="off">@lang("settings.maps.off")</option>
</select>
</div>
<div>
<label class="select-label">@lang("settings.tab.label")</label>
<select class="form-control settings-form-control" name="param_newtab">
<option value="on" selected>@lang("settings.tab.new")</option>
<option value="off">@lang("settings.tab.same")</option>
</select>
</div>
<div>
<label class="select-label">{!! trans('settings.language.label') !!}</label>
<select class="form-control settings-form-control" name="param_lang">
<option value="all" @if(App::isLocale('de')) selected @endif >{!! trans('settings.language.all') !!}</option>
<option value="de">{!! trans('settings.language.de') !!}</option>
<option value="en" @if(App::isLocale('en')) selected @endif>{!! trans('settings.language.en') !!}</option>
</select>
</div>
<div>
<label class="select-label">{{ trans('settings.request') }}:</label>
<select class="form-control settings-form-control" name="request">
<option value="GET" selected>GET</option>
<option value="POST">POST</option>
</select>
</div>
<div>
<label class="select-label">@lang('settings.autocomplete.label'):</label>
<select class="form-control settings-form-control" name="param_autocomplete">
<option value="on" selected>@lang('settings.autocomplete.on')</option>
<option value="off">@lang('settings.autocomplete.off')</option>
</select>
</div>
<div>
<label class="select-label">@lang('settings.key.label'):</label>
<input type="text" class="form-control settings-form-control" name="param_key" placeholder="@lang('settings.key.placeholder')">
</div>
<div id="settings-buttons">
<a id="settings-abort-btn" class="btn btn-danger mutelink" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">@lang('settings.abort') <i class="fa fa-times" aria-hidden="true"></i></a>
<input id="unten" class="btn btn-primary" type="submit" value="{!! trans('settings.speichern.1') !!}">
<input id="save" class="btn btn-primary hidden" type="button" data-href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}" value="{!! trans('settings.speichern.2') !!}">
<input id="plugin" class="btn btn-primary" type="submit" value="{!! trans('settings.speichern.3') !!}">
</div>
</form>
<script src="{{ elixir('js/settings.js') }}"></script>
......
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