tarteaucitron.services.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /*global tarteaucitron, ga, Shareaholic, stLight*/
  2. // disqus
  3. tarteaucitron.services.disqus = {
  4. "key": "disqus",
  5. "type": "social",
  6. "name": "Disqus",
  7. "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy",
  8. "needConsent": true,
  9. "js": function () {
  10. "use strict";
  11. if (tarteaucitron.user.disqusShortname === undefined) {
  12. return;
  13. }
  14. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js');
  15. tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js');
  16. }
  17. };
  18. // shareathis
  19. tarteaucitron.services.sharethis = {
  20. "key": "sharethis",
  21. "type": "social",
  22. "name": "ShareThis",
  23. "uri": "http://www.sharethis.com/legal/privacy/",
  24. "needConsent": true,
  25. "js": function () {
  26. "use strict";
  27. if (tarteaucitron.user.sharethisPublisher === undefined) {
  28. return;
  29. }
  30. var switchTo5x = true,
  31. uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js';
  32. tarteaucitron.addScript(uri, '', function () {
  33. stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false});
  34. });
  35. },
  36. "fallback": function () {
  37. "use strict";
  38. var cookies = ['__unam'];
  39. tarteaucitron.cookie.purge(cookies);
  40. }
  41. };
  42. // shareaholic
  43. tarteaucitron.services.shareaholic = {
  44. "key": "shareaholic",
  45. "type": "social",
  46. "name": "Shareaholic",
  47. "uri": "https://shareaholic.com/privacy/choices",
  48. "needConsent": true,
  49. "js": function () {
  50. "use strict";
  51. if (tarteaucitron.user.shareaholicSiteId === undefined) {
  52. return;
  53. }
  54. tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () {
  55. try {
  56. Shareaholic.init(tarteaucitron.user.shareaholicSiteId);
  57. } catch (e) {}
  58. });
  59. },
  60. "fallback": function () {
  61. "use strict";
  62. var cookies = ['__utma', '__utmb', '__utmc', '__utmz'];
  63. tarteaucitron.cookie.purge(cookies);
  64. }
  65. };
  66. // addthis
  67. tarteaucitron.services.addthis = {
  68. "key": "addthis",
  69. "type": "social",
  70. "name": "AddThis",
  71. "uri": "http://www.addthis.com/privacy/privacy-policy#publisher-visitors",
  72. "needConsent": true,
  73. "js": function () {
  74. "use strict";
  75. if (tarteaucitron.user.addthisPubId === undefined) {
  76. return;
  77. }
  78. tarteaucitron.addScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=' + tarteaucitron.user.addthisPubId);
  79. },
  80. "fallback": function () {
  81. "use strict";
  82. var cookies = ['__atuvc'];
  83. tarteaucitron.cookie.purge(cookies);
  84. }
  85. };
  86. // ferank
  87. tarteaucitron.services.ferank = {
  88. "key": "ferank",
  89. "type": "analytics",
  90. "name": "FERank",
  91. "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience",
  92. "needConsent": false,
  93. "js": function () {
  94. "use strict";
  95. tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () {
  96. if (typeof tarteaucitron.user.ferankMore === 'function') {
  97. tarteaucitron.user.ferankMore();
  98. }
  99. });
  100. }
  101. };
  102. // facebook
  103. tarteaucitron.services.facebook = {
  104. "key": "facebook",
  105. "type": "social",
  106. "name": "Facebook",
  107. "uri": "https://www.facebook.com/help/cookies/",
  108. "needConsent": true,
  109. "js": function () {
  110. "use strict";
  111. tarteaucitron.fallback(['fb-like'], '');
  112. tarteaucitron.addScript('//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
  113. },
  114. "fallback": function () {
  115. "use strict";
  116. 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>');
  117. }
  118. };
  119. // google adsense
  120. tarteaucitron.services.adsense = {
  121. "key": "adsense",
  122. "type": "ads",
  123. "name": "Adsense (Google)",
  124. "uri": "http://www.google.com/ads/preferences/",
  125. "needConsent": true,
  126. "js": function () {
  127. "use strict";
  128. tarteaucitron.addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js');
  129. }
  130. };
  131. // google analytics
  132. tarteaucitron.services.analytics = {
  133. "key": "analytics",
  134. "type": "analytics",
  135. "name": "Analytics (Google)",
  136. "uri": "https://support.google.com/analytics/answer/6004245",
  137. "needConsent": true,
  138. "js": function () {
  139. "use strict";
  140. window.GoogleAnalyticsObject = 'ga';
  141. window.ga = window.ga || function () {
  142. window.ga.q = window.ga.q || [];
  143. window.ga.q.push(arguments);
  144. };
  145. window.ga.l = new Date();
  146. tarteaucitron.addScript('//www.google-analytics.com/analytics.js', '', function () {
  147. ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
  148. ga('send', 'pageview');
  149. if (typeof tarteaucitron.user.analyticsMore === 'function') {
  150. tarteaucitron.user.analyticsMore();
  151. }
  152. });
  153. },
  154. "fallback": function () {
  155. "use strict";
  156. var cookies = ['_ga', '_gat', '__utma', '__utmb', '__utmc', '__utmz'];
  157. tarteaucitron.cookie.purge(cookies);
  158. }
  159. };
  160. // google+
  161. tarteaucitron.services.gplus = {
  162. "key": "gplus",
  163. "type": "social",
  164. "name": "Google+",
  165. "uri": "http://www.google.fr/intl/policies/privacy/",
  166. "needConsent": true,
  167. "js": function () {
  168. "use strict";
  169. tarteaucitron.addScript('https://apis.google.com/js/platform.js');
  170. },
  171. "fallback": function () {
  172. "use strict";
  173. 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>');
  174. }
  175. };
  176. // linkedin
  177. tarteaucitron.services.linkedin = {
  178. "key": "linkedin",
  179. "type": "social",
  180. "name": "Linkedin",
  181. "uri": "https://www.linkedin.com/legal/cookie_policy",
  182. "needConsent": true,
  183. "js": function () {
  184. "use strict";
  185. tarteaucitron.fallback(['tacLinkedin'], '');
  186. tarteaucitron.addScript('//platform.linkedin.com/in.js');
  187. },
  188. "fallback": function () {
  189. "use strict";
  190. 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>');
  191. }
  192. };
  193. // pinterest
  194. tarteaucitron.services.pinterest = {
  195. "key": "pinterest",
  196. "type": "social",
  197. "name": "Pinterest",
  198. "uri": "https://about.pinterest.com/privacy-policy",
  199. "needConsent": true,
  200. "js": function () {
  201. "use strict";
  202. tarteaucitron.addScript('//assets.pinterest.com/js/pinit.js');
  203. }
  204. };
  205. // twitter
  206. tarteaucitron.services.twitter = {
  207. "key": "twitter",
  208. "type": "social",
  209. "name": "Twitter",
  210. "uri": "https://support.twitter.com/articles/20170514",
  211. "needConsent": true,
  212. "js": function () {
  213. "use strict";
  214. tarteaucitron.fallback(['tacTwitter'], '');
  215. tarteaucitron.addScript('//platform.twitter.com/widgets.js', 'twitter-wjs');
  216. },
  217. "fallback": function () {
  218. "use strict";
  219. 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>');
  220. }
  221. };