Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Osnabrück
Stud.IP
Commits
8c8a2717
Commit
8c8a2717
authored
1 year ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
fixed screen reader output for tooltips
parent
d28f3aff
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/visual.inc.php
+12
-3
12 additions, 3 deletions
lib/visual.inc.php
resources/assets/javascripts/bootstrap/tooltip.js
+0
-1
0 additions, 1 deletion
resources/assets/javascripts/bootstrap/tooltip.js
templates/shared/tooltip.php
+7
-4
7 additions, 4 deletions
templates/shared/tooltip.php
with
19 additions
and
8 deletions
lib/visual.inc.php
+
12
−
3
View file @
8c8a2717
...
...
@@ -596,7 +596,12 @@ function tooltipIcon($text, $important = false, $html = false): string
// render tooltip
$template
=
$GLOBALS
[
'template_factory'
]
->
open
(
'shared/tooltip'
);
return
$template
->
render
(
compact
(
'text'
,
'important'
,
'html'
));
return
$template
->
render
([
'text'
=>
$text
,
'important'
=>
$important
,
'html'
=>
$html
,
'tooltip_id'
=>
md5
(
$text
)
.
random_bytes
(
4
)
]);
}
/**
...
...
@@ -608,9 +613,13 @@ function tooltipIcon($text, $important = false, $html = false): string
function
tooltipHtmlIcon
(
$text
,
$important
=
false
)
{
// render tooltip
$html
=
true
;
$template
=
$GLOBALS
[
'template_factory'
]
->
open
(
'shared/tooltip'
);
return
$template
->
render
(
compact
(
'text'
,
'important'
,
'html'
));
return
$template
->
render
([
'text'
=>
$text
,
'important'
=>
$important
,
'html'
=>
true
,
'tooltip_id'
=>
md5
(
$text
)
.
random_bytes
(
4
)
]);
}
/**
...
...
This diff is collapsed.
Click to expand it.
resources/assets/javascripts/bootstrap/tooltip.js
+
0
−
1
View file @
8c8a2717
...
...
@@ -41,7 +41,6 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti
tooltip
=
new
STUDIP
.
Tooltip
(
x
,
y
,
content
);
data
.
tooltipObject
=
tooltip
;
$
(
this
).
attr
(
'
aria-describedby
'
,
tooltip
.
id
);
$
(
this
).
on
(
'
remove
'
,
function
()
{
tooltip
.
remove
();
...
...
This diff is collapsed.
Click to expand it.
templates/shared/tooltip.php
+
7
−
4
View file @
8c8a2717
<span
class=
"tooltip tooltip-icon
<?
if
(
$important
)
echo
'tooltip-important'
;
?>
"
data-tooltip
<?
if
(
!
$html
)
printf
(
'title="%s"'
,
htmlReady
(
$text
))
?>
tabindex=
"0"
>
<?
if
(
$html
)
:
?>
<span
class=
"tooltip-content"
>
<?=
$text
?>
</span>
<?
endif
;
?>
<span
class=
"tooltip tooltip-icon
<?
if
(
$important
)
echo
'tooltip-important'
;
?>
"
data-tooltip
<?
if
(
!
$html
)
printf
(
'title="%s"'
,
htmlReady
(
$text
))
?>
tabindex=
"0"
aria-describedby=
"tooltip_
<?=
htmlReady
(
$tooltip_id
)
?>
"
>
<?
if
(
$html
)
:
?>
<span
class=
"tooltip-content"
>
<?=
$text
?>
</span>
<?
endif
;
?>
</span>
<span
id=
"tooltip_
<?=
htmlReady
(
$tooltip_id
)
?>
"
class=
"sr-only"
>
<?=
htmlReady
(
$text
)
?>
</span>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment