tarteaucitron.services.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /*global tarteaucitron, ga, Shareaholic, stLight, clicky, top*/
  2. /*jslint regexp: true, nomen: true*/
  3. // addthis
  4. tarteaucitron.services.addthis = {
  5. "key": "addthis",
  6. "type": "social",
  7. "name": "AddThis",
  8. "uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors",
  9. "needConsent": true,
  10. "js": function () {
  11. "use strict";
  12. if (tarteaucitron.user.addthisPubId === undefined) {
  13. return;
  14. }
  15. tarteaucitron.fallback(['addthis_sharing_toolbox'], '');
  16. tarteaucitron.addScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=' + tarteaucitron.user.addthisPubId);
  17. },
  18. "fallback": function () {
  19. "use strict";
  20. var cookies = ['__atuvc', '__atuvs'],
  21. id = 'addthis';
  22. tarteaucitron.cookie.purge(cookies);
  23. tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
  24. }
  25. };
  26. // alexa
  27. tarteaucitron.services.alexa = {
  28. "key": "alexa",
  29. "type": "analytics",
  30. "name": "Alexa",
  31. "uri": "http://www.alexa.com/help/privacy",
  32. "needConsent": true,
  33. "js": function () {
  34. "use strict";
  35. if (tarteaucitron.user.alexaAccountID === undefined) {
  36. return;
  37. }
  38. window._atrk_opts = {
  39. atrk_acct: tarteaucitron.user.alexaAccountID,
  40. domain: window.location.hostname.match(/[^\.]*\.[^.]*$/)[0],
  41. dynamic: true
  42. };
  43. tarteaucitron.addScript('https://d31qbv1cthcecs.cloudfront.net/atrk.js');
  44. },
  45. "fallback": function () {
  46. "use strict";
  47. var cookies = ['__asc', '__auc'];
  48. tarteaucitron.cookie.purge(cookies);
  49. }
  50. };
  51. // clicky
  52. tarteaucitron.services.clicky = {
  53. "key": "clicky",
  54. "type": "analytics",
  55. "name": "Clicky",
  56. "uri": "https://clicky.com/terms",
  57. "needConsent": true,
  58. "js": function () {
  59. "use strict";
  60. if (tarteaucitron.user.clickyId === undefined) {
  61. return;
  62. }
  63. tarteaucitron.addScript('//static.getclicky.com/js', '', function () {
  64. if (typeof clicky.init === 'function') {
  65. clicky.init(tarteaucitron.user.clickyId);
  66. }
  67. if (typeof tarteaucitron.user.clickyMore === 'function') {
  68. tarteaucitron.user.clickyMore();
  69. }
  70. });
  71. },
  72. "fallback": function () {
  73. "use strict";
  74. 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];
  75. tarteaucitron.cookie.purge(cookies);
  76. }
  77. };
  78. // dailymotion
  79. tarteaucitron.services.dailymotion = {
  80. "key": "dailymotion",
  81. "type": "social",
  82. "name": "Dailymotion",
  83. "uri": "http://www.dailymotion.com/legal/privacy",
  84. "needConsent": true,
  85. "js": function () {
  86. "use strict";
  87. tarteaucitron.fallback(['dailymotion_player'], function (x) {
  88. var video_id = x.getAttribute("videoID"),
  89. video_width = x.getAttribute("width"),
  90. frame_width = 'width=',
  91. video_height = x.getAttribute("height"),
  92. frame_height = 'height=',
  93. video_frame;
  94. if (video_id === undefined) {
  95. return "";
  96. }
  97. if (video_width !== undefined) {
  98. frame_width += '"' + video_width + '" ';
  99. } else {
  100. frame_width += '"" ';
  101. }
  102. if (video_height !== undefined) {
  103. frame_height += '"' + video_height + '" ';
  104. } else {
  105. frame_height += '"" ';
  106. }
  107. video_frame = '<iframe src="//www.dailymotion.com/embed/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" allowfullscreen></iframe>';
  108. return video_frame;
  109. });
  110. },
  111. "fallback": function () {
  112. "use strict";
  113. var cookies = ['ts', 'dmvk', 'hist', 'v1st', 's_vi'],
  114. id = 'dailymotion';
  115. tarteaucitron.cookie.purge(cookies);
  116. tarteaucitron.fallback(['dailymotion_player'], tarteaucitron.engage(id));
  117. }
  118. };
  119. // disqus
  120. tarteaucitron.services.disqus = {
  121. "key": "disqus",
  122. "type": "social",
  123. "name": "Disqus",
  124. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  125. "needConsent": true,
  126. "js": function () {
  127. "use strict";
  128. if (tarteaucitron.user.disqusShortname === undefined) {
  129. return;
  130. }
  131. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  132. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  133. },
  134. "fallback": function () {
  135. "use strict";
  136. var id = 'disqus';
  137. if (document.getElementById('disqus_thread')) {
  138. document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
  139. }
  140. }
  141. };
  142. // facebook
  143. tarteaucitron.services.facebook = {
  144. "key": "facebook",
  145. "type": "social",
  146. "name": "Facebook",
  147. "uri": "https://www.facebook.com/help/cookies/",
  148. "needConsent": true,
  149. "js": function () {
  150. "use strict";
  151. tarteaucitron.fallback(['fb-like'], '');
  152. tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  153. },
  154. "fallback": function () {
  155. "use strict";
  156. 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>');
  157. }
  158. };
  159. // ferank
  160. tarteaucitron.services.ferank = {
  161. "key": "ferank",
  162. "type": "analytics",
  163. "name": "FERank",
  164. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  165. "needConsent": false,
  166. "js": function () {
  167. "use strict";
  168. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  169. if (typeof tarteaucitron.user.ferankMore === 'function') {
  170. tarteaucitron.user.ferankMore();
  171. }
  172. });
  173. }
  174. };
  175. // google+
  176. tarteaucitron.services.gplus = {
  177. "key": "gplus",
  178. "type": "social",
  179. "name": "Google+",
  180. "uri": "http://www.google.fr/intl/policies/privacy/",
  181. "needConsent": true,
  182. "js": function () {
  183. "use strict";
  184. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  185. },
  186. "fallback": function () {
  187. "use strict";
  188. 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>');
  189. }
  190. };
  191. // google adsense
  192. tarteaucitron.services.adsense = {
  193. "key": "adsense",
  194. "type": "ads",
  195. "name": "Adsense (Google)",
  196. "uri": "http://www.google.com/ads/preferences/",
  197. "needConsent": true,
  198. "js": function () {
  199. "use strict";
  200. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  201. },
  202. "fallback": function () {
  203. "use strict";
  204. var id = 'adsense';
  205. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  206. }
  207. };
  208. // google analytics (old)
  209. tarteaucitron.services.gajs = {
  210. "key": "gajs",
  211. "type": "analytics",
  212. "name": "Google Analytics (ga.js)",
  213. "uri": "https://support.google.com/analytics/answer/6004245",
  214. "needConsent": true,
  215. "js": function () {
  216. "use strict";
  217. window._gaq = window._gaq || [];
  218. window._gaq.push(['_setAccount', tarteaucitron.user.gajsUa]);
  219. window._gaq.push(['_trackPageview']);
  220. tarteaucitron.addScript('//www.google-analytics.com/ga.js', '', function () {
  221. if (typeof tarteaucitron.user.gajsMore === 'function') {
  222. tarteaucitron.user.gajsMore();
  223. }
  224. });
  225. },
  226. "fallback": function () {
  227. "use strict";
  228. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  229. tarteaucitron.cookie.purge(cookies);
  230. }
  231. };
  232. // google analytics
  233. tarteaucitron.services.analytics = {
  234. "key": "analytics",
  235. "type": "analytics",
  236. "name": "Google Analytics (universal)",
  237. "uri": "https://support.google.com/analytics/answer/6004245",
  238. "needConsent": true,
  239. "js": function () {
  240. "use strict";
  241. window.GoogleAnalyticsObject = 'ga';
  242. window.ga = window.ga || function () {
  243. window.ga.q = window.ga.q || [];
  244. window.ga.q.push(arguments);
  245. };
  246. window.ga.l = new Date();
  247. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  248. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  249. ga('send', 'pageview');
  250. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  251. tarteaucitron.user.analyticsMore();
  252. }
  253. });
  254. },
  255. "grayJs": function () {
  256. "use strict";
  257. window.GoogleAnalyticsObject = 'ga';
  258. window.ga = window.ga || function () {
  259. window.ga.q = window.ga.q || [];
  260. window.ga.q.push(arguments);
  261. };
  262. window.ga.l = new Date();
  263. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  264. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
  265. ga('set', 'anonymizeIp', true);
  266. ga('set', 'forceSSL', true);
  267. ga('send', 'pageview');
  268. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  269. tarteaucitron.user.analyticsMore();
  270. }
  271. });
  272. },
  273. "fallback": function () {
  274. "use strict";
  275. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  276. tarteaucitron.cookie.purge(cookies);
  277. }
  278. };
  279. // linkedin
  280. tarteaucitron.services.linkedin = {
  281. "key": "linkedin",
  282. "type": "social",
  283. "name": "Linkedin",
  284. "uri": "https://www.linkedin.com/legal/cookie_policy",
  285. "needConsent": true,
  286. "js": function () {
  287. "use strict";
  288. tarteaucitron.fallback(['tacLinkedin'], '');
  289. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  290. },
  291. "fallback": function () {
  292. "use strict";
  293. 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>');
  294. }
  295. };
  296. // pinterest
  297. tarteaucitron.services.pinterest = {
  298. "key": "pinterest",
  299. "type": "social",
  300. "name": "Pinterest",
  301. "uri": "https://about.pinterest.com/privacy-policy",
  302. "needConsent": true,
  303. "js": function () {
  304. "use strict";
  305. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  306. }
  307. };
  308. // shareaholic
  309. tarteaucitron.services.shareaholic = {
  310. "key": "shareaholic",
  311. "type": "social",
  312. "name": "Shareaholic",
  313. "uri": "https://shareaholic.com/privacy/choices",
  314. "needConsent": true,
  315. "js": function () {
  316. "use strict";
  317. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  318. return;
  319. }
  320. tarteaucitron.fallback(['shareaholic-canvas'], '');
  321. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  322. try {
  323. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  324. } catch (e) {}
  325. });
  326. },
  327. "fallback": function () {
  328. "use strict";
  329. var cookies = ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  330. id = 'shareaholic';
  331. tarteaucitron.cookie.purge(cookies);
  332. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  333. }
  334. };
  335. // sharethis
  336. tarteaucitron.services.sharethis = {
  337. "key": "sharethis",
  338. "type": "social",
  339. "name": "ShareThis",
  340. "uri": "http://www.sharethis.com/legal/privacy/",
  341. "needConsent": true,
  342. "js": function () {
  343. "use strict";
  344. if (tarteaucitron.user.sharethisPublisher === undefined) {
  345. return;
  346. }
  347. var switchTo5x = true,
  348. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  349. tarteaucitron.fallback(['tacSharethis'], '');
  350. tarteaucitron.addScript(uri, '', function () {
  351. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  352. });
  353. },
  354. "fallback": function () {
  355. "use strict";
  356. var cookies = ['__unam'],
  357. id = 'sharethis';
  358. tarteaucitron.cookie.purge(cookies);
  359. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  360. }
  361. };
  362. // twitter
  363. tarteaucitron.services.twitter = {
  364. "key": "twitter",
  365. "type": "social",
  366. "name": "Twitter",
  367. "uri": "https://support.twitter.com/articles/20170514",
  368. "needConsent": true,
  369. "js": function () {
  370. "use strict";
  371. tarteaucitron.fallback(['tacTwitter'], '');
  372. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  373. },
  374. "fallback": function () {
  375. "use strict";
  376. 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>');
  377. }
  378. };
  379. // vimeo
  380. tarteaucitron.services.vimeo = {
  381. "key": "vimeo",
  382. "type": "social",
  383. "name": "Viméo",
  384. "uri": "http://vimeo.com/privacy",
  385. "needConsent": true,
  386. "js": function () {
  387. "use strict";
  388. tarteaucitron.fallback(['vimeo_player'], function (x) {
  389. var video_id = x.getAttribute("videoID"),
  390. video_width = x.getAttribute("width"),
  391. frame_width = 'width=',
  392. video_height = x.getAttribute("height"),
  393. frame_height = 'height=',
  394. video_frame;
  395. if (video_id === undefined) {
  396. return "";
  397. }
  398. if (video_width !== undefined) {
  399. frame_width += '"' + video_width + '" ';
  400. } else {
  401. frame_width += '"" ';
  402. }
  403. if (video_height !== undefined) {
  404. frame_height += '"' + video_height + '" ';
  405. } else {
  406. frame_height += '"" ';
  407. }
  408. video_frame = '<iframe src="//player.vimeo.com/video/' + video_id + '" ' + frame_width + frame_height + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
  409. return video_frame;
  410. });
  411. },
  412. "fallback": function () {
  413. "use strict";
  414. var cookies = ['__utmt_player', '__utma', '__utmb', '__utmc', '__utmv', 'vuid', '__utmz', 'player'],
  415. id = 'vimeo';
  416. tarteaucitron.cookie.purge(cookies);
  417. tarteaucitron.fallback(['vimeo_player'], tarteaucitron.engage(id));
  418. }
  419. };
  420. // xiti
  421. tarteaucitron.services.xiti = {
  422. "key": "xiti",
  423. "type": "analytics",
  424. "name": "Xiti",
  425. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  426. "needConsent": true,
  427. "js": function () {
  428. "use strict";
  429. if (tarteaucitron.user.xitiId === undefined) {
  430. return;
  431. }
  432. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  433. Xt_r,
  434. Xt_h,
  435. Xt_i,
  436. Xt_s,
  437. div = document.createElement('div');
  438. try {
  439. Xt_r = top.document.referrer;
  440. } catch (e) {
  441. Xt_r = document.referrer;
  442. }
  443. Xt_h = new Date();
  444. Xt_i = '<img style="display:none" border="0" alt="" ';
  445. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  446. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  447. if (parseFloat(navigator.appVersion) >= 4) {
  448. Xt_s = screen;
  449. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  450. }
  451. div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  452. document.getElementsByTagName('body')[0].appendChild(div.firstChild);
  453. if (typeof tarteaucitron.user.xitiMore === 'function') {
  454. tarteaucitron.user.xitiMore();
  455. }
  456. },
  457. "fallback": function () {
  458. "use strict";
  459. var cookies = [''];
  460. tarteaucitron.cookie.purge(cookies);
  461. }
  462. };
  463. // youtube
  464. tarteaucitron.services.youtube = {
  465. "key": "youtube",
  466. "type": "social",
  467. "name": "YouTube",
  468. "uri": "https://www.google.fr/intl/fr/policies/privacy/",
  469. "needConsent": true,
  470. "js": function () {
  471. "use strict";
  472. tarteaucitron.fallback(['youtube_player'], function (x) {
  473. var video_id = x.getAttribute("videoID"),
  474. video_width = x.getAttribute("width"),
  475. frame_width = 'width=',
  476. video_height = x.getAttribute("height"),
  477. frame_height = 'height=',
  478. video_frame;
  479. if (video_id === undefined) {
  480. return "";
  481. }
  482. if (video_width !== undefined) {
  483. frame_width += '"' + video_width + '" ';
  484. } else {
  485. frame_width += '"" ';
  486. }
  487. if (video_height !== undefined) {
  488. frame_height += '"' + video_height + '" ';
  489. } else {
  490. frame_height += '"" ';
  491. }
  492. video_frame = '<iframe type="text/html" ' + frame_width + frame_height + ' src="//www.youtube.com/embed/' + video_id + ' " frameborder="0"></iframe>';
  493. return video_frame;
  494. });
  495. },
  496. "fallback": function () {
  497. "use strict";
  498. var cookies = ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],
  499. id = 'youtube';
  500. tarteaucitron.cookie.purge(cookies);
  501. tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
  502. }
  503. };
  504. // zopim
  505. tarteaucitron.services.zopim = {
  506. "key": "zopim",
  507. "type": "social",
  508. "name": "Zopim",
  509. "uri": "https://www.zopim.com/privacy",
  510. "needConsent": true,
  511. "js": function () {
  512. "use strict";
  513. if (tarteaucitron.user.zopimID === undefined) {
  514. return;
  515. }
  516. tarteaucitron.addScript('//v2.zopim.com/?' + tarteaucitron.user.zopimID);
  517. },
  518. "fallback": function () {
  519. "use strict";
  520. var cookies = ['__zlcid', '__zprivacy'];
  521. tarteaucitron.cookie.purge(cookies);
  522. }
  523. };