diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 73de4c190e313c9017dbd0312b5d16c743eaf4a7..96f152ce40a4b1f61cbc1a2841350f281f570027 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -843,8 +843,9 @@ "EXAMPLE_BUTTON_TEXT_ICON": "Icon", "EXAMPLE_BUTTON_TEXT_WIDTH": "Width", "EXAMPLE_BUTTON_TEXT_WIDTH_HELP": "eg: 200px, 50%", - "EXAMPLE_BUTTON_ICON_CESIUM": "Cesium logo", + "EXAMPLE_BUTTON_ICON_NONE": "No icon", "EXAMPLE_BUTTON_ICON_DUNITER": "Duniter logo", + "EXAMPLE_BUTTON_ICON_CESIUM": "Cesium logo", "EXAMPLE_BUTTON_ICON_G1_COLOR": "Ğ1 logo", "EXAMPLE_BUTTON_ICON_G1_BLACK": "Ğ1 logo (outline)" } diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index f0bcb75d97e05b08ff288975d852216b70d3edd2..1517958ceacbd8757f75ec2e78ad475713679652 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -843,8 +843,9 @@ "EXAMPLE_BUTTON_TEXT_ICON": "Icon", "EXAMPLE_BUTTON_TEXT_WIDTH": "Width", "EXAMPLE_BUTTON_TEXT_WIDTH_HELP": "eg: 200px, 50%", - "EXAMPLE_BUTTON_ICON_CESIUM": "Cesium logo", + "EXAMPLE_BUTTON_ICON_NONE": "No icon", "EXAMPLE_BUTTON_ICON_DUNITER": "Duniter logo", + "EXAMPLE_BUTTON_ICON_CESIUM": "Cesium logo", "EXAMPLE_BUTTON_ICON_G1_COLOR": "Ğ1 logo", "EXAMPLE_BUTTON_ICON_G1_BLACK": "Ğ1 logo (outline)" } diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index a49fc0897f14f84d567bf388bdeffaf054cfe4e6..49e4a953d96602227c8dff85feb8d52161328793 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -843,8 +843,9 @@ "EXAMPLE_BUTTON_TEXT_ICON": "Icône", "EXAMPLE_BUTTON_TEXT_WIDTH": "Largeur", "EXAMPLE_BUTTON_TEXT_WIDTH_HELP": "Exemple: 200px, 50%", - "EXAMPLE_BUTTON_ICON_CESIUM": "Logo Cesium", + "EXAMPLE_BUTTON_ICON_NONE": "Aucune", "EXAMPLE_BUTTON_ICON_DUNITER": "Logo Duniter", + "EXAMPLE_BUTTON_ICON_CESIUM": "Logo Cesium", "EXAMPLE_BUTTON_ICON_G1_COLOR": "Logo Ğ1", "EXAMPLE_BUTTON_ICON_G1_BLACK": "Logo Ğ1 (noir)" } diff --git a/www/js/api/app.js b/www/js/api/app.js index b41617a76ba546c030ef148d6bfcb12d50260527..3dcfd370e0fb4d90d16193f6e64adc25068d39b7 100644 --- a/www/js/api/app.js +++ b/www/js/api/app.js @@ -121,6 +121,9 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr html: undefined, showParameters: false, // hide integration parameters, by default icons: [ + { + label: 'API.DOC.TRANSFER.EXAMPLE_BUTTON_ICON_NONE' + }, { label: 'API.DOC.TRANSFER.EXAMPLE_BUTTON_ICON_DUNITER', filename: '../img/logo_duniter_32px.png' @@ -146,7 +149,7 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr width: undefined } }; - $scope.transferButton.style.icon = $scope.transferButton.icons[0]; + $scope.transferButton.style.icon = $scope.transferButton.icons[1/*Duniter icon*/]; $scope.transferDemoUrl = $rootScope.rootPath + $state.href('api.transfer', angular.merge({}, $scope.transferData, { demo: true, redirect_url: $rootScope.rootPath + '#/app/home?service=payment&result={tx}', @@ -199,7 +202,7 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr // Compute HTML: advanced button else { html = '<a href="'+url+'">\n'+ - ' <div style="border-radius: 5px; min-height: 42px; text-align: center; padding: 5px; '; + ' <div style="border-radius: 5px; min-height: 42px; text-align: center; padding: 5px; line-height: 30px; '; if ($scope.transferButton.style.width) { html += 'max-width: '+$scope.transferButton.style.width+'; '; } @@ -209,9 +212,11 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr if ($scope.transferButton.style.fontColor) { html += 'color: '+$scope.transferButton.style.fontColor+'; '; } - html += '">\n'+ - ' <img style="vertical-align: middle;" src="'+$rootScope.rootPath + $scope.transferButton.style.icon.filename+'">\n' + - ' ' + $scope.transferButton.style.text + '\n' + + html += '">\n'; + if ($scope.transferButton.style.icon && $scope.transferButton.style.icon.filename) { + html += ' <img style="vertical-align: middle;" src="'+$rootScope.rootPath + $scope.transferButton.style.icon.filename+'">\n'; + } + html += ' ' + $scope.transferButton.style.text + '\n' + ' </div>\n' + '</a>'; }