Skip to content
Snippets Groups Projects
Select Git revision
  • gdev-802
  • master default protected
  • 305-re-enable-sanity-tests
  • 308-add-a-runtime-api-to-simulate-max-net-tx-cost-for-the-end-user-fees-refund
  • 270-parametrage-de-la-gtest
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
  • runtime-401 protected
  • v0.4.0 protected
40 results

autocompletion.md

Blame
  • common-controllers.js 12.65 KiB
    
    angular.module('cesium.graph.common.controllers', ['cesium.services'])
    
      .controller('GpCurrencyAbstractCtrl', GpCurrencyAbstractController)
    ;
    
    function GpCurrencyAbstractController($scope, $filter, $ionicPopover, $ionicHistory, $state, csSettings, csCurrency, esHttp, UIUtils) {
      'ngInject';
    
      $scope.loading = true;
      $scope.formData = $scope.formData || {
        useRelative: csSettings.data.useRelative,
        timePct: 100,
        rangeDuration: 'day',
        maxAge: undefined, // forever
        firstBlockTime: 0,
        scale: 'linear',
        hide: [],
        beginAtZero: true
      };
      $scope.scale = 'linear';
      $scope.height = undefined;
      $scope.width = undefined;
      $scope.maintainAspectRatio = true;
      $scope.times = [];
    
      function _truncDate(time) {
        return moment.unix(time).utc().startOf($scope.formData.rangeDuration).unix();
      }
    
      $scope.enter = function (e, state) {
        if ($scope.loading) {
    
          // Make sure there is currency, or load it not
          if (!$scope.formData.currency) {
            return csCurrency.get()
              .then(function (currency) {
                $scope.formData.currency = currency ? currency.name : null;
                $scope.formData.firstBlockTime = currency ? _truncDate(currency.firstBlockTime) : 0;
                if (!$scope.formData.firstBlockTime){
                  console.warn('[graph] currency.firstBlockTime not loaded ! Should have been loaded by currrency service!');
                }
                $scope.formData.currencyAge = _truncDate(moment().utc().unix()) - $scope.formData.firstBlockTime;
    
                return $scope.enter(e, state); // Loop
              });
          }
    
          if (state && state.stateParams) {
            // remember state, to be able to refresh location
            $scope.stateName = state && state.stateName;
            $scope.stateParams = angular.copy(state && state.stateParams||{});
    
            if (!$scope.formData.currency && state && state.stateParams && state.stateParams.currency) { // Currency parameter
              $scope.formData.currency = state.stateParams.currency;
            }
            if (state.stateParams.t) {
              $scope.formData.timePct = state.stateParams.t;
            }
            else if (state.stateParams.timePct) {
              $scope.formData.timePct = state.stateParams.timePct;
            }
            if (state.stateParams.stepUnit) {
              $scope.formData.rangeDuration = state.stateParams.stepUnit;
            }
            if (state.stateParams.scale) {
              $scope.formData.scale = state.stateParams.scale;
            }
            // Allow to hide some dataset
            if (state.stateParams.hide) {