Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery Abhängigkeit entfernen? #40

Open
NGWNGW opened this issue May 9, 2021 · 2 comments
Open

jQuery Abhängigkeit entfernen? #40

NGWNGW opened this issue May 9, 2021 · 2 comments

Comments

@NGWNGW
Copy link
Member

NGWNGW commented May 9, 2021

In vielen Projekten nutze ich kein jQuery mehr und müsste es nur wegen des AddOns einsetzen.

Den JS-Code vom emailobfuscator könnte man auch ohne jQuery Abhängigkeiten umsetzen:

var email_links = document.querySelectorAll('[href^="javascript:decryptUnicorn"]');

Array.prototype.forEach.call(email_links, function(email_link, index, array) {

    var email = email_link.href.match(/\((.*)\)/)[1];

    email = email
        // ROT13-Transformation
        .replace(/[a-z]/gi, function (s) {
            return String.fromCharCode(s.charCodeAt(0) + (s.toLowerCase() < 'n' ? 13 : -13));
        })
        // Ersetze # durch @
        .replace(/\|/g, '@');

        // Ersetze Einhörner
        email_link.href = 'mailto:'+email;

});
@alxndr-w
Copy link
Member

@NGWNGW möchtest du das als PR einreichen?

@alxndr-w
Copy link
Member

ping @NGWNGW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants