@@ -17,7 +17,7 @@ import "./shareon.css";
17
17
* }) => string }}
18
18
*/
19
19
const urlBuilderMap = {
20
- facebook : ( d ) => `https://www.facebook.com/sharer/sharer.php?u=${ d . url } ${ d . hashtags ? `&hashtag=%23${ d . hashtags . split ( '%2C' ) [ 0 ] } ` : '' } ` ,
20
+ facebook : ( d ) => `https://www.facebook.com/sharer/sharer.php?u=${ d . url } ${ d . hashtags ? `&hashtag=%23${ d . hashtags . split ( '%2C' ) [ 0 ] } ` : '' } ` ,
21
21
email : ( d ) => `mailto:?subject=${ d . title } &body=${ d . url } ` ,
22
22
linkedin : ( d ) => `https://www.linkedin.com/sharing/share-offsite/?url=${ d . url } ` ,
23
23
mastodon : ( d ) => `https://toot.kytta.dev/?text=${ d . title } %0D%0A${ d . url } ${ d . text ? `%0D%0A%0D%0A${ d . text } ` : '' } ${ d . via ? `%0D%0A%0D%0A${ d . via } ` : '' } ` ,
@@ -28,8 +28,8 @@ const urlBuilderMap = {
28
28
reddit : ( d ) => `https://www.reddit.com/submit?title=${ d . title } &url=${ d . url } ` ,
29
29
teams : ( d ) => `https://teams.microsoft.com/share?href=${ d . url } ${ d . text ? `&msgText=${ d . text } ` : '' } ` ,
30
30
telegram : ( d ) => `https://telegram.me/share/url?url=${ d . url } ${ d . text ? `&text=${ d . text } ` : '' } ` ,
31
- tumblr : ( d ) => `https://www.tumblr.com/widgets/share/tool?posttype=link${ d . hashtags ? `&tags=${ d . hashtags } ` : '' } &title=${ d . title } &content=${ d . url } &canonicalUrl=${ d . url } ${ d . text ? `&caption=${ d . text } ` : '' } ${ d . via ? `&show-via=${ d . via } ` : '' } ` ,
32
- twitter : ( d ) => `https://twitter.com/intent/tweet?url=${ d . url } &text=${ d . title } ${ d . via ? `&via=${ d . via } ` : '' } ${ d . hashtags ? `&hashtags=${ d . hashtags } ` : '' } ` ,
31
+ tumblr : ( d ) => `https://www.tumblr.com/widgets/share/tool?posttype=link${ d . hashtags ? `&tags=${ d . hashtags } ` : '' } &title=${ d . title } &content=${ d . url } &canonicalUrl=${ d . url } ${ d . text ? `&caption=${ d . text } ` : '' } ${ d . via ? `&show-via=${ d . via } ` : '' } ` ,
32
+ twitter : ( d ) => `https://twitter.com/intent/tweet?url=${ d . url } &text=${ d . title } ${ d . via ? `&via=${ d . via } ` : '' } ${ d . hashtags ? `&hashtags=${ d . hashtags } ` : '' } ` ,
33
33
viber : ( d ) => `viber://forward?text=${ d . title } %0D%0A${ d . url } ${ d . text ? `%0D%0A%0D%0A${ d . text } ` : '' } ` ,
34
34
vkontakte : ( d ) => `https://vk.com/share.php?url=${ d . url } &title=${ d . title } ${ d . media ? `&image=${ d . media } ` : '' } ` ,
35
35
whatsapp : ( d ) => `https://wa.me/?text=${ d . title } %0D%0A${ d . url } ${ d . text ? `%0D%0A%0D%0A${ d . text } ` : '' } ` ,
@@ -68,6 +68,13 @@ const init = () => {
68
68
} ) ;
69
69
}
70
70
71
+ // if it's "Print"
72
+ if ( cls === "print" ) {
73
+ child . addEventListener ( "click" , ( ) => {
74
+ window . print ( ) ;
75
+ } ) ;
76
+ }
77
+
71
78
// if it's "Web Share"
72
79
if ( cls === "web-share" ) {
73
80
const data = {
0 commit comments