diff --git a/package.json b/package.json index fd12c00763609e8434553155e272ee8afd67f845..7980d902a5d2a402c581521c14e491b508f14eed 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,8 @@ { "locator": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git", "id": "phonegap-plugin-barcodescanner" - } + }, + "cordova-plugin-inappbrowser" ], "cordovaPlatforms": [ "ios", diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index ba2fae96e7c910405cc4b187e9999369fe32f656..cc5e8838268806d2267a16a899534e986330ed50 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -545,6 +545,7 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, U $scope.alreadyCertified = true; UIUtils.alert.info('INFO.CERTIFICATION_DONE'); $scope.formData.received_cert_pending.unshift(cert); + $scope.formData.requirements.pendingCertificationCount++; $scope.doMotion(); } }) diff --git a/www/js/services/device-services.js b/www/js/services/device-services.js index ee980fb1df76262f55284b929838970b4bb3de58..8f0df0a2b3331aa07fb97b07151083732a367277 100644 --- a/www/js/services/device-services.js +++ b/www/js/services/device-services.js @@ -25,26 +25,6 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services'] exports.enable = false; // endRemoveIf(device) - // Replace the '$ionicPlatform.ready()', to enable multiple calls - function ready() { - if (!readyPromise) { - readyPromise = $ionicPlatform.ready().then(function(){ - - var enableCamera = !!navigator.camera; - exports.enable = enableCamera; - - if (exports.enable){ - var enableBarcodeScanner = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner; - console.debug('[device] Ionic platform ready, with [barcodescanner={0}] [camera={1}]'.format(enableBarcodeScanner, enableCamera)); - } - else { - console.debug('[device] Ionic platform ready - no device detected.'); - } - }); - } - return readyPromise; - } - function getPicture(options) { if (!exports.enable) { return $q.reject("Camera not enable. Please call 'Device.ready()' once before use (e.g in app.js)."); @@ -138,7 +118,34 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services'] return deferred.promise; } - exports.ready = ready; + // Replace the '$ionicPlatform.ready()', to enable multiple calls + readyPromise = $ionicPlatform.ready(); + function ready() { + return readyPromise; + } + + readyPromise.then(function(){ + + var enableCamera = !!navigator.camera; + exports.enable = enableCamera; + + if (exports.enable){ + var enableBarcodeScanner = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner; + + console.debug('[device] Ionic platform ready, with [barcodescanner={0}] [camera={1}]'.format(enableBarcodeScanner, enableCamera)); + + if (cordova.InAppBrowser) { + console.debug('[device] Enabling InAppBrowser'); + } + } + else { + console.debug('[device] Ionic platform ready - no device detected.'); + } + }); + + exports.ready = function() { + return readyPromise; + }; exports.clipboard = {copy: copy}; exports.camera = { getPicture : getPicture, diff --git a/www/js/services/modal-services.js b/www/js/services/modal-services.js index ae94cc5a18e3e034e921cb34667cfb8b5f640c2e..cb86214f810fb6b19dc32872b80e3820501c0f69 100644 --- a/www/js/services/modal-services.js +++ b/www/js/services/modal-services.js @@ -165,6 +165,7 @@ angular.module('cesium.modal.services', []) parameters); } + return { showTransfer: showTransfer, showLogin: showLogin, diff --git a/www/js/services/utils-services.js b/www/js/services/utils-services.js index a885daa7cfbd7338d6536deb77f14702ed13e970..20df2ef7f07dffa9b18dd4edddc3726e66070d38 100644 --- a/www/js/services/utils-services.js +++ b/www/js/services/utils-services.js @@ -380,6 +380,18 @@ angular.module('cesium.utils.services', ['ngResource']) return deferred.promise; } + function showCopyPopover(event, value) { + var rows = value && value.indexOf('\n') >= 0 ? value.split('\n').length : 1; + showPopover(event, { + templateUrl: 'templates/common/popover_copy.html', + bindings: { + value: value, + rows: rows + }, + autoselect: '.popover-copy ' + (rows <= 1 ? 'input' : 'textarea') + }); + } + function showSharePopover(event, options) { options = options || {}; options.templateUrl = options.templateUrl ? options.templateUrl : 'templates/common/popover_share.html'; @@ -645,6 +657,7 @@ angular.module('cesium.utils.services', ['ngResource']) }, popover: { show: showPopover, + copy: showCopyPopover, share: showSharePopover, helptip: showHelptip }, diff --git a/www/plugins/es/js/controllers/common-controllers.js b/www/plugins/es/js/controllers/common-controllers.js index d7b802bccc0538a79f94a2a278baca6ac2d90507..325de74b60de46e6d86e982f58866b0871a9715f 100644 --- a/www/plugins/es/js/controllers/common-controllers.js +++ b/www/plugins/es/js/controllers/common-controllers.js @@ -6,6 +6,8 @@ angular.module('cesium.es.common.controllers', ['ngResource', 'cesium.es.service .controller('ESSocialsEditCtrl', ESSocialsEditController) + .controller('ESSocialsViewCtrl', ESSocialsViewController) + .controller('ESCommentsCtrl', ESCommentsController) .controller('ESCategoryModalCtrl', ESCategoryModalController) @@ -282,7 +284,7 @@ function ESCommentsController($scope, $timeout, $filter, $state, $focus, UIUtils }; } -function ESSocialsEditController($scope, $focus, $timeout, $filter, UIUtils, SocialUtils) { +function ESSocialsEditController($scope, $focus, $filter, UIUtils, SocialUtils) { 'ngInject'; $scope.socialData = { @@ -327,3 +329,23 @@ function ESSocialsEditController($scope, $focus, $timeout, $filter, UIUtils, Soc $focus('socialUrl'); }; } + +function ESSocialsViewController($scope, $window, Device, UIUtils) { + 'ngInject'; + + $scope.open = function(event, social) { + if (!social) return; + var url = (social.type == 'email') ? ('mailto:' + social.url) : social.url; + + // If email, do not try to open, but copy value + if (!Device.enable && social.type == 'email') { + UIUtils.popover.copy(event, social.url); + return; + } + + // Open the url + // Note: If device is enable, this will use InAppBrowser cordova plugin + $window.open(url, '_system', 'location=yes'); + }; + +} diff --git a/www/plugins/es/js/services/notification-services.js b/www/plugins/es/js/services/notification-services.js index 5e55002c9a9701338fa9ed91656cf5f4654fe63a..ea1f80cc435cccc300aa1e7eb240e17faa508142 100644 --- a/www/plugins/es/js/services/notification-services.js +++ b/www/plugins/es/js/services/notification-services.js @@ -205,8 +205,10 @@ angular.module('cesium.es.notification.services', ['cesium.services', 'cesium.es var userEventWs = that.raw.ws.getUserEvent(); listeners.push(userEventWs.close); return userEventWs.on( - function(){ - $rootScope.$apply(onNewNotification); + function(event){ + $rootScope.$apply(function() { + onNewNotification(event); + }); }, {pubkey: data.pubkey, locale: csSettings.data.locale.id} ) diff --git a/www/plugins/es/templates/user/items_profile.html b/www/plugins/es/templates/user/items_profile.html index e1bd076a9d0809f04e604ac907e2716bdaa35bac..69ebd065a1145874cadc68d96aeedf070bb70f4f 100644 --- a/www/plugins/es/templates/user/items_profile.html +++ b/www/plugins/es/templates/user/items_profile.html @@ -25,19 +25,19 @@ </div> <!-- Socials networks --> -<div class="item" ng-if="formData.profile.socials && formData.profile.socials.length"> +<div class="item" ng-if="formData.profile.socials && formData.profile.socials.length" ng-controller="ESSocialsViewCtrl"> <span class="gray" translate>PROFILE.SOCIAL_NETWORKS_DIVIDER</span> <div class="list no-padding"> - <ion-item class="item-icon-left item-text-wrap no-padding-bottom" - ng-repeat="social in formData.profile.socials track by social.url" - id="social-{{::social.url|formatSlug}}"> + <ion-item ng-repeat="social in formData.profile.socials track by social.url" + id="social-{{::social.url|formatSlug}}" + class="item-icon-left item-text-wrap no-padding-bottom ink" + ng-click="open($event, social)"> <i class="icon ion-social-{{social.type}}" ng-class="{'ion-bookmark': social.type == 'other', 'ion-link': social.type == 'web', 'ion-email': social.type == 'email'}"></i> <p ng-if="social.type && social.type != 'web'">{{social.type}}</p> - <h2> - <a href="{{social.url}}" ng-if="social.type != 'email'" target="_blank">{{::social.url}}</a> - <a href="mailto:{{social.url}}" ng-if="social.type == 'email'">{{::social.url}}</a> - </h2> + <h4> + <a>{{::social.url}}</a> + </h4> </ion-item> </div> </div>