Skip to content

Commit ba9754a

Browse files
committed
Weibo share button
1 parent 70c424a commit ba9754a

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

APlayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ APlayer.prototype.init = function () {
1818
+ '<div class="aplayer-music">'
1919
+ '<span class="aplayer-title">' + this.option.music.title + '</span>'
2020
+ '<span class="aplayer-author"> - ' + this.option.music.author + '</span>'
21-
+ '<a href="#" title="分享至微博"><i class="demo-icon icon-weibo"></i></a>'
21+
+ '<a href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f=\'http://v.t.sina.com.cn/share/share.php?appkey=2992571369\',u=z||d.location,p=[\'&url=\',e(u),\'&title=\',e(t||d.title),\'&source=\',e(r),\'&sourceUrl=\',e(l),\'&content=\',c||\'gb2312\',\'&pic=\',e(p||\'\')].join(\'\');function%20a(){if(!window.open([f,p].join(\'\'),\'mb\',[\'toolbar=0,status=0,resizable=1,width=440,height=430,left=\',(s.width-440)/2,\',top=\',(s.height-430)/2].join(\'\')))u.href=[f,p].join(\'\');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,\'\',\'\',\'' + this.option.music.pic + '\',\'' + '#APlayer音乐分享# ' + this.option.music.title + ' - ' + this.option.music.author + ' \',\'\',\'\'));" title="分享至微博"><i class="demo-icon icon-weibo"></i></a>'
2222
+ '</div>'
2323
+ '<div class="aplayer-controller">'
2424
+ '<div class="aplayer-bar-wrap">'

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The following HTML structure is used for APlayer:
3131
<script src="APlayer.js"></script>
3232
```
3333

34-
And this is how the jRating is initialized:
34+
And this is how the APlayer is initialized:
3535

3636
```
3737
var ap = new APlayer({
@@ -75,7 +75,8 @@ API
7575

7676
- [x] 播放进度拖拽控制
7777
- [x] 音量控制
78-
- [ ] 分享到微博
78+
- [x] 分享到微博
79+
- [ ] 错误处理
7980
- [ ] 播放列表
8081
- [ ] 歌词展示
8182

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
title: 'Preparation',
1919
author: 'Hans Zimmer/Richard Harvey',
2020
url: 'Preparation.mp3',
21-
pic: 'Preparation.jpg'
21+
pic: 'https://dn-diygod.qbox.me/Preparation.jpg'
2222
}
2323
});
2424
ap.init();

0 commit comments

Comments
 (0)