1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-25 20:55:47 +00:00
gitea/web_src/js/features
Yarden Shoham b7b5834831
Use auto-updating, natively hoverable, localized time elements (#23988)
- Added [GitHub's `relative-time` element](https://github.com/github/relative-time-element)
- Converted all formatted timestamps to use this element
- No more flashes of unstyled content around time elements
- These elements are localized using the `lang` property of the HTML file
- Relative (e.g. the activities in the dashboard) and duration (e.g.
server uptime in the admin page) time elements are auto-updated to keep
up with the current time without refreshing the page
- Code that is not needed anymore such as `formatting.js` and parts of `since.go` have been deleted

Replaces #21440
Follows #22861

## Screenshots

### Localized

![image](https://user-images.githubusercontent.com/20454870/230775041-f0af4fda-8f6b-46d3-b8e3-d340c791a50c.png)

![image](https://user-images.githubusercontent.com/20454870/230673393-931415a9-5729-4ac3-9a89-c0fb5fbeeeb7.png)

### Tooltips

#### Native for dates

![image](https://user-images.githubusercontent.com/20454870/230797525-1fa0a854-83e3-484c-9da5-9425ab6528a3.png)

#### Interactive for relative

![image](https://user-images.githubusercontent.com/115237/230796860-51e1d640-c820-4a34-ba2e-39087020626a.png)

### Auto-update

![rec](https://user-images.githubusercontent.com/20454870/230672159-37480d8f-435a-43e9-a2b0-44073351c805.gif)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
2023-04-11 01:01:20 +02:00
..
admin Use auto-updating, natively hoverable, localized time elements (#23988) 2023-04-11 01:01:20 +02:00
comp Replace tribute with text-expander-element for textarea (#23985) 2023-04-09 12:18:45 -04:00
captcha.js Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
citation.js Fix switched citation format (#23250) 2023-03-02 13:08:02 -06:00
clipboard.js Use clippie module to copy to clipboard (#23801) 2023-04-02 17:25:36 +08:00
codeeditor.js Allow new file and edit file preview if it has editable extension (#23624) 2023-03-26 13:25:41 +08:00
colorpicker.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
common-global.js Fix dropdown direction behavior (#23806) 2023-03-30 13:53:51 -04:00
common-organization.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
contextpopup.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 2023-04-03 18:06:57 +08:00
copycontent.js Use clippie module to copy to clipboard (#23801) 2023-04-02 17:25:36 +08:00
dropzone.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
emoji.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
eventsource.sharedworker.js Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) 2022-08-03 22:58:27 +03:00
file-fold.js Scroll collapsed file into view (#23702) 2023-04-05 07:51:42 +08:00
heatmap.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
imagediff.js Fix various ImageDiff/SVG bugs (#23312) 2023-03-07 20:11:24 +08:00
install.js Fix various bugs for "install" page (#23194) 2023-03-04 10:12:02 +08:00
notification.js Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
org-team.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
pull-view-file.js Expand/Collapse all changed files (#23639) 2023-04-09 21:11:02 +08:00
repo-branch.js Add apply-patch, basic revert and cherry-pick functionality (#17902) 2022-02-09 20:28:55 +00:00
repo-code.js Use clippie module to copy to clipboard (#23801) 2023-04-02 17:25:36 +08:00
repo-code.test.js Ignore line anchor links with leading zeroes (#21728) 2022-11-11 18:22:36 +08:00
repo-commit.js Fix hidden commit status on multiple checks (#22889) 2023-02-20 16:43:04 +08:00
repo-common.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-diff-filetree.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
repo-diff.js Expand/Collapse all changed files (#23639) 2023-04-09 21:11:02 +08:00
repo-editor.js Editor preview support for external renderers (#23333) 2023-03-24 14:12:23 +08:00
repo-findfile.js Refactor branch/tag selector to Vue SFC (#23421) 2023-03-14 17:51:20 +08:00
repo-findfile.test.js Refactor branch/tag selector to Vue SFC (#23421) 2023-03-14 17:51:20 +08:00
repo-graph.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-home.js Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626) 2023-03-26 19:31:26 +08:00
repo-issue-content.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-issue-list.js Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2023-04-07 08:11:02 +08:00
repo-issue-pr-form.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
repo-issue.js Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2023-04-07 08:11:02 +08:00
repo-legacy.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 2023-04-03 18:06:57 +08:00
repo-migrate.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-migration.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-projects.js Sync the class change of Edit Column Button to JS code (#23400) 2023-03-12 19:09:20 +08:00
repo-release.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 2023-04-03 18:06:57 +08:00
repo-settings.js Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) 2022-06-03 17:38:26 -04:00
repo-template.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-unicode-escape.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-wiki.js Improve markdown editor: width, height, preferred (#23895) 2023-04-07 13:03:29 -04:00
serviceworker.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
sshkey-helper.js Use explicit jQuery import, remove unused eslint globals (#18435) 2022-01-28 21:00:11 +00:00
stopwatch.js Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
tablesort.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
tribute.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 2023-04-03 18:06:57 +08:00
user-auth-webauthn.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
user-auth.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
user-settings.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00