mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Forbid jQuery is and fix issues (#30016)
				
					
				
			Tested all functionality. --------- Co-authored-by: Yarden Shoham <git@yardenshoham.com>
This commit is contained in:
		@@ -84,7 +84,7 @@ export function initAdminCommon() {
 | 
			
		||||
    hideElem($('.oauth2_use_custom_url_field'));
 | 
			
		||||
    $('.oauth2_use_custom_url_field input[required]').removeAttr('required');
 | 
			
		||||
 | 
			
		||||
    if ($('#oauth2_use_custom_url').is(':checked')) {
 | 
			
		||||
    if (document.getElementById('oauth2_use_custom_url')?.checked) {
 | 
			
		||||
      for (const custom of ['token_url', 'auth_url', 'profile_url', 'email_url', 'tenant']) {
 | 
			
		||||
        if (applyDefaultValues) {
 | 
			
		||||
          $(`#oauth2_${custom}`).val($(`#${provider}_${custom}`).val());
 | 
			
		||||
@@ -98,7 +98,7 @@ export function initAdminCommon() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function onEnableLdapGroupsChange() {
 | 
			
		||||
    toggleElem($('#ldap-group-options'), $('.js-ldap-group-toggle').is(':checked'));
 | 
			
		||||
    toggleElem($('#ldap-group-options'), $('.js-ldap-group-toggle')[0].checked);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // New authentication
 | 
			
		||||
 
 | 
			
		||||
@@ -373,7 +373,7 @@ function initGlobalShowModal() {
 | 
			
		||||
 | 
			
		||||
      if (attrTargetAttr) {
 | 
			
		||||
        $attrTarget[0][attrTargetAttr] = attrib.value;
 | 
			
		||||
      } else if ($attrTarget.is('input') || $attrTarget.is('textarea')) {
 | 
			
		||||
      } else if ($attrTarget[0].matches('input, textarea')) {
 | 
			
		||||
        $attrTarget.val(attrib.value); // FIXME: add more supports like checkbox
 | 
			
		||||
      } else {
 | 
			
		||||
        $attrTarget.text(attrib.value); // FIXME: it should be more strict here, only handle div/span/p
 | 
			
		||||
 
 | 
			
		||||
@@ -139,7 +139,7 @@ export function initRepoCommentForm() {
 | 
			
		||||
 | 
			
		||||
      hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var
 | 
			
		||||
 | 
			
		||||
      const $clickedItem = $(this);
 | 
			
		||||
      const clickedItem = this; // eslint-disable-line unicorn/no-this-assignment
 | 
			
		||||
      const scope = $(this).attr('data-scope');
 | 
			
		||||
 | 
			
		||||
      $(this).parent().find('.item').each(function () {
 | 
			
		||||
@@ -148,10 +148,10 @@ export function initRepoCommentForm() {
 | 
			
		||||
          if ($(this).attr('data-scope') !== scope) {
 | 
			
		||||
            return true;
 | 
			
		||||
          }
 | 
			
		||||
          if (!$(this).is($clickedItem) && !$(this).hasClass('checked')) {
 | 
			
		||||
          if (this !== clickedItem && !$(this).hasClass('checked')) {
 | 
			
		||||
            return true;
 | 
			
		||||
          }
 | 
			
		||||
        } else if (!$(this).is($clickedItem)) {
 | 
			
		||||
        } else if (this !== clickedItem) {
 | 
			
		||||
          // Toggle for other labels
 | 
			
		||||
          return true;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user