tarteaucitron.services.js 20 KB

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