Cleanup, mobile module

This commit is contained in:
jendib 2013-08-12 19:56:31 +02:00
parent 2c430f522c
commit 10a7be01f5
2 changed files with 106 additions and 101 deletions

View File

@ -14,7 +14,7 @@
async: false, // load imports async async: false, // load imports async
fileAsync: false, // load imports async when in a page under a file protocol fileAsync: false, // load imports async when in a page under a file protocol
poll: 1000, // when in watch mode, time in ms between polls poll: 1000, // when in watch mode, time in ms between polls
dumpLineNumbers: 'all', // or "mediaQuery" or "comments" dumpLineNumbers: 'all' // or "mediaQuery" or "comments"
}; };
</script> </script>
<script src="lib/jquery.js" type="text/javascript"></script> <script src="lib/jquery.js" type="text/javascript"></script>
@ -24,6 +24,7 @@
<script src="lib/colorpicker.js" type="text/javascript"></script> <script src="lib/colorpicker.js" type="text/javascript"></script>
<script src="lib/angular/angular.js" type="text/javascript"></script> <script src="lib/angular/angular.js" type="text/javascript"></script>
<script src="lib/angular/angular-sanitize.js" type="text/javascript"></script> <script src="lib/angular/angular-sanitize.js" type="text/javascript"></script>
<script src="lib/angular/angular-mobile.js" type="text/javascript"></script>
<script src="lib/angular.ui-router.js" type="text/javascript"></script> <script src="lib/angular.ui-router.js" type="text/javascript"></script>
<script src="lib/angular.ui-bootstrap.js" type="text/javascript"></script> <script src="lib/angular.ui-bootstrap.js" type="text/javascript"></script>
<script src="lib/angular.ui-utils.js" type="text/javascript"></script> <script src="lib/angular.ui-utils.js" type="text/javascript"></script>

View File

@ -3,7 +3,11 @@
/** /**
* Trackino application. * Trackino application.
*/ */
var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.keypress', 'ui.validate', 'ui.sortable', 'restangular', 'ngSanitize', 'colorpicker.module']) var App = angular.module('docs',
// Dependencies
['ui.state', 'ui.bootstrap', 'ui.route', 'ui.keypress', 'ui.validate',
'ui.sortable', 'restangular', 'ngSanitize', 'ngMobile', 'colorpicker.module']
)
/** /**
* Configuring modules. * Configuring modules.
@ -39,69 +43,69 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
} }
} }
}) })
.state('settings.default', { .state('settings.default', {
url: '', url: '',
views: { views: {
'settings': { 'settings': {
templateUrl: 'partial/settings.default.html', templateUrl: 'partial/settings.default.html',
controller: 'SettingsDefault' controller: 'SettingsDefault'
}
} }
} })
}) .state('settings.account', {
.state('settings.account', { url: '/account',
url: '/account', views: {
views: { 'settings': {
'settings': { templateUrl: 'partial/settings.account.html',
templateUrl: 'partial/settings.account.html', controller: 'SettingsAccount'
controller: 'SettingsAccount' }
} }
} })
}) .state('settings.session', {
.state('settings.session', { url: '/session',
url: '/session', views: {
views: { 'settings': {
'settings': { templateUrl: 'partial/settings.session.html',
templateUrl: 'partial/settings.session.html', controller: 'SettingsSession'
controller: 'SettingsSession' }
} }
} })
}) .state('settings.log', {
.state('settings.log', { url: '/log',
url: '/log', views: {
views: { 'settings': {
'settings': { templateUrl: 'partial/settings.log.html',
templateUrl: 'partial/settings.log.html', controller: 'SettingsLog'
controller: 'SettingsLog' }
} }
} })
}) .state('settings.user', {
.state('settings.user', { url: '/user',
url: '/user', views: {
views: { 'settings': {
'settings': { templateUrl: 'partial/settings.user.html',
templateUrl: 'partial/settings.user.html', controller: 'SettingsUser'
controller: 'SettingsUser' }
} }
} })
}) .state('settings.user.edit', {
.state('settings.user.edit', { url: '/edit/:username',
url: '/edit/:username', views: {
views: { 'user': {
'user': { templateUrl: 'partial/settings.user.edit.html',
templateUrl: 'partial/settings.user.edit.html', controller: 'SettingsUserEdit'
controller: 'SettingsUserEdit' }
} }
} })
}) .state('settings.user.add', {
.state('settings.user.add', { url: '/add',
url: '/add', views: {
views: { 'user': {
'user': { templateUrl: 'partial/settings.user.edit.html',
templateUrl: 'partial/settings.user.edit.html', controller: 'SettingsUserEdit'
controller: 'SettingsUserEdit' }
} }
} })
})
.state('document', { .state('document', {
url: '/document', url: '/document',
abstract: true, abstract: true,
@ -112,50 +116,50 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
} }
} }
}) })
.state('document.default', { .state('document.default', {
url: '', url: '',
views: { views: {
'document': { 'document': {
templateUrl: 'partial/document.default.html', templateUrl: 'partial/document.default.html',
controller: 'DocumentDefault' controller: 'DocumentDefault'
}
} }
} })
}) .state('document.add', {
.state('document.add', { url: '/add',
url: '/add', views: {
views: { 'document': {
'document': { templateUrl: 'partial/document.edit.html',
templateUrl: 'partial/document.edit.html', controller: 'DocumentEdit'
controller: 'DocumentEdit' }
} }
} })
}) .state('document.edit', {
.state('document.edit', { url: '/edit/:id',
url: '/edit/:id', views: {
views: { 'document': {
'document': { templateUrl: 'partial/document.edit.html',
templateUrl: 'partial/document.edit.html', controller: 'DocumentEdit'
controller: 'DocumentEdit' }
} }
} })
}) .state('document.view', {
.state('document.view', { url: '/view/:id',
url: '/view/:id', views: {
views: { 'document': {
'document': { templateUrl: 'partial/document.view.html',
templateUrl: 'partial/document.view.html', controller: 'DocumentView'
controller: 'DocumentView' }
} }
} })
}) .state('document.view.file', {
.state('document.view.file', { url: '/file/:fileId',
url: '/file/:fileId', views: {
views: { 'file': {
'file': { controller: 'FileView'
controller: 'FileView' }
} }
} })
})
.state('login', { .state('login', {
url: '/login', url: '/login',
views: { views: {
@ -169,7 +173,7 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
// Configuring Restangular // Configuring Restangular
RestangularProvider.setBaseUrl('api'); RestangularProvider.setBaseUrl('api');
// Configuring $http // Configuring $http to act like jQuery.ajax
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; $httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.transformRequest = [function(data) { $httpProvider.defaults.transformRequest = [function(data) {