JS: Fix scrutinizer warnings and indentation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
9b9c1432f2
commit
516e396a58
@@ -20,57 +20,58 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: oc_requesttoken, markdownitLinkTarget */
|
||||||
|
|
||||||
app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvider, $urlRouterProvider, $stateProvider, $compileProvider, markdownItConverterProvider) {
|
app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvider, $urlRouterProvider, $stateProvider, $compileProvider, markdownItConverterProvider) {
|
||||||
'use strict';
|
'use strict';
|
||||||
$httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;
|
$httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;
|
||||||
|
|
||||||
$compileProvider.debugInfoEnabled(true);
|
$compileProvider.debugInfoEnabled(true);
|
||||||
|
|
||||||
markdownItConverterProvider.config({
|
markdownItConverterProvider.config({
|
||||||
breaks: true,
|
breaks: true,
|
||||||
linkify: true,
|
linkify: true,
|
||||||
xhtmlOut: true
|
xhtmlOut: true
|
||||||
});
|
});
|
||||||
markdownItConverterProvider.use(markdownitLinkTarget);
|
markdownItConverterProvider.use(markdownitLinkTarget);
|
||||||
|
|
||||||
$urlRouterProvider.otherwise('/');
|
$urlRouterProvider.otherwise('/');
|
||||||
|
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('list', {
|
.state('list', {
|
||||||
url: '/:filter',
|
url: '/:filter',
|
||||||
templateUrl: '/boardlist.mainView.html',
|
templateUrl: '/boardlist.mainView.html',
|
||||||
controller: 'ListController',
|
controller: 'ListController',
|
||||||
reloadOnSearch: false,
|
reloadOnSearch: false,
|
||||||
params: {
|
params: {
|
||||||
filter: { value: '', dynamic: true }
|
filter: {value: '', dynamic: true}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('board', {
|
.state('board', {
|
||||||
url: '/board/:boardId/:filter',
|
url: '/board/:boardId/:filter',
|
||||||
templateUrl: '/board.html',
|
templateUrl: '/board.html',
|
||||||
controller: 'BoardController',
|
controller: 'BoardController',
|
||||||
params: {
|
params: {
|
||||||
filter: { value: '', dynamic: true }
|
filter: {value: '', dynamic: true}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('board.detail', {
|
.state('board.detail', {
|
||||||
url: '/detail/',
|
url: '/detail/',
|
||||||
reloadOnSearch : false,
|
reloadOnSearch: false,
|
||||||
views: {
|
views: {
|
||||||
'sidebarView': {
|
'sidebarView': {
|
||||||
templateUrl: '/board.sidebarView.html'
|
templateUrl: '/board.sidebarView.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('board.card', {
|
.state('board.card', {
|
||||||
url: '/card/:cardId',
|
url: '/card/:cardId',
|
||||||
views: {
|
views: {
|
||||||
'sidebarView': {
|
'sidebarView': {
|
||||||
templateUrl: '/card.sidebarView.html',
|
templateUrl: '/card.sidebarView.html',
|
||||||
controller: 'CardController'
|
controller: 'CardController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -20,57 +20,58 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** global: OC, oc_defaults, Snap */
|
||||||
app.run(function ($document, $rootScope, $transitions, BoardService) {
|
app.run(function ($document, $rootScope, $transitions, BoardService) {
|
||||||
'use strict';
|
'use strict';
|
||||||
$document.click(function (event) {
|
$document.click(function (event) {
|
||||||
$rootScope.$broadcast('documentClicked', event);
|
$rootScope.$broadcast('documentClicked', event);
|
||||||
});
|
});
|
||||||
$transitions.onEnter({from: 'list'}, function($state, $transition$) {
|
$transitions.onEnter({from: 'list'}, function ($state, $transition$) {
|
||||||
BoardService.unsetCurrrent();
|
BoardService.unsetCurrrent();
|
||||||
});
|
});
|
||||||
$transitions.onEnter({to: 'list'}, function($state, $transition$) {
|
$transitions.onEnter({to: 'list'}, function ($state, $transition$) {
|
||||||
BoardService.unsetCurrrent();
|
BoardService.unsetCurrrent();
|
||||||
document.title = "Deck - " + oc_defaults.name;
|
document.title = "Deck - " + oc_defaults.name;
|
||||||
});
|
});
|
||||||
$transitions.onEnter({to: 'board.card'}, function ($state, $transition$) {
|
$transitions.onEnter({to: 'board.card'}, function ($state, $transition$) {
|
||||||
$rootScope.sidebar.show = true;
|
$rootScope.sidebar.show = true;
|
||||||
});
|
});
|
||||||
$transitions.onEnter({to: 'board.detail'}, function ($state, $transition$) {
|
$transitions.onEnter({to: 'board.detail'}, function ($state, $transition$) {
|
||||||
$rootScope.sidebar.show = true;
|
$rootScope.sidebar.show = true;
|
||||||
});
|
});
|
||||||
$transitions.onEnter({to: 'board'}, function ($state) {
|
$transitions.onEnter({to: 'board'}, function ($state) {
|
||||||
$rootScope.sidebar.show = false;
|
$rootScope.sidebar.show = false;
|
||||||
});
|
});
|
||||||
$transitions.onExit({from: 'board.card'}, function ($state) {
|
$transitions.onExit({from: 'board.card'}, function ($state) {
|
||||||
$rootScope.sidebar.show = false;
|
$rootScope.sidebar.show = false;
|
||||||
});
|
});
|
||||||
$transitions.onExit({from: 'board.detail'}, function ($state) {
|
$transitions.onExit({from: 'board.detail'}, function ($state) {
|
||||||
$rootScope.sidebar.show = false;
|
$rootScope.sidebar.show = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('link[rel="shortcut icon"]').attr(
|
$('link[rel="shortcut icon"]').attr(
|
||||||
'href',
|
'href',
|
||||||
OC.filePath('deck', 'img', 'app-512.png')
|
OC.filePath('deck', 'img', 'app-512.png')
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#app-navigation-toggle').off('click');
|
$('#app-navigation-toggle').off('click');
|
||||||
// App sidebar on mobile
|
// App sidebar on mobile
|
||||||
var snapper = new Snap({
|
var snapper = new Snap({
|
||||||
element: document.getElementById('app-content'),
|
element: document.getElementById('app-content'),
|
||||||
disable: 'right',
|
disable: 'right',
|
||||||
maxPosition: 250,
|
maxPosition: 250,
|
||||||
touchToDrag: false
|
touchToDrag: false
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#app-navigation-toggle').click(function(){
|
$('#app-navigation-toggle').click(function () {
|
||||||
if($(window).width() > 768) {
|
if ($(window).width() > 768) {
|
||||||
$('#app-navigation').toggle('hidden');
|
$('#app-navigation').toggle('hidden');
|
||||||
} else {
|
} else {
|
||||||
if(snapper.state().state === 'left'){
|
if (snapper.state().state === 'left') {
|
||||||
snapper.close();
|
snapper.close();
|
||||||
} else {
|
} else {
|
||||||
snapper.open('left');
|
snapper.open('left');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user