Javascript.RU

Создать новую тему Ответ
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 21.12.2016, 18:17
Интересующийся
Отправить личное сообщение для Eadweard Посмотреть профиль Найти все сообщения от Eadweard
 
Регистрация: 16.02.2016
Сообщений: 19

Поделиться в соц. сети.
Подключил на сайт скрипт:
!function(e,t,o){e(t).ready(function(){goodshare={doit:function(o,a){var n=goodshare,i=e.extend({type:"vk",url:location.href,title:t.title,image:e('meta[property="og:image"]').attr("content"),text:""!=e('meta[property="og:description"]').attr("content")?e('meta[property="og:description"]').attr("content"):e('meta[name="description"]').attr("content")},e(o).data(),a);return null===n.popup(link=n[i.type](i))?e(o).is("a")?(e(o).prop("href",link),!0):(location.href=link,!1):!1},vk:function(o){var a=e.extend({url:location.href,title:t.title,image:"",text:""},o);return"http://vk.com/share.php?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)+"&description="+encodeURIComponent(a.text)+"&image="+encodeURIComponent(a.image)+"&noparse=true"},ok:function(t){var o=e.extend({url:location.href,text:""},t);return"http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st.comments="+encodeURIComponent(o.text)+"&st._surl="+encodeURIComponent(o.url)},fb:function(o){var a=e.extend({url:location.href,title:t.title,image:"",text:""},o);return"http://www.facebook.com/sharer.php?s=100&p[title]="+encodeURIComponent(a.title)+"&p[summary]="+encodeURIComponent(a.text)+"&p[url]="+encodeURIComponent(a.url)+"&p[images][0]="+encodeURIComponent(a.image)},lj:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://livejournal.com/update.bml?subject="+encodeURIComponent(a.title)+"&event="+encodeURIComponent('<a href="'+a.url+'">'+a.title+"</a> "+a.text)+"&transform=1"},tw:function(o){var a=e.extend({url:location.href,title:t.title},o);return"http://twitter.com/share?text="+encodeURIComponent(a.title)+"&url="+encodeURIComponent(a.url)},gp:function(t){var o=e.extend({url:location.href},t);return"https://plus.google.com/share?url="+encodeURIComponent(o.url)},mr:function(o){var a=e.extend({url:location.href,title:t.title,image:"",text:""},o);return"http://connect.mail.ru/share?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)+"&description="+encodeURIComponent(a.text)+"&imageurl="+encodeURIComponent(a.image)},li:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)+"&summary="+encodeURIComponent(a.text)},tm:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://www.tumblr.com/share/link?url="+encodeURIComponent(a.url)+"&name="+encodeURIComponent(a.title)+"&description="+encodeURIComponent(a.text)},bl:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"https://www.blogger.com/blog-this.g?u="+encodeURIComponent(a.url)+"&n="+encodeURIComponent(a.title)},pt:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"https://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(a.url)+"&description="+encodeURIComponent(a.title)},en:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"https://www.evernote.com/clip.action?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)+"&body="+encodeURIComponent(a.text+'<br/><a href="'+a.url+'">'+a.title+"</a>")},di:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://digg.com/submit?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)},yz:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://zakladki.yandex.ru/newlink.xml?url="+encodeURIComponent(a.url)+"&name="+encodeURIComponent(a.title)+"&descr="+encodeURIComponent(a.text)},rd:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://www.reddit.com/submit?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)},sb:function(o){var a=e.extend({url:location.href,title:t.title,text:""},o);return"http://surfingbird.ru/share?url="+encodeURIComponent(a.url)+"&title="+encodeURIComponent(a.title)},popup:function(e){return o.open(e,"","toolbar=0,status=0,scrollbars=1,width=626,height=436")}},e(t).on("click",".revoshare",function(e){e.preventDefault(),goodshare.doit(this)})})}(jQuery,document,window);
//# sourceMappingURL=goodshare.min.js.map


Всё работает, но есть нюанс. При репосте он хватает любую картинку и вставляет её, также пустое описание. Пытался добавить, и только разрушал скрипт Можно мне пальцем тыкнуть, где всё задать, пока для ВК (какая именно картинка появляется, какой именно текст).
Ответить с цитированием
  #2 (permalink)  
Старый 22.12.2016, 08:24
Интересующийся
Отправить личное сообщение для Eadweard Посмотреть профиль Найти все сообщения от Eadweard
 
Регистрация: 16.02.2016
Сообщений: 19

Разобрался. Помощь больше не нужна. Спасибо, что заходили и читали)
Ответить с цитированием
Ответ


Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Поделиться новостью ivt32 Элементы интерфейса 2 20.01.2014 13:29
кнопка "загрузить еще" как в соц сети okapo AJAX и COMET 4 14.04.2013 01:36
кросспост в соц сети mcavalon AJAX и COMET 1 19.12.2012 15:45
Вход через соц сети Zoxan111111111 Оффтопик 4 08.09.2012 17:57
HELP!!! У меня проблема с соц. сетью Вконтакте, причиною является "JavaScript error" Mixa Общие вопросы Javascript 1 14.07.2012 14:42