From bbb836412975d339e1f5117d5719f8daa20cff7d Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Thu, 12 Oct 2023 19:43:59 +0300 Subject: [PATCH 01/10] Make userlist and chat go on top of content #1102 --- www/pad/app-pad.less | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index ffa417143..d7d4cb96d 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -22,6 +22,16 @@ body.cp-app-pad { flex-flow: row; height: 100%; overflow: hidden; + position: relative; + + .cp-toolbar-chat-drawer, .cp-toolbar-userlist-drawer{ + @media screen and (max-width: @browser_media-medium-screen){ + position: absolute; + right: 0; + height: 90%; + + } + } } @media screen and (max-height: @browser_media-medium-screen), @@ -152,6 +162,7 @@ body.cp-app-pad { .cke_toolbar { height: 28px; padding: 2px 0; + display: flex; } .cp-app-pad-wordCount { float: right; @@ -169,6 +180,15 @@ body.cp-app-pad { border-color: @toolbar-bg-active; } .cke_button, .cke_combo_button { + .cke_combo_open{ + display: flex; + flex-flow: row; + .cke_combo_arrow{ + @media (max-width: 360px){ + display:none; + } + } + } .tools_unselectable(); &.cke_button_on, &.cke_combo_button:hover, &.cke_button_off:hover { background-color: @toolbar-bg-active; From a8d8c98e9faedebfabf8fb725913c839f4449109 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:42:19 +0300 Subject: [PATCH 02/10] Add comm modal improvement on small screens #1271 --- www/pad/app-pad.less | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index d7d4cb96d..4e9734444 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -22,8 +22,6 @@ body.cp-app-pad { flex-flow: row; height: 100%; overflow: hidden; - position: relative; - .cp-toolbar-chat-drawer, .cp-toolbar-userlist-drawer{ @media screen and (max-width: @browser_media-medium-screen){ position: absolute; @@ -82,9 +80,13 @@ body.cp-app-pad { border-color: @cryptpad_color_red; } } + .cp-pad-show { line-height: 0px; } + .h2{ + text-align: center; + } } #cp-app-pad-resize { order: 2; @@ -143,7 +145,7 @@ body.cp-app-pad { } h2 { font-size: 1.5rem; - text-align: right; + text-align: center; } .comments_main(); } @@ -154,6 +156,10 @@ body.cp-app-pad { h2 { text-align: left; } + p.msg{ + overflow: hidden; + align-self: center; + } } .cke_toolbox_main { From 5d83cf34275810de20d22a599821e363ebbf824b Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:40:59 +0300 Subject: [PATCH 03/10] Delete unnecessary stuff+reduce padding for comm --- www/pad/app-pad.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index 4e9734444..3ecaf13da 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -84,9 +84,6 @@ body.cp-app-pad { .cp-pad-show { line-height: 0px; } - .h2{ - text-align: center; - } } #cp-app-pad-resize { order: 2; @@ -157,8 +154,11 @@ body.cp-app-pad { text-align: left; } p.msg{ - overflow: hidden; align-self: center; + padding: 0; + } + .dialog.nav{ + padding: 10px; } } From 442d7655dc36cbe9fa2000d38f12ed26cce7136a Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Sat, 28 Oct 2023 17:21:48 +0300 Subject: [PATCH 04/10] Fix chat and userlist height problem --- www/pad/app-pad.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index 3ecaf13da..b944663d6 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -26,7 +26,8 @@ body.cp-app-pad { @media screen and (max-width: @browser_media-medium-screen){ position: absolute; right: 0; - height: 90%; + bottom: 0; + top: 74px; } } From 7f358408af8cdb85434db5433e3f1c87d8d32c80 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:58:27 +0200 Subject: [PATCH 05/10] Fix ckedit context menu and paste dialog #631,#453 --- customize.dist/ckeditor-config.js | 4 ++-- www/pad/inner.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/customize.dist/ckeditor-config.js b/customize.dist/ckeditor-config.js index 9435c3d44..679123d9d 100644 --- a/customize.dist/ckeditor-config.js +++ b/customize.dist/ckeditor-config.js @@ -4,11 +4,11 @@ CKEDITOR.editorConfig = function( config ) { // https://dev.ckeditor.com/ticket/10907 config.needsBrFiller= fixThings; config.needsNbspFiller= fixThings; - config.removeButtons= 'Source,Maximize'; // magicline plugin inserts html crap into the document which is not part of the // document itself and causes problems when it's sent across the wire and reflected back - config.removePlugins= 'resize,elementspath'; + config.removePlugins= 'resize,elementspath,contextmenu,liststyle,tabletools,tableselection'; + config.forcePasteAsPlainText = true; config.resize_enabled= false; //bottom-bar config.extraPlugins= 'autolink,colorbutton,colordialog,font,indentblock,justify,mediatag,print,blockbase64,mathjax,wordcount,comments'; config.toolbarGroups= [ diff --git a/www/pad/inner.js b/www/pad/inner.js index 39216c281..462973e13 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -1422,7 +1422,7 @@ define([ }; module.ckeditor = editor = Ckeditor.replace('editor1', { - customConfig: '/customize/ckeditor-config.js', + customConfig: '/customize.dist/ckeditor-config.js', }); editor.on('instanceReady', waitFor()); From 5348b35efcaa83a2405e6999b6d1d7909a56a035 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:13:43 +0200 Subject: [PATCH 06/10] Do not change formatting --- customize.dist/ckeditor-config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/customize.dist/ckeditor-config.js b/customize.dist/ckeditor-config.js index 679123d9d..6b2a86588 100644 --- a/customize.dist/ckeditor-config.js +++ b/customize.dist/ckeditor-config.js @@ -8,7 +8,6 @@ CKEDITOR.editorConfig = function( config ) { // magicline plugin inserts html crap into the document which is not part of the // document itself and causes problems when it's sent across the wire and reflected back config.removePlugins= 'resize,elementspath,contextmenu,liststyle,tabletools,tableselection'; - config.forcePasteAsPlainText = true; config.resize_enabled= false; //bottom-bar config.extraPlugins= 'autolink,colorbutton,colordialog,font,indentblock,justify,mediatag,print,blockbase64,mathjax,wordcount,comments'; config.toolbarGroups= [ From d850b06bf4599e67b8cc878867f6e72e0a989117 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:54:04 +0200 Subject: [PATCH 07/10] Undo folder change --- www/pad/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/pad/inner.js b/www/pad/inner.js index 462973e13..39216c281 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -1422,7 +1422,7 @@ define([ }; module.ckeditor = editor = Ckeditor.replace('editor1', { - customConfig: '/customize.dist/ckeditor-config.js', + customConfig: '/customize/ckeditor-config.js', }); editor.on('instanceReady', waitFor()); From 2e13c041617f087ac9c8446273ca375116485dc5 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:35:01 +0200 Subject: [PATCH 08/10] Make ricktext toolbar keyboard accesible #1272 --- customize.dist/ckeditor-config.js | 10 ++++++++-- www/pad/csp.js | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/customize.dist/ckeditor-config.js b/customize.dist/ckeditor-config.js index 6b2a86588..b2cb6cdb6 100644 --- a/customize.dist/ckeditor-config.js +++ b/customize.dist/ckeditor-config.js @@ -28,7 +28,7 @@ CKEDITOR.editorConfig = function( config ) { config.mathJaxLib = '/pad/mathjax/MathJax.js?config=TeX-AMS_HTML'; config.font_defaultLabel = 'Arial'; config.fontSize_defaultLabel = '16'; - + config.accessibility = 'true'; config.keystrokes = [ [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ], [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ], @@ -46,7 +46,13 @@ CKEDITOR.editorConfig = function( config ) { [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ], [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ], - [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ] + [CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ], + [37 /* Left Arrow */, 'focusPreviousButton'], + [39 /* Right Arrow */, 'focusNextButton'], + //enter + [13, 'clickFocusedButton'], + //space bar + [32, 'clickFocusedButton'] ]; //skin: 'moono-cryptpad,/pad/themes/moono-cryptpad/' diff --git a/www/pad/csp.js b/www/pad/csp.js index 39cf032f0..2f27855fc 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -14,11 +14,12 @@ define(['jquery'], function ($) { CKEDITOR.tools.callFunction(Number(m[1]), e.currentTarget); $iframe.scrollTop(s); }); - + // Buttons var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button'); $a.each(function (i, el) { var $el = $(el); + $el.attr('tabindex', '0'); var $icon = $el.find('span.cke_button_icon'); if ($icon.length) { try { @@ -30,7 +31,7 @@ define(['jquery'], function ($) { } catch (e) { console.error(e); } } $el.on('keydown blur focus click dragstart', function (e) { - e.preventDefault(); + //e.preventDefault(); var attr = $(el).attr('oon'+e.type); if (!attr) { return; } if (['blur', 'dragstart'].indexOf(e.type) !== -1) { return false; } From 36e4837d086a3d9ad68d0b59399fa8162fdf3ce7 Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Wed, 13 Dec 2023 17:00:18 +0200 Subject: [PATCH 09/10] Fix toolbar keyboard nav linux #1272 --- www/pad/csp.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/www/pad/csp.js b/www/pad/csp.js index 2f27855fc..8504f3362 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -32,6 +32,15 @@ define(['jquery'], function ($) { } $el.on('keydown blur focus click dragstart', function (e) { //e.preventDefault(); + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + var focusedButton = document.activeElement; + + // Simulate a click event on the focused button + if (focusedButton) { + focusedButton.click(); + } + } var attr = $(el).attr('oon'+e.type); if (!attr) { return; } if (['blur', 'dragstart'].indexOf(e.type) !== -1) { return false; } @@ -45,7 +54,7 @@ define(['jquery'], function ($) { $iframe.scrollTop(s); }); }); - + // Dropdown menus @@ -104,7 +113,7 @@ define(['jquery'], function ($) { that.onLoad(); } }).contents().find('body').on('click dragstart mouseover mouseout', '.cke_button, a.cke_colormore, a.cke_colorbox, .cke_colorauto, .cke_combo_button, .cke_panel_listItem a, a.cke_menubutton', function (e) { - e.preventDefault(); + //e.preventDefault(); if (e.type === 'dragstart') { return false; } var attr = $(e.currentTarget).attr('oon'+e.type); if (!attr) { return; } From 45ac8d901f32a9259d609d24b04ab11026361641 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 13 Dec 2023 16:27:20 +0100 Subject: [PATCH 10/10] Remove CSP warnings in the console with CkEditor toolbar --- www/pad/csp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/pad/csp.js b/www/pad/csp.js index 8504f3362..b7c54a264 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -31,7 +31,7 @@ define(['jquery'], function ($) { } catch (e) { console.error(e); } } $el.on('keydown blur focus click dragstart', function (e) { - //e.preventDefault(); + if (e.key !== 'Tab') { e.preventDefault(); } if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); var focusedButton = document.activeElement; @@ -113,7 +113,7 @@ define(['jquery'], function ($) { that.onLoad(); } }).contents().find('body').on('click dragstart mouseover mouseout', '.cke_button, a.cke_colormore, a.cke_colorbox, .cke_colorauto, .cke_combo_button, .cke_panel_listItem a, a.cke_menubutton', function (e) { - //e.preventDefault(); + e.preventDefault(); if (e.type === 'dragstart') { return false; } var attr = $(e.currentTarget).attr('oon'+e.type); if (!attr) { return; }