From: Matthias Schmidt Date: Thu, 7 Feb 2019 18:11:52 +0000 (+0100) Subject: Add share button support in message share content dialog X-Git-Tag: 5.2.0_Alpha_1~304 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fec37b1ad2daa6fed8743e27fb04f3955564074;p=GitHub%2FWoltLab%2FWCF.git Add share button support in message share content dialog Close #2845 --- diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index cdb140c01d..4e2a33171c 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -2181,10 +2181,19 @@ WCF.Message.Share.Content = Class.extend({ */ _dialog: null, + /** + * template containing the social media share buttons + * @var string + */ + _shareButtonsTemplate: '', + /** * Initializes the WCF.Message.Share.Content class. + * + * @param {string?} shareButtonsTemplate */ - init: function() { + init: function(shareButtonsTemplate) { + this._shareButtonsTemplate = shareButtonsTemplate || ''; this._cache = { }; this._dialog = null; @@ -2235,6 +2244,12 @@ WCF.Message.Share.Content = Class.extend({ var $section = $('

').appendTo(this._dialog); $('').attr('value', '' + WCF.String.escapeHTML($title) + '').appendTo($section); + // share buttons + if (this._shareButtonsTemplate !== '') { + $section = $('

' + WCF.Language.get('wcf.message.share') + '

' + this._shareButtonsTemplate + '
').appendTo(this._dialog); + elData($section.children('.jsMessageShareButtons')[0], 'url', WCF.String.escapeHTML($link)); + } + this._cache[$key] = this._dialog.html(); if ($dialogInitialized) {