tarteaucitron.services.js 8.6 KB

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