Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support weibo ralatUid option (like Twitter via). Case sensitive param!

  • Loading branch information...
commit 6c6dcc5360fed865067db1b8792f9dba2e67a413 1 parent 0889f14
@monospaced monospaced authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 extensions/socialite.weibo.js
View
23 extensions/socialite.weibo.js
@@ -7,6 +7,7 @@
(function(window, document, Socialite, undefined)
{
// External documentation URLs
+ // http://open.weibo.com/sharebutton
Socialite.setup({
weibo: {
@@ -24,19 +25,20 @@
Socialite.processInstance(instance);
var src = 'http://hits.sinajs.cn/A1/weiboshare.html?',
data = {
- url : instance.el.getAttribute('data-url') || location.href,
- title : instance.el.getAttribute('data-title') || document.title,
- type : instance.el.getAttribute('data-type') || '6',
- language : Socialite.settings.weibo.language,
- appkey : Socialite.settings.weibo.appkey,
- rnd : new Date().valueOf()
+ url : instance.el.getAttribute('data-url') || location.href,
+ title : instance.el.getAttribute('data-title') || document.title,
+ type : instance.el.getAttribute('data-type') || '6',
+ ralateUid : instance.el.getAttribute('data-ralateuid') || '',
+ language : Socialite.settings.weibo.language,
+ appkey : Socialite.settings.weibo.appkey,
+ rnd : new Date().valueOf()
},
width = parseInt(instance.el.getAttribute('data-width'), 10),
height = parseInt(instance.el.getAttribute('data-height'), 10),
params = [];
for (var a in data) {
- params.push(a + '=' + encodeURIComponent( data[a] || '' ));
+ params.push(a + '=' + encodeURIComponent(data[a] || ''));
}
src += params.join('&') + '&';
@@ -44,8 +46,7 @@
instance.el.setAttribute('data-url', '');
instance.el.setAttribute('data-title', '');
instance.el.setAttribute('data-type', '');
- instance.el.setAttribute('data-langauge', '');
- instance.el.setAttribute('data-appkey', '');
+ instance.el.setAttribute('data-ralateuid', '');
instance.el.setAttribute('data-width', '');
instance.el.setAttribute('data-height', '');
instance.el.setAttribute('data-default-href', '');
@@ -54,8 +55,8 @@
src += Socialite.getDataAttributes(instance.el, true);
var iframe = Socialite.createIframe(src, instance);
- iframe.style.width = (isNaN(width) ? 84 : width) + 'px';
- iframe.style.height = (isNaN(height) ? 18 : height) + 'px';
+ iframe.style.width = (isNaN(width) ? 86 : width) + 'px';
+ iframe.style.height = (isNaN(height) ? 16 : height) + 'px';
instance.el.appendChild(iframe);
Socialite.activateInstance(instance);
Please sign in to comment.
Something went wrong with that request. Please try again.