Skip to content

Commit

Permalink
Add Calameo Library Fix #1260
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed Jul 12, 2024
1 parent 3715382 commit 3038ede
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions tarteaucitron.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,38 @@ tarteaucitron.services.calameo = {
}
};

// calameolibrary
tarteaucitron.services.calameolibrary = {
"key": "calameolibrary",
"type": "video",
"name": "Calameo Library",
"uri": "https://fr.calameo.com/privacy",
"needConsent": true,
"cookies": [],
"js": function () {
"use strict";
tarteaucitron.fallback(['calameolibrary-canvas'], function (x) {
var frame_title = tarteaucitron.getElemAttr(x, "title") || 'Calameo iframe',
id = tarteaucitron.getElemAttr(x, "data-id"),
width = tarteaucitron.getElemAttr(x, "width"),
height = tarteaucitron.getElemAttr(x, "height"),
url = '//v.calameo.com/library/?type=subscription&id=' + id,
allowfullscreen = tarteaucitron.getElemAttr(x, "allowfullscreen");

return '<iframe title="' + frame_title + '" src="' + url + '" width="' + width + '" height="' + height + '" scrolling="no" allowtransparency ' + (allowfullscreen == '0' ? '' : ' webkitallowfullscreen mozallowfullscreen allowfullscreen') + '></iframe>';
});
},
"fallback": function () {
"use strict";
var id = 'calameolibrary';
tarteaucitron.fallback(['calameolibrary-canvas'], function (elem) {
elem.style.width = elem.getAttribute('width') + 'px';
elem.style.height = elem.getAttribute('height') + 'px';
return tarteaucitron.engage(id);
});
}
};

// clicky
tarteaucitron.services.clicky = {
"key": "clicky",
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.services.min.js

Large diffs are not rendered by default.

0 comments on commit 3038ede

Please sign in to comment.