Skip to content
Snippets Groups Projects
Select Git revision
  • 642f33008fe4fa65d4cd4eec441af1e0d50d6dca
  • dev default protected
  • release/1.9.1 protected
  • pini-1.8-docker
  • pini-sync-onlypeers
  • duniter-v2s-issue-123-industrialize-releases
  • feature/build-aarch64-nodejs16
  • release/1.8 protected
  • pini-docker
  • ci_tags
  • fix/1448/1.8/txs_not_stored
  • feature/node-20
  • fix/1441/node_summary_with_storage
  • fix/1442/improve_bma_tx_history
  • feature/wotwizard-1.8
  • release/1.9 protected
  • 1.7 protected
  • feature/docker-set-latest protected
  • feature/fast-docker-build-1.8.4
  • fast-docker-build protected
  • feature/dump-distance
  • v1.8.7 protected
  • v1.8.7-rc4 protected
  • v1.8.7-rc3 protected
  • v1.8.7-rc2 protected
  • v1.8.7-rc1 protected
  • v1.8.6 protected
  • v1.7.23 protected
  • v1.8.5 protected
  • v1.8.4 protected
  • v1.8.3 protected
  • v1.8.2 protected
  • v1.8.1 protected
  • v1.8.0 protected
  • v1.8.0-rc1 protected
  • v1.8.0-beta5 protected
  • v1.8.0-beta4 protected
  • v1.8.0-beta3 protected
  • v1.8.0-beta2 protected
  • v1.8.0-beta protected
  • v1.7.21 protected
41 results

duniter.sh

Blame
  • app.js 14.42 KiB
    // Ionic Starter App
    
    // angular.module is a global place for creating, registering and retrieving Angular modules
    // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
    // the 2nd parameter is an array of 'requires'
    // 'starter.controllers' is found in controllers.js
    angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht.translate',
      'ngApi', 'angular-cache', 'angular.screenmatch', 'angular.bind.notifier','ImageCropper', 'ngFileSaver',
      // removeIf(no-device)
      'ngCordova',
      // endRemoveIf(no-device)
      // removeIf(no-plugin)
      'cesium.plugins',
      // endRemoveIf(no-plugin)
      'cesium.controllers', 'cesium.templates', 'cesium.translations'
      ])
    
      .filter('formatInteger', function() {
        return function(input) {
          return !input ? '0' : (input < 10000000 ? numeral(input).format('0,0') : numeral(input).format('0,0.000 a'));
        };
      })
    
      .filter('formatAmount', function(csConfig, csSettings, csWallet, $filter) {
        var minValue = 1 / Math.pow(10, csConfig.decimalCount || 4);
        var format = '0,0.0' + Array(csConfig.decimalCount || 4).join('0');
    
        function formatRelative(input, options) {
          var currentUD = options && options.currentUD ? options.currentUD : csWallet.data.currentUD;
          if (!currentUD) {
            console.warn("formatAmount: currentUD not defined");
            return;
          }
          var amount = input / currentUD;
          if (Math.abs(amount) < minValue && input !== 0) {
            amount = '~ 0';
          }
          else {
            amount = numeral(amount).format(format);
          }
          if (options && options.currency) {
            return amount + ' ' + $filter('currencySymbol')(options.currency, true);
          }
          return amount;
        }
    
        function formatQuantitative(input, options) {
          var amount = numeral(input/100).format((input > -1000000000 && input < 1000000000) ? '0,0.00' : '0,0.000 a');
          if (options && options.currency) {
            return amount + ' ' + $filter('currencySymbol')(options.currency, false);
          }
          return amount;
        }
    
        return function(input, options) {
          if (input === undefined) return;
          return (options && angular.isDefined(options.useRelative) ? options.useRelative : csSettings.data.useRelative) ?
            formatRelative(input, options) :
            formatQuantitative(input, options);
        };
      })
    
      .filter('currencySymbol', function($rootScope, $filter, csSettings) {
        return function(input, useRelative) {
          if (!input) return '';
          return (angular.isDefined(useRelative) ? useRelative : csSettings.data.useRelative) ?
            ($rootScope.translations.UD + '<sub>' + $filter('abbreviate')(input) + '</sub>') :
            $filter('abbreviate')(input);
        };
      })