From 37beedbe962e6f0e4cde40c3ca464034547358a4 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Feb 2021 12:35:57 +0100 Subject: [PATCH 1/5] Mermaid dark theme --- www/common/diffMarked.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 71149b59f..2875e88fd 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -40,6 +40,7 @@ define([ Mermaid = _Mermaid; Mermaid.initialize({ gantt: { axisFormat: '%m-%d', }, + theme: (window.CryptPad_theme === 'dark') ? 'dark' : undefined, "themeCSS": mermaidThemeCSS, }); } From 666c3972037f9055e3c320ecdd9d56c881f91ee5 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Feb 2021 12:41:22 +0100 Subject: [PATCH 2/5] Fix kanban undefined --- www/kanban/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/kanban/inner.js b/www/kanban/inner.js index da41f2169..f93d375c3 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -149,7 +149,7 @@ define([ _updateBoards(framework, kanban, boards); return; } - _updateBoardsThrottle(); + _updateBoardsThrottle(framework, kanban, boards); }; var onRemoteChange = Util.mkEvent(); From 5d5276110ba23763afe4c62c268eb09179c4cd08 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Feb 2021 16:35:25 +0100 Subject: [PATCH 3/5] Add textbox in whiteboard --- www/whiteboard/inner.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index f217be0c4..abcff141c 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -56,12 +56,13 @@ define([ var $history = $('.cp-whiteboard-history'); var $undo = $('.cp-whiteboard-history .undo'); var $redo = $('.cp-whiteboard-history .redo'); + var $text = $('.cp-whiteboard-text button'); var $deleteButton = $('#cp-app-whiteboard-delete'); var metadataMgr = framework._.cpNfInner.metadataMgr; var brush = { - color: '#000000', + color: window.CryptPad_theme === "dark" ? '#FFFFFF' : '#000000', opacity: 1 }; @@ -140,6 +141,14 @@ define([ $deleteButton.prop('disabled', ''); }); + $text.click(function () { + $move.click(); + canvas.add(new fabric.Textbox('My Text', { + fill: brush.color, + top: 5, + left: 5 + })); + }); $undo.click(function () { if (typeof(APP.canvas.undo) !== "function") { return; } APP.canvas.undo(); @@ -199,6 +208,16 @@ define([ c = Colors.rgb2hex(c); brush.color = c; canvas.freeDrawingBrush.color = Colors.hex2rgba(brush.color, brush.opacity); + if (!APP.draw) { + var active = canvas.getActiveObject(); + if (active) { + var col = Colors.hex2rgba(brush.color, brush.opacity); + if (active.text) { active.set('fill', col); } + else { active.set('stroke', col); } + canvas.renderAll(); + APP.onLocal(); + } + } createCursor(); }; @@ -533,6 +552,9 @@ define([ h('button.btn.undo.fa.fa-undo', {title: Messages.undo}), h('button.btn.redo.fa.fa-repeat', {title: Messages.redo}), ]), + h('div.cp-whiteboard-text', [ + h('button.btn.fa.fa-font') + ]), h('button.btn.fa.fa-trash#cp-app-whiteboard-delete', { disabled: 'disabled', title: Messages.canvas_delete From eb85946ce236508e2d14b9469cb6aaa56a3b5d5a Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Feb 2021 17:27:38 +0100 Subject: [PATCH 4/5] Fix drag&drop in kanban for mobile --- www/kanban/app-kanban.less | 18 ++++++++++++++---- www/kanban/jkanban_cp.js | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/www/kanban/app-kanban.less b/www/kanban/app-kanban.less index 93626300c..1209a4609 100644 --- a/www/kanban/app-kanban.less +++ b/www/kanban/app-kanban.less @@ -140,6 +140,9 @@ border: 0; background: transparent; align-self: flex-start; + @media (hover: none) { + margin-right: 20px; + } } .cp-kanban-cursors { @@ -165,7 +168,10 @@ flex-wrap: wrap; touch-action: none; background: @cp_kanban-item-bg; + .tools_unselectable(); + touch-action: none; cursor: move; + cursor: grab; margin-bottom: 10px; &:last-child { @@ -253,12 +259,14 @@ .kanban-board { position: relative; transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); - margin: 10px; vertical-align: top; display: flex; flex-flow: column; width: 300px; margin: 10px 5px; + @media (hover: none) { + margin-bottom: 30px; + } &.is-moving.gu-mirror { transform: rotate(3deg); @@ -276,12 +284,17 @@ overflow-y: auto; justify-content: space-around; min-height: 38px; // Size of one card + @media (hover: none) { + padding-right: 30px; + } } header { display: flex; flex-wrap: wrap; align-items: center; padding: 5px 10px; + cursor: move; + cursor: grab; .kanban-title-board { flex: 1; min-width: 0; @@ -299,9 +312,6 @@ #kanban-edit { font-weight: bold; } - &:hover { - cursor: move; - } } footer { margin: 10px; diff --git a/www/kanban/jkanban_cp.js b/www/kanban/jkanban_cp.js index bddbfd704..56dcfaa60 100644 --- a/www/kanban/jkanban_cp.js +++ b/www/kanban/jkanban_cp.js @@ -26,7 +26,7 @@ define([ element: '', gutter: '15px', widthBoard: '250px', - responsive: '700', + responsive: 0, //'700', responsivePercentage: false, boards: { data: {}, From 5af6aaa57e5facc035ac350c1746b006c1fd30a3 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 5 Feb 2021 16:28:14 +0100 Subject: [PATCH 5/5] Fix CSS conflicts with tokenfield --- www/common/common-interface.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 3f7db9149..efd505ad4 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -388,6 +388,7 @@ define([ })); }; + $t.closest('.tokenfield').removeClass('form-control'); t.focus = function () { var $temp = $t.closest('.tokenfield').find('.token-input'); $temp.css('width', '20%');