tarteaucitron.services.js 8.6 KB

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