/*
* Author: Aaron Alexander (nerdfiles.net)
*/
var baseDomain = "test.com";
var baseEmailDomain = "test.com";
$(document).ready(function(){
/*
Since the "target" attribute is no longer permitted under the XHTML 1.0 Strict specification
See (for a discussion): http://robertnyman.com/2006/02/13/how-evil-is-the-target-attribute/
Example: <a href="http://google.com" rel="external">google.com</a>
*/
$("a[rel='external']").addClass("external-link");
$("a[rel='external']").click(function(event) {
window.open(this.href);
event.preventDefault();
});
/*
A poor man's e-mail obfuscation
Checks to see if rel attribute has "email" then grabs the preceding word.
Example: <a href="#" rel="e-mail handle">com.tset@eldnah</a>
*/
$("a[rel^='e-mail']").css({
"unicode-bidi": "bidi-override",
"direction": "rtl",
});
$("a[rel^='e-mail']").click(function(event) {
var str = this.rel;
var emailHandle = str.replace(/e-mail /, "");
window.location = "mailto:" + emailHandle + "@" + baseEmailDomain;
event.preventDefault();
});
});