From 88ce7cf073da599e173294324e26a8ad8600cd7c Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 23 Jan 2024 12:12:14 +0100 Subject: [PATCH 1/4] Fix sanitizer applied twice in notifications #1379 --- www/common/notifications.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/notifications.js b/www/common/notifications.js index 45ad6d976..414d7e5cd 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -498,6 +498,7 @@ define([ if (!toShow) { return defaultDismiss(common, data)(); } var slice = toShow.length > 200; + var unsafe = toShow; toShow = Util.fixHTML(toShow); content.getFormatText = function () { @@ -510,7 +511,7 @@ define([ content.handler = function () { var content = h('div', [ h('h4', Messages.broadcast_newCustom), - h('div.cp-admin-message', toShow) + h('div.cp-admin-message', unsafe) // Use unsafe string, hyperscript is safe ]); UI.alert(content); }; From 484687d002415b0f2484ca1e590c83f40b0baea3 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Tue, 23 Jan 2024 15:07:22 +0100 Subject: [PATCH 2/4] Set constant difference between start and end dates in time ranges --- www/lib/calendar/date-picker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/lib/calendar/date-picker.js b/www/lib/calendar/date-picker.js index 887384a6b..e0d96b112 100644 --- a/www/lib/calendar/date-picker.js +++ b/www/lib/calendar/date-picker.js @@ -30,17 +30,22 @@ define([ enableTime: true, time_24hr: is24h, dateFormat: dateFormat, - minDate: start.date + minDate: start.date, + onChange: function () { + duration = parseDate(e.value) - parseDate(s.value); + } }); endPickr.setDate(end.date); var s = $(start.input)[0]; + var duration = end.date - start.date; var startPickr = Flatpickr(s, { enableTime: true, time_24hr: is24h, dateFormat: dateFormat, onChange: function () { endPickr.set('minDate', parseDate(s.value)); + endPickr.setDate(parseDate(s.value).getTime() + duration); } }); startPickr.setDate(start.date); From 17096312b2599480eb3f25ff46d762a48c9409a4 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Wed, 24 Jan 2024 11:29:45 +0100 Subject: [PATCH 3/4] Remove confusing log message --- www/common/outer/x2t.js | 1 - 1 file changed, 1 deletion(-) diff --git a/www/common/outer/x2t.js b/www/common/outer/x2t.js index 326c1a026..55ceb869c 100644 --- a/www/common/outer/x2t.js +++ b/www/common/outer/x2t.js @@ -130,7 +130,6 @@ define([ var ext = s.pop() || 'bin'; var name = s.join(''); var replacement = ''; - console.error(name); var sanitized = name .replace(illegalRe, replacement) .replace(controlRe, replacement) From edaa6ed07659963fde82cbefaadeaf736f762779 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 24 Jan 2024 16:25:45 +0100 Subject: [PATCH 4/4] Standardize input width in admin panel --- www/admin/app-admin.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index f674160ca..b85c6329e 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -37,12 +37,12 @@ } } - .cp-admin-setlimit-form, .cp-admin-broadcast-form { - label { + .cp-sidebarlayout-element { + label:not(> label) { font-weight: normal !important; } input { - max-width: 400px; + max-width: 25rem; } nav { display: flex;