From 16d4913e5a6b7a0e5b7abfaee36877c7a5d685ab Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Sat, 17 Sep 2016 10:53:50 +0200 Subject: [PATCH] - Add facebook and googplus share link - Fix share popover on firefox --- www/i18n/locale-en.json | 1 + www/i18n/locale-fr-FR.json | 7 +++-- www/js/controllers/wallet-controllers.js | 2 +- www/js/controllers/wot-controllers.js | 2 +- .../es/js/controllers/market-controllers.js | 3 +- www/templates/common/popover_share.html | 29 ++++++++++++------- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 541f7268a..b1b6cc4d1 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -43,6 +43,7 @@ "SHARE_ON_TWITTER": "Share on Twitter", "SHARE_ON_FACEBOOK": "Share on Facebook", "SHARE_ON_DIASPORA": "Share on Diaspora*", + "SHARE_ON_GOOGLEPLUS": "Share on Google+" } }, "SYSTEM": { diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 52c82241b..597f3c972 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -40,9 +40,10 @@ "RESULTS_LIST": "Résultats :", "POPOVER_SHARE": { "TITLE": "Partager", - "SHARE_ON_TWITTER": "Partager ce lien sur Twitter", - "SHARE_ON_FACEBOOK": "Partager ce lien sur Facebook", - "SHARE_ON_DIASPORA": "Partager ce lien sur Diaspora*", + "SHARE_ON_TWITTER": "Partager sur Twitter", + "SHARE_ON_FACEBOOK": "Partager sur Facebook", + "SHARE_ON_DIASPORA": "Partager sur Diaspora*", + "SHARE_ON_GOOGLEPLUS": "Partager sur Google+" } }, "SYSTEM": { diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index ec01d1346..90f980ec0 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -311,7 +311,7 @@ function WalletController($scope, $q, $ionicPopup, $timeout, $state, screenmatch }); }; - $scope.showSharePopover = function() { + $scope.showSharePopover = function(event) { var title = $scope.walletData.name || $scope.walletData.uid || $scope.walletData.pubkey; var url = $state.href('app.wot_view_identity', {pubkey: $scope.walletData.pubkey, uid: $scope.walletData.name || $scope.walletData.uid}, {absolute: true}); UIUtils.popover.share(event, { diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index 821db865d..585d06413 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -297,7 +297,7 @@ function WotIdentityViewController($scope, $state, screenmatch, $timeout, UIUtil }); }; - $scope.showSharePopover = function() { + $scope.showSharePopover = function(event) { var title = $scope.formData.name || $scope.formData.uid || $scope.formData.pubkey; var url = $state.href('app.wot_view_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.name || $scope.formData.uid}, {absolute: true}); UIUtils.popover.share(event, { diff --git a/www/plugins/es/js/controllers/market-controllers.js b/www/plugins/es/js/controllers/market-controllers.js index 9d8327bf4..3c390d043 100644 --- a/www/plugins/es/js/controllers/market-controllers.js +++ b/www/plugins/es/js/controllers/market-controllers.js @@ -566,7 +566,8 @@ function ESMarketRecordViewController($scope, $anchorScroll, $ionicPopover, $sta titleKey: 'MARKET.VIEW.POPOVER_SHARE_TITLE', titleValues: {title: title}, time: $scope.formData.time, - postMessage: title + postMessage: title, + postImage: $scope.pictures.length > 0 ? $scope.pictures[0] : null } }); }; diff --git a/www/templates/common/popover_share.html b/www/templates/common/popover_share.html index 6abe49904..f90d28256 100644 --- a/www/templates/common/popover_share.html +++ b/www/templates/common/popover_share.html @@ -25,22 +25,31 @@ <div class="bar bar-footer "> <div class="button-bar"> + + <a class="button button-icon positive icon ion-social-facebook" + href="https://www.facebook.com/sharer/sharer.php?u={{postUrl|formatEncodeURI}}&title={{postMessage|formatEncodeURI}}" + onclick="window.open(this.href, 'facebook-share','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=580,height=296');return false;" + title="{{'COMMON.POPOVER_SHARE.SHARE_ON_FACEBOOK'|translate}}"> + </a> + <a class="button button-icon positive icon ion-social-twitter" - href="https://twitter.com/intent/tweet?url={{postUrl|formatEncodeURI}}&text={{postMessage}}" - target="_blank" + href="https://twitter.com/intent/tweet?url={{postUrl|formatEncodeURI}}&text={{postMessage|formatEncodeURI}}" + onclick="window.open(this.href, 'twitter-share','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=580,height=296');return false;" title="{{'COMMON.POPOVER_SHARE.SHARE_ON_TWITTER'|translate}}"> </a> - <!--a class="button-icon button-small pull-left" - href="https://twitter.com/intent/tweet?url={{postUrl|formatEncodeURI}}&text={{postMessage}}" - target="_blank" - title="{{'COMMON.POPOVER_SHARE.SHARE_ON_FACEBOOK'|translate}}"> - <i class="icon ion-social-facebook"></i> - </a--> + + <a class="button button-icon positive icon ion-social-googleplus" + href="https://plus.google.com/share?url={{postUrl|formatEncodeURI}}" + onclick="window.open(this.href, 'google-plus-share', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=296,width=580');return false;" + title="{{'COMMON.POPOVER_SHARE.SHARE_ON_GOOGLEPLUS'|translate}}"> + </a> + <a class="button button-icon positive icon ion-social-diaspora" - href="https://sharetodiaspora.github.io/?title={{postMessage}}&url={{postUrl|formatEncodeURI}}" - target="_blank" + href="https://sharetodiaspora.github.io/?title={{postMessage|formatEncodeURI}}&url={{postUrl|formatEncodeURI}}" + onclick="window.open(this.href, 'diaspora-share','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=580,height=296');return false;" title="{{'COMMON.POPOVER_SHARE.SHARE_ON_DIASPORA'|translate}}"> </a> + <a class="button-close" title="{{'COMMON.BTN_CLOSE'|translate}}" ng-click="closePopover()"> -- GitLab