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
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
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
06a4d28f
Commit
06a4d28f
authored
Aug 12, 2019
by
Aria Givi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some name changes for clarity
parent
2f8d92a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
27 deletions
+27
-27
resources/js/keyboardNavigation.js
resources/js/keyboardNavigation.js
+16
-17
resources/less/metager/pages/resultpage.less
resources/less/metager/pages/resultpage.less
+1
-1
resources/less/metager/pages/resultpage/keyboard-nav.less
resources/less/metager/pages/resultpage/keyboard-nav.less
+2
-2
resources/views/layouts/keyboardNavBox.blade.php
resources/views/layouts/keyboardNavBox.blade.php
+5
-5
webpack.mix.js
webpack.mix.js
+3
-2
No files found.
resources/js/keyboardNavigation.js
View file @
06a4d28f
var
ctrlInfo
=
false
;
// Flag used for checking if the user was shown the keyboard control information
var
currentResultIndex
=
1
;
// stores index of result which was focused last
var
current
ElementData
=
{
// Object used for storing currently focused element and element type (e.g. anchor tag or result div)
var
current
FocusedElement
=
{
// Object used for storing currently focused element and element type (e.g. anchor tag or result div)
element
:
$
(
"
div.result
"
).
first
(),
type
:
"
result
"
};
...
...
@@ -18,11 +18,10 @@ $(document).on('keydown', function(e) {
}
});
function
setFocus
(
e
,
type
)
{
currentElementData
.
element
=
e
;
currentElementData
.
type
=
type
;
console
.
log
(
currentElementData
);
currentElementData
.
element
.
focus
();
function
focusElement
(
e
,
type
)
{
currentFocusedElement
.
element
=
e
;
currentFocusedElement
.
type
=
type
;
currentFocusedElement
.
element
.
focus
();
}
function
tabKeyPressed
()
{
...
...
@@ -35,31 +34,31 @@ function tabKeyPressed() {
}
function
enterKeyPressed
()
{
if
(
current
ElementData
.
type
===
"
result
"
)
{
if
(
current
FocusedElement
.
type
===
"
result
"
)
{
console
.
log
(
$
(
"
:focus
"
).
find
(
"
a
"
).
first
());
setFocus
(
$
(
"
:focus
"
).
find
(
"
a
"
).
first
(),
"
link
"
)
}
else
if
(
current
ElementData
.
type
===
"
link
"
)
{
window
.
location
=
current
ElementData
.
element
.
attr
(
'
href
'
);
focusElement
(
$
(
"
:focus
"
).
find
(
"
a
"
).
first
(),
"
link
"
)
}
else
if
(
current
FocusedElement
.
type
===
"
link
"
)
{
window
.
location
=
current
FocusedElement
.
element
.
attr
(
'
href
'
);
}
}
function
showInfoBox
()
{
$
(
"
#keyboard-
ctrl
-info
"
).
show
();
setFocus
(
$
(
"
#keyboard-ctrl
-info
"
),
"
infobox
"
);
$
(
"
#keyboard-
nav
-info
"
).
show
();
focusElement
(
$
(
"
#keyboard-nav
-info
"
),
"
infobox
"
);
}
function
focusNextElement
()
{
if
(
current
ElementData
.
type
===
"
result
"
)
{
if
(
current
FocusedElement
.
type
===
"
result
"
)
{
focusNextResult
();
}
else
{
setFocus
(
$
(
"
div.result
"
).
not
(
'
.ad
'
).
first
(),
"
result
"
);
focusElement
(
$
(
"
div.result
"
).
not
(
'
.ad
'
).
first
(),
"
result
"
);
}
}
function
focusNextResult
()
{
if
(
current
ElementData
.
element
.
next
().
length
>
0
)
{
setFocus
(
currentElementData
.
element
.
next
(),
"
result
"
);
if
(
current
FocusedElement
.
element
.
next
().
length
>
0
)
{
focusElement
(
currentFocusedElement
.
element
.
next
(),
"
result
"
);
}
else
{
setFocus
(
$
(
"
div.result
"
).
not
(
'
.ad
'
).
first
(),
"
result
"
);
focusElement
(
$
(
"
div.result
"
).
not
(
'
.ad
'
).
first
(),
"
result
"
);
}
}
resources/less/metager/pages/resultpage.less
View file @
06a4d28f
...
...
@@ -3,4 +3,4 @@
@import "./resultpage/product.less";
@import "./resultpage/quicktips.less";
@import "./resultpage/result-saver.less";
@import "./resultpage/keyboard-ctrl.less";
\ No newline at end of file
@import "./resultpage/keyboard-nav.less";
\ No newline at end of file
resources/less/metager/pages/resultpage/keyboard-
ctrl
.less
→
resources/less/metager/pages/resultpage/keyboard-
nav
.less
View file @
06a4d28f
/* Keyboard control styles*/
#keyboard-
ctrl
-info {
#keyboard-
nav
-info {
display: none;
position: relative;
margin: 10px 0;
...
...
@@ -14,7 +14,7 @@
border: 10px solid yellow;
}
.keyboard-
ctrl
-info-header{
.keyboard-
nav
-info-header{
text-align: center;
h5 {
font-weight: bold;
...
...
resources/views/layouts/keyboardNavBox.blade.php
View file @
06a4d28f
<div
id=
"keyboard-
ctrl
-info"
tabindex=
"0"
>
<div
class=
"keyboard-
ctrl
-info-content"
>
<div
class=
"keyboard-
ctrl
-info-header"
>
<h5
class=
"keyboard-
ctrl
-info-title"
>
Tastatur-Navigationsanleitung
</h5>
<div
class=
"keyboard-
ctrl
-info-body"
>
<div
id=
"keyboard-
nav
-info"
tabindex=
"0"
>
<div
class=
"keyboard-
nav
-info-content"
>
<div
class=
"keyboard-
nav
-info-header"
>
<h5
class=
"keyboard-
nav
-info-title"
>
Tastatur-Navigationsanleitung
</h5>
<div
class=
"keyboard-
nav
-info-body"
>
<p>
Die Navigation durch die Ergebnisseite ist hierarchisch aufgebaut.
</p>
<ul>
<li>
TAB-Taste: Innerhalb der aktuellen Ebene zum nächsten Element springen.
</li>
...
...
webpack.mix.js
View file @
06a4d28f
...
...
@@ -60,7 +60,8 @@ mix
[
"
resources/js/scriptResultPage.js
"
,
"
resources/js/result-saver.js
"
,
"
resources/js/translations.js
"
"
resources/js/translations.js
"
,
"
resources/js/keyboardNavigation.js
"
],
"
public/js/scriptResultPage.js
"
)
...
...
@@ -68,7 +69,7 @@ mix
.
babel
(
"
resources/js/bitpay.js
"
,
"
public/js/bitpay.js
"
)
// utility
.
babel
(
[
"
resources/js/utility.js
"
,
"
resources/js/
keyboardNavigation.js
"
,
"
resources/js/
translations.js
"
],
[
"
resources/js/utility.js
"
,
"
resources/js/translations.js
"
],
"
public/js/utility.js
"
)
.
babel
(
"
resources/js/widgets.js
"
,
"
public/js/widgets.js
"
)
...
...
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