tarteaucitron.services.js 14 KB

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