Skip to content
Snippets Groups Projects
Select Git revision
  • db7691fe6d857b6bd69685db41d975792cb7bfeb
  • master default protected
  • patch-1
  • gitlab_migration_1
  • dev
  • rml8
  • v1.0.6
  • v1.0.5
  • v1.0.4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • v1.0.0
  • v0.19.6
  • v0.19.5
  • v0.19.4
  • v0.19.3
  • v0.19.2
  • v0.19.1
  • v0.19.0
  • v0.18.3
  • v0.18.2
  • v0.18.1
  • v0.18.0
  • v0.17.6
  • v0.17.5
26 results

wallet-controllers.js

Blame
  • Forked from clients / Cesium-grp / Cesium
    Source project has a limited visibility.
    wallet-controllers.js 1.58 KiB
    angular.module('cesium.es.wallet.controllers', ['cesium.es.services'])
    
      .config(function(PluginServiceProvider, csConfig) {
        'ngInject';
    
        var enable = csConfig.plugins && csConfig.plugins.es;
        if (enable) {
          PluginServiceProvider.extendState('app.view_wallet', {
              points: {
                'after-general': {
                  templateUrl: "plugins/es/templates/wallet/view_wallet_extend.html",
                  controller: 'ESWalletCtrl'
                }
              }
            })
          ;
        }
    
      })
    
    
      .controller('ESWalletCtrl', ESWalletController)
    
    ;
    
    function ESWalletController($scope, $controller, esModals,csWallet,UIUtils,esProfile) {
      'ngInject';
    
      // Initialize the super class and extend it.
      angular.extend(this, $controller('ESWotIdentityViewCtrl', {$scope: $scope}));
    
      /* -- modals -- */
    
      $scope.showNewPageModal = function() {
        return esModals.showNewPage();
      };
    
      $scope.deleteProfile = function(){    
            return csWallet && csWallet.auth({minData: true}) 
          .then(function(walletData) {
           UIUtils.loading.hide();
           UIUtils.alert.confirm('PROFILE.CONFIRM.DELETE')
             .then(function(confirm) {
                  if (confirm){ 
                      esProfile.remove(walletData.pubkey)
                      .then(function () {
                        $scope.formData.name=null;
                        $scope.formData.profile = null;
                        $scope.doUpdate(true);
                      UIUtils.toast.show('PROFILE.INFO.PROFILE_REMOVED');
                   }).catch(UIUtils.onError('PROFILE.ERROR.REMOVE_PROFILE_FAILED'));
                  }
                });
          });
      };
    }