Merge: Added contributing guidelines and link from readme
[nit.git] / share / nitweb / javascripts / nitweb.js
1 /*
2 * Copyright 2016 Alexandre Terrasa <alexandre@moz-code.org>.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 (function() {
18 angular.module('nitweb', ['ngRoute', 'ngSanitize', 'entities', 'index'])
19
20 .config(function($routeProvider, $locationProvider) {
21 $routeProvider
22 .when('/', {
23 templateUrl: 'views/index.html',
24 controller: 'IndexCtrl',
25 controllerAs: 'indexCtrl'
26 })
27 .when('/package/:id', {
28 templateUrl: 'views/package.html',
29 controller: 'EntityCtrl',
30 controllerAs: 'entityCtrl'
31 })
32 .when('/group/:id', {
33 templateUrl: 'views/group.html',
34 controller: 'EntityCtrl',
35 controllerAs: 'entityCtrl'
36 })
37 .when('/module/:id', {
38 templateUrl: 'views/module.html',
39 controller: 'EntityCtrl',
40 controllerAs: 'entityCtrl'
41 })
42 .when('/class/:id', {
43 templateUrl: 'views/class.html',
44 controller: 'EntityCtrl',
45 controllerAs: 'entityCtrl'
46 })
47 .when('/classdef/:id', {
48 templateUrl: 'views/classdef.html',
49 controller: 'EntityCtrl',
50 controllerAs: 'entityCtrl'
51 })
52 .when('/property/:id', {
53 templateUrl: 'views/property.html',
54 controller: 'EntityCtrl',
55 controllerAs: 'entityCtrl'
56 })
57 .when('/propdef/:id', {
58 templateUrl: 'views/propdef.html',
59 controller: 'EntityCtrl',
60 controllerAs: 'entityCtrl'
61 })
62 .otherwise({
63 redirectTo: '/'
64 });
65 $locationProvider.html5Mode(true);
66 });
67 })();