Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
57
Issues
57
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
ec9f2f63
Commit
ec9f2f63
authored
Feb 19, 2018
by
Aria Givi
Browse files
Options
Browse Files
Download
Plain Diff
Merge 667
parents
daec5a60
8ca3cb83
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
178 additions
and
123 deletions
+178
-123
app/Http/Controllers/StartpageController.php
app/Http/Controllers/StartpageController.php
+0
-11
app/MetaGer.php
app/MetaGer.php
+25
-0
composer.lock
composer.lock
+6
-6
resources/assets/js/searchbar.js
resources/assets/js/searchbar.js
+1
-27
resources/assets/less/metager/foki.less
resources/assets/less/metager/foki.less
+73
-0
resources/assets/less/metager/metager.less
resources/assets/less/metager/metager.less
+1
-0
resources/assets/less/metager/searchbar.less
resources/assets/less/metager/searchbar.less
+16
-15
resources/lang/de/index.php
resources/lang/de/index.php
+1
-1
resources/views/layouts/researchandtabs.blade.php
resources/views/layouts/researchandtabs.blade.php
+2
-2
resources/views/modals/create-focus-modal.blade.php
resources/views/modals/create-focus-modal.blade.php
+41
-45
resources/views/parts/foki.blade.php
resources/views/parts/foki.blade.php
+10
-15
resources/views/parts/searchbar.blade.php
resources/views/parts/searchbar.blade.php
+2
-1
No files found.
app/Http/Controllers/StartpageController.php
View file @
ec9f2f63
...
...
@@ -37,15 +37,6 @@ class StartpageController extends Controller
$autocomplete
=
$option_values
[
'autocomplete'
];
}
foreach
(
$request
->
all
()
as
$key
=>
$value
)
{
if
(
$value
===
'on'
&&
!
in_array
(
$key
,
$optionParams
))
{
$focusPages
[]
=
str_replace
(
'param_'
,
''
,
$key
);
}
if
(
$key
===
'param_theme'
)
{
$theme
=
str_replace
(
'param_'
,
''
,
$key
);
}
}
$lang
=
LaravelLocalization
::
getCurrentLocale
();
if
(
$lang
===
'de'
)
{
$lang
=
'all'
;
...
...
@@ -54,10 +45,8 @@ class StartpageController extends Controller
return
view
(
'index'
)
->
with
(
'title'
,
trans
(
'titles.index'
))
->
with
(
'homeIcon'
)
->
with
(
'focusPages'
,
$focusPages
)
->
with
(
'browser'
,
(
new
Agent
())
->
browser
())
->
with
(
'navbarFocus'
,
'suche'
)
->
with
(
'theme'
,
$theme
)
->
with
(
'focus'
,
$request
->
input
(
'focus'
,
'web'
))
->
with
(
'time'
,
$request
->
input
(
'param_time'
,
'1500'
))
->
with
(
'request'
,
$request
->
input
(
'request'
,
'GET'
))
...
...
app/MetaGer.php
View file @
ec9f2f63
...
...
@@ -90,6 +90,15 @@ class MetaGer
# Erstellt aus den gesammelten Ergebnissen den View
public
function
createView
(
$quicktipResults
=
NULL
)
{
# Hiermit werden die evtl. ausgewählten SuMas extrahiert, damit die Input-Boxen richtig gesetzt werden können
$focusPages
=
[];
foreach
(
$this
->
request
->
all
()
as
$key
=>
$value
)
{
if
(
$value
===
'on'
)
{
$focusPages
[]
=
str_replace
(
'param_'
,
''
,
str_replace
(
'engine_'
,
''
,
$key
));
}
}
$viewResults
=
[];
# Wir extrahieren alle notwendigen Variablen und geben Sie an unseren View:
foreach
(
$this
->
results
as
$result
)
{
...
...
@@ -179,6 +188,7 @@ class MetaGer
default
:
return
view
(
'metager3'
)
->
with
(
'eingabe'
,
$this
->
eingabe
)
->
with
(
'focusPages'
,
$focusPages
)
->
with
(
'mobile'
,
$this
->
mobile
)
->
with
(
'warnings'
,
$this
->
warnings
)
->
with
(
'errors'
,
$this
->
errors
)
...
...
@@ -493,6 +503,12 @@ class MetaGer
$sumaCount
=
0
;
$isCustomSearch
=
$this
->
startsWith
(
$this
->
fokus
,
'focus_'
);
# Im Falle einer Custom-Suche ohne mindestens einer selektierter Suchmaschine wird eine Web-Suche durchgeführt
if
(
$isCustomSearch
&&
!
$this
->
atLeastOneSearchengineSelected
(
$request
))
{
$isCustomSearch
=
false
;
$this
->
fokus
=
'web'
;
}
/* Erstellt die Liste der eingestellten Sumas
* Der einzige Unterschied bei angepasstem Suchfokus ist,
...
...
@@ -1209,6 +1225,15 @@ class MetaGer
}
}
public
function
atLeastOneSearchengineSelected
(
Request
$request
)
{
foreach
(
$request
->
all
()
as
$key
=>
$value
)
{
if
(
$this
->
startsWith
(
$key
,
'engine'
))
{
return
true
;
}
}
return
false
;
}
public
function
showQuicktips
()
{
return
$this
->
quicktips
;
...
...
composer.lock
View file @
ec9f2f63
...
...
@@ -469,7 +469,7 @@
},
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.5
7
",
"version": "v1.2.5
8
",
"source": {
"type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
...
...
@@ -3045,16 +3045,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.7.
3
",
"version": "1.7.
4
",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "
e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf
"
"reference": "
9f901e29c93dae4aa77c0bb161df4276f9c9a1be
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/
e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf
",
"reference": "
e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf
",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/
9f901e29c93dae4aa77c0bb161df4276f9c9a1be
",
"reference": "
9f901e29c93dae4aa77c0bb161df4276f9c9a1be
",
"shasum": ""
},
"require": {
...
...
@@ -3066,7 +3066,7 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
"phpunit/phpunit": "^4.8.35 || ^5.7
|| ^6.5
"
},
"type": "library",
"extra": {
...
...
resources/assets/js/searchbar.js
View file @
ec9f2f63
$
(
function
()
{
loadLocalStorage
();
setSearchbarActionListeners
();
});
/**
...
...
@@ -12,10 +11,6 @@ function loadLocalStorage () {
}
}
function
setSearchbarActionListeners
()
{
$
(
'
#toggleOptBtn
'
).
click
(
toggleOptionsDialog
);
}
function
setSettings
()
{
var
acceptedParams
=
[
'
autocomplete
'
,
'
key
'
,
'
lang
'
,
'
newtab
'
,
'
sprueche
'
];
for
(
var
key
in
localStorage
)
{
...
...
@@ -41,25 +36,4 @@ function setSettings () {
if
(
requestMethod
!==
null
&&
(
requestMethod
===
'
GET
'
||
requestMethod
===
'
POST
'
))
{
$
(
'
#searchForm
'
).
attr
(
'
method
'
,
requestMethod
);
}
}
function
toggleOptionsDialog
()
{
var
btnMode
=
$
(
'
#toggleOptBtn
'
).
attr
(
'
data-mode
'
);
if
(
btnMode
==
'
o
'
)
{
openOptionsDialog
();
}
else
{
closeOptionsDialog
();
}
}
function
openOptionsDialog
()
{
$
(
'
#toggleOptBtn
'
).
html
(
'
<i class="fa fa-chevron-up" aria-hidden="true"></i>
'
);
$
(
'
#toggleOptBtn
'
).
attr
(
'
data-mode
'
,
'
c
'
);
$
(
'
.search-option-frame
'
).
removeClass
(
'
hide
'
);
}
function
closeOptionsDialog
()
{
$
(
'
#toggleOptBtn
'
).
html
(
'
<i class="fa fa-sliders" aria-hidden="true"></i>
'
);
$
(
'
#toggleOptBtn
'
).
attr
(
'
data-mode
'
,
'
o
'
);
$
(
'
.search-option-frame
'
).
addClass
(
'
hide
'
);
}
}
\ No newline at end of file
resources/assets/less/metager/foki.less
0 → 100644
View file @
ec9f2f63
/* Rund ums Fokus Modal */
#show-create-focus:checked {
& + #create-focus-modal {
display: flex;
}
}
#create-focus-modal {
display: none;
position: fixed;
justify-content: center;
min-height: 100%;
background: linear-gradient(rgba(0,0,0,.7),rgba(0,0,0,.7));
z-index: 150;
#foki-modal-dialog {
background-color: white;
max-width: 70%;
margin: 30px auto;
height: 900px;
overflow-y: auto;
#foki-modal-content {
#foki-modal-header {
padding: 15px;
position: relative;
border-bottom: 1px solid #e5e5e5;
#close-create-focus{
position: absolute;
right: 15px;
&::after {
font-size: 24px;
content: "×";
}
}
}
.focus-dropdown-toggle {
display: none;
&:not(:checked) {
& ~ .focus-dropdown-label ~ .row {
max-height: 0px;
overflow: hidden;
}
}
&:checked {
& ~ .focus-dropdown-label::after {
content: "🡡";
}
}
}
.focus-dropdown-label {
&::after {
font-size: 16px;
content: "🡣";
margin-left: 3px;
}
& ~ .row {
-webkit-transition: max-height 0.4s ease; /* Chrome 1-25, Safari 3.2+ */
-moz-transition: max-height 0.4s ease; /* Firefox 4-15 */
-o-transition: max-height 0.4s ease; /* Opera 10.50–12.00 */
transition: max-height 0.4s ease;
max-height: 400px;
}
}
}
}
}
\ No newline at end of file
resources/assets/less/metager/metager.less
View file @
ec9f2f63
...
...
@@ -5,6 +5,7 @@
@import "./settings.less";
@import "./variables.less";
@import "./sidebar.less";
@import "./foki.less";
@import "./footer.less";
@import "./searchbar.less";
@import "./aufruf-winter.less";
\ No newline at end of file
resources/assets/less/metager/searchbar.less
View file @
ec9f2f63
...
...
@@ -176,9 +176,11 @@
}
}
div:hover>
.searchbar-tooltip {
label:hover+
.searchbar-tooltip {
display: inline-block;
@media (max-width: @screen-xs-max) {
top: 30px;
left: -10px;
@media (max-width: 799px) {
display: none;
}
}
...
...
@@ -252,8 +254,6 @@ div:hover>.searchbar-tooltip {
.searchbar-tooltip {
display: none;
position: absolute;
top: 45px;
left: -10px;
&>.searchbar-tooltip-arrow {
position: absolute;
top: -4px;
...
...
@@ -339,24 +339,25 @@ header:nth-child(1) {
display: flex;
width: 100%;
max-width: @resultpage-leftbox-max-width;
background-color: white;
border: 1px solid #ccc;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
background-color: white;
border: 1px solid #ccc;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
overflow-x: auto;
padding: 10px;
&>div {
padding: 0px 10px;
&>a {
color: black;
}
overflow-x: auto;
&>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;
}
margin-left: 7px;
}
/* Scrollbar Style */
&::-webkit-scrollbar {
height: 0px;
...
...
resources/lang/de/index.php
View file @
ec9f2f63
...
...
@@ -119,7 +119,7 @@ return [
'plugin.vivaldi.9'
=>
'Klicken Sie in Ihrem Browser oben links auf das rote Vivaldi Logo und wählen Sie zuerst "Werkzeuge", dann im Untermenü "Einstellungen".'
,
'plugin.vivaldi.10'
=>
'Tragen Sie im Feld "Startseite" "https://metager.de" ein.'
,
'tooltips.add-focus'
=>
'
Eigenen Fokus hinzufüg
en'
,
'tooltips.add-focus'
=>
'
Suche anpass
en'
,
'tooltips.edit-focus'
=>
'Aktuellen Fokus bearbeiten'
,
'tooltips.settings'
=>
'Allgemeine Einstellungen'
,
];
resources/views/layouts/researchandtabs.blade.php
View file @
ec9f2f63
...
...
@@ -33,8 +33,8 @@
<
div
id
=
"results-container"
>
@
yield
(
'results'
)
</
div
>
<
div
id
=
"additions-container"
>
<
div
id
=
"search-settings"
style
=
"display:none"
>
<
div
id
=
"additions-container"
style
=
"display: none;"
>
<
div
id
=
"search-settings"
>
<
h1
>
Eigene
Suche
</
h1
>
@
foreach
(
App\Http\Controllers\FokiLoader
::
loadFoki
()
as
$fokus
=>
$sumas
)
<
h2
class
=
"focus-category"
>
...
...
resources/views/modals/create-focus-modal.blade.php
View file @
ec9f2f63
<div
id=
"create-focus-modal"
class=
"modal fade"
tab-index=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog modal-lg
"
>
<div
class=
"content modal-content
"
>
<div
class=
"modal-header
"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close
"
>
<span
aria-hidden=
"true"
>
×
</span
>
<
/button
>
{{
--
TODO
HIDDEN
INPUT
-
FIELD
fürs
Modal
in
dem
die
vorherige
Eingabe
steht
,
eigenes
<
form
>
tag
fürs
Modal
--
}}
<
input
type
=
"checkbox"
id
=
"show-create-focus"
class
=
"hidden
"
>
<
div
id
=
"create-focus-modal"
tab
-
index
=
"-1"
role
=
"dialog
"
>
<
div
id
=
"foki-modal-dialog
"
>
<
div
id
=
"foki-modal-content
"
>
<
div
id
=
"foki-modal-header"
>
<
label
type
=
"button"
id
=
"close-create-focus"
role
=
"button"
for
=
"show-create-focus"
></
label
>
<
h4
>
@
lang
(
"index.focus-creator.head"
)
</
h4
>
<
p
class
=
"text-muted"
>@
lang
(
"index.focus-creator.description"
)
</
p
>
</div>
<div
class=
"modal-body"
>
<
div
class
=
"clearfix"
>
<div
class=
"pull-left"
>
<label
for=
"focus-name"
>
@lang('index.focus-creator.focusname')
</label>
<input
id=
"focus-name"
type=
"text"
name=
"focus-name"
placeholder=
"@lang('index.focus-creator.name-placeholder')"
>
<input
id=
"original-id"
type=
"hidden"
name=
"original-id"
value=
""
>
</div>
<
div
class
=
"settings-modal-buttons pull-right"
>
<button
class=
"delete-focus-btn btn btn-danger"
>
@lang('index.focus-creator.delete')
</button>
<button
class=
"save-focus-btn btn btn-primary"
>
<
button
type
=
"submit"
form
=
"customSearchForm"
class
=
"save-focus-btn btn btn-primary"
>
@
lang
(
'index.focus-creator.save'
)
</
button
>
</
div
>
</
div
>
@foreach( App\Http\Controllers\FokiLoader::loadFoki() as $fokus => $sumas )
<div
class=
"headingGroup {{ $fokus }}"
>
<h3
class=
"focus-category"
>
@lang("settings.foki." . $fokus)
</h3>
<div
class=
"row"
>
@foreach( $sumas as $name => $data )
<div
class=
"col-sm-6 col-md-4 col-lg-3"
>
<div
class=
"checkbox settings-checkbox"
>
<label>
<input
type=
"checkbox"
name=
"engine_{{ strtolower($name) }}"
class=
"focusCheckbox"
@
if
($
fokus=
='web'
)
checked
@
endif
>
{{ $data['displayName'] }}
<a
class=
"settings-icon"
target=
"_blank"
rel=
"noopener"
href=
"{{ $data['url'] }}"
>
<i
class=
"fa fa-link"
aria-hidden=
"true"
></i>
</a>
</label>
</
div
>
<
div
class
=
"modal-body"
>
<
form
id
=
"customSearchForm"
method
=
"GET"
action
=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
meta
/
meta
.
ger3
") }}"
accept
-
charset
=
"UTF-8"
>
<
input
type
=
"hidden"
name
=
"eingabe"
value
=
"@if(isset(
$eingabe
))
{
{$eingabe}
}
@endif"
>
<
input
type
=
"hidden"
name
=
"encoding"
value
=
"utf8"
>
<
input
type
=
"hidden"
name
=
"focus"
value
=
"focus_custom"
>
@
foreach
(
App\Http\Controllers\FokiLoader
::
loadFoki
()
as
$fokus
=>
$sumas
)
<
div
class
=
"headingGroup {{
$fokus
}}"
>
<
input
type
=
"checkbox"
id
=
"toggle-{{
$fokus
}}-dropdown"
class
=
"focus-dropdown-toggle"
checked
>
<
label
for
=
"toggle-{{
$fokus
}}-dropdown"
class
=
"focus-category focus-dropdown-label h3"
>
@
lang
(
"settings.foki."
.
$fokus
)
</
label
>
<
div
class
=
"row"
>
@
foreach
(
$sumas
as
$name
=>
$data
)
<
div
class
=
"col-sm-6 col-md-4 col-lg-3"
>
<
div
class
=
"checkbox settings-checkbox"
>
<
label
>
<
input
type
=
"checkbox"
name
=
"engine_{{ strtolower(
$name
) }}"
class
=
"focusCheckbox"
@
if
(
isset
(
$focusPages
)
&&
in_array
(
strtolower
(
$name
),
$focusPages
))
checked
@
endif
>
{{
$data
[
'displayName'
]
}}
<
a
class
=
"settings-icon"
target
=
"_blank"
rel
=
"noopener"
href
=
"{{
$data['url']
}}"
>
<
i
class
=
"fa fa-link"
aria
-
hidden
=
"true"
></
i
>
</
a
>
</
label
>
</
div
>
</
div
>
@
endforeach
</
div
>
@endforeach
</
div
>
@
endforeach
<
div
class
=
"clearfix"
>
<
div
class
=
"settings-modal-buttons pull-right"
>
<
button
type
=
"submit"
class
=
"save-focus-btn btn btn-primary"
>
@
lang
(
'index.focus-creator.save'
)
</
button
>
</
div
>
</
div
>
@endforeach
<div
class=
"clearfix"
>
<div
class=
"settings-modal-buttons pull-right"
>
<button
class=
"delete-focus-btn btn btn-danger"
>
@lang('index.focus-creator.delete')
</button>
<button
class=
"save-focus-btn btn btn-primary"
>
@lang('index.focus-creator.save')
</button>
</div>
</div>
</
form
>
</
div
>
</
div
>
</
div
>
...
...
resources/views/parts/foki.blade.php
View file @
ec9f2f63
...
...
@@ -14,18 +14,13 @@
<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"
>
<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>
<label
for=
"show-create-focus"
role=
"button"
id=
""
>
<i
class=
"fa fa-sliders"
></i>
</label>
<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>
resources/views/parts/searchbar.blade.php
View file @
ec9f2f63
...
...
@@ -23,7 +23,8 @@
@
if
(
isset
(
$option_values
))
<
input
type
=
"hidden"
name
=
"time"
value
=
{{
$time
}}
>
@
endif
@
if
(
isset
(
$focusPages
))
@
if
(
isset
(
$focusPages
)
&&
!
empty
(
$focusPages
))
<
input
type
=
"hidden"
name
=
"focus"
value
=
"focus_custom"
>
@
foreach
(
$focusPages
as
$fp
)
<
input
type
=
"hidden"
name
=
{{
$fp
}}
value
=
"on"
>
@
endforeach
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment