Skip to content
Snippets Groups Projects
Commit f0aa5e65 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] Cesium API button example: add "none" option for icon

parent db3b0309
No related branches found
No related tags found
No related merge requests found
......@@ -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)"
}
......
......@@ -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)"
}
......
......@@ -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)"
}
......
......@@ -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>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment