diff --git a/README.md b/README.md index be5c5c2..641c93f 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ Bonus: * SlideShare * Vimeo * YouTube + * Issuu ## Visitors outside the EU diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 50f07dc..1fed07c 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -15,7 +15,7 @@ tarteaucitron.services.iframe = { var width = x.getAttribute("width"), height = x.getAttribute("height"), url = x.getAttribute("data-url"); - + return ''; }); }, @@ -143,7 +143,7 @@ tarteaucitron.services.amazon = { productId = x.getAttribute("productid"), url = '//ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=' + tarteaucitron.getLanguage().toUpperCase() + '&source=ss&ref=ss_til&ad_type=product_link&tracking_id=' + amazonId + '&marketplace=amazon®ion=' + tarteaucitron.getLanguage().toUpperCase() + '&placement=' + productId + '&asins=' + productId + '&show_border=true&link_opens_in_new_window=true', iframe = ''; - + return iframe; }); }, @@ -169,7 +169,7 @@ tarteaucitron.services.calameo = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = '//v.calameo.com/?bkcode=' + id; - + return ''; }); }, @@ -227,13 +227,13 @@ tarteaucitron.services.clicmanager = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//ads.clicmanager.fr/exe.php?'; uri += 'c=' + document.getElementById(uniqIds[i]).getAttribute('c') + '&'; uri += 's=' + document.getElementById(uniqIds[i]).getAttribute('s') + '&'; uri += 't=' + document.getElementById(uniqIds[i]).getAttribute('t'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -254,11 +254,11 @@ tarteaucitron.services.crazyegg = { "cookies": [], "js": function () { "use strict"; - + if (tarteaucitron.user.crazyeggId === undefined) { return; } - + tarteaucitron.addScript('//script.crazyegg.com/pages/scripts/' + tarteaucitron.user.crazyeggId.substr(0, 4) + '/' + tarteaucitron.user.crazyeggId.substr(4, 4) + '.js'); } }; @@ -283,7 +283,7 @@ tarteaucitron.services.criteo = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//cas.criteo.com/delivery/ajs.php?'; uri += 'zoneid=' + document.getElementById(uniqIds[i]).getAttribute('zoneid'); @@ -296,7 +296,7 @@ tarteaucitron.services.criteo = { uri += (document.context !== undefined) ? '&context=' + encodeURI(document.context) : ''; uri += ((document.MAX_ct0 !== undefined) && (document.MAX_ct0.substring(0, 4) === 'http')) ? '&ct0=' + encodeURI(document.MAX_ct0) : ''; uri += (document.mmm_fo !== undefined) ? '&mmm_fo=1' : ''; - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -325,7 +325,7 @@ tarteaucitron.services.dailymotion = { frame_height = 'height=', video_frame, params = 'info=' + x.getAttribute("showinfo") + '&autoPlay=' + x.getAttribute("autoplay"); - + if (video_id === undefined) { return ""; } @@ -376,7 +376,7 @@ tarteaucitron.services.datingaffiliation = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = 'http://www.tools-affil2.com/rotaban/ban.php?' + comfrom; - + return ''; }); }, @@ -410,7 +410,7 @@ tarteaucitron.services.datingaffiliationpopup = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'http://www.promotools.biz/da/popunder/script.php?'; uri += 'comfrom=' + document.getElementById(uniqIds[i]).getAttribute('comfrom') + '&'; @@ -433,7 +433,7 @@ tarteaucitron.services.datingaffiliationpopup = { uri += 'snd=' + document.getElementById(uniqIds[i]).getAttribute('snd') + '&'; uri += 'aabd=' + document.getElementById(uniqIds[i]).getAttribute('aabd') + '&'; uri += 'aabs=' + document.getElementById(uniqIds[i]).getAttribute('aabs'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -463,7 +463,7 @@ tarteaucitron.services.disqus = { "fallback": function () { "use strict"; var id = 'disqus'; - + if (document.getElementById('disqus_thread')) { document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id); } @@ -638,7 +638,7 @@ tarteaucitron.services.getplus = { if (tarteaucitron.user.getplusId === undefined) { return; } - + window.webleads_site_ids = window.webleads_site_ids || []; window.webleads_site_ids.push(tarteaucitron.user.getplusId); tarteaucitron.addScript('//stats.webleads-tracker.com/js'); @@ -753,7 +753,7 @@ tarteaucitron.services.adsensesearchresult = { "fallback": function () { "use strict"; var id = 'adsensesearchresult'; - + if (document.getElementById('gcse_searchresults')) { document.getElementById('gcse_searchresults').innerHTML = tarteaucitron.engage(id); } @@ -773,7 +773,7 @@ tarteaucitron.services.googleadwordsconversion = { if (tarteaucitron.user.adwordsconversionId === undefined) { return; } - + tarteaucitron.addScript('//www.googleadservices.com/pagead/conversion_async.js', '', function () { window.google_trackConversion({ google_conversion_id: tarteaucitron.user.adwordsconversionId, @@ -805,7 +805,7 @@ tarteaucitron.services.googleadwordsremarketing = { if (tarteaucitron.user.adwordsremarketingId === undefined) { return; } - + tarteaucitron.addScript('//www.googleadservices.com/pagead/conversion_async.js', '', function () { window.google_trackConversion({ google_conversion_id: tarteaucitron.user.adwordsremarketingId, @@ -828,7 +828,7 @@ tarteaucitron.services.gajs = { window._gaq = window._gaq || []; window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]); window._gaq.push(['_trackPageview']); - + tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () { if (typeof tarteaucitron.user.gajsMore === 'function') { tarteaucitron.user.gajsMore(); @@ -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,12 +879,11 @@ 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()); gtag('config', tarteaucitron.user.gtagUa); - + if (typeof tarteaucitron.user.gtagMore === 'function') { tarteaucitron.user.gtagMore(); } @@ -920,7 +918,7 @@ tarteaucitron.services.googlemaps = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { mapOptions = { zoom: parseInt(document.getElementById(uniqIds[i]).getAttribute('zoom'), 10), @@ -1025,12 +1023,12 @@ tarteaucitron.services.mautic = { if (tarteaucitron.user.mauticurl === undefined) { return; } - + window['MauticTrackingObject'] = 'mt'; window['mt'] = window['mt'] || function() { (window['mt'].q = window['mt'].q || []).push(arguments); }; - + tarteaucitron.addScript(tarteaucitron.user.mauticurl, '', function() { mt('send', 'pageview'); }); @@ -1050,7 +1048,7 @@ tarteaucitron.services.microsoftcampaignanalytics = { if (tarteaucitron.user.microsoftcampaignanalyticsUUID === undefined) { return; } - + tarteaucitron.addScript('//flex.atdmt.com/mstag/site/' + tarteaucitron.user.microsoftcampaignanalyticsUUID + '/mstag.js', 'mstag_tops', function () { window.mstag = {loadTag : function () {}, time : (new Date()).getTime()}; window.mstag.loadTag("analytics", {dedup: "1", domainId: tarteaucitron.user.microsoftcampaignanalyticsdomainId, type: "1", actionid: tarteaucitron.user.microsoftcampaignanalyticsactionId}); @@ -1097,14 +1095,14 @@ tarteaucitron.services.prelinker = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'http://promo.easy-dating.org/banner/index?'; uri += 'site_id=' + document.getElementById(uniqIds[i]).getAttribute('siteId') + '&'; uri += 'banner_id=' + document.getElementById(uniqIds[i]).getAttribute('bannerId') + '&'; uri += 'default_language=' + document.getElementById(uniqIds[i]).getAttribute('defaultLanguage') + '&'; uri += 'tr4ck=' + document.getElementById(uniqIds[i]).getAttribute('trackrt'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -1130,7 +1128,7 @@ tarteaucitron.services.prezi = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = 'https://prezi.com/embed/' + id + '/?bgcolor=ffffff&lock_to_path=0&autoplay=0&autohide_ctrls=0'; - + return ''; }); }, @@ -1164,12 +1162,12 @@ tarteaucitron.services.pubdirecte = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = '//www.pubdirecte.com/script/banniere.php?'; uri += 'id=' + document.getElementById(uniqIds[i]).getAttribute('pid') + '&'; uri += 'ref=' + document.getElementById(uniqIds[i]).getAttribute('ref'); - + tarteaucitron.makeAsync.init(uri, uniqIds[i]); } }, @@ -1193,7 +1191,7 @@ tarteaucitron.services.purechat = { if (tarteaucitron.user.purechatId === undefined) { return; } - + tarteaucitron.addScript('//app.purechat.com/VisitorWidget/WidgetScript', '', function () { try { window.w = new PCWidget({ c: tarteaucitron.user.purechatId, f: true }); @@ -1215,7 +1213,7 @@ tarteaucitron.services.shareaholic = { if (tarteaucitron.user.shareaholicSiteId === undefined) { return; } - + tarteaucitron.fallback(['shareaholic-canvas'], ''); tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () { try { @@ -1249,7 +1247,7 @@ tarteaucitron.services.shareasale = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { uri = 'https://shareasale.com/sale.cfm?'; uri += 'amount=' + document.getElementById(uniqIds[i]).getAttribute('amount') + '&'; @@ -1259,7 +1257,7 @@ tarteaucitron.services.shareasale = { uri += 'perlead=' + document.getElementById(uniqIds[i]).getAttribute('perlead') + '&'; uri += 'perhit=' + document.getElementById(uniqIds[i]).getAttribute('perhit') + '&'; uri += 'merchantID=' + document.getElementById(uniqIds[i]).getAttribute('merchantID'); - + document.getElementById(uniqIds[i]).innerHTML = ''; } }, @@ -1285,12 +1283,12 @@ tarteaucitron.services.sharethis = { } var switchTo5x = true, uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js'; - + tarteaucitron.fallback(['tacSharethis'], ''); tarteaucitron.addScript(uri, '', function () { stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false}); }); - + if (tarteaucitron.isAjax === true) { if (typeof stButtons !== "undefined") { stButtons.locateElements(); @@ -1319,7 +1317,7 @@ tarteaucitron.services.slideshare = { width = x.getAttribute("width"), height = x.getAttribute("height"), url = '//www.slideshare.net/slideshow/embed_code/' + id; - + return ''; }); }, @@ -1353,7 +1351,7 @@ tarteaucitron.services.statcounter = { uniqIds.push(uniqId); return '
'; }); - + for (i = 0; i < uniqIds.length; i += 1) { tarteaucitron.makeAsync.init(uri, uniqIds[i]); } @@ -1433,11 +1431,11 @@ tarteaucitron.services.twenga = { "cookies": [], "js": function () { "use strict"; - + if (tarteaucitron.user.twengaId === undefined || tarteaucitron.user.twengaLocale === undefined) { return; } - + tarteaucitron.addScript('//tracker.twenga.' + tarteaucitron.user.twengaLocale + '/st/tracker_' + tarteaucitron.user.twengaId + '.js'); } }; @@ -1490,7 +1488,7 @@ tarteaucitron.services.twitterembed = { html += '>'; return html; }); - + tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs', function () { for (i = 0; i < uniqIds.length; i += 1) { e = document.getElementById(uniqIds[i]); @@ -1574,7 +1572,7 @@ tarteaucitron.services.vimeo = { video_height = x.getAttribute("height"), frame_height = 'height=', video_frame; - + if (video_id === undefined) { return ""; } @@ -1695,10 +1693,10 @@ tarteaucitron.services.xiti = { Xt_s = screen; Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth; } - + div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">'; document.getElementsByTagName('body')[0].appendChild(div.firstChild); - + if (typeof tarteaucitron.user.xitiMore === 'function') { tarteaucitron.user.xitiMore(); } @@ -1723,7 +1721,7 @@ tarteaucitron.services.youtube = { frame_height = 'height=', video_frame, params = 'theme=' + x.getAttribute("theme") + '&rel=' + x.getAttribute("rel") + '&controls=' + x.getAttribute("controls") + '&showinfo=' + x.getAttribute("showinfo") + '&autoplay=' + x.getAttribute("autoplay"); - + if (video_id === undefined) { return ""; } @@ -1770,7 +1768,7 @@ tarteaucitron.services.youtubeplaylist = { frame_height = 'height=', video_frame, params = 'theme=' + x.getAttribute("theme") + '&rel=' + x.getAttribute("rel") + '&controls=' + x.getAttribute("controls") + '&showinfo=' + x.getAttribute("showinfo") + '&autoplay=' + x.getAttribute("autoplay"); - + if (playlist_id === undefined) { return ""; } @@ -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 = ''; + 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", @@ -1889,4 +1933,5 @@ tarteaucitron.services.webmecanik = { mt('send', 'pageview'); }); } -}; \ No newline at end of file +}; +