Modifications pour le document KanbanMacro
Modifié par Admin le 21/07/2025 - 08:59
Résumé
-
Objets (3 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -51,13 +51,7 @@ 51 51 gutter: '15px', 52 52 widthBoard: '250px', 53 53 responsive: '700', 54 - colors: { 55 - 'green': '#8C4', 56 - 'blue':'#0AC', 57 - 'orange':'#F91', 58 - 'yellow':'#FC3', 59 - 'red':'#E43' 60 - }, 54 + colors: ["yellow", "green", "blue", "red", "orange"], 61 61 boards: [], 62 62 dragBoards: true, 63 63 addItemButton: false, ... ... @@ -297,9 +297,9 @@ 297 297 allClasses.map(function (value) { 298 298 headerBoard.classList.add(value); 299 299 }); 300 - //We want to keepbackwardmpatibilitywiththeold"color"propertyso we don't break existing boards.301 - color=defaults.colors[board.color] ? defaults.colors[board.color]:board.color;302 - headerBoard.style.background = color;294 + if (board.color !== '' && board.color !== undefined) { 295 + headerBoard.classList.add("kanban-header-" + board.color); 296 + } 303 303 titleBoard = document.createElement('div'); 304 304 titleBoard.classList.add('kanban-title-board'); 305 305 titleBoard.innerHTML = board.title;
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -111,6 +111,26 @@ 111 111 font-weight: bold; 112 112 } 113 113 114 +.kanban-header-yellow { 115 + background: #FC3; 116 +} 117 + 118 +.kanban-header-orange { 119 + background: #F91; 120 +} 121 + 122 +.kanban-header-blue { 123 + background: #0AC; 124 +} 125 + 126 +.kanban-header-red { 127 + background: #E43; 128 +} 129 + 130 +.kanban-header-green { 131 + background: #8C4; 132 +} 133 + 114 114 .kanban-addboard { 115 115 float: left; 116 116 margin: 30px;
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -110,6 +110,25 @@ 110 110 }); 111 111 112 112 }, 113 + colorClick: function (el, boardId) { 114 + console.log("in color click"); 115 + var board = jQuery(el.parentNode).attr("data-id"); 116 + var boardJSON = kanban.getBoardJSON(board); 117 + var currentColor = boardJSON.color; 118 + console.log("Current color " + currentColor); 119 + var index = kanban.options.colors.findIndex(function (element) { 120 + return (element == currentColor) 121 + }) + 1; 122 + console.log("Next index " + index); 123 + if (index >= kanban.options.colors.length) 124 + index = 0; 125 + var nextColor = kanban.options.colors[index]; 126 + console.log("Next color " + nextColor); 127 + boardJSON.color = nextColor; 128 + jQuery(el).removeClass("kanban-header-" + currentColor); 129 + jQuery(el).addClass("kanban-header-" + nextColor); 130 + kanban.onChange(); 131 + }, 113 113 removeClick: function (el, boardId) { 114 114 if (confirm("Do you want to delete this board?")) { 115 115 console.log("Delete board");