Merge pull request #110 from achterbahn/issuu

Add service for Issuu (www.issuu.com) Iframe embed
This commit is contained in:
Amauri CHAMPEAUX 2018-06-15 15:02:40 +02:00 committed by GitHub
commit c2e71961b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 94 additions and 48 deletions

View File

@ -89,6 +89,7 @@ Bonus:
* SlideShare
* Vimeo
* YouTube
* Issuu
## Visitors outside the EU

View File

@ -853,7 +853,6 @@ tarteaucitron.services.analytics = {
window.ga.q.push(arguments);
};
window.ga.l = new Date();
tarteaucitron.addScript('https://www.google-analytics.com/analytics.js', '', function () {
ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
ga('send', 'pageview');
@ -880,7 +879,6 @@ tarteaucitron.services.gtag = {
"js": function () {
"use strict";
window.dataLayer = window.dataLayer || [];
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () {
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
@ -1867,6 +1865,52 @@ tarteaucitron.services.facebookpixel = {
}
};
//Issuu
tarteaucitron.services.issuu = {
"key": "issuu",
"type": "other",
"name": "Issuu",
"uri": "https://issuu.com/legal/privacy",
"needConsent": true,
"cookies": ['__qca', 'iutk', 'mc'],
"js": function () {
"use strict";
tarteaucitron.fallback(['issuu_player'], function (x) {
var issuu_id = x.getAttribute("issuuID"),
issuu_width = x.getAttribute("width"),
frame_width = 'width=',
issuu_height = x.getAttribute("height"),
frame_height = 'height=',
issuu_frame;
if (issuu_id === undefined) {
return "";
}
if (issuu_width !== undefined) {
frame_width += '"' + issuu_width + '" ';
} else {
frame_width += '"" ';
}
if (issuu_height !== undefined) {
frame_height += '"' + issuu_height + '" ';
} else {
frame_height += '"" ';
}
issuu_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//e.issuu.com/embed.html#' + issuu_id + '" frameborder="0"></iframe>';
return issuu_frame;
});
},
"fallback": function () {
"use strict";
var id = 'issuu';
tarteaucitron.fallback(['issuu_player'], function (elem) {
elem.style.width = elem.getAttribute('width') + 'px';
elem.style.height = elem.getAttribute('height') + 'px';
return tarteaucitron.engage(id);
});
}
};
// webmecanik
tarteaucitron.services.webmecanik = {
"key": "webmecanik",
@ -1890,3 +1934,4 @@ tarteaucitron.services.webmecanik = {
});
}
};