From 14ca22076a5c5d30bba7a88cfcd899740f2b65ff Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:26:18 +0200 Subject: [PATCH 01/52] Improved ML button styling Not perfect, but much better than it actually was. The button is more obvious. Users will see more easily that they have to translate the field. --- assets/less/multilingual.less | 126 ++++++++++++---------------------- 1 file changed, 44 insertions(+), 82 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 87b77681..3ae11362 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -6,128 +6,90 @@ position: relative; .ml-btn { - background: transparent; + z-index: 2; position: absolute; - color: lighten(@multilingual-btn-color, 15%); - text-transform: uppercase; + top: 1px; + right: 1px; + + height: calc(100% - 2px); + max-height: 38px; + + width: auto; + max-width: 44px; + + color: #7b7b7b; + background-color: #F8F6F3; + font-size: 11px; letter-spacing: 1px; - width: 44px; - padding-right: 0; - .box-shadow(none); - text-shadow: none; - z-index: 2; + text-transform: uppercase; + + margin: 0 !important; + padding: 0 12px; + + border-top-left-radius: 0; + border-bottom-left-radius: 0; + + transition: color 420ms ease; &:hover { color: @multilingual-btn-color; } } - &.field-multilingual-text { - .form-control { - padding-right: 44px; - } - .ml-btn { - right: 4px; - top: 50%; - margin-top: -44px; - height: 88px; - } + textarea + .ml-btn { + border-bottom-right-radius: 0px; + border-bottom-left-radius: .375rem; } - &.field-multilingual-textarea { - textarea { - // increase padding on the right so that the textarea content does not overlap with the language button - padding-right: 30px; - } - - .ml-btn { - right: 13px; - top: 5px; - width: 24px; - text-align: right; - padding-left: 4px; - } + &.field-multilingual-repeater .ml-btn { + top: 5px; /* counter padding-top .field-repeater */ + height: auto; + transform: translateY(-100%); + border-radius: .375rem; + } + &.field-multilingual-textarea { .ml-dropdown-menu { - top: 39px; + top: 28px; right: 1px; } } &.field-multilingual-richeditor { - .ml-btn { - top: 43px; - right: 25px; - text-align: right; - } - .ml-dropdown-menu { top: 74px; - right: 12px; + right: 1px; } } &.field-multilingual-markdowneditor { - .ml-btn { - top: 43px; - right: 25px; - text-align: right; - } - .ml-dropdown-menu { - top: 74px !important; - right: 12px; + top: 74px; + right: 1px; } } &.field-multilingual-repeater, &.field-multilingual-nestedform { - .ml-btn { - top: -27px; - right: 11px; - text-align: right; - } - .ml-dropdown-menu { - top: 0; + top: 2px; right: 0; } - - &.is-empty { - padding-top: 5px; - - .ml-btn { - top: -10px; - right: 5px; - text-align: right; - } - - .ml-dropdown-menu { - top: 15px; - right: -7px; - } - } } } .fancy-layout { .form-tabless-fields .field-multilingual { .ml-btn { - color: rgba(255,255,255,.8); - - &:hover { - color: rgba(255,255,255,1); - } + background-color: rgba(248, 246, 243, 0.75) } } - .field-multilingual-text input.form-control { - padding-right: 44px; - } } -.help-block.before-field + .field-multilingual.field-multilingual-textarea { - .ml-btn { - top: -41px; - } -} +// ?? CHECK THIS +// .help-block.before-field + .field-multilingual.field-multilingual-textarea { +// .ml-btn { +// top: -41px; +// } +// } From 8ea49d24de8f9a95b3ca5532eb8d8ce212537a52 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:27:56 +0200 Subject: [PATCH 02/52] Compile multilingual.less --- assets/css/multilingual.css | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 3307979f..ca65c0a9 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -1,26 +1,11 @@ .field-multilingual{position:relative} -.field-multilingual .ml-btn{background:transparent;position:absolute;color:#7b7b7b;text-transform:uppercase;font-size:11px;letter-spacing:1px;width:44px;padding-right:0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none;z-index:2} +.field-multilingual .ml-btn{z-index:2;position:absolute;top:1px;right:1px;height:calc(98%);max-height:38px;width:auto;max-width:44px;color:#7b7b7b;background-color:#F8F6F3;font-size:11px;letter-spacing:1px;text-transform:uppercase;margin:0 !important;padding:0 12px;border-top-left-radius:0;border-bottom-left-radius:0;transition:color 420ms ease} .field-multilingual .ml-btn:hover{color:#555} -.field-multilingual.field-multilingual-text .form-control{padding-right:44px} -.field-multilingual.field-multilingual-text .ml-btn{right:4px;top:50%;margin-top:-44px;height:88px} -.field-multilingual.field-multilingual-textarea textarea{padding-right:30px} -.field-multilingual.field-multilingual-textarea .ml-btn{right:13px;top:5px;width:24px;text-align:right;padding-left:4px} -.field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:39px;right:1px} -.field-multilingual.field-multilingual-richeditor .ml-btn{top:43px;right:25px;text-align:right} -.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:12px} -.field-multilingual.field-multilingual-markdowneditor .ml-btn{top:43px;right:25px;text-align:right} -.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:74px !important;right:12px} -.field-multilingual.field-multilingual-repeater .ml-btn, -.field-multilingual.field-multilingual-nestedform .ml-btn{top:-27px;right:11px;text-align:right} +.field-multilingual textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} +.field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} +.field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} +.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} +.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:74px;right:1px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, -.field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:0;right:0} -.field-multilingual.field-multilingual-repeater.is-empty, -.field-multilingual.field-multilingual-nestedform.is-empty{padding-top:5px} -.field-multilingual.field-multilingual-repeater.is-empty .ml-btn, -.field-multilingual.field-multilingual-nestedform.is-empty .ml-btn{top:-10px;right:5px;text-align:right} -.field-multilingual.field-multilingual-repeater.is-empty .ml-dropdown-menu, -.field-multilingual.field-multilingual-nestedform.is-empty .ml-dropdown-menu{top:15px;right:-7px} -.fancy-layout .form-tabless-fields .field-multilingual .ml-btn{color:rgba(255,255,255,0.8)} -.fancy-layout .form-tabless-fields .field-multilingual .ml-btn:hover{color:#fff} -.fancy-layout .field-multilingual-text input.form-control{padding-right:44px} -.help-block.before-field + .field-multilingual.field-multilingual-textarea .ml-btn{top:-41px} \ No newline at end of file +.field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} +.fancy-layout .form-tabless-fields .field-multilingual .ml-btn{background-color:rgba(248,246,243,0.75)} From 52b48e463fd30706b0a4a73737f0e4a010054454 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:40:34 +0200 Subject: [PATCH 03/52] Fix markdown ML button position --- assets/less/multilingual.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 3ae11362..b5fef80c 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -64,6 +64,9 @@ } &.field-multilingual-markdowneditor { + .ml-btn { + top: 41px; + } .ml-dropdown-menu { top: 74px; right: 1px; From c4d5435390796dfcd57e23762a939ea8e3a54c82 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:41:51 +0200 Subject: [PATCH 04/52] Fix markdown ML button --- assets/css/multilingual.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index ca65c0a9..5c74f7c8 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -5,6 +5,7 @@ .field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} +.field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px} .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:74px;right:1px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, .field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} From 33100765fd1cf69ae40857c14b41da43a86f6ed0 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:25:00 +0200 Subject: [PATCH 05/52] Fix ML button color --- assets/less/multilingual.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index b5fef80c..a372eddf 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -17,7 +17,7 @@ width: auto; max-width: 44px; - color: #7b7b7b; + color: lighten(@multilingual-btn-color, 15%); background-color: #F8F6F3; font-size: 11px; From d1b787130b0f2224fdaaa12aca72039831de5297 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:36:38 +0200 Subject: [PATCH 06/52] Remove height, reset box shadow and add bottom --- assets/less/multilingual.less | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index a372eddf..1979d938 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -9,16 +9,16 @@ z-index: 2; position: absolute; top: 1px; + bottom: 1px; right: 1px; - - height: calc(100% - 2px); - max-height: 38px; - + width: auto; max-width: 44px; + max-height: 38px; color: lighten(@multilingual-btn-color, 15%); background-color: #F8F6F3; + box-shadow: none; font-size: 11px; letter-spacing: 1px; @@ -64,9 +64,6 @@ } &.field-multilingual-markdowneditor { - .ml-btn { - top: 41px; - } .ml-dropdown-menu { top: 74px; right: 1px; From 204ee73639ebf40ac6ced735c148187346775e25 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:38:29 +0200 Subject: [PATCH 07/52] fix oopsie --- assets/less/multilingual.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 1979d938..db20a4a7 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -64,6 +64,10 @@ } &.field-multilingual-markdowneditor { + .ml-btn { + top: 41px; + } + .ml-dropdown-menu { top: 74px; right: 1px; From b14c93c809f3db1b1696a68baac84aa275521c5b Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:38:51 +0200 Subject: [PATCH 08/52] Compile multilingual.less --- assets/css/multilingual.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 5c74f7c8..ed84f950 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -1,5 +1,5 @@ .field-multilingual{position:relative} -.field-multilingual .ml-btn{z-index:2;position:absolute;top:1px;right:1px;height:calc(98%);max-height:38px;width:auto;max-width:44px;color:#7b7b7b;background-color:#F8F6F3;font-size:11px;letter-spacing:1px;text-transform:uppercase;margin:0 !important;padding:0 12px;border-top-left-radius:0;border-bottom-left-radius:0;transition:color 420ms ease} +.field-multilingual .ml-btn{z-index:2;position:absolute;top:1px;bottom:1px;right:1px;width:auto;max-width:44px;max-height:38px;color:#7b7b7b;background-color:#F8F6F3;box-shadow:none;font-size:11px;letter-spacing:1px;text-transform:uppercase;margin:0 !important;padding:0 12px;border-top-left-radius:0;border-bottom-left-radius:0;transition:color 420ms ease} .field-multilingual .ml-btn:hover{color:#555} .field-multilingual textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} From ac185453577cd96bdd618fc12f6eaee5912ab472 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:18:24 +0200 Subject: [PATCH 09/52] Move markdowneditor ML button inside the toolbar Feedback @mjauvin --- assets/less/multilingual.less | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index db20a4a7..a174cc8e 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -65,12 +65,13 @@ &.field-multilingual-markdowneditor { .ml-btn { - top: 41px; + right: 76px; + background-color: transparent; } .ml-dropdown-menu { - top: 74px; - right: 1px; + top: 36px; + right: 76px; } } From ba7bdde950b465554878f57bbd53715dffc4dac8 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:18:51 +0200 Subject: [PATCH 10/52] Compile multilingual.less --- assets/css/multilingual.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index ed84f950..84c9b1a3 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -5,8 +5,8 @@ .field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} -.field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px} -.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:74px;right:1px} +.field-multilingual.field-multilingual-markdowneditor .ml-btn{right:76px;background-color:transparent} +.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:36px;right:76px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, .field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} .fancy-layout .form-tabless-fields .field-multilingual .ml-btn{background-color:rgba(248,246,243,0.75)} From ad9670b1ef652dc5f9e4e8a611c4afc1d1aa728c Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:23:53 +0200 Subject: [PATCH 11/52] Fix richeditor ML button --- assets/less/multilingual.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index a174cc8e..237ba1a4 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -57,6 +57,11 @@ } &.field-multilingual-richeditor { + .ml-btn { + top: 3px; + bottom: auto; + } + .ml-dropdown-menu { top: 74px; right: 1px; From fbb910ce21f0cea229bc4e99f96b4266f196daee Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:24:10 +0200 Subject: [PATCH 12/52] Compile multilingual.less --- assets/css/multilingual.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 84c9b1a3..a3a185d4 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -4,6 +4,7 @@ .field-multilingual textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} +.field-multilingual.field-multilingual-richeditor .ml-btn{top:3px;bottom:auto} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} .field-multilingual.field-multilingual-markdowneditor .ml-btn{right:76px;background-color:transparent} .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:36px;right:76px} From a543e7e8b5a9490839f29e33bef7b8253a99933d Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:06:47 +0200 Subject: [PATCH 13/52] fixes for ML buttons --- assets/less/multilingual.less | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 237ba1a4..01fc9e06 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -43,7 +43,8 @@ } &.field-multilingual-repeater .ml-btn { - top: 5px; /* counter padding-top .field-repeater */ + top: 3px; + bottom: auto; height: auto; transform: translateY(-100%); border-radius: .375rem; @@ -57,9 +58,14 @@ } &.field-multilingual-richeditor { + .editor-write { + margin-right: 2rem; + } + .ml-btn { - top: 3px; - bottom: auto; + top: 41px; + border-radius: 0; + border-bottom-left-radius: .375rem; } .ml-dropdown-menu { @@ -69,14 +75,18 @@ } &.field-multilingual-markdowneditor { + .editor-write { + margin-right: 2rem; + } + .ml-btn { - right: 76px; - background-color: transparent; + top: 41px; + border-radius: 0; + border-bottom-left-radius: .375rem; } .ml-dropdown-menu { - top: 36px; - right: 76px; + top: 80px; } } From be58cb909df9581788e5002ffa3ebcf6f0018f98 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:07:13 +0200 Subject: [PATCH 14/52] Compile multilingual.less --- assets/css/multilingual.css | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index a3a185d4..5b41b216 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -2,12 +2,14 @@ .field-multilingual .ml-btn{z-index:2;position:absolute;top:1px;bottom:1px;right:1px;width:auto;max-width:44px;max-height:38px;color:#7b7b7b;background-color:#F8F6F3;box-shadow:none;font-size:11px;letter-spacing:1px;text-transform:uppercase;margin:0 !important;padding:0 12px;border-top-left-radius:0;border-bottom-left-radius:0;transition:color 420ms ease} .field-multilingual .ml-btn:hover{color:#555} .field-multilingual textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} -.field-multilingual.field-multilingual-repeater .ml-btn{top:5px;height:auto;transform:translateY(-100%);border-radius:.375rem} +.field-multilingual.field-multilingual-repeater .ml-btn{top:3px;bottom:auto;height:auto;transform:translateY(-100%);border-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} -.field-multilingual.field-multilingual-richeditor .ml-btn{top:3px;bottom:auto} +.field-multilingual.field-multilingual-richeditor .editor-write{margin-right:2rem} +.field-multilingual.field-multilingual-richeditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} -.field-multilingual.field-multilingual-markdowneditor .ml-btn{right:76px;background-color:transparent} -.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:36px;right:76px} +.field-multilingual.field-multilingual-markdowneditor .editor-write{margin-right:2rem} +.field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} +.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, .field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} .fancy-layout .form-tabless-fields .field-multilingual .ml-btn{background-color:rgba(248,246,243,0.75)} From 15afd6e32edfb1767b92bba1f6839022eb5ca8b9 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:11:04 +0200 Subject: [PATCH 15/52] Fix textarea and mediafinder --- assets/less/multilingual.less | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 01fc9e06..e93f120e 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -37,11 +37,6 @@ } } - textarea + .ml-btn { - border-bottom-right-radius: 0px; - border-bottom-left-radius: .375rem; - } - &.field-multilingual-repeater .ml-btn { top: 3px; bottom: auto; @@ -51,6 +46,15 @@ } &.field-multilingual-textarea { + textarea { + padding-right: 2rem; + } + + textarea + .ml-btn { + border-bottom-right-radius: 0px; + border-bottom-left-radius: .375rem; + } + .ml-dropdown-menu { top: 28px; right: 1px; @@ -97,6 +101,12 @@ right: 0; } } + + &.field-multilingual-mediafinder { + .ml-btn { + border-radius: .375rem; + } + } } .fancy-layout { From 0cefe014e7a7b31badc0b2bc75cd4fb2173b546e Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:11:24 +0200 Subject: [PATCH 16/52] Compile multilingual.less --- assets/css/multilingual.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 5b41b216..6bf77798 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -1,8 +1,9 @@ .field-multilingual{position:relative} .field-multilingual .ml-btn{z-index:2;position:absolute;top:1px;bottom:1px;right:1px;width:auto;max-width:44px;max-height:38px;color:#7b7b7b;background-color:#F8F6F3;box-shadow:none;font-size:11px;letter-spacing:1px;text-transform:uppercase;margin:0 !important;padding:0 12px;border-top-left-radius:0;border-bottom-left-radius:0;transition:color 420ms ease} .field-multilingual .ml-btn:hover{color:#555} -.field-multilingual textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-repeater .ml-btn{top:3px;bottom:auto;height:auto;transform:translateY(-100%);border-radius:.375rem} +.field-multilingual.field-multilingual-textarea textarea{padding-right:2rem} +.field-multilingual.field-multilingual-textarea textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .editor-write{margin-right:2rem} .field-multilingual.field-multilingual-richeditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} @@ -12,4 +13,5 @@ .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, .field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} +.field-multilingual.field-multilingual-mediafinder .ml-btn{border-radius:.375rem} .fancy-layout .form-tabless-fields .field-multilingual .ml-btn{background-color:rgba(248,246,243,0.75)} From 719fb5c626c3faa1e3e4ea9345b31ec3e683ef4f Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:13:16 +0200 Subject: [PATCH 17/52] Cleanup --- assets/less/multilingual.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index e93f120e..f7c2c2eb 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -50,7 +50,7 @@ padding-right: 2rem; } - textarea + .ml-btn { + .ml-btn { border-bottom-right-radius: 0px; border-bottom-left-radius: .375rem; } From ab5f5f1b92ad69402aa2843e2d2408a890b518f7 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:13:40 +0200 Subject: [PATCH 18/52] Compile multilingual.less --- assets/css/multilingual.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 6bf77798..5e1ae2aa 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -3,7 +3,7 @@ .field-multilingual .ml-btn:hover{color:#555} .field-multilingual.field-multilingual-repeater .ml-btn{top:3px;bottom:auto;height:auto;transform:translateY(-100%);border-radius:.375rem} .field-multilingual.field-multilingual-textarea textarea{padding-right:2rem} -.field-multilingual.field-multilingual-textarea textarea + .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} +.field-multilingual.field-multilingual-textarea .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .editor-write{margin-right:2rem} .field-multilingual.field-multilingual-richeditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} From f889107f83f7f0239e0b582746eb8d36e2076732 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:45:52 +0200 Subject: [PATCH 19/52] fix richeditor --- assets/less/multilingual.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index f7c2c2eb..5c81765a 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -62,8 +62,8 @@ } &.field-multilingual-richeditor { - .editor-write { - margin-right: 2rem; + .fr-wrapper { + padding-right: 23px; } .ml-btn { From 1fdda7e30ae377ab647f4f378e9c06755c961a1e Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:46:10 +0200 Subject: [PATCH 20/52] Compile multilingual.less --- assets/css/multilingual.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 5e1ae2aa..864788cd 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -5,7 +5,7 @@ .field-multilingual.field-multilingual-textarea textarea{padding-right:2rem} .field-multilingual.field-multilingual-textarea .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} -.field-multilingual.field-multilingual-richeditor .editor-write{margin-right:2rem} +.field-multilingual.field-multilingual-richeditor .fr-wrapper{padding-right:23px} .field-multilingual.field-multilingual-richeditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} .field-multilingual.field-multilingual-markdowneditor .editor-write{margin-right:2rem} From 2076df25191d9347aed0960e3f91546c6aeecc6c Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:05:49 +0200 Subject: [PATCH 21/52] Remove .ml-btn 6px margin --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index 68247fea..5adb39a9 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -92,8 +92,8 @@ } var height = $toolbar.outerHeight(true) - $btn.css('top', height + 6) - $dropdown.css('top', height + 40) + $btn.css('top', height) + $dropdown.css('top', height + 34) } // MLRICHEDITOR PLUGIN DEFINITION From f0474919125d667e8d550cb090408bc555ebd4e3 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:22:41 +0200 Subject: [PATCH 22/52] Only set top if height is > 0 --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index 5adb39a9..08e7e7d9 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -92,6 +92,7 @@ } var height = $toolbar.outerHeight(true) + if (!height) return $btn.css('top', height) $dropdown.css('top', height + 34) } From 8db7c6255aae38fb8c9dd75f9098efeb3d44a0bc Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:29:01 +0200 Subject: [PATCH 23/52] Set correct richeditor default .ml-element values --- assets/less/multilingual.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 5c81765a..13dcff9d 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -67,13 +67,12 @@ } .ml-btn { - top: 41px; border-radius: 0; border-bottom-left-radius: .375rem; } .ml-dropdown-menu { - top: 74px; + top: 28px; right: 1px; } } From 4082615f96e577833d355d5b937ada1991385be5 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:29:23 +0200 Subject: [PATCH 24/52] Compile multilingual.less --- assets/css/multilingual.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 864788cd..5add0de3 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -6,8 +6,8 @@ .field-multilingual.field-multilingual-textarea .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .fr-wrapper{padding-right:23px} -.field-multilingual.field-multilingual-richeditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} -.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:74px;right:1px} +.field-multilingual.field-multilingual-richeditor .ml-btn{border-radius:0;border-bottom-left-radius:.375rem} +.field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-markdowneditor .editor-write{margin-right:2rem} .field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} From 3a4e069eb75a64ea794902dae55e515cf4541146 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:16:10 +0200 Subject: [PATCH 25/52] [fix] mlricheditor .ml-btn --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index 08e7e7d9..6e393a0c 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -85,7 +85,8 @@ MLRichEditor.prototype.updateLayout = function() { var $toolbar = $('.fr-toolbar', this.$el), $btn = $('.ml-btn[data-active-locale]:first', this.$el), - $dropdown = $('.ml-dropdown-menu[data-locale-dropdown]:first', this.$el) + $dropdown = $('.ml-dropdown-menu[data-locale-dropdown]:first', this.$el), + $element = $('.fr-element', this.$el) if (!$toolbar.length) { return @@ -95,6 +96,14 @@ if (!height) return $btn.css('top', height) $dropdown.css('top', height + 34) + + var scrollHeight = $element.prop('scrollHeight') + var offsetHeight = $element.outerHeight() + if (scrollHeight > offsetHeight) { + $element.css('padding-right', 40) + $btn.css('right', 16) + $dropdown.css('right', 14) + } } // MLRICHEDITOR PLUGIN DEFINITION From de68bf209a46c0a550110e3e5f7ed245be097d5d Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:17:51 +0200 Subject: [PATCH 26/52] [fix] mlrepeater padding From 132c6fd742be3f69a8eab3ee5b05e82f0d76485a Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:18:26 +0200 Subject: [PATCH 27/52] [fix] mlricheditor compile multilingual.less --- assets/css/multilingual.css | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 5add0de3..923aa508 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -5,7 +5,6 @@ .field-multilingual.field-multilingual-textarea textarea{padding-right:2rem} .field-multilingual.field-multilingual-textarea .ml-btn{border-bottom-right-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} -.field-multilingual.field-multilingual-richeditor .fr-wrapper{padding-right:23px} .field-multilingual.field-multilingual-richeditor .ml-btn{border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-markdowneditor .editor-write{margin-right:2rem} From 90dc182227644acda5f3b28dca501c784774ab0f Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:21:51 +0200 Subject: [PATCH 28/52] [fix] mlricheditor padding --- assets/less/multilingual.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 13dcff9d..c9d6a6d7 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -62,10 +62,6 @@ } &.field-multilingual-richeditor { - .fr-wrapper { - padding-right: 23px; - } - .ml-btn { border-radius: 0; border-bottom-left-radius: .375rem; From 52b7b77e24c450862be595eda449f3c66a2d25fc Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:28:33 +0200 Subject: [PATCH 29/52] [fix] mlricheditor rounding exception https://stackoverflow.com/questions/34079032/what-is-the-jquery-equivalent-to-offsetheight#:~:text=//%20My%20machine%3A%20149.714%20%3C%20150%20%3D%20true --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index 6e393a0c..e3d5c3ec 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -97,8 +97,8 @@ $btn.css('top', height) $dropdown.css('top', height + 34) - var scrollHeight = $element.prop('scrollHeight') - var offsetHeight = $element.outerHeight() + var scrollHeight = $element.prop('scrollHeight') // int + var offsetHeight = Math.round($element.outerHeight()); // round the float if (scrollHeight > offsetHeight) { $element.css('padding-right', 40) $btn.css('right', 16) From f5584b46584db153c832d23667650c140953209a Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:41:51 +0200 Subject: [PATCH 30/52] [fix] mlricheditor scrollbar A suggestion as discussed on Discord --- .../mlricheditor/assets/js/mlricheditor.js | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index e3d5c3ec..1729c5a7 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -93,17 +93,41 @@ } var height = $toolbar.outerHeight(true) - if (!height) return - $btn.css('top', height) - $dropdown.css('top', height + 34) - - var scrollHeight = $element.prop('scrollHeight') // int - var offsetHeight = Math.round($element.outerHeight()); // round the float - if (scrollHeight > offsetHeight) { - $element.css('padding-right', 40) - $btn.css('right', 16) - $dropdown.css('right', 14) + if (height) { + $btn.css('top', height) + $dropdown.css('top', height + 34) } + + // set ML button position + var hasScrollbar = false + var scrollbarWidth = 0 + var elementHeight = $element.outerHeight() + + setMLButtonPosition() + $element.on('keydown', setMLButtonPosition) + $element.on('keyup', setMLButtonPosition) + + function setMLButtonPosition() { + var scrollHeight = $element[0].scrollHeight + var showScrollbar = scrollHeight > elementHeight + + if (!hasScrollbar && showScrollbar) { + + hasScrollbar = true + if (!scrollbarWidth) scrollbarWidth = $element[0].offsetWidth - $element[0].clientWidth + + $element.css('padding-right', scrollbarWidth + 23) + $btn.css('right', scrollbarWidth - 1) + $dropdown.css('right', scrollbarWidth - 2) + + } else if (hasScrollbar && !showScrollbar) { + hasScrollbar = false + $element.css('padding-right', '') + $btn.css('right', '') + $dropdown.css('right', '') + } + } + } // MLRICHEDITOR PLUGIN DEFINITION From 244b156e40bfa1d27e4e7fc1acff7041ff2db017 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:44:28 +0200 Subject: [PATCH 31/52] [fix] toolbar check --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index 1729c5a7..acce7f5c 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -88,14 +88,12 @@ $dropdown = $('.ml-dropdown-menu[data-locale-dropdown]:first', this.$el), $element = $('.fr-element', this.$el) - if (!$toolbar.length) { - return - } - - var height = $toolbar.outerHeight(true) - if (height) { - $btn.css('top', height) - $dropdown.css('top', height + 34) + if ($toolbar.length) { + var height = $toolbar.outerHeight(true) + if (height) { + $btn.css('top', height) + $dropdown.css('top', height + 34) + } } // set ML button position From 979453a6fb05b343911507e0ab19d0b61ac50ab9 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:16:01 +0200 Subject: [PATCH 32/52] Merge keydown & keyup event in one '.on()' function --- formwidgets/mlricheditor/assets/js/mlricheditor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/formwidgets/mlricheditor/assets/js/mlricheditor.js b/formwidgets/mlricheditor/assets/js/mlricheditor.js index acce7f5c..75f5d4b9 100644 --- a/formwidgets/mlricheditor/assets/js/mlricheditor.js +++ b/formwidgets/mlricheditor/assets/js/mlricheditor.js @@ -102,9 +102,8 @@ var elementHeight = $element.outerHeight() setMLButtonPosition() - $element.on('keydown', setMLButtonPosition) - $element.on('keyup', setMLButtonPosition) - + $element.on('keydown keyup', setMLButtonPosition) + function setMLButtonPosition() { var scrollHeight = $element[0].scrollHeight var showScrollbar = scrollHeight > elementHeight From 756a248233f7eae00fe7c56174f6c1406639af12 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:03:17 +0200 Subject: [PATCH 33/52] [fix] markdown margin<->padding --- assets/less/multilingual.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index c9d6a6d7..e83edd32 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -75,7 +75,7 @@ &.field-multilingual-markdowneditor { .editor-write { - margin-right: 2rem; + padding-right: 2rem; } .ml-btn { From 2b399a8ff78d55b9b54369fb298e0913e1b8b378 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:04:26 +0200 Subject: [PATCH 34/52] Compile multilingual.less --- assets/css/multilingual.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 923aa508..11b0bd2a 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -7,7 +7,7 @@ .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .ml-btn{border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:28px;right:1px} -.field-multilingual.field-multilingual-markdowneditor .editor-write{margin-right:2rem} +.field-multilingual.field-multilingual-markdowneditor .editor-write{padding-right:2rem} .field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, From b43207298d1e41be724a63454960d58b87cf03ce Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:13:50 +0200 Subject: [PATCH 35/52] Support markdown splitmode --- assets/less/multilingual.less | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index e83edd32..68e9a787 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -74,7 +74,11 @@ } &.field-multilingual-markdowneditor { - .editor-write { + .mode-tab .editor-write { + padding-right: 2rem; + } + + .mode-split .editor-preview { padding-right: 2rem; } From 5c329f08123a13c232433b355a4761680aa03326 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:14:08 +0200 Subject: [PATCH 36/52] Compile multilingual.less --- assets/css/multilingual.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 11b0bd2a..772910b0 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -7,7 +7,8 @@ .field-multilingual.field-multilingual-textarea .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-richeditor .ml-btn{border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:28px;right:1px} -.field-multilingual.field-multilingual-markdowneditor .editor-write{padding-right:2rem} +.field-multilingual.field-multilingual-markdowneditor .mode-tab .editor-write{padding-right:2rem} +.field-multilingual.field-multilingual-markdowneditor .mode-split .editor-preview{padding-right:2rem} .field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} .field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, From 3d037ccb1824cbeab5db8c6b190e2787d189e4fb Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:46:11 +0200 Subject: [PATCH 37/52] [fix] Markdowneditor ML button position --- .../assets/js/mlmarkdowneditor.js | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/formwidgets/mlmarkdowneditor/assets/js/mlmarkdowneditor.js b/formwidgets/mlmarkdowneditor/assets/js/mlmarkdowneditor.js index 35c70494..9f6830f2 100644 --- a/formwidgets/mlmarkdowneditor/assets/js/mlmarkdowneditor.js +++ b/formwidgets/mlmarkdowneditor/assets/js/mlmarkdowneditor.js @@ -46,6 +46,10 @@ this.$el.on('setLocale.oc.multilingual', this.proxy(this.onSetLocale)) this.$textarea.on('changeContent.oc.markdowneditor', this.proxy(this.onChangeContent)) + this.updateLayout() + + $(window).on('resize', this.proxy(this.updateLayout)) + $(window).on('oc.updateUi', this.proxy(this.updateLayout)) this.$el.one('dispose-control', this.proxy(this.dispose)) } @@ -75,6 +79,53 @@ this.$el.multiLingual('setLocaleValue', value) } + MLMarkdownEditor.prototype.updateLayout = function() { + var $toolbar = $('.control-toolbar', this.$el), + $btn = $('.ml-btn[data-active-locale]:first', this.$el), + $dropdown = $('.ml-dropdown-menu[data-locale-dropdown]:first', this.$el), + $container = $('.editor-write', this.$el), + $scrollbar = $('.ace_scrollbar', this.$el), + $input = $('.ace_text-input', this.$el) + + if ($toolbar.length) { + var height = $toolbar.outerHeight(true) + if (height) { + $btn.css('top', height + 0.5) + $dropdown.css('top', height + 34) + } + } + + // set ML button position + if (this.$markdownEditor.hasClass('mode-tab')) { + + var $container = $('.editor-write', this.$el), + $scrollbar = $('.ace_scrollbar', this.$el), + $input = $('.ace_text-input', this.$el) + + setMLButtonPosition() + $input.on('keydown keyup', setMLButtonPosition) + + function setMLButtonPosition() { + var scrollbarWidth = $scrollbar[0].offsetWidth - 5 + + if (scrollbarWidth >= 0) { + $container.css('padding-right', scrollbarWidth + 23) + $btn.css('right', scrollbarWidth - 1) + $dropdown.css('right', scrollbarWidth - 2) + } else { + $container.css('padding-right', '') + $btn.css('right', '') + $dropdown.css('right', '') + } + } + + } + + } + + // MLMARKDOWNEDITOR PLUGIN DEFINITION + // ============================ + var old = $.fn.mlMarkdownEditor $.fn.mlMarkdownEditor = function (option) { @@ -94,11 +145,17 @@ $.fn.mlMarkdownEditor.Constructor = MLMarkdownEditor; + // MLMARKDOWNEDITOR NO CONFLICT + // ================= + $.fn.mlMarkdownEditor.noConflict = function () { $.fn.mlMarkdownEditor = old return this } + // MLMARKDOWNEDITOR DATA-API + // =============== + $(document).render(function (){ $('[data-control="mlmarkdowneditor"]').mlMarkdownEditor() }) From 233576a64a95e9bf8a2be46caeec5687f93aa9e2 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:46:51 +0200 Subject: [PATCH 38/52] Update multilingual.less --- assets/less/multilingual.less | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/less/multilingual.less b/assets/less/multilingual.less index 68e9a787..a037c667 100644 --- a/assets/less/multilingual.less +++ b/assets/less/multilingual.less @@ -82,14 +82,18 @@ padding-right: 2rem; } + .editor-code { + padding-right: inherit; + } + .ml-btn { - top: 41px; border-radius: 0; border-bottom-left-radius: .375rem; } .ml-dropdown-menu { - top: 80px; + top: 28px; + right: 1px; } } From 8d265952b679753264e7160b83a39d417731b65d Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:47:05 +0200 Subject: [PATCH 39/52] Update multilingual.css --- assets/css/multilingual.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/css/multilingual.css b/assets/css/multilingual.css index 772910b0..1b2bc38c 100644 --- a/assets/css/multilingual.css +++ b/assets/css/multilingual.css @@ -9,8 +9,9 @@ .field-multilingual.field-multilingual-richeditor .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-markdowneditor .mode-tab .editor-write{padding-right:2rem} .field-multilingual.field-multilingual-markdowneditor .mode-split .editor-preview{padding-right:2rem} -.field-multilingual.field-multilingual-markdowneditor .ml-btn{top:41px;border-radius:0;border-bottom-left-radius:.375rem} -.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:80px} +.field-multilingual.field-multilingual-markdowneditor .editor-code{padding-right:inherit} +.field-multilingual.field-multilingual-markdowneditor .ml-btn{border-radius:0;border-bottom-left-radius:.375rem} +.field-multilingual.field-multilingual-markdowneditor .ml-dropdown-menu{top:28px;right:1px} .field-multilingual.field-multilingual-repeater .ml-dropdown-menu, .field-multilingual.field-multilingual-nestedform .ml-dropdown-menu{top:2px;right:0} .field-multilingual.field-multilingual-mediafinder .ml-btn{border-radius:.375rem} From 64081efe9831b8a9ee19ee5868258121deb4e9c4 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:19:32 +0200 Subject: [PATCH 40/52] Create mltextarea.js --- .../mltextarea/assets/js/mltextarea.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 formwidgets/mltextarea/assets/js/mltextarea.js diff --git a/formwidgets/mltextarea/assets/js/mltextarea.js b/formwidgets/mltextarea/assets/js/mltextarea.js new file mode 100644 index 00000000..a168bfd9 --- /dev/null +++ b/formwidgets/mltextarea/assets/js/mltextarea.js @@ -0,0 +1,24 @@ +function updateTextareaLayout($element) { + + // get elements + const $parent = $element.parentElement + const $btn = $parent.querySelector('.ml-btn[data-active-locale]') + const $dropdown = $parent.querySelector('.ml-dropdown-menu[data-locale-dropdown]') + + // set ML button position + const elementHeight = $element.offsetHeight + const scrollHeight = $element.scrollHeight + const showScrollbar = (scrollHeight - elementHeight) > 0 ? true : false + + if (showScrollbar) { + const scrollbarWidth = $element.offsetWidth - $element.clientWidth + $element.style.paddingRight = `${scrollbarWidth + 23}px` + $btn.style.right = `${scrollbarWidth -1}px` + $dropdown.style.right = `${scrollbarWidth -2}px` + } else { + $element.style.paddingRight = '' + $btn.style.right = '' + $dropdown.style.right = '' + } + +} From 04a6f34421fb7dec6aa3b4966b5c6fc3a904493f Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:20:18 +0200 Subject: [PATCH 41/52] Update _mltextarea.htm --- formwidgets/mltextarea/partials/_mltextarea.htm | 1 + 1 file changed, 1 insertion(+) diff --git a/formwidgets/mltextarea/partials/_mltextarea.htm b/formwidgets/mltextarea/partials/_mltextarea.htm index 1a710bd2..7801a630 100644 --- a/formwidgets/mltextarea/partials/_mltextarea.htm +++ b/formwidgets/mltextarea/partials/_mltextarea.htm @@ -15,6 +15,7 @@ placeholder="placeholder)) ?>" class="form-control field-textarea size-size ?>" autocomplete="off" + onchange="updateTextareaLayout(this)" getAttributes() ?>>value) ?>