diff options
author | silverwind <me@silverwind.io> | 2022-01-28 13:00:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 21:00:11 +0000 |
commit | 19b017f3986655468d72b383141256f11d58c186 (patch) | |
tree | 3d9856a8515936f704f4be2dc008365092dbef7e /web_src/js/features/comp | |
parent | 7b04c97b7b0fd96676c94e02a857a43a6ef32b3d (diff) | |
download | gitea-19b017f3986655468d72b383141256f11d58c186.tar.gz gitea-19b017f3986655468d72b383141256f11d58c186.zip |
Use explicit jQuery import, remove unused eslint globals (#18435)
- Don't rely on globals (window.$) for jQuery import
- Remove eslint globals no longer in use
Diffstat (limited to 'web_src/js/features/comp')
-rw-r--r-- | web_src/js/features/comp/ColorPicker.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/EasyMDE.js | 5 | ||||
-rw-r--r-- | web_src/js/features/comp/ImagePaste.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/LabelEdit.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/MarkupContentPreview.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/ReactionSelector.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/SearchUserBox.js | 1 | ||||
-rw-r--r-- | web_src/js/features/comp/WebHookEditor.js | 1 |
8 files changed, 10 insertions, 2 deletions
diff --git a/web_src/js/features/comp/ColorPicker.js b/web_src/js/features/comp/ColorPicker.js index 669e1d1f18..053fc6c059 100644 --- a/web_src/js/features/comp/ColorPicker.js +++ b/web_src/js/features/comp/ColorPicker.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import createColorPicker from '../colorpicker.js'; export function initCompColorPicker() { diff --git a/web_src/js/features/comp/EasyMDE.js b/web_src/js/features/comp/EasyMDE.js index 3a2f935dc2..9d711088d8 100644 --- a/web_src/js/features/comp/EasyMDE.js +++ b/web_src/js/features/comp/EasyMDE.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import attachTribute from '../tribute.js'; const {appSubUrl} = window.config; @@ -54,7 +55,7 @@ export async function importEasyMDE() { * @returns {null|EasyMDE} */ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) { - if (textarea instanceof jQuery) { + if (textarea instanceof $) { textarea = textarea[0]; } if (!textarea) { @@ -151,7 +152,7 @@ export function attachEasyMDEToElements(easyMDE) { * @returns {null|EasyMDE} */ export function getAttachedEasyMDE(el) { - if (el instanceof jQuery) { + if (el instanceof $) { el = el[0]; } if (!el) { diff --git a/web_src/js/features/comp/ImagePaste.js b/web_src/js/features/comp/ImagePaste.js index 8c8a4186c7..13c1a17c25 100644 --- a/web_src/js/features/comp/ImagePaste.js +++ b/web_src/js/features/comp/ImagePaste.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; const {csrfToken} = window.config; async function uploadFile(file, uploadUrl) { diff --git a/web_src/js/features/comp/LabelEdit.js b/web_src/js/features/comp/LabelEdit.js index 7d71e6effa..df294078fa 100644 --- a/web_src/js/features/comp/LabelEdit.js +++ b/web_src/js/features/comp/LabelEdit.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import {initCompColorPicker} from './ColorPicker.js'; export function initCompLabelEdit(selector) { diff --git a/web_src/js/features/comp/MarkupContentPreview.js b/web_src/js/features/comp/MarkupContentPreview.js index ed0995296b..61fd699b29 100644 --- a/web_src/js/features/comp/MarkupContentPreview.js +++ b/web_src/js/features/comp/MarkupContentPreview.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import {initMarkupContent} from '../../markup/content.js'; const {csrfToken} = window.config; diff --git a/web_src/js/features/comp/ReactionSelector.js b/web_src/js/features/comp/ReactionSelector.js index d77b8d3d4e..f3b7a7668e 100644 --- a/web_src/js/features/comp/ReactionSelector.js +++ b/web_src/js/features/comp/ReactionSelector.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; const {csrfToken} = window.config; export function initCompReactionSelector(parent) { diff --git a/web_src/js/features/comp/SearchUserBox.js b/web_src/js/features/comp/SearchUserBox.js index 1382c7060d..18b67919b5 100644 --- a/web_src/js/features/comp/SearchUserBox.js +++ b/web_src/js/features/comp/SearchUserBox.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import {htmlEscape} from 'escape-goat'; const {appSubUrl} = window.config; diff --git a/web_src/js/features/comp/WebHookEditor.js b/web_src/js/features/comp/WebHookEditor.js index efef10ad64..85a4f92809 100644 --- a/web_src/js/features/comp/WebHookEditor.js +++ b/web_src/js/features/comp/WebHookEditor.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; const {csrfToken} = window.config; export function initCompWebHookEditor() { |