Add support for the native web share API in share dialog (#4201)
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / headIncludeJavaScript.tpl
index 9b70fc5a07883202dff4d5b24db538cf047baffd..fe9b47518ae4dc970cd0316aeeceb5e02fda99fe 100644 (file)
@@ -133,7 +133,28 @@ window.addEventListener('pageshow', function(event) {
                        'wcf.date.datePicker.hour': '{jslang}wcf.date.datePicker.hour{/jslang}',
                        'wcf.date.datePicker.minute': '{jslang}wcf.date.datePicker.minute{/jslang}',
                        'wcf.global.form.password.button.hide': '{jslang}wcf.global.form.password.button.hide{/jslang}',
-                       'wcf.global.form.password.button.show': '{jslang}wcf.global.form.password.button.show{/jslang}'
+                       'wcf.global.form.password.button.show': '{jslang}wcf.global.form.password.button.show{/jslang}',
+                       'wcf.message.share': '{jslang}wcf.message.share{/jslang}',
+                       'wcf.message.share.facebook': '{jslang}wcf.message.share.facebook{/jslang}',
+                       'wcf.message.share.twitter': '{jslang}wcf.message.share.twitter{/jslang}',
+                       'wcf.message.share.reddit': '{jslang}wcf.message.share.reddit{/jslang}',
+                       'wcf.message.share.whatsApp': '{jslang}wcf.message.share.whatsApp{/jslang}',
+                       'wcf.message.share.linkedIn': '{jslang}wcf.message.share.linkedIn{/jslang}',
+                       'wcf.message.share.pinterest': '{jslang}wcf.message.share.pinterest{/jslang}',
+                       'wcf.message.share.xing': '{jslang}wcf.message.share.xing{/jslang}',
+                       'wcf.message.share.permalink': '{jslang}wcf.message.share.permalink{/jslang}',
+                       'wcf.message.share.permalink.bbcode': '{jslang}wcf.message.share.permalink.bbcode{/jslang}',
+                       'wcf.message.share.permalink.html': '{jslang}wcf.message.share.permalink.html{/jslang}',
+                       'wcf.message.share.socialMedia': '{jslang}wcf.message.share.socialMedia{/jslang}',
+                       'wcf.message.share.copy': '{jslang}wcf.message.share.copy{/jslang}',
+                       'wcf.message.share.copy.success': '{jslang}wcf.message.share.copy.success{/jslang}',
+                       'wcf.message.share.nativeShare': '{jslang}wcf.message.share.nativeShare{/jslang}',
+                       'wcf.global.button.rss': '{jslang}wcf.global.button.rss{/jslang}',
+                       'wcf.global.rss.copy': '{jslang}wcf.global.rss.copy{/jslang}',
+                       'wcf.global.rss.copy.success': '{jslang}wcf.global.rss.copy.success{/jslang}',
+                       'wcf.global.rss.accessToken.info': '{jslang}wcf.global.rss.accessToken.info{/jslang}',
+                       'wcf.global.rss.withoutAccessToken': '{jslang}wcf.global.rss.withoutAccessToken{/jslang}',
+                       'wcf.global.rss.withAccessToken': '{jslang}wcf.global.rss.withAccessToken{/jslang}'
                        {if MODULE_LIKE}
                                ,'wcf.like.button.like': '{jslang}wcf.like.button.like{/jslang}',
                                'wcf.like.button.dislike': '{jslang}wcf.like.button.dislike{/jslang}',
@@ -146,6 +167,12 @@ window.addEventListener('pageshow', function(event) {
                        {event name='javascriptLanguageImport'}
                });
                
+               User.init(
+                       {@$__wcf->user->userID},
+                       '{@$__wcf->user->username|encodeJS}',
+                       {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if}
+               );
+               
                BootstrapFrontend.setup({
                        backgroundQueue: {
                                url: '{link controller="BackgroundQueuePerform"}{/link}',
@@ -153,10 +180,11 @@ window.addEventListener('pageshow', function(event) {
                        },
                        enableUserPopover: {if $__wcf->getSession()->getPermission('user.profile.canViewUserProfile')}true{else}false{/if},
                        executeCronjobs: {if $executeCronjobs}true{else}false{/if},
+                       {if ENABLE_SHARE_BUTTONS}
+                           shareButtonProviders: [{implode from="\n"|explode:SHARE_BUTTONS_PROVIDERS item=shareButtonProvider}'{$shareButtonProvider}'{/implode}],
+                       {/if}
                        styleChanger: {if $__wcf->getStyleHandler()->showStyleChanger()}true{else}false{/if}
                });
-               
-               User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}', {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if});
        });
        
        // prevent jQuery and other libraries from utilizing define()