From fe43330e7389746ef26c47a6e4d492b4e017f419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 13 Dec 2017 11:10:52 +0100 Subject: [PATCH 1/4] Datepicker design fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/css/header.scss | 9 ++++--- core/css/styles.scss | 63 ++++++++++++++++++++++++++++++-------------- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/core/css/header.scss b/core/css/header.scss index b38c0bcb4014c..1b25e0c46c7d6 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -206,12 +206,15 @@ nav { margin-left: -54px; } -.header-left #navigation, -.ui-datepicker, -.ui-timepicker.ui-widget { +.header-left #navigation { position: relative; left: -100%; width: 160px; +} + +.header-left #navigation, +.ui-datepicker, +.ui-timepicker.ui-widget { background-color: $color-main-background; filter: drop-shadow(0 1px 10px $color-box-shadow); &:after { diff --git a/core/css/styles.scss b/core/css/styles.scss index 1b76e3c68de2d..cd3c57bda4fb7 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -1030,15 +1030,6 @@ code { background-color: inherit; } td { - > * { - border-radius: 50%; - text-align: center; - font-weight: normal; - color: $color-main-text; - padding: 6px; - line-height: 12px; - } - &.ui-datepicker-today a:not(.ui-state-hover) { background-color: nc-lighten($color-main-text, 86%); } @@ -1051,7 +1042,7 @@ code { font-weight: bold; } - &.ui-datepicker-week-end :not(.ui-state-hover), + &.ui-datepicker-week-end:not(.ui-state-disabled) :not(.ui-state-hover), .ui-priority-secondary:not(.ui-state-hover) { color: nc-lighten($color-main-text, 33%); opacity: .8; @@ -1094,6 +1085,12 @@ code { font-weight: 300; } } + /* AM/PM fix */ + table.ui-timepicker tr th { + position: absolute; + margin-left: -24px; + top: calc(50% + 5px); + } .ui-timepicker-table { th { font-weight: normal; @@ -1104,16 +1101,6 @@ code { background-color: inherit; } td { - > * { - border-radius: 50%; - text-align: center; - font-weight: normal; - color: $color-main-text; - padding: 8px 7px; - font-size: .9em; - line-height: 12px; - } - &.ui-timepicker-hour-cell a.ui-state-active, &.ui-timepicker-minute-cell a.ui-state-active, .ui-state-hover, @@ -1129,6 +1116,42 @@ code { &.ui-timepicker-hours { border-right: 1px solid $color-border; + /* AM/PM fix */ + .ui-timepicker tr { + position: relative; + margin-left: 25px; + } + } + } + } +} + +/* ---- jQuery UI datepicker & timepicker global rules ---- */ +.ui-widget.ui-datepicker .ui-datepicker-calendar, +.ui-widget.ui-timepicker table.ui-timepicker { + tr { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + td { + display: block; + flex: 1 1; + margin: 0; + padding: 2px; + display: flex; + align-items: center; + justify-content: center; + > * { + border-radius: 50%; + text-align: center; + font-weight: normal; + color: $color-main-text; + display: block; + line-height: 18px; + width: 18px; + height: 18px; + padding: 3px; + font-size: .9em; } } } From bcad10075edfc620abff2a1afc084a4a524bb7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 13 Dec 2017 11:11:05 +0100 Subject: [PATCH 2/4] Share datepicker fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/sharedialogshareelistview.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index b4828e3b0dce3..b90c5f4640960 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -513,19 +513,14 @@ var shareId = li.data('share-id'); var expirationDatePicker = '#expirationDatePicker-' + this.cid + '-' + shareId; var view = this; - $(expirationDatePicker).closest('div').datepicker({ + $(expirationDatePicker).datepicker({ dateFormat : 'dd-mm-yy', - onSelect: - function (expireDate) { - view.setExpirationDate(shareId, expireDate); - }, - onClose: - function () { - $(expirationDatePicker).removeClass('hidden-visually'); - } + onSelect: function (expireDate) { + view.setExpirationDate(shareId, expireDate); + } }); + $(expirationDatePicker).focus(); - $(expirationDatePicker).addClass('hidden-visually'); }, setExpirationDate: function(shareId, expireDate) { From d190754e2bade0c79b53a7e7a15193003d9a123d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 20 Dec 2017 10:37:33 +0100 Subject: [PATCH 3/4] Fix am-pm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/css/styles.scss | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/css/styles.scss b/core/css/styles.scss index cd3c57bda4fb7..0739d66b238f2 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -1086,16 +1086,19 @@ code { } } /* AM/PM fix */ - table.ui-timepicker tr th { - position: absolute; - margin-left: -24px; - top: calc(50% + 5px); + table.ui-timepicker tr .ui-timepicker-hour-cell:first-child { + margin-left: 30px; } .ui-timepicker-table { th { font-weight: normal; color: nc-lighten($color-main-text, 33%); opacity: .8; + &.periods { + padding: 0; + width: 30px; + line-height: 30px; + } } tr:hover { background-color: inherit; @@ -1116,11 +1119,6 @@ code { &.ui-timepicker-hours { border-right: 1px solid $color-border; - /* AM/PM fix */ - .ui-timepicker tr { - position: relative; - margin-left: 25px; - } } } } From 6127d19f546904e97ed67696f9bc2fdfd5c8d575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 5 Jan 2018 08:26:01 +0100 Subject: [PATCH 4/4] Fixed default expire date and placeholder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/sharedialogshareelistview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index b90c5f4640960..30cbeff3c6472 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -116,7 +116,7 @@ '' + '
' + ' ' + - ' ' + + ' ' + '
' + '' + '' + @@ -266,6 +266,8 @@ expireDateLabel: t('core', 'Set expiration date'), passwordLabel: t('core', 'Password protect'), crudsLabel: t('core', 'Access control'), + expirationDatePlaceholder: t('core', 'Expiration date'), + defaultExpireDate: moment().add(1, 'day').format('DD-MM-YYYY'), // Can't expire today triangleSImage: OC.imagePath('core', 'actions/triangle-s'), isResharingAllowed: this.configModel.get('isResharingAllowed'), isPasswordForMailSharesRequired: this.configModel.get('isPasswordForMailSharesRequired'),