Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
better_social_sharing_buttons
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
better_social_sharing_buttons
Commits
17a09585
Commit
17a09585
authored
8 months ago
by
joachim desarmenien
Committed by
Shelane French
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3447889
by joachim desarmenien: Accessibility fixes
parent
b4351213
No related branches found
No related tags found
1 merge request
!15
Issue #3447889 by joachim-desarmenien : accessibility fixes
Pipeline
#186684
passed
8 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
better_social_sharing_buttons.libraries.yml
+3
-0
3 additions, 0 deletions
better_social_sharing_buttons.libraries.yml
templates/better-social-sharing-buttons.html.twig
+28
-28
28 additions, 28 deletions
templates/better-social-sharing-buttons.html.twig
with
31 additions
and
28 deletions
better_social_sharing_buttons.libraries.yml
+
3
−
0
View file @
17a09585
...
...
@@ -9,6 +9,9 @@ copy-current-url:
version
:
1.x
js
:
js/copy-current-url.js
:
{}
dependencies
:
-
core/drupal
-
core/once
# Load print css
print-css
:
...
...
This diff is collapsed.
Click to expand it.
templates/better-social-sharing-buttons.html.twig
+
28
−
28
View file @
17a09585
...
...
@@ -6,8 +6,8 @@
<div
class=
"social-sharing-buttons"
>
{# Facebook share button #}
{%
if
items.services.facebook
%}
<a
href=
"https://www.facebook.com/sharer/sharer.php?u=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Facebook"
aria-label=
"
{{
'Share to'
|
t
}}
Facebook"
class=
"social-sharing-buttons
-
button share-facebook"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.facebook.com/sharer/sharer.php?u=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Facebook"
aria-label=
"
{{
'Share to'
|
t
}}
Facebook"
class=
"social-sharing-buttons
__
button share-facebook"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#facebook"
/>
</svg>
</a>
...
...
@@ -15,8 +15,8 @@
{# X share button #}
{%
if
items.services.x
%}
<a
href=
"https://twitter.com/intent/tweet?text=
{{
items.title
}}
+
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
X"
aria-label=
"
{{
'Share to'
|
t
}}
X"
class=
"social-sharing-buttons
-
button share-x"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://twitter.com/intent/tweet?text=
{{
items.title
}}
+
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
X"
aria-label=
"
{{
'Share to'
|
t
}}
X"
class=
"social-sharing-buttons
__
button share-x"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#x"
/>
</svg>
</a>
...
...
@@ -24,8 +24,8 @@
{# WhatsApp share button #}
{%
if
items.services.whatsapp
%}
<a
href=
"https://wa.me/?text=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
WhatsApp"
aria-label=
"
{{
'Share to'
|
t
}}
WhatsApp"
class=
"social-sharing-buttons
-
button share-whatsapp"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://wa.me/?text=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
WhatsApp"
aria-label=
"
{{
'Share to'
|
t
}}
WhatsApp"
class=
"social-sharing-buttons
__
button share-whatsapp"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#whatsapp"
/>
</svg>
</a>
...
...
@@ -33,8 +33,8 @@
{# Facebook Messenger share button #}
{%
if
items.services.facebook_messenger
%}
<a
href=
"https://www.facebook.com/dialog/send?app_id=
{{
items.facebook_app_id
}}
&link=
{{
items.page_url
}}
&redirect_uri=
{{
url
(
'<current>'
)
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Facebook Messenger"
aria-label=
"
{{
'Share to'
|
t
}}
Facebook Messenger"
class=
"social-sharing-buttons
-
button share-facebook-messenger"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.facebook.com/dialog/send?app_id=
{{
items.facebook_app_id
}}
&link=
{{
items.page_url
}}
&redirect_uri=
{{
url
(
'<current>'
)
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Facebook Messenger"
aria-label=
"
{{
'Share to'
|
t
}}
Facebook Messenger"
class=
"social-sharing-buttons
__
button share-facebook-messenger"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#messenger"
/>
</svg>
</a>
...
...
@@ -42,8 +42,8 @@
{# Pinterest share button #}
{%
if
items.services.pinterest
%}
<a
href=
"https://pinterest.com/pin/create/link/?url=
{{
items.page_url
}}
&description=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Pinterest"
aria-label=
"
{{
'Share to'
|
t
}}
Pinterest"
class=
"social-sharing-buttons
-
button share-pinterest"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://pinterest.com/pin/create/link/?url=
{{
items.page_url
}}
&description=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Pinterest"
aria-label=
"
{{
'Share to'
|
t
}}
Pinterest"
class=
"social-sharing-buttons
__
button share-pinterest"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#pinterest"
/>
</svg>
</a>
...
...
@@ -51,8 +51,8 @@
{# Linkedin share button #}
{%
if
items.services.linkedin
%}
<a
href=
"https://www.linkedin.com/sharing/share-offsite/?url=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Linkedin"
aria-label=
"
{{
'Share to'
|
t
}}
Linkedin"
class=
"social-sharing-buttons
-
button share-linkedin"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.linkedin.com/sharing/share-offsite/?url=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Linkedin"
aria-label=
"
{{
'Share to'
|
t
}}
Linkedin"
class=
"social-sharing-buttons
__
button share-linkedin"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#linkedin"
/>
</svg>
</a>
...
...
@@ -60,8 +60,8 @@
{# Xing share button #}
{%
if
items.services.xing
%}
<a
href=
"https://www.xing.com/spi/shares/new?url=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Xing"
aria-label=
"
{{
'Share to'
|
t
}}
Xing"
class=
"social-sharing-buttons
-
button share-xing"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.xing.com/spi/shares/new?url=
{{
items.page_url
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Xing"
aria-label=
"
{{
'Share to'
|
t
}}
Xing"
class=
"social-sharing-buttons
__
button share-xing"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#xing"
/>
</svg>
</a>
...
...
@@ -69,8 +69,8 @@
{# Tumblr share button #}
{%
if
items.services.tumblr
%}
<a
href=
"https://www.tumblr.com/share?v=3&u=
{{
items.page_url
}}
&t=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Tumblr"
aria-label=
"
{{
'Share to'
|
t
}}
Tumblr"
class=
"social-sharing-buttons
-
button share-tumblr"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.tumblr.com/share?v=3&u=
{{
items.page_url
}}
&t=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Tumblr"
aria-label=
"
{{
'Share to'
|
t
}}
Tumblr"
class=
"social-sharing-buttons
__
button share-tumblr"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#tumblr"
/>
</svg>
</a>
...
...
@@ -78,8 +78,8 @@
{# Reddit share button #}
{%
if
items.services.reddit
%}
<a
href=
"https://www.reddit.com/submit?url=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Reddit"
aria-label=
"
{{
'Share to'
|
t
}}
Reddit"
class=
"social-sharing-buttons
-
button share-reddit"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.reddit.com/submit?url=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Reddit"
aria-label=
"
{{
'Share to'
|
t
}}
Reddit"
class=
"social-sharing-buttons
__
button share-reddit"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#reddit"
/>
</svg>
</a>
...
...
@@ -87,8 +87,8 @@
{# Evernote share button #}
{%
if
items.services.evernote
%}
<a
href=
"https://www.evernote.com/clip.action?url=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Evernote"
aria-label=
"
{{
'Share to'
|
t
}}
Evernote"
class=
"social-sharing-buttons
-
button share-evernote"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"https://www.evernote.com/clip.action?url=
{{
items.page_url
}}
&title=
{{
items.title
}}
"
target=
"_blank"
title=
"
{{
'Share to'
|
t
}}
Evernote"
aria-label=
"
{{
'Share to'
|
t
}}
Evernote"
class=
"social-sharing-buttons
__
button share-evernote"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#evernote"
/>
</svg>
</a>
...
...
@@ -96,8 +96,8 @@
{# Email share button #}
{%
if
items.services.email
%}
<a
href=
"mailto:?subject=
{{
items.title
}}
&body=
{{
items.page_url
}}
"
title=
"
{{
'Share to'
|
t
}}
Email"
aria-label=
"
{{
'Share to'
|
t
}}
Email"
class=
"social-sharing-buttons
-
button share-email"
target=
"_blank"
rel=
"noopener"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"mailto:?subject=
{{
items.title
}}
&body=
{{
items.page_url
}}
"
title=
"
{{
'Share to'
|
t
}}
Email"
aria-label=
"
{{
'Share to'
|
t
}}
Email"
class=
"social-sharing-buttons
__
button share-email"
target=
"_blank"
rel=
"noopener"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#email"
/>
</svg>
</a>
...
...
@@ -106,11 +106,11 @@
{# Copy link share button #}
{%
if
items.services.copy
%}
{{
attach_library
(
'better_social_sharing_buttons/copy-current-url'
)
}}
<a
class=
"btn
-c
opy social-sharing-buttons
-
button share-copy"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
class=
"btn
C
opy social-sharing-buttons
__
button share-copy"
tabindex=
"0"
role=
"button"
title=
"
{{
'Copy link'
|
t
}}
"
aria-label=
"
{{
'Copy link'
|
t
}}
"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#copy"
/>
</svg>
<div
class=
"social-sharing-buttons
-
popup"
>
{{
'Copied to clipboard'
|
t
}}
</div>
<div
class=
"social-sharing-buttons
__
popup"
role=
"alert"
aria-live=
"assertive"
>
{{
'Copied to clipboard'
|
t
}}
</div>
</a>
{%
endif
%}
...
...
@@ -123,10 +123,10 @@
{%
else
%}
{%
set
href
=
"javascript:window.print()"
%}
{%
endif
%}
<a
href=
"
{{
href
}}
"
rel=
"
{{
rel
}}
"
class=
"bssb-printlink
"
class=
"share-print
"
>
<svg
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<a
href=
"
{{
href
}}
"
rel=
"
{{
rel
}}
"
class=
"bssb-printlink
social-sharing-buttons__button"
class=
"share-print"
title=
"
{{
'Print'
|
t
}}
"
aria-label=
"
{{
'Print'
|
t
}}
"
>
<svg
aria-hidden=
"true"
width=
"
{{
items.width
}}
"
height=
"
{{
items.width
}}
"
style=
"border-radius:
{{
items.radius
}}
;"
>
<use
href=
"
{{
social_buttons_sprite
}}
#print"
/>
</svg>
</a>
{%
endif
%}
</div>
</div>
\ No newline at end of file
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