2014-01-05 20:07:11 +04:00
|
|
|
/*!
|
2017-12-30 23:39:10 +04:00
|
|
|
* Webogram v0.7 - messaging web application for MTProto
|
2014-01-05 20:07:11 +04:00
|
|
|
* https://github.com/zhukov/webogram
|
|
|
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
|
|
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
|
|
|
*/
|
|
|
|
|
2016-06-28 19:40:53 +03:00
|
|
|
'use strict'
|
2017-03-13 19:57:24 +01:00
|
|
|
/* global Config, templateUrl */
|
2014-01-05 20:07:11 +04:00
|
|
|
|
2016-06-28 19:40:53 +03:00
|
|
|
var extraModules = []
|
2016-01-20 00:49:50 +03:00
|
|
|
if (Config.Modes.animations) {
|
2016-06-28 19:40:53 +03:00
|
|
|
extraModules.push('ngAnimate')
|
2016-01-20 00:49:50 +03:00
|
|
|
}
|
|
|
|
|
2014-01-05 20:07:11 +04:00
|
|
|
// Declare app level module which depends on filters, and services
|
|
|
|
angular.module('myApp', [
|
|
|
|
'ngRoute',
|
|
|
|
'ngSanitize',
|
2014-07-01 22:46:16 +04:00
|
|
|
'ngTouch',
|
2014-01-05 20:07:11 +04:00
|
|
|
'ui.bootstrap',
|
2014-09-23 11:33:50 +04:00
|
|
|
'mediaPlayer',
|
2016-04-19 22:20:19 +03:00
|
|
|
'toaster',
|
2014-06-20 19:34:14 +04:00
|
|
|
'izhukov.utils',
|
|
|
|
'izhukov.mtproto',
|
|
|
|
'izhukov.mtproto.wrapper',
|
2014-01-05 20:07:11 +04:00
|
|
|
'myApp.filters',
|
|
|
|
'myApp.services',
|
2014-03-12 22:55:12 +01:00
|
|
|
/*PRODUCTION_ONLY_BEGIN
|
|
|
|
'myApp.templates',
|
|
|
|
PRODUCTION_ONLY_END*/
|
2014-01-05 20:07:11 +04:00
|
|
|
'myApp.directives',
|
|
|
|
'myApp.controllers'
|
2016-06-28 19:40:53 +03:00
|
|
|
].concat(extraModules)).config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvider', function ($locationProvider, $routeProvider, $compileProvider, StorageProvider) {
|
|
|
|
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//)
|
|
|
|
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|tg|mailto|blob|filesystem|chrome-extension|app):|data:/)
|
2014-01-05 20:07:11 +04:00
|
|
|
|
2016-04-13 22:09:58 +03:00
|
|
|
/*PRODUCTION_ONLY_BEGIN
|
2016-06-28 19:40:53 +03:00
|
|
|
$compileProvider.debugInfoEnabled(false)
|
2016-04-13 22:09:58 +03:00
|
|
|
PRODUCTION_ONLY_END*/
|
|
|
|
|
2014-06-25 15:24:47 +04:00
|
|
|
if (Config.Modes.test) {
|
2016-06-28 19:40:53 +03:00
|
|
|
StorageProvider.setPrefix('t_')
|
2014-06-25 15:24:47 +04:00
|
|
|
}
|
2014-01-05 20:07:11 +04:00
|
|
|
|
2016-07-07 15:53:00 +03:00
|
|
|
$routeProvider.when('/', {template: '', controller: 'AppWelcomeController'})
|
2016-06-28 19:40:53 +03:00
|
|
|
$routeProvider.when('/login', {templateUrl: templateUrl('login'), controller: 'AppLoginController'})
|
|
|
|
$routeProvider.when('/im', {templateUrl: templateUrl('im'), controller: 'AppIMController', reloadOnSearch: false})
|
|
|
|
$routeProvider.otherwise({redirectTo: '/'})
|
|
|
|
}])
|