Add service for Issuu (www.issuu.com) Iframe embed

This commit is contained in:
Fabian Christen 2018-05-25 11:12:56 +02:00
parent a7b5fb7e36
commit 7143dc9258
2 changed files with 93 additions and 47 deletions

View File

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

View File

@ -1848,3 +1848,48 @@ 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);
});
}
};