mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-10 21:22:35 +01:00
formatting / links rel
This commit is contained in:
parent
d74d339e4b
commit
594b584500
@ -12,9 +12,7 @@ const analytics = new testPilotGA({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function sendEvent() {
|
function sendEvent() {
|
||||||
return analytics.sendEvent
|
return analytics.sendEvent.apply(analytics, arguments).catch(() => 0);
|
||||||
.apply(analytics, arguments)
|
|
||||||
.catch(() => 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function findMetric(href) {
|
function findMetric(href) {
|
||||||
@ -60,4 +58,4 @@ module.exports = {
|
|||||||
Raven,
|
Raven,
|
||||||
sendEvent,
|
sendEvent,
|
||||||
findMetric
|
findMetric
|
||||||
}
|
};
|
||||||
|
@ -12,7 +12,6 @@ require('jquery-circle-progress');
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
gcmCompliant()
|
gcmCompliant()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
|
||||||
$('.send-new').click(function() {
|
$('.send-new').click(function() {
|
||||||
sendEvent('recipient', 'restarted', {
|
sendEvent('recipient', 'restarted', {
|
||||||
cd2: 'completed'
|
cd2: 'completed'
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
|
let links = [];
|
||||||
|
|
||||||
let links = []
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
links = document.querySelectorAll('a:not([target])');
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
});
|
||||||
links = document.querySelectorAll('a:not([target])')
|
|
||||||
})
|
|
||||||
|
|
||||||
function setOpenInNewTab(bool) {
|
function setOpenInNewTab(bool) {
|
||||||
if (bool === false) {
|
if (bool === false) {
|
||||||
links.forEach(l => l.removeAttribute('target'));
|
links.forEach(l => {
|
||||||
}
|
l.removeAttribute('target');
|
||||||
else {
|
l.removeAttribute('rel');
|
||||||
links.forEach(l => l.setAttribute('target', '_blank'));
|
});
|
||||||
|
} else {
|
||||||
|
links.forEach(l => {
|
||||||
|
l.setAttribute('target', '_blank');
|
||||||
|
l.setAttribute('rel', 'noopener noreferrer');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
setOpenInNewTab
|
setOpenInNewTab
|
||||||
}
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user