Merge: curl: basic Unix domain socket support
[nit.git] / share / nitweb / javascripts / nitweb.js
index efbbc1b..1de3f69 100644 (file)
  */
 
 (function() {
-       angular.module('nitweb', ['ui.router', 'ngSanitize', 'angular-loading-bar', 'index', 'entities', 'docdown', 'metrics', 'users', 'grades'])
+       angular.module('nitweb', ['ui.router', 'ngSanitize', 'angular-loading-bar', 'catalog', 'entities', 'docdown', 'metrics', 'users', 'grades'])
 
        .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
                cfpLoadingBarProvider.includeSpinner = false;
        }])
 
-       .run(['$anchorScroll', function($anchorScroll) {
+       .run(function($rootScope, $anchorScroll) {
                $anchorScroll.yOffset = 80;
-       }])
+               $rootScope.$on('$stateChangeSuccess', function() {
+                 $anchorScroll();
+               });
+       })
 
        .config(function($stateProvider, $locationProvider) {
                $stateProvider
-                       .state('user', {
-                               url: '/user',
-                               templateUrl: 'views/user.html',
-                               controller: 'UserCtrl',
-                               controllerAs: 'userCtrl'
-                       })
-                       .state('login', {
-                               url: '/login',
-                               controller : function(){
-                                       window.location.replace('/login');
-                               },
-                           template : "<div></div>"
-                       })
-                       .state('logout', {
-                               controller : function(){
-                                       window.location.replace('/logout');
-                               },
-                           template : "<div></div>"
-                       })
                        .state({
                                name: '404',
                                url: '*path',
@@ -53,8 +37,4 @@
                        })
                $locationProvider.html5Mode(true);
        })
-
-       .filter('encodeURI', function() {
-               return encodeURIComponent;
-       });
 })();