yab_email -- Email obfuscate/defuscate as textpattern plugin
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
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 |
|---|---|---|
| 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
# - 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 ;-)
# - trenc schrieb am 25. September 2009, 10:13:
Hi Sumu,
hast Du bestimmt übersehen, aber der Hinweis steht ganz oben in der Plugin-Hilfe. :)
# - Su-Mu schrieb am 25. September 2009, 12:05:
nein, habe ich nicht übersehen! nicht verstanden!
Damit konnte ich leider nichts anfangen …
# - trenc schrieb am 25. September 2009, 16:40:
Ah ok.
Ich ändere die Hilfe beim nächsten Update.
# - 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!
# - trenc schrieb am 21. April 2010, 10:40:
Hi Sev,
ja das funktioniert leider nicht. Allerdings könntest Du das mittels CSS machen.
und im CSS folgendermaßen:
Natürlich die Höhe und Weite an die des Icons anpassen.
# - eliph schrieb am 24. Januar 2012, 18:37:
Nützliches Plugin, aber der HTML5-Validator (W3C) meldet einen Fehler. Nach einer kleinen Verbesserung:
ist es wieder gut.
# - trenc schrieb am 25. Januar 2012, 15:57:
Danke für die Info.
Ja die Leerzeichen sind nicht als %20 escaped. Allerdings wird bei mir kein Validierungsfehhler angezeigt.
# - eliph schrieb am 25. Januar 2012, 18:46:
Na so was. Vielleicht verwenden wir einen unterschiedlichen Validator. Der W3C Validator jedenfalls hat ein Problem mit dem Plugin in der unveränderten Version. Zum Test habe ich es noch einmal installiert.
# - trenc schrieb am 2. Februar 2012, 19:14:
Wirklich sehr skuril. Meine eigenes Impressum wird als valide angezeigt, obwohl da auch die Leerzeichen nicht encoded sind:
Test!