webogram-i2p/app/js/app.js

63 lines
2.2 KiB
JavaScript
Raw Normal View History

2014-01-05 16:07:11 +00:00
/*!
2014-11-12 19:52:40 +00:00
* Webogram v0.3.4 - messaging web application for MTProto
2014-01-05 16:07:11 +00:00
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myApp', [
'ngRoute',
'ngSanitize',
'ngTouch',
2014-01-05 16:07:11 +00:00
'ui.bootstrap',
2014-09-23 07:33:50 +00:00
'mediaPlayer',
'izhukov.utils',
'izhukov.mtproto',
'izhukov.mtproto.wrapper',
2014-01-05 16:07:11 +00:00
'myApp.filters',
'myApp.services',
2014-03-12 21:55:12 +00:00
/*PRODUCTION_ONLY_BEGIN
'myApp.templates',
PRODUCTION_ONLY_END*/
2014-01-05 16:07:11 +00:00
'myApp.directives',
'myApp.controllers'
]).
config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvider', function($locationProvider, $routeProvider, $compileProvider, StorageProvider) {
2014-01-05 16:07:11 +00:00
var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, row, column, totalColumns;
2014-01-05 16:07:11 +00:00
for (j = 0; j < Config.EmojiCategories.length; j++) {
totalColumns = Config.EmojiCategorySpritesheetDimens[j][1];
for (i = 0; i < Config.EmojiCategories[j].length; i++) {
dataItem = Config.Emoji[Config.EmojiCategories[j][i]];
name = dataItem[1][0];
row = Math.floor(i / totalColumns);
column = (i % totalColumns);
icons[':' + name + ':'] = [j, row, column, ':'+name+':'];
reverseIcons[name] = dataItem[0];
2014-01-05 16:07:11 +00:00
}
}
$.emojiarea.spritesheetPath = 'img/emojisprite_!.png';
$.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens;
$.emojiarea.iconSize = 20;
2014-01-05 16:07:11 +00:00
$.emojiarea.icons = icons;
$.emojiarea.reverseIcons = reverseIcons;
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|mailto|blob|filesystem|chrome-extension|app):|data:image\//);
2014-01-05 16:07:11 +00:00
2014-06-25 11:24:47 +00:00
if (Config.Modes.test) {
StorageProvider.setPrefix('t_');
}
2014-01-05 16:07:11 +00:00
$routeProvider.when('/', {templateUrl: templateUrl('welcome'), controller: 'AppWelcomeController'});
$routeProvider.when('/login', {templateUrl: templateUrl('login'), controller: 'AppLoginController'});
$routeProvider.when('/im', {templateUrl: templateUrl('im'), controller: 'AppIMController', reloadOnSearch: false});
2014-01-05 16:07:11 +00:00
$routeProvider.otherwise({redirectTo: '/'});
}]);