Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2012-07-10 08:14:53

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

got it working. i called the jquery.js at the bottom of the page. that was the problem.

Offline

#26 2012-09-04 13:54:56

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

I updated the plugin a little bit:

yab_email_v0.5.txt

2012-09-04 v0.5

  • bugfix: withespaces in href are now correctly escaped
  • bugfix: removed redundant type attributes in script tag
  • bugfix: plugin help rewritten and extended (plugin help guidelines)

Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#27 2012-09-24 13:23:12

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Another small bugfix version

yab_email_v0.6.txt

2012-09-24 v0.6

  • bugfix: works now with jQuery 1.8.0 and greater

Last edited by trenc (2012-09-24 13:23:52)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#28 2013-11-14 10:20:30

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

My knowledge of JS, etc. is little so I don’t know if the plug-in really works … !?

Live > stichtingkarkas.com … the contact info is at the bottom.

TXP (tag in article) >

p(contact). E: <txp:yab_email email="info@stichtingkarkas.nl" text="info@stichtingkarkas.nl" set_js="0" />

HTML (at bottom page) >

<!-- calling jQuery the right way > https://github.com/h5bp/html5-boilerplate/blob/master/index.html -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.9.1.min.js"><\/script>')</script>
<!-- only if jQuery include is at the bottom of HTML > http://goo.gl/I7nzpz -->
<txp:yab_email_javascript />

Results in (HTML rendered) >

<p class="contact">E: <a class="yab-email-link" href="mailto:info(%20at%20)stichtingkarkas.nl">info@stichtingkarkas.nl</a></p>

Is this all?

Offline

#29 2013-11-14 11:47:46

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Hi Jop,

My knowledge of JS, etc. is little so I don’t know if the plug-in really works … !?

It is working. But I would leave the text attribute blank:

<txp:yab_email email="info@stichtingkarkas.nl" set_js="0" />

So the displayed text is the obfuscated mail address too, otherwise the exact text phrase will be shown, which is in your case the non-obfuscated mail address.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#30 2013-11-14 11:58:49

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Thanks Trenc … but why can’t I see an obfuscated email address? The answer is (of course) because the script defuscating the address also … isn’t it?

Offline

#31 2013-11-15 11:25:22

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Thanks Trenc … but why can’t I see an obfuscated email address? The answer is (of course) because the script defuscating the address also … isn’t it?

So it is.
The tag itselfs is calling some PHP functions. These will obfuscate your mail and create the mailto-link. The result you can see in your HTML source code of your website (btw. it is a really nice clean layout and design).
It’s a link with the class yab-email-link and every char in your mail address is replaced with its HTML entity. Some mail harvester can’t read these entities. Additonally the @ char is replaced by a (%20at%20). The %20 were escaped whitespaces für HTML validity.

The JavaScript in your browser then replace the (%20at%20) back to a normal @. So the browser renders the link normally and it looks familiar.
Due mail harvesters are really simple and don’t understand JavaScript the harvesters will only see the obfuscated mail address. In case of e.g name@example.com the harvester will see the source code:

&#110;&#97;&#109;&#101;(%20at%20)&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;

An browser with JavaSript disabled and some »render-abled« harvester will render:

name( at )example.com

And a browser with JavaScript enabled will see the correct mail:

name@example.com

Hope that helps,

trenc

Last edited by trenc (2013-11-15 11:25:30)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#32 2013-11-15 12:25:50

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Sure, your explanation does help. And thanks for the compliment … :))

Offline

#33 2015-05-18 18:12:39

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

I need to obfuscate an email address in a section of my site.
Anyway, cause I need to have this address:

mysite.it/privacy

and not this:

mysite.it/privacy/name_of_the_article_talking_about_the_privacy_policy

I have to write the article in the page itself, without using the normal method (create article).
In this way I can’t use the plugin tag.

So, can you help me to obfuscate the mail without the plugin but directly with an HTML code? Any suggestions?

Thanks in advance.

Last edited by candyman (2015-05-18 18:14:01)

Offline

#34 2015-05-26 08:26:53

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

Hi candyman,

you can use the plugin in an article or a form or a page. It doesn’t matter. Plugin tags can be used everywhere, when activated in preferences.

Last edited by trenc (2015-05-26 08:27:12)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#35 2017-02-10 12:12:25

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: yab_email (simple obfuscate/defuscate email adresses, jQuery based)

yab_email_v0.7.txt is now TXP 4.6-ready.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

Board footer

Powered by FluxBB