1$(function uil_init_share_buttons() { 2 3 var SHARE = { 4 odnoklassniki: function (purl, ptitle, pimg, text) { 5 var url = 'https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.cmd=WidgetSharePreview&st._aid=ExternalShareWidget_SharePreview'; 6 url += '&st.shareUrl=' + encodeURIComponent(purl); 7 if (text) 8 url += '&st.comments=' + encodeURIComponent(text); 9 if (pimg) 10 url += '&st.imageUrl=' + encodeURIComponent(pimg); 11 else 12 url += '&st.imageUrl=none'; 13 return { 14 'url': url, 15 'callback': function (href) { 16 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 17 return false; 18 } 19 }; 20 }, 21 vkontakte: function (purl, ptitle, pimg, text) { 22 var url = 'https://vk.com/share.php'; 23 url += '?url=' + encodeURIComponent(purl); 24 if (ptitle) 25 url += '&title=' + encodeURIComponent(ptitle); 26 if (pimg) 27 url += '&image=' + encodeURIComponent(pimg); 28 url += '&noparse=true'; 29 return { 30 'url': url, 31 'callback': function (href) { 32 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 33 return false; 34 } 35 }; 36 }, 37 moimir: function (purl, ptitle, pimg, text) { 38 var url = 'https://connect.mail.ru/share?'; 39 url += 'url=' + encodeURIComponent(purl); 40 if (ptitle) 41 url += '&title=' + encodeURIComponent(ptitle); 42 if (text) 43 url += '&description=' + encodeURIComponent(text); 44 if (pimg) 45 url += '&imageurl=' + encodeURIComponent(pimg); 46 return { 47 'url': url, 48 'callback': function (href) { 49 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 50 return false; 51 } 52 }; 53 }, 54 lj: function (purl, ptitle, pimg, text) { 55 var url = 'https://www.livejournal.com/update.bml'; 56 url += '?event=' + encodeURIComponent(purl); 57 if (ptitle) 58 url += '&subject=' + encodeURIComponent(ptitle); 59 return { 60 'url': url, 61 'callback': false 62 }; 63 }, 64 telegram: function (purl, ptitle, pimg, text) { 65 var url = 'https://t.me/share/url'; 66 url += '?url=' + encodeURIComponent(purl); 67 if (text) 68 url += '&text=' + encodeURIComponent(text); 69 return { 70 'url': url, 71 'callback': function (href) { 72 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 73 return false; 74 } 75 }; 76 }, 77 whatsapp: function (purl, ptitle, pimg, text) { 78 var url = 'https://api.whatsapp.com/send'; 79 url += '?text=' + encodeURIComponent(purl); 80 if (text) 81 url += ' â ' + encodeURIComponent(text); 82 return { 83 'url': url, 84 'callback': function (href) { 85 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 86 return false; 87 } 88 }; 89 }, 90 messenger: function (purl, ptitle, pimg, text) { 91 var url = 'https://yandex.ru/chat'; 92 url += '?text=' + encodeURIComponent(purl); 93 if (text) 94 url += ' â ' + encodeURIComponent(text); 95 url += '#/forward'; 96 return { 97 'url': url, 98 'callback': function (href) { 99 window.open(href, '', 'toolbar=0,status=0,width=800,height=600'); 100 return false; 101 } 102 }; 103 }, 104 }; 105 106 var $head = $('head'); 107 var title = $head.find('meta[property="og:title"]').attr('content'); 108 var description = $head.find('meta[property="og:description"]').attr('content'); 109 var url = $head.find('meta[property="og:url"]').attr('content'); 110 var image = $head.find('meta[property="og:image"]').attr('content'); 111 112 if (url === undefined) 113 url = location.href; 114 115 function init($root) { 116 $root.find('a[data-uil-share-buttons]').each(function () { 117 var $link = $(this); 118 var name = $link.attr('data-uil-share-buttons'); 119 if (name in SHARE) { 120 var data = SHARE[name](url, title, image, description); 121 $link.attr('target', '_blank').attr('href', data['url']); 122 if (typeof data['callback'] === 'function') 123 $link.click(function () { 124 return data['callback'](this.href); 125 }); 126 } else { 127 $link.hide(); 128 } 129 }); 130 } 131 132 $(document).on('inova_popup.set_html:after', function () { 133 init(inova_popup.content); 134 }); 135 136 init($(document)); 137 138});
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.