PageSourceSearch

https://www.astrocentr.ru/img/bookmarks/vkshare.js?v=2

js astrocentr.ru collected 2026-10-02 03:11:43 UTC 9,739 bytes, 195 lines download raw bytes

1if (!window.VK) window.VK = {};
2if (!VK.Share) {
3VK.Share = {
4_popups: [],
5_gens: [],
6_base_domain: '',
7_ge: function(id) {
8return document.getElementById(id);
9},
10button: function(gen, but, index) {
11if (!gen) gen = {};
12if (gen === gen.toString()) gen = {url: gen.toString()};
13if (!gen.url) gen.url = VK.Share._loc;
14if (!but) but = {type: 'round'};
15if (but === but.toString()) but = {type: 'round', text: but};
16if (!but.text) but.text = '\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c';
17var old = true, count_style = 'display: none', count_width = 22;
18if (index === undefined) {
19gen.count = 0;
20gen.shared = (but.type == 'button' || but.type == 'round') ? false : true;
21this._gens.push(gen);
22this._popups.push(false);
23index = this._popups.length - 1;
24old = false;
25} else {
26if ((gen.count = this._gens[index].count) && (but.type == 'button' || but.type == 'round')) {
27count_style = '';
28count_width = 29;
29}
30gen.shared = this._gens[index].shared;
31this._gens[index] = gen;
32}
33var head = document.getElementsByTagName('head')[0];
34if (!this._base_domain) {
35for (var elem = head.firstChild; elem; elem = elem.nextSibling) {
36var m;
37if (elem.tagName && elem.tagName.toLowerCase() == 'script' && (m = elem.src.match(/(https?:\/\/(?:[a-z0-9_\-\.]*\.)?(?:vk\.com|vkontakte\.ru)\/)js\/api\/share\.js(?:\?|$)/))) {
38this._base_domain = m[1];
39}
40}
41}
42if (!this._base_domain) {
43this._base_domain = 'http://vk.com/';
44}
45if (!old && (but.type == 'button' || but.type == 'round')) {
46var elem = document.createElement('script');
47elem.src = this._base_domain + 'share.php?act=count&index=' + index + '&url=' + encodeURIComponent(gen.url);
48head.appendChild(elem);
49}
50var a = '<a href="'+this._base_domain+'share.php?url='+encodeURIComponent(gen.url)+'" onmouseup="this._btn=event.button;this.blur();" onclick="return VK.Share.click(' + index + ', this);"', a1 = a+' style="text-decoration:none;">', a2='</a>', a3 = a+' style="display:inline-block;text-decoration:none;">', td1 = '<td style="vertical-align: middle;">', td2 = '</td>';
51if (but.type == 'button' || but.type == 'button_nocount') {
52return '<table cellspacing="0" cellpadding="0" id="vkshare' + index + '" onmouseover="VK.Share.change(1, ' + index + ');" onmouseout="VK.Share.change(0, ' + index + ');" onmousedown="VK.Share.change(2, ' + index + ');" onmouseup="VK.Share.change(1, ' + index + ');" style="position: relative; width: auto; border: 0px;"><tr style="line-height: normal;"><td></td>' +
53td1+a1+'<div style="border: 1px solid #3b6798; cursor:pointer;"><div style="border: 1px solid #5c82ab; border-top-color: #7e9cbc; background-color: #6d8fb3; color: #fff; text-shadow: 0px 1px #45688E; height: 15px; padding: 2px 4px 0px 6px; font-size: 10px; font-family: tahoma, arial;">' + but.text + '</div></div>'+a2+td2 +
54td1+a1+'<div style="background: url(https://vk.com/images/btns.png) 0px 0px no-repeat; cursor:pointer; width:' + count_width + 'px; height: 21px"></div>'+a2+td2 +
55td1+a1+'<div style="border: 1px solid #a2b9d3; cursor:pointer; border-left: 0px; background-color: #dee6f1; color:#000; height: 15px; padding: 2px 6px 0px 4px; font-size: 10px; font-weight: bold; font-family: tahoma, arial;' + count_style + '">' + gen.count + '</div>'+a2+td2 +
56'</tr></table>';
57} else if (but.type == 'round' || but.type == 'round_nocount') {
58return '<table cellspacing="0" cellpadding="0" id="vkshare' + index + '" onmouseover="VK.Share.change(1, ' + index + ');" onmouseout="VK.Share.change(0, ' + index + ');" onmousedown="VK.Share.change(2, ' + index + ');" onmouseup="VK.Share.change(1, ' + index + ');" style="position: relative; width: auto; cursor: pointer; border: 0px;"><tr style="line-height: normal;">' +
59td1+a1+'<div style="height: 21px; cursor:pointer; width: 2px; background: url(https://vk.com/images/btns.png) no-repeat -21px -42px;"></div>'+a2+td2 +
60td1+a1+'<div style="border: 1px solid #3b6798; cursor:pointer; border-left: 0px;"><div style="border: 1px solid #5c82ab; border-left: 0px; border-top-color: #7e9cbc; background-color: #6d8fb3; color: #fff; text-shadow: 0px 1px #45688E; height: 15px; padding: 2px 4px 0px 6px; font-family: tahoma, arial; font-size: 10px;">
60' + but.text + '</div></div>'+a2+td2 +
61td1+a1+'<div style="background: url(https://vk.com/images/btns.png) 0px -21px no-repeat; cursor:pointer; width:' + count_width + 'px; height: 21px"></div>'+a2+td2 +
62td1+a1+'<div style="border: 1px solid #a2b9d3; border-width: 1px 0px; cursor:pointer; background-color: #dee6f1; color:#000; height: 15px; padding: 2px 6px 0px 4px; font-size: 10px; font-weight: bold; font-family: tahoma, arial;' + count_style + '">' + gen.count + '</div>'+a2+td2 +
63td1+a1+'<div style="background: url(https://vk.com/images/btns.png) -27px -42px; cursor:pointer; width: 2px; height: 21px;' + count_style + '"></div>'+a2+td2 +
64'</tr></table>';
65} else if (but.type == 'link') {
66return '<table style="position: relative; cursor:pointer; width: auto; line-height: normal;" onmouseover="this.rows[0].cells[1].firstChild.firstChild.style.textDecoration=\'underline\'" onmouseout="this.rows[0].cells[1].firstChild.firstChild.style.textDecoration=\'none\'" cellspacing="0" cellpadding="0"><tr style="line-height: normal;">' +
67td1+a1+'<img src="https://vk.com/images/vk16.png" style="vertical-align: middle;border:0;"/>'+a2+td2 +
68td1+a1+'<span style="padding: 0 0 0 5px; color: #2B587A; font-family: tahoma, arial; font-size: 11px;">' + but.text + '</span>'+a2+td2 +
69'</tr></table>';
70} else if (but.type == 'link_noicon') {
71return a3+'<span style="position: relative; font-family: tahoma, arial; font-size: 11px; color: #2B587A; line-height: normal;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'">' + but.text + '</span>'+a2;
72} else {
73return a3+'<span style="position: relative; padding:0;">' + but.text + '</span>'+a2;
74}
75},
76change: function(state, index) {
77var row = this._ge('vkshare' + index).rows[0];
78var elem = row.cells[1].firstChild.firstChild.firstChild;
79if (state == 0) {
80elem.style.backgroundColor = '#6d8fb3';
81elem.style.borderColor = '#7e9cbc #5c82ab #5c82ab';
82} else if (state == 1) {
83elem.style.backgroundColor = '#84a1bf';
84elem.style.borderColor = '#92acc7 #7293b7 #7293b7';
85} else if (state == 2) {
86elem.style.backgroundColor = '#6688ad';
87elem.style.borderColor = '#51779f #51779f #7495b8';
88}
89var left = row.cells[0].firstChild;
90if (left) {
91if (state == 0) {
92left.style.backgroundPosition = '-21px -42px';
93} else if (state == 1) {
94left.style.backgroundPosition = '-23px -42px';
95} else if (state == 2) {
96left.style.backgroundPosition = '-25px -42px';
97}
98}
99},
100click: function(index, el) {
101var e = window.event;
102if (e) {
103if (!e.which && el._btn) e.which = (el._btn & 1 ? 1 : (el._btn & 2 ? 3 : (el._btn & 4 ? 2 : 0)));
104if (e.which == 2) {
105return true;
106}
107}
108var details = this._gens[index];
109if (!details.shared) {
110VK.Share.count(index, details.count + 1);
111details.shared = true;
112}
113var undefined;
114if (details.noparse === undefined) {
115details.noparse = details.title && details.description && details.image;
116}
117details.noparse = details.noparse ? 1 : 0;
118var params = {url: details.url};
119var fields = ['title', 'description', 'image', 'noparse'];
120for (var i = 0; i < fields.length; ++i) {
121if (details[fields[i]]) {
122params[fields[i]] = details[fields[i]];
123}
124}
125var popupName = '_blank';
126var width = 554;
127var height = 349;
128var left = (screen.width - width) / 2;
129var top = (screen.height - height) / 2;
130var url = this._base_domain + 'share.php';
131var popupParams = 'scrollbars=0, resizable=1, menubar=0, left=' + left + ', top=' + top + ', width=' + width + ', height=' + height + ', toolbar=0, status=0';
132var popup = false;
133try {
134var doc_dom = '', loc_hos = '';
135try {
136doc_dom = document.domain;
137loc_hos = location.host;
138} catch (e) {}
139if (doc_dom != loc_hos) {
140var ua = navigator.userAgent.toLowerCase();
141if (!/opera/i.test(ua) && /msie/i.test(ua)) {
142throw 'wont work';
143}
144}
145popup = this._popups[index] = window.open('', popupName, popupParams);
146var text = '<form accept-charset="UTF-8" action="' + url + '" method="POST" id="share_form">';
147for (var i in params) {
148text += '<input type="hidden" name="' + i + '" value="' + params[i].toString().replace(/"/g, '&myquot;').replace(/&quot/ig, '&myquot') + '" />';
149}
150text += '</form>';
151text += '<script type="text/javascript">document.getElementById("share_form").submit()</script>';
152text = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
153'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">' +
154'<head><meta http-equiv="content-type" content="text/html; charset=windows-1251" /></head>' +
155'<body>
155' + text + '</body></html>';
156popup.document.write(text);
157popup.focus();
158} catch (e) { // ie with changed domain.
159try {
160if (popup) {
161popup.close();
162}
163url += '?';
164for (var i in params) {
165url += encodeURIComponent(i) + '=' + encodeURIComponent(params[i]) + '&';
166}
167popup = this._popups[index] = window.open(url, popupName, popupParams);
168popup.focus();
169} catch (e) {}
170}
171return false;
172},
173count: function(index, count) {
174this._gens[index].count = count;
175var elem = this._ge('vkshare' + index);
176if (elem) {
177var row = elem.rows[0];
178if (count) {
179row.cells[3].firstChild.firstChild.innerHTML = count;
180row.cells[2].firstChild.firstChild.style.width = '29px';
181row.cells[3].firstChild.firstChild.style.display = 'block';
182if (row.cells.length > 4) {
183row.cells[4].firstChild.firstChild.style.display = 'block';
184}
185} else {
186row.cells[2].firstChild.firstChild.style.width = '22px';
187row.cells[3].firstChild.firstChild.style.display = 'none';
188if (row.cells.length > 4) {
189row.cells[4].firstChild.firstChild.style.display = 'none';
190}}}}}
191try {
192VK.Share._loc = location.toString();
193} catch(e) {
194VK.Share._loc = 'http://vkontakte.ru/';
195}}

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.