committed by
Julius Härtl
parent
47b51c512d
commit
afec4f211c
@@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** global: OC, oc_defaults, Snap */
|
/* global 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) {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
// filter cards here, as ng-sortable will not work nicely with html-inline filters
|
// filter cards here, as ng-sortable will not work nicely with html-inline filters
|
||||||
$scope.filterData = function (order, text) {
|
$scope.filterData = function (order, text) {
|
||||||
if ($scope.stacks === undefined)
|
if ($scope.stacks === undefined)
|
||||||
return;
|
{return;}
|
||||||
angular.copy(StackService.getData(), $scope.stacks);
|
angular.copy(StackService.getData(), $scope.stacks);
|
||||||
$scope.stacks = $filter('orderBy')($scope.stacks, 'order');
|
$scope.stacks = $filter('orderBy')($scope.stacks, 'order');
|
||||||
angular.forEach($scope.stacks, function (value, key) {
|
angular.forEach($scope.stacks, function (value, key) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo
|
|||||||
|
|
||||||
$scope.cardRenameShow = function () {
|
$scope.cardRenameShow = function () {
|
||||||
if ($scope.archived || !BoardService.canEdit())
|
if ($scope.archived || !BoardService.canEdit())
|
||||||
return false;
|
{return false;}
|
||||||
else {
|
else {
|
||||||
$scope.status.cardRename = true;
|
$scope.status.cardRename = true;
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.labelRemove = function (element, model) {
|
$scope.labelRemove = function (element, model) {
|
||||||
CardService.removeLabel($scope.cardId, element.id)
|
CardService.removeLabel($scope.cardId, element.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setDuedate = function (duedate) {
|
$scope.setDuedate = function (duedate) {
|
||||||
|
|||||||
@@ -27,19 +27,19 @@
|
|||||||
app.filter('relativeDateFilter', function() {
|
app.filter('relativeDateFilter', function() {
|
||||||
return function (timestamp) {
|
return function (timestamp) {
|
||||||
return OC.Util.relativeModifiedDate(timestamp*1000);
|
return OC.Util.relativeModifiedDate(timestamp*1000);
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
app.filter('relativeDateFilterString', function() {
|
app.filter('relativeDateFilterString', function() {
|
||||||
return function (date) {
|
return function (date) {
|
||||||
return OC.Util.relativeModifiedDate(Date.parse(date));
|
return OC.Util.relativeModifiedDate(Date.parse(date));
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
app.filter('dateToTimestamp', function() {
|
app.filter('dateToTimestamp', function() {
|
||||||
return function (date) {
|
return function (date) {
|
||||||
return Date.parse(date);
|
return Date.parse(date);
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
app.filter('parseDate', function() {
|
app.filter('parseDate', function() {
|
||||||
@@ -48,7 +48,7 @@ app.filter('parseDate', function() {
|
|||||||
return moment(date).format('YYYY-MM-DD');
|
return moment(date).format('YYYY-MM-DD');
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
app.filter('parseTime', function() {
|
app.filter('parseTime', function() {
|
||||||
@@ -57,5 +57,5 @@ app.filter('parseTime', function() {
|
|||||||
return moment(date).format('HH:mm');
|
return moment(date).format('HH:mm');
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
@@ -39,7 +39,7 @@ app.filter('iconWhiteFilter', function () {
|
|||||||
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
||||||
var h, s, l = (max + min) / 2;
|
var h, s, l = (max + min) / 2;
|
||||||
|
|
||||||
if (max == min) {
|
if (max === min) {
|
||||||
h = s = 0; // achromatic
|
h = s = 0; // achromatic
|
||||||
} else {
|
} else {
|
||||||
var d = max - min;
|
var d = max - min;
|
||||||
@@ -62,5 +62,5 @@ app.filter('iconWhiteFilter', function () {
|
|||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ app.filter('lightenColorFilter', function() {
|
|||||||
} else {
|
} else {
|
||||||
return "#" + hex;
|
return "#" + hex;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
app.filter('orderObjectBy', function(){
|
app.filter('orderObjectBy', function(){
|
||||||
return function(input, attribute) {
|
return function(input, attribute) {
|
||||||
if (!angular.isObject(input)) return input;
|
if (!angular.isObject(input)) {return input;}
|
||||||
var array = [];
|
var array = [];
|
||||||
for(var objectKey in input) {
|
for(var objectKey in input) {
|
||||||
array.push(input[objectKey]);
|
array.push(input[objectKey]);
|
||||||
@@ -34,5 +34,5 @@ app.filter('orderObjectBy', function(){
|
|||||||
return a < b;
|
return a < b;
|
||||||
});
|
});
|
||||||
return array;
|
return array;
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
@@ -64,5 +64,5 @@ app.filter('textColorFilter', function () {
|
|||||||
return "#000000";
|
return "#000000";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ app.factory('BoardService', function (ApiService, $http, $q) {
|
|||||||
permissionManage: true,
|
permissionManage: true,
|
||||||
permissionShare: true,
|
permissionShare: true,
|
||||||
type: type
|
type: type
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
BoardService.prototype.addAcl = function (acl) {
|
BoardService.prototype.addAcl = function (acl) {
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ app.factory('CardService', function(ApiService, $http, $q){
|
|||||||
CardService.prototype.reorder = function (card, order) {
|
CardService.prototype.reorder = function (card, order) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var self = this;
|
var self = this;
|
||||||
$http.put(this.baseUrl + '/' + card.id + '/reorder', {cardId: card.id, order: order, stackId: card.stackId}).then(function (response) {
|
$http.put(this.baseUrl + '/' + card.id + '/reorder', {
|
||||||
|
cardId: card.id,
|
||||||
|
order: order,
|
||||||
|
stackId: card.stackId
|
||||||
|
}).then(function (response) {
|
||||||
deferred.resolve(response.data);
|
deferred.resolve(response.data);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
deferred.reject('Error while update ' + self.endpoint);
|
deferred.reject('Error while update ' + self.endpoint);
|
||||||
@@ -40,7 +44,10 @@ app.factory('CardService', function(ApiService, $http, $q){
|
|||||||
CardService.prototype.rename = function (card) {
|
CardService.prototype.rename = function (card) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var self = this;
|
var self = this;
|
||||||
$http.put(this.baseUrl + '/' + card.id + '/rename', {cardId: card.id, title: card.title}).then(function (response) {
|
$http.put(this.baseUrl + '/' + card.id + '/rename', {
|
||||||
|
cardId: card.id,
|
||||||
|
title: card.title
|
||||||
|
}).then(function (response) {
|
||||||
self.data[card.id].title = card.title;
|
self.data[card.id].title = card.title;
|
||||||
deferred.resolve(response.data);
|
deferred.resolve(response.data);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|||||||
@@ -61,7 +61,10 @@ app.factory('StackService', function(ApiService, $http, $q){
|
|||||||
StackService.prototype.reorder = function (stack, order) {
|
StackService.prototype.reorder = function (stack, order) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var self = this;
|
var self = this;
|
||||||
$http.put(this.baseUrl + '/' + stack.id + '/reorder', {stackId: stack.id, order: order}).then(function (response) {
|
$http.put(this.baseUrl + '/' + stack.id + '/reorder', {
|
||||||
|
stackId: stack.id,
|
||||||
|
order: order
|
||||||
|
}).then(function (response) {
|
||||||
angular.forEach(response.data, function (value, key) {
|
angular.forEach(response.data, function (value, key) {
|
||||||
var id = value.id;
|
var id = value.id;
|
||||||
self.data[id].order = value.order;
|
self.data[id].order = value.order;
|
||||||
@@ -89,9 +92,9 @@ app.factory('StackService', function(ApiService, $http, $q){
|
|||||||
// sort array by order
|
// sort array by order
|
||||||
this.data[entity.stackId].cards.sort(function (a, b) {
|
this.data[entity.stackId].cards.sort(function (a, b) {
|
||||||
if (a.order < b.order)
|
if (a.order < b.order)
|
||||||
return -1;
|
{return -1;}
|
||||||
if (a.order > b.order)
|
if (a.order > b.order)
|
||||||
return 1;
|
{return 1;}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ app.factory('StatusService', function(){
|
|||||||
|
|
||||||
StatusService.prototype.releaseWaiting = function () {
|
StatusService.prototype.releaseWaiting = function () {
|
||||||
if (this.counter > 0)
|
if (this.counter > 0)
|
||||||
this.counter--;
|
{this.counter--;}
|
||||||
if (this.counter <= 0) {
|
if (this.counter <= 0) {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
this.counter = 0;
|
this.counter = 0;
|
||||||
@@ -71,7 +71,7 @@ app.factory('StatusService', function(){
|
|||||||
getInstance: function () {
|
getInstance: function () {
|
||||||
return new StatusService();
|
return new StatusService();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user