forked from 0x2620/pandora
dont open mailto: links via /url=, fixes #2349
This commit is contained in:
parent
160dbacbb0
commit
da77fa00d9
1 changed files with 10 additions and 2 deletions
|
@ -283,7 +283,7 @@ pandora.clickLink = function(e) {
|
|||
}
|
||||
pandora.URL.push(e.target.pathname, true);
|
||||
} else {
|
||||
window.open('/url=' + encodeURIComponent(e.target.href), '_blank');
|
||||
pandora.openLink(e.target.href);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -302,7 +302,7 @@ pandora.createLinks = function($element) {
|
|||
) {
|
||||
e.preventDefault();
|
||||
if (isExternalLink(e.target)) {
|
||||
window.open('/url=' + encodeURIComponent(e.target.href), '_blank');
|
||||
pandora.openLink(e.target.href);
|
||||
} else {
|
||||
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) {
|
||||
// fixme: this is still voodoo
|
||||
pandora.user = Ox.extend(data.user, {
|
||||
|
|
Loading…
Reference in a new issue