Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Remove unnecessary use of jquery on the recaptcha page #11308

Closed
dkasak opened this issue Nov 11, 2021 · 6 comments · Fixed by #14672
Closed

Remove unnecessary use of jquery on the recaptcha page #11308

dkasak opened this issue Nov 11, 2021 · 6 comments · Fixed by #14672
Labels
good first issue Good for newcomers S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@dkasak
Copy link
Member

dkasak commented Nov 11, 2021

Currently we use jquery for some very rudimentary operations on the recaptcha page.

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="/_matrix/static/client/register/style.css">
<script>
function captchaDone() {
$('#registrationForm').submit();
}

This seems like overkill since they could easily be replaced by document.getElementById or document.querySelector.

@squahtx squahtx added good first issue Good for newcomers S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Nov 11, 2021
@Jennyfriel
Copy link

Good day,

How i submit my registration form??

@ankur12-1610
Copy link

I'll work on it!

@GAURAV1-ui
Copy link

Hey, I would love to solve this issue.

@DMRobertson
Copy link
Contributor

To do this:

  1. Remove the jquery script tags quoted above.

  2. Replace the script with

    function captchaDone() {
         document.getElementById('registrationForm').submit(); 
    } 

    assuming that jquery's .submit method is a wrapper around HTMLFormElement.submit.

  3. Ideally: test this works---not sure how that's done though.

@JeyRathnam
Copy link
Contributor

Is this still needed? If so, can I work on it?

@squahtx
Copy link
Contributor

squahtx commented Dec 12, 2022

Is this still needed? If so, can I work on it?

Yes, feel free to work on it and open a PR.

JeyRathnam added a commit to JeyRathnam/synapse that referenced this issue Dec 13, 2022
JeyRathnam added a commit to JeyRathnam/synapse that referenced this issue Dec 13, 2022
@DMRobertson DMRobertson linked a pull request Dec 13, 2022 that will close this issue
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
7 participants