From: Vincent Vanwaelscappel Date: Thu, 2 Nov 2017 16:33:42 +0000 (+0100) Subject: done #1775 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7e804fbb5e5cd68376c0f9a836c8247477fb03e6;p=fluidbook-html5.git done #1775 @1.5 --- diff --git a/js/libs/fluidbook/fluidbook.share.js b/js/libs/fluidbook/fluidbook.share.js index 2d9352c5..6f8f76aa 100644 --- a/js/libs/fluidbook/fluidbook.share.js +++ b/js/libs/fluidbook/fluidbook.share.js @@ -1,7 +1,7 @@ function FluidbookShare(fluidbook) { this.fluidbook = fluidbook; - if(this.isEnabled()){ - var $this=this; + if (this.isEnabled()) { + var $this = this; $(document).on('click', '.share', function () { var f = 'send' + ucfirst($(this).data('service')); $this[f](); @@ -30,7 +30,7 @@ FluidbookShare.prototype = { return res; }, - getShareLinks: function(hideLabels) { + getShareLinks: function (hideLabels) { var shareLinks = {}, shareHTML = ''; @@ -72,13 +72,14 @@ FluidbookShare.prototype = { }, openShare: function (p1, p2, callback) { - + var view; view = '
' + this.fluidbook.menu.closeButton() + '

' + this.fluidbook.l10n.__('share') + '

'; view += '
'; view += this.getShareLinks(); - view += '
';; + view += ''; + ; $("#view").append('
' + view + '
'); if (callback != undefined) { @@ -93,6 +94,11 @@ FluidbookShare.prototype = { body = this.fluidbook.datas.title + ' : ' + this.getShareURL(); } + // Normalize new lines + body = body.replace(/\r\n/g, "\n"); + body = body.replace(/\r/g, "\n"); + body = body.replace(/\n/g, "\r\n"); + if (this.fluidbook.datas.phonegap == 'android') { var extras = {}; extras[window.plugins.webintent.EXTRA_SUBJECT] = subject;