summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-legacy.js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-01-16 19:19:26 +0800
committerGitHub <noreply@github.com>2022-01-16 11:19:26 +0000
commit4d0a72a2710fd3381574485980f056ac644a10d7 (patch)
treef22868107e8e7dff2ab638ef366477d4efdc5fe3 /web_src/js/features/repo-legacy.js
parent72b36816481a6af1cf3fc1bc4e27b96b8a2779ef (diff)
downloadgitea-4d0a72a2710fd3381574485980f056ac644a10d7.tar.gz
gitea-4d0a72a2710fd3381574485980f056ac644a10d7.zip
Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)
This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.
Diffstat (limited to 'web_src/js/features/repo-legacy.js')
-rw-r--r--web_src/js/features/repo-legacy.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js
index 5a42ac7620..f30345bfee 100644
--- a/web_src/js/features/repo-legacy.js
+++ b/web_src/js/features/repo-legacy.js
@@ -42,7 +42,7 @@ export function initRepoCommentForm() {
$branchMenu.find('.item:not(.no-select)').click(function () {
const selectedValue = $(this).data('id');
const editMode = $('#editing_mode').val();
- $.find($(this).data('id-selector')).val(selectedValue);
+ $($(this).data('id-selector')).val(selectedValue);
if ($isNewIssue) {
$selectBranch.find('.ui .branch-name').text($(this).data('name'));
return;
@@ -58,7 +58,7 @@ export function initRepoCommentForm() {
$selectBranch.find('.reference.column').on('click', function () {
$selectBranch.find('.scrolling.reference-list-menu').css('display', 'none');
$selectBranch.find('.reference .text').removeClass('black');
- $.find($(this).data('target')).css('display', 'block');
+ $($(this).data('target')).css('display', 'block');
$(this).find('.text').addClass('black');
return false;
});
@@ -145,9 +145,9 @@ export function initRepoCommentForm() {
$(this).parent().find('.item').each(function () {
if ($(this).hasClass('checked')) {
listIds.push($(this).data('id'));
- $.find($(this).data('id-selector')).removeClass('hide');
+ $($(this).data('id-selector')).removeClass('hide');
} else {
- $.find($(this).data('id-selector')).addClass('hide');
+ $($(this).data('id-selector')).addClass('hide');
}
});
if (listIds.length === 0) {
@@ -155,7 +155,7 @@ export function initRepoCommentForm() {
} else {
$noSelect.addClass('hide');
}
- $.find($(this).parent().data('id')).val(listIds.join(','));
+ $($(this).parent().data('id')).val(listIds.join(','));
return false;
});
$listMenu.find('.no-select.item').on('click', function (e) {
@@ -182,7 +182,7 @@ export function initRepoCommentForm() {
$(this).addClass('hide');
});
$noSelect.removeClass('hide');
- $.find($(this).parent().data('id')).val('');
+ $($(this).parent().data('id')).val('');
});
}
@@ -247,7 +247,7 @@ export function initRepoCommentForm() {
$list.find('.selected').html('');
$list.find('.no-select').removeClass('hide');
- $.find(input_id).val('');
+ $(input_id).val('');
});
}
@@ -450,20 +450,20 @@ export function initRepository() {
// Enable or select internal/external wiki system and issue tracker.
$('.enable-system').on('change', function () {
if (this.checked) {
- $.find($(this).data('target')).removeClass('disabled');
- if (!$(this).data('context')) $.find($(this).data('context')).addClass('disabled');
+ $($(this).data('target')).removeClass('disabled');
+ if (!$(this).data('context')) $($(this).data('context')).addClass('disabled');
} else {
- $.find($(this).data('target')).addClass('disabled');
- if (!$(this).data('context')) $.find($(this).data('context')).removeClass('disabled');
+ $($(this).data('target')).addClass('disabled');
+ if (!$(this).data('context')) $($(this).data('context')).removeClass('disabled');
}
});
$('.enable-system-radio').on('change', function () {
if (this.value === 'false') {
- $.find($(this).data('target')).addClass('disabled');
- if (typeof $(this).data('context') !== 'undefined') $.find($(this).data('context')).removeClass('disabled');
+ $($(this).data('target')).addClass('disabled');
+ if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).removeClass('disabled');
} else if (this.value === 'true') {
- $.find($(this).data('target')).removeClass('disabled');
- if (typeof $(this).data('context') !== 'undefined') $.find($(this).data('context')).addClass('disabled');
+ $($(this).data('target')).removeClass('disabled');
+ if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).addClass('disabled');
}
});
}