Sha256: 2139ceac5ae77dc091520bde90be279d9203f0021c2b6fc9cc3ba7bcfa462ebf

Contents?: true

Size: 1.86 KB

Versions: 10

Compression:

Stored size: 1.86 KB

Contents

 !(angular => {
  'use strict';

  angular
    .module('alephControllers', [
      'alephControllers.schemaIndexController',
      'alephControllers.queryIndexController',
      'alephControllers.queryShowController',
      'alephControllers.queryReplController',
      'alephControllers.alertIndexController',
      'alephControllers.alertShowController',
      'alephControllers.snippetIndexController',
      'alephServices',
      'ui.ace',
      'ngRoute',
      'ui.bootstrap.alert'
    ])

    .controller('BodyController', ['$scope', 'SpinnerState', 'ServerConfigurations',
      function NavBarController($scope, SpinnerState, ServerConfigurations) {
        $scope.SpinnerState = SpinnerState;
        $scope.ServerConfigurations = ServerConfigurations;
      }
    ])

    .controller('NavBarController', ['$scope', '$window', '$location',
      function NavBarController($scope, $window, $location) {

        $scope.pathIncludes = function pathIncludes(string) {
          return ($location.path().indexOf(string) > -1);
        };

        $scope.signOut = function signOut() {
          $window.location.href = '/sign_out';
        };
      }
    ])

    .controller('AlertBarController', ['$scope', '$rootScope',
      function ($scope, $rootScope) {
        $scope.alerts = [];

        $scope.dismiss = function dismiss() {
          $scope.alerts.length = 0;
        };

        $rootScope.$on('$routeChangeSuccess', () => {
          if ($scope.scheduledAlert) {
            $scope.alerts.push($scope.scheduledAlert);
            $scope.scheduledAlert = null;
          } else {
            $scope.dismiss();
          }
        });

        $rootScope.$on('scheduleAlert', (event, alert) => {
          $scope.scheduledAlert = alert;
        });

        $rootScope.$on('setAlert', (event, alert) => {
          $scope.alerts.push(alert);
        });
      }
    ]);
}(angular));

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
aleph_analytics-0.0.4 public/assets/angular/controllers/controllers.js-7431ae468ea2f0d392661448a61cfdf3.es6
aleph_analytics-0.0.4 app/assets/javascripts/angular/controllers/controllers.js.es6
aleph_analytics-0.0.3 app/assets/javascripts/angular/controllers/controllers.js.es6
aleph_analytics-0.0.3 public/assets/angular/controllers/controllers.js-7431ae468ea2f0d392661448a61cfdf3.es6
aleph_analytics-0.0.2 public/assets/angular/controllers/controllers.js-7431ae468ea2f0d392661448a61cfdf3.es6
aleph_analytics-0.0.2 app/assets/javascripts/angular/controllers/controllers.js.es6
aleph_analytics-0.0.1.alpha public/assets/angular/controllers/controllers.js-7431ae468ea2f0d392661448a61cfdf3.es6
aleph_analytics-0.0.1.alpha app/assets/javascripts/angular/controllers/controllers.js.es6
aleph_analytics-0.0.0.alpha app/assets/javascripts/angular/controllers/controllers.js.es6
aleph_analytics-0.0.0.alpha public/assets/angular/controllers/controllers.js-7431ae468ea2f0d392661448a61cfdf3.es6