mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Forbid variables containing jQuery collections not having the $ prefix (#29839)
				
					
				
			See https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/variable-pattern.md --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		@@ -15,9 +15,9 @@ function initEditPreviewTab($form) {
 | 
			
		||||
      const $this = $(this);
 | 
			
		||||
      let context = `${$this.data('context')}/`;
 | 
			
		||||
      const mode = $this.data('markup-mode') || 'comment';
 | 
			
		||||
      const treePathEl = $form.find('input#tree_path');
 | 
			
		||||
      if (treePathEl.length > 0) {
 | 
			
		||||
        context += treePathEl.val();
 | 
			
		||||
      const $treePathEl = $form.find('input#tree_path');
 | 
			
		||||
      if ($treePathEl.length > 0) {
 | 
			
		||||
        context += $treePathEl.val();
 | 
			
		||||
      }
 | 
			
		||||
      context = context.substring(0, context.lastIndexOf('/'));
 | 
			
		||||
 | 
			
		||||
@@ -25,7 +25,7 @@ function initEditPreviewTab($form) {
 | 
			
		||||
      formData.append('mode', mode);
 | 
			
		||||
      formData.append('context', context);
 | 
			
		||||
      formData.append('text', $form.find(`.tab[data-tab="${$tabMenu.data('write')}"] textarea`).val());
 | 
			
		||||
      formData.append('file_path', treePathEl.val());
 | 
			
		||||
      formData.append('file_path', $treePathEl.val());
 | 
			
		||||
      try {
 | 
			
		||||
        const response = await POST($this.data('url'), {data: formData});
 | 
			
		||||
        const data = await response.text();
 | 
			
		||||
@@ -78,11 +78,11 @@ export function initRepoEditor() {
 | 
			
		||||
  const joinTreePath = ($fileNameEl) => {
 | 
			
		||||
    const parts = [];
 | 
			
		||||
    $('.breadcrumb span.section').each(function () {
 | 
			
		||||
      const element = $(this);
 | 
			
		||||
      if (element.find('a').length) {
 | 
			
		||||
        parts.push(element.find('a').text());
 | 
			
		||||
      const $element = $(this);
 | 
			
		||||
      if ($element.find('a').length) {
 | 
			
		||||
        parts.push($element.find('a').text());
 | 
			
		||||
      } else {
 | 
			
		||||
        parts.push(element.text());
 | 
			
		||||
        parts.push($element.text());
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    if ($fileNameEl.val()) parts.push($fileNameEl.val());
 | 
			
		||||
@@ -181,6 +181,6 @@ export function renderPreviewPanelContent($panelPreviewer, data) {
 | 
			
		||||
  $panelPreviewer.html(data);
 | 
			
		||||
  initMarkupContent();
 | 
			
		||||
 | 
			
		||||
  const refIssues = $panelPreviewer.find('p .ref-issue');
 | 
			
		||||
  attachRefIssueContextPopup(refIssues);
 | 
			
		||||
  const $refIssues = $panelPreviewer.find('p .ref-issue');
 | 
			
		||||
  attachRefIssueContextPopup($refIssues);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user