tarteaucitron.services.js 9.5 KB

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