tarteaucitron.services.js 19 KB

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