tarteaucitron.services.js 7.0 KB

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