|
|
@ -25,35 +25,32 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
// Kanban code
|
|
|
|
// Kanban code
|
|
|
|
var initKanban = function (framework, boards) {
|
|
|
|
var initKanban = function (framework, boards) {
|
|
|
|
var defaultBoards = [{ // XXX
|
|
|
|
var defaultBoards = [{
|
|
|
|
"id": "todo",
|
|
|
|
"id": "todo",
|
|
|
|
"title": "To Do",
|
|
|
|
"title": Messages.kanban_todo,
|
|
|
|
"color": "blue",
|
|
|
|
"color": "blue",
|
|
|
|
"item": [
|
|
|
|
"item": [{
|
|
|
|
{
|
|
|
|
"title": Messages._getKey('kanban_item', [1])
|
|
|
|
"title": "Item 1"
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
"title": Messages._getKey('kanban_item', [2])
|
|
|
|
{
|
|
|
|
}]
|
|
|
|
"title": "Item 2"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
"id": "working",
|
|
|
|
"id": "working",
|
|
|
|
"title": "Working",
|
|
|
|
"title": Messages.kanban_working,
|
|
|
|
"color": "orange",
|
|
|
|
"color": "orange",
|
|
|
|
"item": [{
|
|
|
|
"item": [{
|
|
|
|
"title": "Item 3",
|
|
|
|
"title": Messages._getKey('kanban_item', [3])
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
"title": "Item 4",
|
|
|
|
"title": Messages._getKey('kanban_item', [4])
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
"id": "done",
|
|
|
|
"id": "done",
|
|
|
|
"title": "Done",
|
|
|
|
"title": Messages.kanban_done,
|
|
|
|
"color": "green",
|
|
|
|
"color": "green",
|
|
|
|
"item": [{
|
|
|
|
"item": [{
|
|
|
|
"title": "Item 5",
|
|
|
|
"title": Messages._getKey('kanban_item', [5])
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
"title": "Item 6",
|
|
|
|
"title": Messages._getKey('kanban_item', [6])
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
@ -154,12 +151,10 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removeClick: function (el, boardId) {
|
|
|
|
removeClick: function (el, boardId) {
|
|
|
|
// XXX
|
|
|
|
UI.confirm(Messages.kanban_deleteBoard, function (yes) {
|
|
|
|
UI.confirm("Do you want to delete this board?", function (yes) {
|
|
|
|
|
|
|
|
if (!yes) { return; }
|
|
|
|
if (!yes) { return; }
|
|
|
|
console.log("Delete board");
|
|
|
|
console.log("Delete board");
|
|
|
|
var boardName = $(el.parentNode.parentNode).attr("data-id");
|
|
|
|
var boardName = $(el.parentNode.parentNode).attr("data-id");
|
|
|
|
console.log(boardName, boardId); // TODO
|
|
|
|
|
|
|
|
for (var index in kanban.options.boards) {
|
|
|
|
for (var index in kanban.options.boards) {
|
|
|
|
if (kanban.options.boards[index].id === boardName) {
|
|
|
|
if (kanban.options.boards[index].id === boardName) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -195,9 +190,8 @@ define([
|
|
|
|
addItemButton: true,
|
|
|
|
addItemButton: true,
|
|
|
|
boards: boards,
|
|
|
|
boards: boards,
|
|
|
|
dragcancelEl: function (el, boardId) {
|
|
|
|
dragcancelEl: function (el, boardId) {
|
|
|
|
// XXX
|
|
|
|
|
|
|
|
var pos = kanban.findElementPosition(el);
|
|
|
|
var pos = kanban.findElementPosition(el);
|
|
|
|
UI.confirm("Are you sure...??", function (yes) {
|
|
|
|
UI.confirm(Messages.kanban_deleteItem, function (yes) {
|
|
|
|
if (!yes) { return; }
|
|
|
|
if (!yes) { return; }
|
|
|
|
var board;
|
|
|
|
var board;
|
|
|
|
kanban.options.boards.some(function (b) {
|
|
|
|
kanban.options.boards.some(function (b) {
|
|
|
@ -222,13 +216,12 @@ define([
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// XXX
|
|
|
|
|
|
|
|
kanban.addBoards([{
|
|
|
|
kanban.addBoards([{
|
|
|
|
"id": "board" + counter,
|
|
|
|
"id": "board" + counter,
|
|
|
|
"title": "New Board",
|
|
|
|
"title": Messages.kanban_newBoard,
|
|
|
|
"color": "yellow",
|
|
|
|
"color": "yellow",
|
|
|
|
"item": [{
|
|
|
|
"item": [{
|
|
|
|
"title": "Item 1",
|
|
|
|
"title": Messages._getKey('kanban_item', [1]),
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
kanban.onChange();
|
|
|
|
kanban.onChange();
|
|
|
|