PageSourceSearch

https://habere-poche.fr/wp-content/themes/citygov/fw/js/social/social-share.js

js habere-poche.fr collected 2026-10-02 23:20:04 UTC 3,804 bytes, 106 lines download raw bytes

1(function ($) {
2    "use strict";
3	$(function () {
4		$('.sc_socials_share a:not(.inited)').each(function (idx) {
5			var el = $(this).addClass('inited'),
6				cnt = el.data('count'),
7				u = el.data('url'),					// share url
8				z = el.data("zero-counter");		// show zero counter
9			if (!u) u = location.href;
10			if (!z) z = 1;
11			if (cnt == "delicious") {
12				function delicious_count(url) {
13					var shares;
14					$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?callback=?&url=' + url, function (data) {
15						shares = data[0] ? data[0].total_posts : 0;
16						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
17					});
18				}
19				delicious_count(u);
20			} else if (cnt == "facebook") {
21				function fb_count(url) {
22					var shares;
23					$.getJSON('http://graph.facebook.com/?callback=?&ids=' + url, function (data) {
24						shares = data[url] && data[url].shares ? data[url].shares : 0;
25						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
26					})
27				}
28				fb_count(u);
29			} else if (cnt == "linkedin") {
30				function lnkd_count(url) {
31					var shares;
32					$.getJSON('http://www.linkedin.com/countserv/count/share?callback=?&url=' + url, function (data) {
33						shares = data.count;
34						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
35					})
36				}
37				lnkd_count(u);
38			} else if (cnt == "mail") {
39				function mail_count(url) {
40					var shares;
41					$.getJSON('http://connect.mail.ru/share_count?callback=1&func=?&url_list=' + url, function (data) {
42						shares = data.hasOwnProperty(url) ? data[url].shares : 0;
43						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
44					})
45				}
46	            mail_count(u);
47			} else if (cnt == "odnoklassniki") {
48				function odkl_count(url) {
49					var shares;
50					$.getScript('http://www.odnoklassniki.ru/dk?st.cmd=extLike&uid=' + idx + '&ref=' + url);
51					if (!window.ODKL) window.ODKL = {};
52					window.ODKL.updateCount = function (idx, number) {
53						shares = number;
54						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
55					}
56				}
57				odkl_count(u);
58			} else if (cnt == "pinterest") {
59				function pin_count(url) {
60					var shares;
61					$.getJSON('http://api.pinterest.com/v1/urls/count.json?callback=?&url=' + url, function (data) {
62						shares = data.count;
63						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
64					})
65				}
66				pin_count(u);
67			} else if (cnt == "twitter") {
68				function twi_count(url) {
69					var shares;
70					$.getJSON('http://urls.api.twitter.com/1/urls/count.json?callback=?&url=' + url, function (data) {
71						shares = data.count;
72						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
73					})
74				}
75				twi_count(u);
76			} else if (cnt == "vk" || cnt == "vk2") {
77				function vk_count(url) {
78					var shares;
79					$.getScript('http://vk.com/share.php?act=count&index=' + idx + '&url=' + url);
80					if (!window.VK) window.VK = {};
81					window.VK.Share = {
82						count: function (idx, number) {
83							shares = number;
84						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
85						}
86					}
87				}
88				vk_count(u);
89			} else if (cnt == "ya") {
90				function ya_count(url) {
91					if (!window.Ya) window.Ya = {};
92					window.Ya.Share = {
93						showCounter: function (number) {
94							window.yaShares = number
95						}
96					};
97					$.getScript('http://wow.ya.ru/ajax/share-counter.xml?url=' + url, function () {
98						var shares = window.yaShares;
99						if (shares > 0 || z == 1) el.after('<span class="share_counter">' + shares + '</span>')
100					})
101				}
102				ya_count(u);
103			}
104        })
105    })
106})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.