diff --git a/app/config.json b/app/config.json index e1da45a7c006ad45ce9e53132f3d2abddd17b011..51ea572428cc3ce161a8cf2fdef75c3a43e3e050 100644 --- a/app/config.json +++ b/app/config.json @@ -13,6 +13,7 @@ "expertMode": false, "decimalCount": 2, "httpsMode": false, + "shareBaseUrl": "https://g1.duniter.fr", "helptip": { "enable": true, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" @@ -69,6 +70,7 @@ "expertMode": false, "decimalCount": 2, "httpsMode": false, + "shareBaseUrl": "https://g1.duniter.fr", "helptip": { "enable": true, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" @@ -118,6 +120,7 @@ "useRelative": false, "expertMode": true, "decimalCount": 2, + "shareBaseUrl": "https://g1.duniter.fr", "helptip": { "enable": false, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" diff --git a/doc/configuration.md b/doc/configuration.md index cc88b445fde9d8c788acf84905031d2148a8a718..5dac7e8128170a5631ead4a2a21246405551272e 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -22,6 +22,7 @@ angular.module("cesium.config", []) "expertMode": false, "decimalCount": 2, "httpsMode": false, + "shareBaseUrl": "https://g1.duniter.fr", "helptip": { "enable": true, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" @@ -108,6 +109,7 @@ cacheTimeMs | Default network request cache time, in millisecond fallbackLanguage | Default locale, if browser default language not exists in Cesium | `en` defaultLanguage | Used to force the default language (ignore browser's language), on user first connection. | =`fallbackLanguage` decimalCount | Number of decimal to display, on float value (when using relative unit) | `4` +shareBaseUrl | Used in share buttons, to reference another web site. | not defined (will use navigator's window location) helptip.installDocUrl | Used in features tour, for the link 'How-to install my own node'. | URL of [Duniter installation node](https://github.com/duniter/duniter/blob/master/doc/install-a-node.md) newIssueUrl | Used for link in the About screen, to submit new issue | URL of [Cesium issues on GitHub](https://github.com/duniter/cesium/issues/new?labels=bug) timeout | Default network request timeout, in millisecond. | `4000` diff --git a/www/js/config.js b/www/js/config.js index 047574a60f04fe8a96d237eeefb168de6fdd593d..8efa94f927edb9078083ebe5086a31d16e454b3e 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -22,6 +22,7 @@ angular.module("cesium.config", []) "expertMode": false, "decimalCount": 2, "httpsMode": false, + "shareBaseUrl": "https://g1.duniter.fr", "helptip": { "enable": true, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" @@ -70,4 +71,4 @@ angular.module("cesium.config", []) "newIssueUrl": "https://github.com/duniter/cesium/issues/new?labels=bug" }) -; \ No newline at end of file +; diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index 2058dd9215963c8522b74c4c7e8eb1ca02d3047f..95a270c5fed158b1acf98f27282699f3c9094d4b 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -59,7 +59,7 @@ angular.module('cesium.wallet.controllers', ['cesium.services', 'cesium.currency ; function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, - UIUtils, csWallet, $translate, $ionicPopover, Modals, csSettings) { + UIUtils, csConfig, csWallet, $translate, $ionicPopover, Modals, csSettings) { 'ngInject'; $scope.loading = true; @@ -514,8 +514,8 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, $scope.hideActionsPopover(); var title = $scope.formData.name || $scope.formData.uid || $scope.formData.pubkey; - // Use rootPath (fix #390) - var url = $rootScope.rootPath + $state.href('app.wot_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.name || $scope.formData.uid}); + // Use shareBasePath (fix #530) or rootPath (fix #390) + var url = (csConfig.shareBaseUrl || $rootScope.rootPath) + $state.href('app.wot_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.name || $scope.formData.uid}); UIUtils.popover.share(event, { bindings: { url: url, diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index 835e27d376b54bb3c49de9c74440c61948cf070b..70a09f523729bc41ab551823903f49394cc90e66 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -571,7 +571,7 @@ function WotLookupModalController($scope, $controller, $focus, parameters){ * @param csWallet * @constructor */ -function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ionicHistory, UIUtils, Modals, csCurrency, csWot, csWallet) { +function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ionicHistory, UIUtils, Modals, csConfig, csCurrency, csWot, csWallet) { 'ngInject'; $scope.formData = { @@ -862,8 +862,8 @@ function WotIdentityAbstractController($scope, $rootScope, $state, $translate, $ $scope.showSharePopover = function(event) { var title = $scope.formData.name || $scope.formData.uid || $scope.formData.pubkey; - // Use rootPath (fix #390) - var url = $rootScope.rootPath + $state.href('app.wot_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.uid}); + // Use shareBasePath (fix #530) or rootPath (fix #390) + var url = (csConfig.shareBaseUrl || $rootScope.rootPath) + $state.href('app.wot_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.uid}); UIUtils.popover.share(event, { bindings: { url: url, diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js index 16bda9654276c44a7b88e4e9b6e559e33e1a37a6..a33ceef00554b07e2fbd9d467a46a51334065b7a 100644 --- a/www/plugins/es/js/controllers/registry-controllers.js +++ b/www/plugins/es/js/controllers/registry-controllers.js @@ -372,7 +372,7 @@ function ESRegistryLookupController($scope, $state, $focus, $timeout, esRegistry } function ESRegistryRecordViewController($scope, $state, $q, $timeout, $ionicPopover, $ionicHistory, $translate, - $anchorScroll, + $anchorScroll, csConfig, csWallet, esRegistry, UIUtils, esHttp) { 'ngInject'; @@ -523,7 +523,8 @@ function ESRegistryRecordViewController($scope, $state, $q, $timeout, $ionicPopo $scope.showSharePopover = function(event) { $scope.hideActionsPopover(); var title = $scope.formData.title; - var url = $rootScope.rootPath + $state.href('app.registry_view_record', {title: title, id: $scope.id}); + // Use shareBasePath (fix #530) or rootPath (fix #390) + var url = (csConfig.shareBaseUrl || $rootScope.rootPath) + $state.href('app.registry_view_record', {title: title, id: $scope.id}); UIUtils.popover.share(event, { bindings: { url: url,