tarteaucitron.services.js 17 KB

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