Merge branch 'master' into flat
commit
1a3ae8cc03
12
Readme.md
12
Readme.md
|
@ -174,6 +174,18 @@ var socialLikesButtons = {
|
|||
};
|
||||
```
|
||||
|
||||
If you know the social network search page's url, you can make a link to results of searching in this network. There are search urls for Twitter and VKontakte by default.
|
||||
|
||||
```javascript
|
||||
var socialLikesButtons = {
|
||||
twitter: {
|
||||
...
|
||||
searchUrl: 'https://twitter.com/search?src=typd&q={url}'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Add some CSS:
|
||||
|
||||
```css
|
||||
|
|
|
@ -50,7 +50,8 @@ var services = {
|
|||
// Add colon to improve readability
|
||||
if (!/[\.:\-–—]\s*$/.test(this.options.pageTitle)) this.options.pageTitle += ':';
|
||||
return true;
|
||||
}
|
||||
},
|
||||
searchUrl: 'https://twitter.com/search?src=typd&q={url}'
|
||||
},
|
||||
mailru: {
|
||||
counterUrl: 'http://connect.mail.ru/share_count?url_list={url}&callback=1&func=?',
|
||||
|
@ -86,7 +87,8 @@ var services = {
|
|||
},
|
||||
popupUrl: 'http://vk.com/share.php?url={url}&title={title}',
|
||||
popupWidth: 550,
|
||||
popupHeight: 330
|
||||
popupHeight: 330,
|
||||
searchUrl: 'http://vk.com/feed?section=search&q=url%3A{url}'
|
||||
},
|
||||
odnoklassniki: {
|
||||
counterUrl: 'http://www.odnoklassniki.ru/dk?st.cmd=shareData&ref={url}&cb=?',
|
||||
|
@ -399,10 +401,13 @@ Button.prototype = {
|
|||
number = parseInt(number, 10);
|
||||
if (!number && !this.options.showZeroes) return;
|
||||
|
||||
var counterElem = $('<span>', {
|
||||
var searchUrl = this.options.searchUrl ? makeUrl(this.options.searchUrl, {url: this.options.pageUrl}) : null;
|
||||
var counterElem = $((this.options.searchUrl ? '<a>' : '<span>'), {
|
||||
'class': this.getElementClassNames('counter'),
|
||||
'text': number
|
||||
'text': number,
|
||||
'href': searchUrl
|
||||
});
|
||||
|
||||
this.widget.append(counterElem);
|
||||
|
||||
this.widget.trigger('counter.' + prefix, [this.service, number]);
|
||||
|
|
|
@ -147,6 +147,13 @@
|
|||
.social-likes__counter_single:after {
|
||||
border-right-color:#f6f6f6;
|
||||
}
|
||||
a.social-likes__counter {
|
||||
cursor: pointer;
|
||||
text-decoration:none;
|
||||
&:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Facebook
|
||||
|
|
Loading…
Reference in New Issue