Commit 5e8d30d1 authored by Benoit Lavenier's avatar Benoit Lavenier

[fix] Avoid fullscreen mode on desktop release

[enh] Ask confirmation before switching to fullscreen, on mobile web browser
parent 48afeb93
Pipeline #5798 passed with stages
in 7 minutes and 31 seconds
......@@ -798,6 +798,7 @@
"POPUP_SECURITY_WARNING_TITLE": "<i class=\"icon ion-alert-circled\"></i> <b>Security warning</b>",
"CERTIFY_RULES_TITLE_UID": "Certify {{uid}}",
"CERTIFY_RULES": "<b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity?",
"FULLSCREEN": "View the application in full screen?",
"EXIT_APP": "Close the application ?",
"TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer?</b>",
"TRANSFER_ALL": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li><br/><li> - Rest : <b>{{restAmount}} {{unit}}</b> to <b>{{restTo}}</b></li></ul><br/><b>Are-you sure you want to do this transfer?</b>",
......
......@@ -798,6 +798,7 @@
"POPUP_SECURITY_WARNING_TITLE": "<i class=\"icon ion-alert-circled\"></i> <b>Security warning</b>",
"CERTIFY_RULES_TITLE_UID": "Certify {{uid}}",
"CERTIFY_RULES": "<b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity?",
"FULLSCREEN": "View the application in full screen?",
"EXIT_APP": "Close the application ?",
"TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer?</b>",
"TRANSFER_ALL": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li><br/><li> - Rest : <b>{{restAmount}} {{unit}}</b> to <b>{{restTo}}</b></li></ul><br/><b>Are-you sure you want to do this transfer?</b>",
......
......@@ -798,6 +798,7 @@
"POPUP_SECURITY_WARNING_TITLE": "<i class=\"icon ion-alert-circled\"></i> <b>Avertissement de sécurité</b>",
"CERTIFY_RULES_TITLE_UID": "Certifier {{uid}}",
"CERTIFY_RULES": "<b class=\"assertive\">Ne PAS certifier</b> un compte si vous pensez que :<br/><br/><ul><li>1.) il ne correspond pas à une personne <b>physique et vivante</b>.<li>2.) son propriétaire <b>possède un autre compte</b> déjà certifié.<li>3.) son propriétaire viole (volontairement ou non) la règle 1 ou 2 (par exemple en certifiant des comptes factices ou en double).</ul><br/><b>Êtes-vous sûr</b> de vouloir néanmoins certifier cette identité ?",
"FULLSCREEN": "Afficher l'application en plein écran ?",
"EXIT_APP": "Fermer l'application ?",
"TRANSFER": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li></ul><br/><b>Êtes-vous sûr de vouloir effectuer ce virement ?</b>",
"TRANSFER_ALL": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li><br/><li> - Reste : <b>{{restAmount}} {{unit}}</b> à <b>{{restTo}}</b></li></ul><br/><b>Êtes-vous sûr de vouloir effectuer ce virement ?</b>",
......
......@@ -54,13 +54,7 @@
<body ng-app="cesium" id="cesium" ng-strict-di="true" window-exit-unauth="true"
ng-class="{'nobackdrop': $root.tour, 'expert-mode': $root.settings.expertMode}">
<!-- Enable fullscreen mode on small device (on a web browser) -->
<!--removeIf(device)-->
<div class="popover-backdrop visible-xs visible-sm"
ng-click="enableFullscreen($event)"
ng-if="forceFullscreen">
</div>
<!--endRemoveIf(device)-->
<ion-nav-view>
<div class="loader">
......
......@@ -138,10 +138,5 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht
// Start plugins eager services
PluginService.start();
$rootScope.forceFullscreen = UIUtils.screen.isSmall();
$rootScope.enableFullscreen = function() {
delete $rootScope.forceFullscreen;
UIUtils.screen.fullscreen.all();
};
})
;
......@@ -74,6 +74,7 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
$scope.login = csWallet.isLogin();
$scope.auth = csWallet.isAuth();
$scope.motion = UIUtils.motion.default;
$scope.fullscreen = UIUtils.screen.fullscreen.isEnabled();
$scope.showHome = function() {
$ionicHistory.nextViewOptions({
......@@ -348,13 +349,6 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
})
.catch(UIUtils.onError());
};
// Full screen
$scope.toggleFullscreen = function() {
UIUtils.screen.fullscreen.toggleAll();
$scope.fullscreen = UIUtils.screen.fullscreen.isEnabled();
};
// Do authentification
$scope.doAuth = function(options) {
var wallet = options && options.wallet || csWallet;
......@@ -410,7 +404,6 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
return Modals.showHelp(parameters);
};
////////////////////////////////////////
// Useful popovers
////////////////////////////////////////
......@@ -444,7 +437,7 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
};
////////////////////////////////////////
// Link managment (fix issue #)
// Link management (fix issue #)
////////////////////////////////////////
$scope.openLink = function($event, uri, options) {
......@@ -479,6 +472,34 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
return $scope.motion.show(options);
};
////////////////////////////////////////
// Fullscreen mode
////////////////////////////////////////
$scope.askFullscreen = function() {
var skip = $scope.fullscreen || !UIUtils.screen.isSmall() || !Device.isWeb();
if (skip) return;
return UIUtils.alert.confirm('CONFIRM.FULLSCREEN', null, {
cancelText: 'COMMON.BTN_NO',
okText: 'COMMON.BTN_YES'
})
.then(function(confirm) {
if (!confirm) return;
$scope.toggleFullscreen();
});
};
$scope.toggleFullscreen = function() {
$scope.fullscreen = !UIUtils.screen.fullscreen.isEnabled();
UIUtils.screen.fullscreen.toggleAll();
};
// removeIf(device)
// Ask switching fullscreen
$scope.askFullscreen();
// endRemoveIf(device)
}
......
......@@ -81,14 +81,16 @@
<a ng-if="login" class="button-icon" ng-click="logout({askConfirm: true})" style="position: absolute; top: 5px; left: 5px; z-index: 999;">
<i class="icon light ion-android-exit"></i>
</a>
<!-- fullscreen -->
<a class="button-icon visible-xs visible-sm"
ng-if="!forceFullscreen"
ng-click="toggleFullscreen()" style="position: absolute; top: 5px; right: 5px; z-index: 999;">
<i class="icon ion-arrow-expand dark"
ng-class="{'ion-arrow-shrink': !fullscreen}"
></i>
<!-- Fullscreen button -->
<!-- removeIf(device) -->
<a ng-if="::$root.device.isWeb()"
ng-click="toggleFullscreen()"
class="button-icon"
style="position: absolute; top: 5px; right: 5px; z-index: 999;">
<i class="icon ion-arrow-expand dark" ng-class="{'ion-arrow-shrink': fullscreen}"></i>
</a>
<!-- endRemoveIf(device) -->
</div>
</ion-header-bar>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment