de-obfuscate an obfuscated email

This commit is contained in:
ansuz
2016-07-11 11:07:59 +02:00
parent 3bdfee71e1
commit 88a3c4227b
3 changed files with 40 additions and 4 deletions

View File

@@ -2,9 +2,22 @@ define([
'/customize/DecorateToolbar.js',
'/common/cryptpad-common.js',
'/bower_components/lil-uri/uri.min.js',
'/common/email.js',
'/bower_components/jquery/dist/jquery.min.js',
], function (DecorateToolbar, Cryptpad, LilUri) {
], function (DecorateToolbar, Cryptpad, LilUri, Email) {
var $ = window.$;
var email = Email.makeScrambler(1);
// slip past the spammers, then unscramble mailto links
$('a[href^="mailto:"]').each(function () {
$(this).attr('href', function (i, href) {
return href.replace(/:(.*$)/, function (a, address) {
return ':' + email.decrypt(address);
});
});
});
DecorateToolbar.main($('#bottom-bar'));
Cryptpad.styleAlerts();