Add generic iframe service

This commit is contained in:
Amauri CHAMPEAUX 2018-04-16 17:31:33 +02:00 committed by GitHub
parent 2252217234
commit 8f7523b710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

View File

@ -1,6 +1,35 @@
/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr, PCWidget*/
/*jslint regexp: true, nomen: true*/
// generic iframe
tarteaucitron.services.iframe = {
"key": "iframe",
"type": "other",
"name": "Web content",
"uri": "",
"needConsent": true,
"cookies": [],
"js": function () {
"use strict";
tarteaucitron.fallback(['tac_iframe'], function (x) {
var width = x.getAttribute("width"),
height = x.getAttribute("height"),
url = x.getAttribute("url");
return '<iframe src="' + url + '" width="' + width + '" height="' + height + '" frameborder="0" scrolling="no" allowtransparency allowfullscreen></iframe>';
});
},
"fallback": function () {
"use strict";
var id = 'iframe';
tarteaucitron.fallback(['tac_iframe'], function (elem) {
elem.style.width = elem.getAttribute('width') + 'px';
elem.style.height = elem.getAttribute('height') + 'px';
return tarteaucitron.engage(id);
});
}
};
// addthis
tarteaucitron.services.addthis = {
"key": "addthis",