tarteaucitron.services.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. /*global tarteaucitron, ga, Shareaholic, stLight*/
  2. // addthis
  3. tarteaucitron.services.addthis = {
  4. "key": "addthis",
  5. "type": "social",
  6. "name": "AddThis",
  7. "uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors",
  8. "needConsent": true,
  9. "js": function () {
  10. "use strict";
  11. if (tarteaucitron.user.addthisPubId === undefined) {
  12. return;
  13. }
  14. tarteaucitron.fallback(['addthis_sharing_toolbox'], '');
  15. tarteaucitron.addScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=' + tarteaucitron.user.addthisPubId);
  16. },
  17. "fallback": function () {
  18. "use strict";
  19. var cookies = ['__atuvc', '__atuvs'],
  20. id = 'addthis';
  21. tarteaucitron.cookie.purge(cookies);
  22. tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
  23. }
  24. };
  25. // youtube
  26. tarteaucitron.services.youtube = {
  27. "key": "youtube",
  28. "type": "social",
  29. "name": "YouTube",
  30. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  31. "needConsent": true,
  32. "js": function () {
  33. "use strict";
  34. tarteaucitron.fallback(['youtube_player'], function (x) {
  35. var video_id = x.getAttribute("videoID");
  36. if ( video_id === undefined ) {
  37. return "";
  38. }
  39. var video_width = x.getAttribute("width");
  40. var frame_width = 'width=';
  41. if ( video_width !== undefined ) {
  42. frame_width+= '"'+video_width+'" ';
  43. } else {
  44. frame_width+= '"" ';
  45. }
  46. var video_height = x.getAttribute("height");
  47. var frame_height = 'height=';
  48. if ( video_height !== undefined ) {
  49. frame_height+= '"'+video_height+'" ';
  50. } else {
  51. frame_height+= '"" ';
  52. }
  53. var video_frame = '<iframe id="ytplayer" type="text/html" '+ frame_width + frame_height +'" src="http://www.youtube.com/embed/'+ video_id +' " frameborder="0"/>';
  54. return video_frame;
  55. })
  56. },
  57. "fallback": function () {
  58. "use strict";
  59. var cookies = ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],id = 'youtube';
  60. tarteaucitron.cookie.purge(cookies);
  61. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  62. }
  63. };
  64. // clicky
  65. tarteaucitron.services.clicky = {
  66. "key": "clicky",
  67. "type": "analytics",
  68. "name": "Clicky",
  69. "uri": "https://clicky.com/terms",
  70. "needConsent": true,
  71. "js": function () {
  72. "use strict";
  73. if (tarteaucitron.user.clickyId === undefined) {
  74. return;
  75. }
  76. tarteaucitron.addScript('//static.getclicky.com/js', '', function () {
  77. if (typeof clicky.init === 'function') {
  78. clicky.init(tarteaucitron.user.clickyId);
  79. }
  80. if (typeof tarteaucitron.user.clickyMore === 'function') {
  81. tarteaucitron.user.clickyMore();
  82. }
  83. });
  84. },
  85. "fallback": function () {
  86. "use strict";
  87. var cookies = ['_jsuid', '_eventqueue', '_referrer_og', '_utm_og', '_first_pageview', 'clicky_olark', 'no_trackyy_' + tarteaucitron.user.clickyId, 'unpoco_' + tarteaucitron.user.clickyId, 'heatmaps_g2g_' + tarteaucitron.user.clickyId];
  88. tarteaucitron.cookie.purge(cookies);
  89. }
  90. };
  91. // disqus
  92. tarteaucitron.services.disqus = {
  93. "key": "disqus",
  94. "type": "social",
  95. "name": "Disqus",
  96. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  97. "needConsent": true,
  98. "js": function () {
  99. "use strict";
  100. if (tarteaucitron.user.disqusShortname === undefined) {
  101. return;
  102. }
  103. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  104. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  105. },
  106. "fallback": function () {
  107. "use strict";
  108. var id = 'disqus';
  109. if (document.getElementById('disqus_thread')) {
  110. document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
  111. }
  112. }
  113. };
  114. // facebook
  115. tarteaucitron.services.facebook = {
  116. "key": "facebook",
  117. "type": "social",
  118. "name": "Facebook",
  119. "uri": "https://www.facebook.com/help/cookies/",
  120. "needConsent": true,
  121. "js": function () {
  122. "use strict";
  123. tarteaucitron.fallback(['fb-like'], '');
  124. tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  125. },
  126. "fallback": function () {
  127. "use strict";
  128. tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-comments', 'fb-activity', 'fb-like-box', 'fb-send', 'fb-share-button', 'fb-like'], '<a href="https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_facebook">Facebook</a>');
  129. }
  130. };
  131. // ferank
  132. tarteaucitron.services.ferank = {
  133. "key": "ferank",
  134. "type": "analytics",
  135. "name": "FERank",
  136. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  137. "needConsent": false,
  138. "js": function () {
  139. "use strict";
  140. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  141. if (typeof tarteaucitron.user.ferankMore === 'function') {
  142. tarteaucitron.user.ferankMore();
  143. }
  144. });
  145. }
  146. };
  147. // google+
  148. tarteaucitron.services.gplus = {
  149. "key": "gplus",
  150. "type": "social",
  151. "name": "Google+",
  152. "uri": "http://www.google.fr/intl/policies/privacy/",
  153. "needConsent": true,
  154. "js": function () {
  155. "use strict";
  156. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  157. },
  158. "fallback": function () {
  159. "use strict";
  160. tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], '<a href="https://plus.google.com/share?url=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_googlep">Google+</a>');
  161. }
  162. };
  163. // google adsense
  164. tarteaucitron.services.adsense = {
  165. "key": "adsense",
  166. "type": "ads",
  167. "name": "Adsense (Google)",
  168. "uri": "http://www.google.com/ads/preferences/",
  169. "needConsent": true,
  170. "js": function () {
  171. "use strict";
  172. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  173. },
  174. "fallback": function () {
  175. "use strict";
  176. var id = 'adsense';
  177. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  178. }
  179. };
  180. // google analytics (old)
  181. tarteaucitron.services.gajs = {
  182. "key": "gajs",
  183. "type": "analytics",
  184. "name": "Google Analytics (ga.js)",
  185. "uri": "https://support.google.com/analytics/answer/6004245",
  186. "needConsent": true,
  187. "js": function () {
  188. "use strict";
  189. window._gaq = window._gaq || [];
  190. window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]);
  191. window._gaq.push(['_trackPageview']);
  192. tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () {
  193. if (typeof tarteaucitron.user.gajsMore === 'function') {
  194. tarteaucitron.user.gajsMore();
  195. }
  196. });
  197. },
  198. "fallback": function () {
  199. "use strict";
  200. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  201. tarteaucitron.cookie.purge(cookies);
  202. }
  203. };
  204. // google analytics
  205. tarteaucitron.services.analytics = {
  206. "key": "analytics",
  207. "type": "analytics",
  208. "name": "Google Analytics (universal)",
  209. "uri": "https://support.google.com/analytics/answer/6004245",
  210. "needConsent": true,
  211. "js": function () {
  212. "use strict";
  213. window.GoogleAnalyticsObject = 'ga';
  214. window.ga = window.ga || function () {
  215. window.ga.q = window.ga.q || [];
  216. window.ga.q.push(arguments);
  217. };
  218. window.ga.l = new Date();
  219. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  220. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  221. ga('send', 'pageview');
  222. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  223. tarteaucitron.user.analyticsMore();
  224. }
  225. });
  226. },
  227. "grayJs": function () {
  228. "use strict";
  229. window.GoogleAnalyticsObject = 'ga';
  230. window.ga = window.ga || function () {
  231. window.ga.q = window.ga.q || [];
  232. window.ga.q.push(arguments);
  233. };
  234. window.ga.l = new Date();
  235. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  236. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
  237. ga('set', 'anonymizeIp', true);
  238. ga('set', 'forceSSL', true);
  239. ga('send', 'pageview');
  240. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  241. tarteaucitron.user.analyticsMore();
  242. }
  243. });
  244. },
  245. "fallback": function () {
  246. "use strict";
  247. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  248. tarteaucitron.cookie.purge(cookies);
  249. }
  250. };
  251. // linkedin
  252. tarteaucitron.services.linkedin = {
  253. "key": "linkedin",
  254. "type": "social",
  255. "name": "Linkedin",
  256. "uri": "https://www.linkedin.com/legal/cookie_policy",
  257. "needConsent": true,
  258. "js": function () {
  259. "use strict";
  260. tarteaucitron.fallback(['tacLinkedin'], '');
  261. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  262. },
  263. "fallback": function () {
  264. "use strict";
  265. tarteaucitron.fallback(['tacLinkedin'], '<a href="http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_linkedin">Linkedin</a>');
  266. }
  267. };
  268. // pinterest
  269. tarteaucitron.services.pinterest = {
  270. "key": "pinterest",
  271. "type": "social",
  272. "name": "Pinterest",
  273. "uri": "https://about.pinterest.com/privacy-policy",
  274. "needConsent": true,
  275. "js": function () {
  276. "use strict";
  277. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  278. }
  279. };
  280. // shareaholic
  281. tarteaucitron.services.shareaholic = {
  282. "key": "shareaholic",
  283. "type": "social",
  284. "name": "Shareaholic",
  285. "uri": "https://shareaholic.com/privacy/choices",
  286. "needConsent": true,
  287. "js": function () {
  288. "use strict";
  289. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  290. return;
  291. }
  292. tarteaucitron.fallback(['shareaholic-canvas'], '');
  293. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  294. try {
  295. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  296. } catch (e) {}
  297. });
  298. },
  299. "fallback": function () {
  300. "use strict";
  301. var cookies = ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  302. id = 'shareaholic';
  303. tarteaucitron.cookie.purge(cookies);
  304. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  305. }
  306. };
  307. // sharethis
  308. tarteaucitron.services.sharethis = {
  309. "key": "sharethis",
  310. "type": "social",
  311. "name": "ShareThis",
  312. "uri": "http://www.sharethis.com/legal/privacy/",
  313. "needConsent": true,
  314. "js": function () {
  315. "use strict";
  316. if (tarteaucitron.user.sharethisPublisher === undefined) {
  317. return;
  318. }
  319. var switchTo5x = true,
  320. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  321. tarteaucitron.fallback(['tacSharethis'], '');
  322. tarteaucitron.addScript(uri, '', function () {
  323. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  324. });
  325. },
  326. "fallback": function () {
  327. "use strict";
  328. var cookies = ['__unam'],
  329. id = 'sharethis';
  330. tarteaucitron.cookie.purge(cookies);
  331. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  332. }
  333. };
  334. // twitter
  335. tarteaucitron.services.twitter = {
  336. "key": "twitter",
  337. "type": "social",
  338. "name": "Twitter",
  339. "uri": "https://support.twitter.com/articles/20170514",
  340. "needConsent": true,
  341. "js": function () {
  342. "use strict";
  343. tarteaucitron.fallback(['tacTwitter'], '');
  344. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  345. },
  346. "fallback": function () {
  347. "use strict";
  348. tarteaucitron.fallback(['tacTwitter'], '<a href="https://twitter.com/intent/tweet?text=' + encodeURIComponent(document.title) + '%20' + encodeURIComponent(document.location) + '" target="_blank" class="tac_share tac_share_twitter">Twitter</a>');
  349. }
  350. };
  351. // xiti
  352. tarteaucitron.services.xiti = {
  353. "key": "xiti",
  354. "type": "analytics",
  355. "name": "Xiti",
  356. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  357. "needConsent": true,
  358. "js": function () {
  359. "use strict";
  360. if (tarteaucitron.user.xitiId === undefined) {
  361. return;
  362. }
  363. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  364. Xt_r,
  365. Xt_h,
  366. Xt_i,
  367. Xt_s,
  368. div = document.createElement('div');
  369. try {
  370. Xt_r = top.document.referrer;
  371. } catch (e) {
  372. Xt_r = document.referrer;
  373. }
  374. Xt_h = new Date();
  375. Xt_i = '<img style="display:none" border="0" alt="" ';
  376. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  377. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  378. if (parseFloat(navigator.appVersion) >= 4) {
  379. Xt_s = screen;
  380. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  381. }
  382. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  383. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  384. if (typeof tarteaucitron.user.xitiMore === 'function') {
  385. tarteaucitron.user.xitiMore();
  386. }
  387. },
  388. "fallback": function () {
  389. "use strict";
  390. var cookies = [''];
  391. tarteaucitron.cookie.purge(cookies);
  392. }
  393. };