diff --git a/README.md b/README.md index 0640f40..9777ddc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Listen 1 (Chrome Extension) (五一先行版) +Listen 1 (Chrome Extension) (最后更新于5月8日) ========== [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) @@ -26,6 +26,20 @@ Listen 1 (Chrome Extension) (五一先行版) 3. 选择 `加载已解压的扩展程序`(如果没有显示先选中`开发者模式`),选中解压后的文件夹,完成! +更新日志 +------- +`2016-05-08` + +* 增加歌词显示 +* 精选歌单:添加歌单到当前播放列表,可点击跳转到原始链接 +* 修复了循环播放网易歌曲一段时间后暂停的bug +* 修复了可能导致微信公众号无法登录的bug +* 优化性能,删除了不必要的事件消息触发 + +`2016-05-02` + +* 增加音量控制 + TODO ---- 加入我的歌单功能(如迫不及待需要,可以安装Listen 1非插件版) diff --git a/css/player.css b/css/player.css index 9afb08b..ee7f93c 100644 --- a/css/player.css +++ b/css/player.css @@ -496,15 +496,18 @@ em, i { _bottom: 90px; right: 0px; _right: 0px; - width: 60%; - height: 301px; + height: 330px; + width: 100%; background-color: #121212; } .m-playbar .menu ul { + display: inline-block; padding-left: 0px; - height: 270px; - overflow: auto; + height: 290px; + overflow-y: scroll; + width: 60%; + margin-bottom: 0px; } .m-playbar .menu li { @@ -513,6 +516,28 @@ em, i { display: block; } +.m-playbar .menu .lyric { + text-align: center; + width: 39%; + display: inline-block; + height: 290px; + overflow-y: scroll; + position: relative; +} + +.m-playbar .menu .lyric p{ + min-height: 20px; +} + +.m-playbar .menu .lyric .placeholder{ + height: 50px; +} + +.m-playbar .menu .lyric .highlight{ + font-size: 15px; + color: #ffffff; +} + .m-playbar .menu .playing { background-color: #555555; } @@ -522,8 +547,8 @@ em, i { } .m-playbar .menu .icn-remove { - height: 25px; - width: 25px; + height: 20px; + width: 20px; background-position: -75px -25px; display: inline-block; } @@ -544,15 +569,37 @@ li { } .menu-header { - height: 28px; - background-color: #121212; + height: 40px; + background-color: #222222; padding-top: 4px; text-align: center; } +.menu-header span { + position: absolute; + left: 19px; + top: 7px; + font-size: 18px; + color: #ffffff; +} + .menu .remove-all { + display: inline-block; + position: absolute; + left: 113px; + top: 9px; +} + +.menu .close-popup { float:right; - margin-right: 10px; + margin-right: 14px; + font-size: 20px; + text-decoration: none; + color: #aaaaaa; +} + +.menu .close-popup:hover { + color: #ffffff; } .menu .title { @@ -636,23 +683,40 @@ li { text-align: center; } -.playlist-detail .detail-head-title .play { +.playlist-detail .detail-head-title a { display: inline-block; text-indent: -9999px; width: 36px; height: 36px; margin-right: 8px; margin-top: 0; - background-position-x: 0; background: url(../images/player_large.png) no-repeat 0 9999px; +} + +.playlist-detail .detail-head-title .play { background-position: 0px 0px; } .playlist-detail .detail-head-title .play:hover { - background: url(../images/player_large.png) no-repeat 0 9999px; background-position: 0px -36px; } +.playlist-detail .detail-head-title .add { + background-position: -216px 0px; +} + +.playlist-detail .detail-head-title .add:hover { + background-position: -216px -36px; +} + +.playlist-detail .detail-head-title .link { + background-position: -256px 0px; +} + +.playlist-detail .detail-head-title .link:hover { + background-position: -256px -36px; +} + .playlist-detail .detail-head-title .delete { display: inline-block; text-indent: -9999px; diff --git a/images/player_large.png b/images/player_large.png index f68dd09..a286317 100644 Binary files a/images/player_large.png and b/images/player_large.png differ diff --git a/js/app.js b/js/app.js index cb2443f..3262634 100644 --- a/js/app.js +++ b/js/app.js @@ -72,6 +72,7 @@ $scope.resetWindow = function() { $scope.cover_img_url = 'images/loading.gif'; $scope.playlist_title = ''; + $scope.playlist_source_url = ''; $scope.songs = []; }; @@ -89,6 +90,7 @@ $scope.songs = data.tracks; $scope.cover_img_url = data.info.cover_img_url; $scope.playlist_title = data.info.title; + $scope.playlist_source_url = data.info.source_url; $scope.list_id = data.info.id; $scope.is_mine = data.is_mine; }); @@ -112,6 +114,7 @@ $scope.songs = data.tracks; $scope.cover_img_url = data.info.cover_img_url; $scope.playlist_title = data.info.title; + $scope.playlist_source_url = data.info.source_url; }); } }; @@ -277,19 +280,34 @@ $scope.current_list_id = list_id; }; - $scope.$on('player:playlist', function(event, data) { - localStorage.setObject('current-playing', data); - }); + $scope.playMylist = function(list_id){ + $timeout(function(){ + angularPlayer.clearPlaylist(function(data) { + //add songs to playlist + angularPlayer.addTrackArray($scope.songs); + var index = 0; + if (angularPlayer.getShuffle()) { + var max = $scope.songs.length - 1; + var min = 0; + index = Math.floor(Math.random() * (max - min + 1)) + min; + } + //play first song + angularPlayer.playTrack($scope.songs[index].id); + }); + }, 0); + $scope.setCurrentList(list_id); + }; - $scope.$on('track:id', function(event, data) { - var current = localStorage.getObject('player-settings'); - current.nowplaying_track_id = data; - localStorage.setObject('player-settings', current); - }); + $scope.addMylist = function(list_id){ + $timeout(function(){ + //add songs to playlist + angularPlayer.addTrackArray($scope.songs); + Notification.success("添加到当前播放成功"); + }, 0); + }; }]); - app.controller('PlayController', ['$scope', '$timeout','$log', '$anchorScroll', '$location', 'angularPlayer', '$http', '$httpParamSerializerJQLike','$rootScope', 'Notification','loWeb', @@ -299,6 +317,8 @@ $scope.volume = angularPlayer.getVolume(); $scope.mute = angularPlayer.getMuteStatus(); $scope.settings = {"playmode": 0, "nowplaying_track_id": -1}; + $scope.lyricArray = []; + $scope.lyricLineNumber = -1; $scope.loadLocalSettings = function() { var defaultSettings = {"playmode": 0, "nowplaying_track_id": -1, "volume": 90}; @@ -419,23 +439,7 @@ angularPlayer.mute(); } - $scope.playmylist = function(list_id){ - $timeout(function(){ - angularPlayer.clearPlaylist(function(data) { - //add songs to playlist - angularPlayer.addTrackArray($scope.songs); - var index = 0; - if (angularPlayer.getShuffle()) { - var max = $scope.songs.length - 1; - var min = 0; - index = Math.floor(Math.random() * (max - min + 1)) + min; - } - //play first song - angularPlayer.playTrack($scope.songs[index].id); - }); - }, 0); - $scope.setCurrentList(list_id); - }; + $scope.removemylist = function(list_id){ var url = '/remove_myplaylist'; @@ -494,6 +498,116 @@ $scope.$on('music:mute', function (event, data) { $scope.mute = data; }); + + $scope.$on('player:playlist', function(event, data) { + localStorage.setObject('current-playing', data); + }); + + function parseLyric(lyric) { + var lines = lyric.split('\n'); + var result = []; + var timeResult = []; + var timeRegResult = null; + + function rightPadding(str, length, padChar) { + var newstr = str; + for (var i=0; i< length - str.length; i++) { + newstr += padChar; + } + return newstr; + } + + for (var i=0; i keyB) return 1; + return 0; + }); + + // disable tag info, because music provider always write + // tag info in lyric timeline. + //result.push.apply(result, timeResult); + result = timeResult; + + for (var i=0; i - + @@ -210,7 +210,7 @@ -
+
@@ -225,7 +225,9 @@

{{ playlist_title }}

- 播放 + 播放 + 添加到当前播放 + 原始链接
@@ -238,7 +240,7 @@
- +
@@ -272,7 +274,7 @@ {{ currentPlaying.artist }} - +
@@ -308,14 +310,10 @@