yab_email -- Email obfuscate/defuscate as textpattern plugin

Trencavel am 20. September 2009

yab_email is a tiny Textpattern CMS-Plugin for obfuscating and defuscating email adresses to prevent harvesting email adresses.

This plugin will use jQuery and is based on the jQuery plugin Email Defuscator.

Download

yab_email_v0.4.txt

Plugin help

This plugin requires the jQuery Javascript-Framework is called in the site.

Tags

<txp:yab_email />

Obfuscate a given email address.

attribute default description
email name@example.com An email address, that will be obfuscated.
text not set Linktext for a created hyperlink.
at at Text between the created parantheses in the obfuscated email address.
set_js 1 Return the javascript for defuscating.
class yab-email-link Class for generated span.
link 1 If no attribute ‘text’ is given and link=“0” so a mailto link will not be generated. Output will be a <span>.
<txp:yab_email_javascript />

Defuscate the obfuscated email address.

If you don’t want do display the defuscating javascript — f.i. if you want to obfuscate/defuscate more than one email address or if you call the jquery.js at the bottom of your page — so you can supress the javascript output by the attribute set_js="0". And with the tag <txp:yab_email_javascript /> you can output the javascript on your own.

attribute default description
class yab-email-link Class for generated span. If you call <txp:yab_email_javascript />, be sure the class is same as used in <txp:yab_email />.
link 1 If no ‘text’ from <txp:yab_email /> is given and link=“0” so a mailto-link will not be generated. Output will be a <span>.

Changelog

  • 2009-09-20 v0.1
    • initial release
  • 2009-09-20 v0.2
    • bugfix: releated DOM load
  • 2009-09-20 v0.3
    • feature: added class attribute
    • bugfix: style in plugin help
  • 2009-09-21 v0.4
    • bugfix: fixed XHTML validation errors
    • feature: added new attribute link

|

Kommentare

  1. # - Su-Mu schrieb am 25. September 2009, 08:17:

    Danke für deine Hilfe, vielleicht solltest du diesen jQuery-Schnipsel für den Head-Bereich noch oben in deine Anleitung einfügen? Ist ja nicht jeder so ein Coder ;-)

  2. # - trenc schrieb am 25. September 2009, 10:13:

    Hi Sumu,

    hast Du bestimmt übersehen, aber der Hinweis steht ganz oben in der Plugin-Hilfe. :)

  3. # - Su-Mu schrieb am 25. September 2009, 12:05:

    nein, habe ich nicht übersehen! nicht verstanden!

    This plugin requires the jQuery Javascript-Framework is called in the site.

    Damit konnte ich leider nichts anfangen …

  4. # - trenc schrieb am 25. September 2009, 16:40:

    Ah ok.

    Ich ändere die Hilfe beim nächsten Update.

  5. # - Sev schrieb am 20. April 2010, 11:35:

    Schönes txp-Plugin!

    Ich habe nur eine Frage zum “text” Parameter.

    Der Text des Links soll eine Grafik sein, jedoch zerschießt es den Output, wenn HTML tags innerhalb des Textes verwendet werden.

    Beispiels-Output:

    <a href=“mailto:name@example.com”> <img class=“first” src=”/img/icon_mail.gif” alt=“E-mail”>
    </a>

    Any ideas?

    Viele Grüße!

  6. # - trenc schrieb am 21. April 2010, 10:40:

    Hi Sev,

    ja das funktioniert leider nicht. Allerdings könntest Du das mittels CSS machen.

    <txp:yab_email email="mailto:name@example.com" text="email" class="icon-mail" />
    

    und im CSS folgendermaßen:

    a.icon-mail {
    	display: block;
    	width: XXpx;
    	height: XXpx;
    	background: transparent url(/img/icon_mail.gif) no-repeat 0 0;
    	text-indent: -3000em
    }
    

    Natürlich die Höhe und Weite an die des Icons anpassen.

 (optional, nicht sichtbar)

 (optional)

Textile-Hilfe