dont open mailto: links via /url=, fixes #2349

This commit is contained in:
j 2014-03-03 20:08:55 +00:00
parent 160dbacbb0
commit da77fa00d9

View file

@ -283,7 +283,7 @@ pandora.clickLink = function(e) {
} }
pandora.URL.push(e.target.pathname, true); pandora.URL.push(e.target.pathname, true);
} else { } else {
window.open('/url=' + encodeURIComponent(e.target.href), '_blank'); pandora.openLink(e.target.href);
} }
}; };
@ -302,7 +302,7 @@ pandora.createLinks = function($element) {
) { ) {
e.preventDefault(); e.preventDefault();
if (isExternalLink(e.target)) { if (isExternalLink(e.target)) {
window.open('/url=' + encodeURIComponent(e.target.href), '_blank'); pandora.openLink(e.target.href);
} else { } else {
pandora.clickLink(e); pandora.clickLink(e);
} }
@ -1937,6 +1937,14 @@ pandora.logEvent = function(data, event, element) {
} }
}; };
pandora.openLink = function(url) {
if (Ox.startsWith(url, 'mailto:')) {
window.open(url);
} else {
window.open('/url=' + encodeURIComponent(url), '_blank');
}
};
pandora.signin = function(data) { pandora.signin = function(data) {
// fixme: this is still voodoo // fixme: this is still voodoo
pandora.user = Ox.extend(data.user, { pandora.user = Ox.extend(data.user, {