Skip to content
Snippets Groups Projects
Commit 24baae33 authored by Karl's avatar Karl
Browse files

Die Neue Fokusauswahl und die Neue Einstellungsseite scheinen zu funktionieren.

Es muss noch die Kompatibilität mit alten Links und Plugins getestet werden
parent b9446d0e
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -36,29 +36,23 @@ class StartpageController extends Controller ...@@ -36,29 +36,23 @@ class StartpageController extends Controller
} }
} }
$maps = $request->input('param_maps', 'on');
$agent = new Agent();
$browser = $agent->browser();
$foki = $this->loadFoki();
return view('index') return view('index')
->with('title', trans('titles.index')) ->with('title', trans('titles.index'))
->with('homeIcon') ->with('homeIcon')
->with('focusPages', $focusPages)
->with('browser', (new Agent())->browser())
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('autocomplete', $request->input('param_autocomplete', 'on'))
->with('foki', $this->loadFoki())
->with('focus', $request->input('focus', 'web')) ->with('focus', $request->input('focus', 'web'))
->with('lang', $request->input('param_lang', 'all')) ->with('lang', $request->input('param_lang', 'all'))
->with('resultCount', $request->input('param_resultCount', '20')) ->with('resultCount', $request->input('param_resultCount', '20'))
->with('time', $request->input('param_time', '1000')) ->with('time', $request->input('param_time', '1000'))
->with('sprueche', $request->input('param_sprueche', 'off')) ->with('sprueche', $request->input('param_sprueche', 'off'))
->with('newtab', $request->input('param_newtab', 'on')) ->with('newtab', $request->input('param_newtab', 'on'))
->with('focusPages', $focusPages) ->with('maps', $maps = $request->input('param_maps', 'on'));
->with('browser', $browser)
->with('navbarFocus', 'suche')
->with('theme', $theme)
->with('maps', $maps)
->with('autocomplete', $request->input('param_autocomplete', 'on'))
->with('foki', $foki);
} }
public function loadPage($subpage) public function loadPage($subpage)
......
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
...@@ -212,21 +212,49 @@ function showFocusEditDialog(id) { ...@@ -212,21 +212,49 @@ function showFocusEditDialog(id) {
} }
function saveFocus() { function saveFocus() {
var focus = {};
var name = document.getElementById("focus-name").value; var name = document.getElementById("focus-name").value;
var id = getIdFromName(name); if (isValidName(name) && atLeastOneChecked()) {
var oldId = document.getElementById("original-id").value; var id = getIdFromName(name);
$("input[type=checkbox]:checked").each(function(el) { var overwrite = true;
focus[$(this).attr("name")] = $(this).val(); if (alreadyInUse(name)) {
}); overwrite = confirm("Name bereits genutzt\nüberschreiben?");
focus["name"] = name; if (overwrite) {
if (oldId !== "") { localStorage.removeItem(id);
localStorage.removeItem(oldId); removeFocusById(id);
removeFocusById(oldId); }
}
if (overwrite) {
var oldId = document.getElementById("original-id").value;
var focus = {};
$("input[type=checkbox]:checked").each(function(el) {
focus[$(this).attr("name")] = $(this).val();
});
focus["name"] = name;
if (oldId !== "") {
localStorage.removeItem(oldId);
removeFocusById(oldId);
}
localStorage.setItem(id, JSON.stringify(focus));
addFocus(name);
$("#create-focus-modal").modal("hide");
}
} else {
alert("Bitte gültigen Namen eingeben:\n* Keine Sonderzeichen\n* Mindestens 1 Buchstabe\n* Mindestens 1 Suchmaschine auswählen");
} }
localStorage.setItem(id, JSON.stringify(focus)); }
addFocus(name);
$("#create-focus-modal").modal("hide"); function isValidName(name) {
// no Characters other then a-z, A-Z, 0-9, ä, ö, ü, ß, -, _ allowed
// at least 1 character
return /^[a-zA-Z0-9äöüß\-_ ]*$/.test(name);
}
function atLeastOneChecked() {
return $("input[type=checkbox]:checked").length > 0;
}
function alreadyInUse(name) {
return localStorage.hasOwnProperty(getIdFromName(name));
} }
function deleteFocus() { function deleteFocus() {
...@@ -312,7 +340,12 @@ function removeFocusById(id) { ...@@ -312,7 +340,12 @@ function removeFocusById(id) {
} }
function getIdFromName(name) { function getIdFromName(name) {
return "focus_" + name.split(" ").join("_").toLowerCase(); name = name.toLowerCase();
name = name.split(" ").join("_");
name = name.split("ä").join("ae");
name = name.split("ö").join("oe");
name = name.split("ü").join("ue");
return "focus_" + name;
} }
function loadFocusById(id) { function loadFocusById(id) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"js/editLanguage.js": "js/editLanguage-7a1cbfb2ba.js", "js/editLanguage.js": "js/editLanguage-7a1cbfb2ba.js",
"js/kontakt.js": "js/kontakt-de49d68db3.js", "js/kontakt.js": "js/kontakt-de49d68db3.js",
"js/scriptResultPage.js": "js/scriptResultPage-1eb7e4a36b.js", "js/scriptResultPage.js": "js/scriptResultPage-1eb7e4a36b.js",
"js/scriptStartPage.js": "js/scriptStartPage-ebe8cec134.js", "js/scriptStartPage.js": "js/scriptStartPage-1d6e62e8c9.js",
"js/settings.js": "js/settings-6ff0eab621.js", "js/settings.js": "js/settings-6ff0eab621.js",
"js/widgets.js": "js/widgets-866379dd63.js" "js/widgets.js": "js/widgets-866379dd63.js"
} }
\ No newline at end of file
...@@ -25,7 +25,7 @@ input[type=text]:focus, textarea:focus, input[type=email]:focus, input[type=tel] ...@@ -25,7 +25,7 @@ input[type=text]:focus, textarea:focus, input[type=email]:focus, input[type=tel]
-webkit-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>; -webkit-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
-moz-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>; -moz-box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>; box-shadow: 0px 0px 2px 2px <?=$colorRGBA?>;
border: 1px solid <?=$colorRGBA?>; // border-color: <?=$colorRGBA?>;
} }
#mglogo > a { #mglogo > a {
background-image: linear-gradient(<?=$color?> 0%, <?=$color?> 250%); background-image: linear-gradient(<?=$color?> 0%, <?=$color?> 250%);
......
...@@ -212,21 +212,49 @@ function showFocusEditDialog(id) { ...@@ -212,21 +212,49 @@ function showFocusEditDialog(id) {
} }
function saveFocus() { function saveFocus() {
var focus = {};
var name = document.getElementById("focus-name").value; var name = document.getElementById("focus-name").value;
var id = getIdFromName(name); if (isValidName(name) && atLeastOneChecked()) {
var oldId = document.getElementById("original-id").value; var id = getIdFromName(name);
$("input[type=checkbox]:checked").each(function(el) { var overwrite = true;
focus[$(this).attr("name")] = $(this).val(); if (alreadyInUse(name)) {
}); overwrite = confirm("Name bereits genutzt\nüberschreiben?");
focus["name"] = name; if (overwrite) {
if (oldId !== "") { localStorage.removeItem(id);
localStorage.removeItem(oldId); removeFocusById(id);
removeFocusById(oldId); }
}
if (overwrite) {
var oldId = document.getElementById("original-id").value;
var focus = {};
$("input[type=checkbox]:checked").each(function(el) {
focus[$(this).attr("name")] = $(this).val();
});
focus["name"] = name;
if (oldId !== "") {
localStorage.removeItem(oldId);
removeFocusById(oldId);
}
localStorage.setItem(id, JSON.stringify(focus));
addFocus(name);
$("#create-focus-modal").modal("hide");
}
} else {
alert("Bitte gültigen Namen eingeben:\n* Keine Sonderzeichen\n* Mindestens 1 Buchstabe\n* Mindestens 1 Suchmaschine auswählen");
} }
localStorage.setItem(id, JSON.stringify(focus)); }
addFocus(name);
$("#create-focus-modal").modal("hide"); function isValidName(name) {
// no Characters other then a-z, A-Z, 0-9, ä, ö, ü, ß, -, _ allowed
// at least 1 character
return /^[a-zA-Z0-9äöüß\-_ ]*$/.test(name);
}
function atLeastOneChecked() {
return $("input[type=checkbox]:checked").length > 0;
}
function alreadyInUse(name) {
return localStorage.hasOwnProperty(getIdFromName(name));
} }
function deleteFocus() { function deleteFocus() {
...@@ -312,7 +340,12 @@ function removeFocusById(id) { ...@@ -312,7 +340,12 @@ function removeFocusById(id) {
} }
function getIdFromName(name) { function getIdFromName(name) {
return "focus_" + name.split(" ").join("_").toLowerCase(); name = name.toLowerCase();
name = name.split(" ").join("_");
name = name.split("ä").join("ae");
name = name.split("ö").join("oe");
name = name.split("ü").join("ue");
return "focus_" + name;
} }
function loadFocusById(id) { function loadFocusById(id) {
......
...@@ -153,13 +153,13 @@ ...@@ -153,13 +153,13 @@
{{-- {{--
<h2>{!! trans('settings.suchmaschinen.1') !!} <small><button type="button" class="btn btn-link allUnchecker hide">{!! trans('settings.suchmaschinen.2') !!}</button></small></h2> <h2>{!! trans('settings.suchmaschinen.1') !!} <small><button type="button" class="btn btn-link allUnchecker hide">{!! trans('settings.suchmaschinen.2') !!}</button></small></h2>
--}} --}}
@foreach( $foki as $focus => $sumas ) @foreach( $foki as $fokus => $sumas )
<div class="headingGroup {{ $focus }}"> <div class="headingGroup {{ $fokus }}">
<h3 class="focus-category"> <h3 class="focus-category">
@lang("settings.foki." . $focus) @lang("settings.foki." . $fokus)
{{-- {{--
<small> <small>
<button type="button" class="checker btn btn-link hide" data-type="{{ $focus }}">{!! trans('settings.suchmaschinen.3') !!}</button> <button type="button" class="checker btn btn-link hide" data-type="{{ $fokus }}">{!! trans('settings.suchmaschinen.3') !!}</button>
</small> </small>
--}} --}}
</h3> </h3>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<div class="col-sm-6 col-md-4 col-lg-3"> <div class="col-sm-6 col-md-4 col-lg-3">
<div class="checkbox settings-checkbox"> <div class="checkbox settings-checkbox">
<label> <label>
<input type="checkbox" name="engine_{{ $name }}" class="focusCheckbox" @if ($focus == 'web') checked @endif >{{ $data['displayName'] }} <input type="checkbox" name="engine_{{ $name }}" class="focusCheckbox" @if ($fokus == 'web') checked @endif >{{ $data['displayName'] }}
<a class="glyphicon settings-glyphicon glyphicon-link" target="_blank" rel="noopener" href="{{ $data['url'] }}"></a> <a class="glyphicon settings-glyphicon glyphicon-link" target="_blank" rel="noopener" href="{{ $data['url'] }}"></a>
</label> </label>
</div> </div>
...@@ -178,12 +178,14 @@ ...@@ -178,12 +178,14 @@
</div> </div>
@endforeach @endforeach
<div class="clearfix"> <div class="clearfix">
<button id="save-focus-btn" class="btn btn-primary pull-right"> <div class="pull-right">
@lang('index.focus-creator.save') <button id="delete-focus-btn" type="button" class="btn btn-danger">
</button> @lang('index.focus-creator.delete')
<button id="delete-focus-btn" type="button" class="btn btn-danger pull-right"> </button>
@lang('index.focus-creator.delete') <button id="save-focus-btn" class="btn btn-primary">
</button> @lang('index.focus-creator.save')
</button>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -257,22 +259,16 @@ ...@@ -257,22 +259,16 @@
</div> </div>
<input type="text" name="eingabe" required="" autofocus="" autocomplete="{{$autocomplete}}" class="form-control" placeholder="{{ trans('index.placeholder') }}"> <input type="text" name="eingabe" required="" autofocus="" autocomplete="{{$autocomplete}}" class="form-control" placeholder="{{ trans('index.placeholder') }}">
<input type="hidden" name="encoding" value="utf8"> <input type="hidden" name="encoding" value="utf8">
@if ($focus === 'angepasst') <input type="hidden" name="lang" value={{ $lang }} >
<input type="hidden" name="lang" value={{ $lang }} > <input type="hidden" name="resultCount" value={{ $resultCount }} >
<input type="hidden" name="resultCount" value={{ $resultCount }} > <input type="hidden" name="time" value={{ $time }} >
<input type="hidden" name="time" value={{ $time }} > <input type="hidden" name="sprueche" value={{ $sprueche }} >
<input type="hidden" name="sprueche" value={{ $sprueche }} > <input type="hidden" name="newtab" value={{ $newtab }} >
<input type="hidden" name="newtab" value={{ $newtab }} > <input type="hidden" name="maps" value={{ $maps }} >
<input type="hidden" name="maps" value={{ $maps }} > @foreach ($focusPages as $fp)
@foreach ($focusPages as $fp) <input type="hidden" name={{ $fp }} value="on">
<input type="hidden" name={{ $fp }} value="on"> @endforeach
@endforeach <input type="hidden" name="theme" value={{ $theme }}>
<input type="hidden" name="theme" value={{ $theme }}>
@elseif( !App::isLocale('de') )
<input type="hidden" name="lang" value="{{ App::getLocale() }}">
@else
<input type="hidden" name="lang" value="all">
@endif
<div class="input-group-addon"> <div class="input-group-addon">
<button type="submit"> <button type="submit">
<span class="glyphicon glyphicon-search"></span> <span class="glyphicon glyphicon-search"></span>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<h1>{!! trans('settings.head.1') !!}</h1> <h1>{!! trans('settings.head.1') !!}</h1>
<p id="lead">{!! trans('settings.head.2') !!}</p> <p id="lead">{!! trans('settings.head.2') !!}</p>
<h2>{!! trans('settings.allgemein.1') !!}</h2> <h2>{!! trans('settings.allgemein.1') !!}</h2>
<input id="settings-focus" type="hidden" name="focus" value="eigene">
<container> <container>
<div class="row"> <div class="row">
<div class="col-sm-6 col-md-4 col-lg-3"> <div class="col-sm-6 col-md-4 col-lg-3">
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
</div> </div>
</container> </container>
<div id="settingsButtons"> <div id="settingsButtons">
<a id="settings-abort-btn" class="btn btn-danger mutelink" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">@lang('settings.abort')</a> <a id="settings-abort-btn" class="btn btn-danger mutelink" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">@lang('settings.abort') <span class="glyphicon glyphicon-remove"></span></a>
<input id="unten" class="btn btn-primary settings-btn" type="submit" value="{!! trans('settings.speichern.1') !!}"> <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="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') !!}"> <input id="plugin" class="btn btn-primary settings-btn" type="submit" value="{!! trans('settings.speichern.3') !!}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment