tarteaucitron.services.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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'],
  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. var clicky_site_ids = clicky_site_ids || [];
  38. clicky_site_ids.push(tarteaucitron.user.clickyId);
  39. tarteaucitron.addScript('//static.getclicky.com/js', function () {
  40. if (typeof tarteaucitron.user.clickyMore === 'function') {
  41. tarteaucitron.user.clickyMore();
  42. }
  43. });
  44. },
  45. "fallback": function () {
  46. "use strict";
  47. var cookies = ['_jsuid', '_eventqueue', '_referrer_og', '_utm_og', '_first_pageview', 'clicky_olark'];
  48. tarteaucitron.cookie.purge(cookies);
  49. }
  50. };
  51. // disqus
  52. tarteaucitron.services.disqus = {
  53. "key": "disqus",
  54. "type": "social",
  55. "name": "Disqus",
  56. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  57. "needConsent": true,
  58. "js": function () {
  59. "use strict";
  60. if (tarteaucitron.user.disqusShortname === undefined) {
  61. return;
  62. }
  63. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  64. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  65. },
  66. "fallback": function () {
  67. "use strict";
  68. var id = 'disqus';
  69. if (document.getElementById('disqus_thread')) {
  70. document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
  71. }
  72. }
  73. };
  74. // facebook
  75. tarteaucitron.services.facebook = {
  76. "key": "facebook",
  77. "type": "social",
  78. "name": "Facebook",
  79. "uri": "https://www.facebook.com/help/cookies/",
  80. "needConsent": true,
  81. "js": function () {
  82. "use strict";
  83. tarteaucitron.fallback(['fb-like'], '');
  84. tarteaucitron.addScript('//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  85. },
  86. "fallback": function () {
  87. "use strict";
  88. 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>');
  89. }
  90. };
  91. // ferank
  92. tarteaucitron.services.ferank = {
  93. "key": "ferank",
  94. "type": "analytics",
  95. "name": "FERank",
  96. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  97. "needConsent": false,
  98. "js": function () {
  99. "use strict";
  100. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  101. if (typeof tarteaucitron.user.ferankMore === 'function') {
  102. tarteaucitron.user.ferankMore();
  103. }
  104. });
  105. }
  106. };
  107. // google+
  108. tarteaucitron.services.gplus = {
  109. "key": "gplus",
  110. "type": "social",
  111. "name": "Google+",
  112. "uri": "http://www.google.fr/intl/policies/privacy/",
  113. "needConsent": true,
  114. "js": function () {
  115. "use strict";
  116. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  117. },
  118. "fallback": function () {
  119. "use strict";
  120. 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>');
  121. }
  122. };
  123. // google adsense
  124. tarteaucitron.services.adsense = {
  125. "key": "adsense",
  126. "type": "ads",
  127. "name": "Adsense (Google)",
  128. "uri": "http://www.google.com/ads/preferences/",
  129. "needConsent": true,
  130. "js": function () {
  131. "use strict";
  132. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  133. },
  134. "fallback": function () {
  135. "use strict";
  136. var id = 'adsense';
  137. tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
  138. }
  139. };
  140. // google analytics
  141. tarteaucitron.services.analytics = {
  142. "key": "analytics",
  143. "type": "analytics",
  144. "name": "Analytics (Google)",
  145. "uri": "https://support.google.com/analytics/answer/6004245",
  146. "needConsent": true,
  147. "js": function () {
  148. "use strict";
  149. window.GoogleAnalyticsObject = 'ga';
  150. window.ga = window.ga || function () {
  151. window.ga.q = window.ga.q || [];
  152. window.ga.q.push(arguments);
  153. };
  154. window.ga.l = new Date();
  155. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  156. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  157. ga('send', 'pageview');
  158. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  159. tarteaucitron.user.analyticsMore();
  160. }
  161. });
  162. },
  163. "grayJs": function () {
  164. "use strict";
  165. window.GoogleAnalyticsObject = 'ga';
  166. window.ga = window.ga || function () {
  167. window.ga.q = window.ga.q || [];
  168. window.ga.q.push(arguments);
  169. };
  170. window.ga.l = new Date();
  171. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  172. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 86400});
  173. ga('set', 'anonymizeIp', true);
  174. ga('set', 'forceSSL', true);
  175. ga('send', 'pageview');
  176. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  177. tarteaucitron.user.analyticsMore();
  178. }
  179. });
  180. },
  181. "fallback": function () {
  182. "use strict";
  183. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmt', '__utmz'];
  184. tarteaucitron.cookie.purge(cookies);
  185. }
  186. };
  187. // linkedin
  188. tarteaucitron.services.linkedin = {
  189. "key": "linkedin",
  190. "type": "social",
  191. "name": "Linkedin",
  192. "uri": "https://www.linkedin.com/legal/cookie_policy",
  193. "needConsent": true,
  194. "js": function () {
  195. "use strict";
  196. tarteaucitron.fallback(['tacLinkedin'], '');
  197. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  198. },
  199. "fallback": function () {
  200. "use strict";
  201. 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>');
  202. }
  203. };
  204. // pinterest
  205. tarteaucitron.services.pinterest = {
  206. "key": "pinterest",
  207. "type": "social",
  208. "name": "Pinterest",
  209. "uri": "https://about.pinterest.com/privacy-policy",
  210. "needConsent": true,
  211. "js": function () {
  212. "use strict";
  213. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  214. }
  215. };
  216. // shareaholic
  217. tarteaucitron.services.shareaholic = {
  218. "key": "shareaholic",
  219. "type": "social",
  220. "name": "Shareaholic",
  221. "uri": "https://shareaholic.com/privacy/choices",
  222. "needConsent": true,
  223. "js": function () {
  224. "use strict";
  225. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  226. return;
  227. }
  228. tarteaucitron.fallback(['shareaholic-canvas'], '');
  229. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  230. try {
  231. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  232. } catch (e) {}
  233. });
  234. },
  235. "fallback": function () {
  236. "use strict";
  237. var cookies = ['__utma', '__utmb', '__utmc', '__utmz'],
  238. id = 'shareaholic';
  239. tarteaucitron.cookie.purge(cookies);
  240. tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
  241. }
  242. };
  243. // sharethis
  244. tarteaucitron.services.sharethis = {
  245. "key": "sharethis",
  246. "type": "social",
  247. "name": "ShareThis",
  248. "uri": "http://www.sharethis.com/legal/privacy/",
  249. "needConsent": true,
  250. "js": function () {
  251. "use strict";
  252. if (tarteaucitron.user.sharethisPublisher === undefined) {
  253. return;
  254. }
  255. var switchTo5x = true,
  256. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  257. tarteaucitron.fallback(['tacSharethis'], '');
  258. tarteaucitron.addScript(uri, '', function () {
  259. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  260. });
  261. },
  262. "fallback": function () {
  263. "use strict";
  264. var cookies = ['__unam'],
  265. id = 'sharethis';
  266. tarteaucitron.cookie.purge(cookies);
  267. tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
  268. }
  269. };
  270. // twitter
  271. tarteaucitron.services.twitter = {
  272. "key": "twitter",
  273. "type": "social",
  274. "name": "Twitter",
  275. "uri": "https://support.twitter.com/articles/20170514",
  276. "needConsent": true,
  277. "js": function () {
  278. "use strict";
  279. tarteaucitron.fallback(['tacTwitter'], '');
  280. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  281. },
  282. "fallback": function () {
  283. "use strict";
  284. 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>');
  285. }
  286. };
  287. // xiti
  288. tarteaucitron.services.xiti = {
  289. "key": "xiti",
  290. "type": "analytics",
  291. "name": "Xiti",
  292. "uri": "http://www.atinternet.com/politique-du-respect-de-la-vie-privee/",
  293. "needConsent": true,
  294. "js": function () {
  295. "use strict";
  296. if (tarteaucitron.user.xitiId === undefined || document.getElementById('xitiTac') === undefined) {
  297. return;
  298. }
  299. var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
  300. Xt_r,
  301. Xt_h,
  302. Xt_i,
  303. Xt_s;
  304. try {
  305. Xt_r = top.document.referrer;
  306. } catch (e) {
  307. Xt_r = document.referrer;
  308. }
  309. Xt_h = new Date();
  310. Xt_i = '<img width="39" height="25" border="0" alt="" ';
  311. Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
  312. Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
  313. if (parseFloat(navigator.appVersion) >= 4) {
  314. Xt_s = screen;
  315. Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth;
  316. }
  317. document.getElementById('xitiTac').innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">';
  318. if (typeof tarteaucitron.user.xitiMore === 'function') {
  319. tarteaucitron.user.xitiMore();
  320. }
  321. },
  322. "fallback": function () {
  323. "use strict";
  324. var cookies = [''];
  325. tarteaucitron.cookie.purge(cookies);
  326. }
  327. };