tarteaucitron.services.js 7.1 KB

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