diff options
author | silverwind <me@silverwind.io> | 2020-06-10 20:35:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 14:35:27 -0400 |
commit | 628ee1d82ed4afdae8734801be85c57d9a525322 (patch) | |
tree | 95e8448278b7cfe0a885e0e9a300cf1963a861f6 /web_src | |
parent | 42752f3902f53d96598e5329a30374ecc82c9a19 (diff) | |
download | gitea-628ee1d82ed4afdae8734801be85c57d9a525322.tar.gz gitea-628ee1d82ed4afdae8734801be85c57d9a525322.zip |
Replace jquery-datetimepicker with native date input (#11684)
This removes the jQuery plugin as well as the associated config options.
Native input[type=date] does not require a language attribute as it is
localized by default, except for the placeholder attribute for which I
currently piggy-back the repo.issues.due_date_form localization option.
Implementation should pretty much match GH. Of note is that Safari does
not provide a UI for this input type, but I don't think providing one is
neccessary and GH did not bother either.
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/features/datetimepicker.js | 8 | ||||
-rw-r--r-- | web_src/js/index.js | 13 | ||||
-rw-r--r-- | web_src/less/_repository.less | 4 | ||||
-rw-r--r-- | web_src/less/themes/theme-arc-green.less | 74 |
4 files changed, 0 insertions, 99 deletions
diff --git a/web_src/js/features/datetimepicker.js b/web_src/js/features/datetimepicker.js deleted file mode 100644 index fb9a75a57a..0000000000 --- a/web_src/js/features/datetimepicker.js +++ /dev/null @@ -1,8 +0,0 @@ -export default async function initDateTimePicker(locale) { - await Promise.all([ - import(/* webpackChunkName: "datetimepicker" */'jquery-datetimepicker'), - import(/* webpackChunkName: "datetimepicker" */'jquery-datetimepicker/build/jquery.datetimepicker.min.css'), - ]); - - $.datetimepicker.setLocale(locale); -} diff --git a/web_src/js/index.js b/web_src/js/index.js index 5c2812b460..b8d6578c34 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -12,7 +12,6 @@ import initContextPopups from './features/contextpopup.js'; import initGitGraph from './features/gitgraph.js'; import initClipboard from './features/clipboard.js'; import initUserHeatmap from './features/userheatmap.js'; -import initDateTimePicker from './features/datetimepicker.js'; import initServiceWorker from './features/serviceworker.js'; import attachTribute from './features/tribute.js'; import createDropzone from './features/dropzone.js'; @@ -755,18 +754,6 @@ async function initRepository() { // Milestones if ($('.repository.new.milestone').length > 0) { - const $datepicker = $('.milestone.datepicker'); - - await initDateTimePicker($datepicker.data('lang')); - - $datepicker.datetimepicker({ - inline: true, - timepicker: false, - startDate: $datepicker.data('start-date'), - onSelectDate(date) { - $('#deadline').val(date.toISOString().substring(0, 10)); - }, - }); $('#clear-date').on('click', () => { $('#deadline').val(''); return false; diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index f4bd71b5ba..2414a4f13b 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1309,10 +1309,6 @@ textarea { height: 200px; } - - #deadline { - width: 150px; - } } &.compare.pull { diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index d7760b32ed..718c7b38f4 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1395,80 +1395,6 @@ a.ui.labels .label:hover { } } -body .xdsoft_datetimepicker { - background: #2a2e39; - border: 1px solid #4c505c; - color: #9e9e9e; - - .xdsoft_monthpicker { - height: 36px; - background: #464c5d; - margin: -2px -8px 2px; - padding: 2px 8px 0; - - button { - background-image: none; - text-indent: 0; - text-align: center; - color: #9e9e9e; - - &.xdsoft_prev::before { - content: "\f0d9"; - font: normal normal normal 14px/1 FontAwesome, serif; - font-size: 1.7em; - } - - &.xdsoft_next::before { - content: "\f0da"; - font: normal normal normal 14px/1 FontAwesome, serif; - font-size: 1.7em; - } - - &.xdsoft_today_button::before { - content: "\f015"; - font: normal normal normal 14px/1 FontAwesome, serif; - font-size: 1.4em; - } - } - - & > div.xdsoft_label { - background: #464c5d; - - i { - line-height: 14px; - background-image: none; - text-indent: 0; - text-align: center; - - ::before { - content: "\f0dd"; - font: normal normal normal 14px/1 FontAwesome, serif; - font-size: .7em; - } - } - - .xdsoft_select { - background: #353945; - } - } - } - - .xdsoft_datepicker .xdsoft_calendar { - td, - th { - border-color: #4c505c; - background-color: #2a2e39; - } - - td.xdsoft_other_month, - td.xdsoft_disabled { - opacity: .8; - background: #a0cc75; - color: #000000; - } - } -} - .heatmap(@heat) { @heatmap-cold: #2d303b; @heatmap-hot: #a0cc75; |