tarteaucitron.services.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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/fr_FR/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
  142. tarteaucitron.services.analytics = {
  143. "key": "analytics",
  144. "type": "analytics",
  145. "name": "Analytics (Google)",
  146. "uri": "https://support.google.com/analytics/answer/6004245",
  147. "needConsent": true,
  148. "js": function () {
  149. "use strict";
  150. window.GoogleAnalyticsObject = 'ga';
  151. window.ga = window.ga || function () {
  152. window.ga.q = window.ga.q || [];
  153. window.ga.q.push(arguments);
  154. };
  155. window.ga.l = new Date();
  156. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  157. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  158. ga('send', 'pageview');
  159. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  160. tarteaucitron.user.analyticsMore();
  161. }
  162. });
  163. },
  164. "grayJs": function () {
  165. "use strict";
  166. window.GoogleAnalyticsObject = 'ga';
  167. window.ga = window.ga || function () {
  168. window.ga.q = window.ga.q || [];
  169. window.ga.q.push(arguments);
  170. };
  171. window.ga.l = new Date();
  172. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  173. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
  174. ga('set', 'anonymizeIp', true);
  175. ga('set', 'forceSSL', true);
  176. ga('send', 'pageview');
  177. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  178. tarteaucitron.user.analyticsMore();
  179. }
  180. });
  181. },
  182. "fallback": function () {
  183. "use strict";
  184. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  185. tarteaucitron.cookie.purge(cookies);
  186. }
  187. };
  188. // linkedin
  189. tarteaucitron.services.linkedin = {
  190. "key": "linkedin",
  191. "type": "social",
  192. "name": "Linkedin",
  193. "uri": "https://www.linkedin.com/legal/cookie_policy",
  194. "needConsent": true,
  195. "js": function () {
  196. "use strict";
  197. tarteaucitron.fallback(['tacLinkedin'], '');
  198. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  199. },
  200. "fallback": function () {
  201. "use strict";
  202. 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>');
  203. }
  204. };
  205. // pinterest
  206. tarteaucitron.services.pinterest = {
  207. "key": "pinterest",
  208. "type": "social",
  209. "name": "Pinterest",
  210. "uri": "https://about.pinterest.com/privacy-policy",
  211. "needConsent": true,
  212. "js": function () {
  213. "use strict";
  214. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  215. }
  216. };
  217. // shareaholic
  218. tarteaucitron.services.shareaholic = {
  219. "key": "shareaholic",
  220. "type": "social",
  221. "name": "Shareaholic",
  222. "uri": "https://shareaholic.com/privacy/choices",
  223. "needConsent": true,
  224. "js": function () {
  225. "use strict";
  226. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  227. return;
  228. }
  229. tarteaucitron.fallback(['shareaholic-canvas'], '');
  230. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  231. try {
  232. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  233. } catch (e) {}
  234. });
  235. },
  236. "fallback": function () {
  237. "use strict";
  238. var cookies = ['__utma', '__utmb', '__utmc', '__utmz', '__utmt_Shareaholic%20Pageviews'],
  239. id = 'shareaholic';
  240. tarteaucitron.cookie.purge(cookies);
  241. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  242. }
  243. };
  244. // sharethis
  245. tarteaucitron.services.sharethis = {
  246. "key": "sharethis",
  247. "type": "social",
  248. "name": "ShareThis",
  249. "uri": "http://www.sharethis.com/legal/privacy/",
  250. "needConsent": true,
  251. "js": function () {
  252. "use strict";
  253. if (tarteaucitron.user.sharethisPublisher === undefined) {
  254. return;
  255. }
  256. var switchTo5x = true,
  257. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  258. tarteaucitron.fallback(['tacSharethis'], '');
  259. tarteaucitron.addScript(uri, '', function () {
  260. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  261. });
  262. },
  263. "fallback": function () {
  264. "use strict";
  265. var cookies = ['__unam'],
  266. id = 'sharethis';
  267. tarteaucitron.cookie.purge(cookies);
  268. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  269. }
  270. };
  271. // twitter
  272. tarteaucitron.services.twitter = {
  273. "key": "twitter",
  274. "type": "social",
  275. "name": "Twitter",
  276. "uri": "https://support.twitter.com/articles/20170514",
  277. "needConsent": true,
  278. "js": function () {
  279. "use strict";
  280. tarteaucitron.fallback(['tacTwitter'], '');
  281. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  282. },
  283. "fallback": function () {
  284. "use strict";
  285. 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>');
  286. }
  287. };
  288. // xiti
  289. tarteaucitron.services.xiti = {
  290. "key": "xiti",
  291. "type": "analytics",
  292. "name": "Xiti",
  293. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  294. "needConsent": true,
  295. "js": function () {
  296. "use strict";
  297. if (tarteaucitron.user.xitiId === undefined || document.getElementById('xitiTac') === undefined) {
  298. return;
  299. }
  300. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  301. Xt_r,
  302. Xt_h,
  303. Xt_i,
  304. Xt_s;
  305. try {
  306. Xt_r = top.document.referrer;
  307. } catch (e) {
  308. Xt_r = document.referrer;
  309. }
  310. Xt_h = new Date();
  311. Xt_i = '<img width="39" height="25" border="0" alt="" ';
  312. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  313. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  314. if (parseFloat(navigator.appVersion) >= 4) {
  315. Xt_s = screen;
  316. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  317. }
  318. document.getElementById('xitiTac').innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  319. if (typeof tarteaucitron.user.xitiMore === 'function') {
  320. tarteaucitron.user.xitiMore();
  321. }
  322. },
  323. "fallback": function () {
  324. "use strict";
  325. var cookies = [''];
  326. tarteaucitron.cookie.purge(cookies);
  327. }
  328. };