mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import createColorPicker from '../colorpicker.js';
 | 
			
		||||
 | 
			
		||||
export function initCompColorPicker() {
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
const {csrfToken} = window.config;
 | 
			
		||||
 | 
			
		||||
async function uploadFile(file, uploadUrl) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import {initCompColorPicker} from './ColorPicker.js';
 | 
			
		||||
 | 
			
		||||
export function initCompLabelEdit(selector) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import {initMarkupContent} from '../../markup/content.js';
 | 
			
		||||
 | 
			
		||||
const {csrfToken} = window.config;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
const {csrfToken} = window.config;
 | 
			
		||||
 | 
			
		||||
export function initCompReactionSelector(parent) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import {htmlEscape} from 'escape-goat';
 | 
			
		||||
 | 
			
		||||
const {appSubUrl} = window.config;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
const {csrfToken} = window.config;
 | 
			
		||||
 | 
			
		||||
export function initCompWebHookEditor() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user