summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-11-22 01:58:55 +0100
committerGitHub <noreply@github.com>2022-11-22 08:58:55 +0800
commitc8b217110ba44ca50f565aa521d5ae63003d8b5a (patch)
tree59fbf33653e2e7a865779e8d7fafdcb072a8a32e /web_src
parent1c7496c7a7e4c3145ab90bbef129dd7c1a0189dd (diff)
downloadgitea-c8b217110ba44ca50f565aa521d5ae63003d8b5a.tar.gz
gitea-c8b217110ba44ca50f565aa521d5ae63003d8b5a.zip
Update JS dependencies (#21881)
- Update all JS deps - Regenerate SVGs - Add new eslint rules, fix issues - Tested Mermaid, Swagger, Vue, Webpack, Citation Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/clipboard.js2
-rw-r--r--web_src/js/features/repo-legacy.js4
-rw-r--r--web_src/js/features/repo-migrate.js2
-rw-r--r--web_src/js/features/tribute.js2
4 files changed, 5 insertions, 5 deletions
diff --git a/web_src/js/features/clipboard.js b/web_src/js/features/clipboard.js
index f266d4f64d..75b96cb781 100644
--- a/web_src/js/features/clipboard.js
+++ b/web_src/js/features/clipboard.js
@@ -4,7 +4,7 @@ const {copy_success, copy_error} = window.config.i18n;
export async function copyToClipboard(content) {
if (content instanceof Blob) {
- const item = new window.ClipboardItem({[content.type]: content});
+ const item = new ClipboardItem({[content.type]: content});
await navigator.clipboard.write([item]);
} else { // text
try {
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js
index e6a7c6dcd1..d438186c5f 100644
--- a/web_src/js/features/repo-legacy.js
+++ b/web_src/js/features/repo-legacy.js
@@ -463,10 +463,10 @@ export function initRepository() {
$('.enable-system-radio').on('change', function () {
if (this.value === 'false') {
$($(this).data('target')).addClass('disabled');
- if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).removeClass('disabled');
+ if ($(this).data('context') !== undefined) $($(this).data('context')).removeClass('disabled');
} else if (this.value === 'true') {
$($(this).data('target')).removeClass('disabled');
- if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).addClass('disabled');
+ if ($(this).data('context') !== undefined) $($(this).data('context')).addClass('disabled');
}
});
const $trackerIssueStyleRadios = $('.js-tracker-issue-style');
diff --git a/web_src/js/features/repo-migrate.js b/web_src/js/features/repo-migrate.js
index 5d61eb410e..d44f540c46 100644
--- a/web_src/js/features/repo-migrate.js
+++ b/web_src/js/features/repo-migrate.js
@@ -9,7 +9,7 @@ export function initRepoMigrationStatusChecker() {
$('#repo_migrating_progress_message').hide();
if (migrating) {
const task = migrating.attr('task');
- if (typeof task === 'undefined') {
+ if (task === undefined) {
return;
}
$.ajax({
diff --git a/web_src/js/features/tribute.js b/web_src/js/features/tribute.js
index 5678acdf47..dcee7aa4a3 100644
--- a/web_src/js/features/tribute.js
+++ b/web_src/js/features/tribute.js
@@ -21,7 +21,7 @@ function makeCollections({mentions, emoji}) {
},
lookup: (item) => item,
selectTemplate: (item) => {
- if (typeof item === 'undefined') return null;
+ if (item === undefined) return null;
return emojiString(item.original);
},
menuItemTemplate: (item) => {