From 506b3e0446ba1d51d9c4e31b32278fbec8c4a5f9 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Tue, 21 Oct 2014 20:17:00 +0200 Subject: [PATCH] Re-order services --- tarteaucitron.services.js | 229 +++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 114 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 52e3be0..31dd09c 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1,90 +1,5 @@ /*global tarteaucitron, ga, Shareaholic, stLight*/ -// disqus -tarteaucitron.services.disqus = { - "key": "disqus", - "type": "social", - "name": "Disqus", - "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy", - "needConsent": true, - "js": function () { - "use strict"; - if (tarteaucitron.user.disqusShortname === undefined) { - return; - } - tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js'); - tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js'); - }, - "fallback": function () { - "use strict"; - var id = 'disqus'; - - if (document.getElementById('disqus_thread')) { - document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id); - } - } -}; - -// shareathis -tarteaucitron.services.sharethis = { - "key": "sharethis", - "type": "social", - "name": "ShareThis", - "uri": "http://www.sharethis.com/legal/privacy/", - "needConsent": true, - "js": function () { - "use strict"; - if (tarteaucitron.user.sharethisPublisher === undefined) { - return; - } - var switchTo5x = true, - uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js'; - - tarteaucitron.fallback(['tacSharethis'], ''); - tarteaucitron.addScript(uri, '', function () { - stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false}); - }); - }, - "fallback": function () { - "use strict"; - var cookies = ['__unam'], - id = 'sharethis'; - - tarteaucitron.cookie.purge(cookies); - tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id)); - } -}; - -// shareaholic -tarteaucitron.services.shareaholic = { - "key": "shareaholic", - "type": "social", - "name": "Shareaholic", - "uri": "https://shareaholic.com/privacy/choices", - "needConsent": true, - "js": function () { - "use strict"; - if (tarteaucitron.user.shareaholicSiteId === undefined) { - return; - } - - tarteaucitron.fallback(['shareaholic-canvas'], ''); - tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () { - try { - Shareaholic.init(tarteaucitron.user.shareaholicSiteId); - } catch (e) {} - }); - }, - "fallback": function () { - "use strict"; - var cookies = ['__utma', '__utmb', '__utmc', '__utmz'], - id = 'shareaholic'; - - tarteaucitron.cookie.purge(cookies); - tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id)); - } -}; - // addthis tarteaucitron.services.addthis = { "key": "addthis", @@ -110,20 +25,28 @@ tarteaucitron.services.addthis = { } }; -// ferank -tarteaucitron.services.ferank = { - "key": "ferank", - "type": "analytics", - "name": "FERank", - "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience", - "needConsent": false, +// disqus +tarteaucitron.services.disqus = { + "key": "disqus", + "type": "social", + "name": "Disqus", + "uri": "https://help.disqus.com/customer/portal/articles/466259-privacy-policy", + "needConsent": true, "js": function () { "use strict"; - tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () { - if (typeof tarteaucitron.user.ferankMore === 'function') { - tarteaucitron.user.ferankMore(); - } - }); + if (tarteaucitron.user.disqusShortname === undefined) { + return; + } + tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/embed.js'); + tarteaucitron.addScript('//' + tarteaucitron.user.disqusShortname + '.disqus.com/count.js'); + }, + "fallback": function () { + "use strict"; + var id = 'disqus'; + + if (document.getElementById('disqus_thread')) { + document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id); + } } }; @@ -145,6 +68,40 @@ tarteaucitron.services.facebook = { } }; +// ferank +tarteaucitron.services.ferank = { + "key": "ferank", + "type": "analytics", + "name": "FERank", + "uri": "https://www.ferank.fr/respect-vie-privee/#mesureaudience", + "needConsent": false, + "js": function () { + "use strict"; + tarteaucitron.addScript('//static.ferank.fr/pixel.js', '', function () { + if (typeof tarteaucitron.user.ferankMore === 'function') { + tarteaucitron.user.ferankMore(); + } + }); + } +}; + +// google+ +tarteaucitron.services.gplus = { + "key": "gplus", + "type": "social", + "name": "Google+", + "uri": "http://www.google.fr/intl/policies/privacy/", + "needConsent": true, + "js": function () { + "use strict"; + tarteaucitron.addScript('https://apis.google.com/js/platform.js'); + }, + "fallback": function () { + "use strict"; + tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], 'Google+'); + } +}; + // google adsense tarteaucitron.services.adsense = { "key": "adsense", @@ -195,23 +152,6 @@ tarteaucitron.services.analytics = { } }; -// google+ -tarteaucitron.services.gplus = { - "key": "gplus", - "type": "social", - "name": "Google+", - "uri": "http://www.google.fr/intl/policies/privacy/", - "needConsent": true, - "js": function () { - "use strict"; - tarteaucitron.addScript('https://apis.google.com/js/platform.js'); - }, - "fallback": function () { - "use strict"; - tarteaucitron.fallback(['g-page', 'g-plus', 'g-plusone'], 'Google+'); - } -}; - // linkedin tarteaucitron.services.linkedin = { "key": "linkedin", @@ -243,6 +183,67 @@ tarteaucitron.services.pinterest = { } }; + +// shareaholic +tarteaucitron.services.shareaholic = { + "key": "shareaholic", + "type": "social", + "name": "Shareaholic", + "uri": "https://shareaholic.com/privacy/choices", + "needConsent": true, + "js": function () { + "use strict"; + if (tarteaucitron.user.shareaholicSiteId === undefined) { + return; + } + + tarteaucitron.fallback(['shareaholic-canvas'], ''); + tarteaucitron.addScript('//dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic.js', '', function () { + try { + Shareaholic.init(tarteaucitron.user.shareaholicSiteId); + } catch (e) {} + }); + }, + "fallback": function () { + "use strict"; + var cookies = ['__utma', '__utmb', '__utmc', '__utmz'], + id = 'shareaholic'; + + tarteaucitron.cookie.purge(cookies); + tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id)); + } +}; + +// sharethis +tarteaucitron.services.sharethis = { + "key": "sharethis", + "type": "social", + "name": "ShareThis", + "uri": "http://www.sharethis.com/legal/privacy/", + "needConsent": true, + "js": function () { + "use strict"; + if (tarteaucitron.user.sharethisPublisher === undefined) { + return; + } + var switchTo5x = true, + uri = ('https:' === document.location.protocol ? 'https://ws' : 'http://w') + '.sharethis.com/button/buttons.js'; + + tarteaucitron.fallback(['tacSharethis'], ''); + tarteaucitron.addScript(uri, '', function () { + stLight.options({publisher: tarteaucitron.user.sharethisPublisher, doNotHash: false, doNotCopy: false, hashAddressBar: false}); + }); + }, + "fallback": function () { + "use strict"; + var cookies = ['__unam'], + id = 'sharethis'; + + tarteaucitron.cookie.purge(cookies); + tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id)); + } +}; + // twitter tarteaucitron.services.twitter = { "key": "twitter",