Skip to content

Commit

Permalink
- Performance: play/pause button controlled by controlInit;
Browse files Browse the repository at this point in the history
  • Loading branch information
rentalhost committed Oct 1, 2011
1 parent 11dca58 commit 75f97a8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion javascript/contentscript.js
Expand Up @@ -227,7 +227,8 @@ var GCInjector = new function () {
this.isSmile(),
this.isFrown(),
queue.activeSong.index,
queue.songs.length
queue.songs.length,
this.GS.player.isPlaying
);
}

Expand Down
5 changes: 4 additions & 1 deletion javascript/groovesharkControl.js
Expand Up @@ -16,7 +16,7 @@ function controlInit(autoCallback) {
// Control the now playing data
userAction('getNowPlaying', null, function(songName, artistName, albumName, albumImage,
playbackPosition, playbackDuration, inLibrary, inFavorite, isSmile, isFrown,
queueIndex, queueLength){
queueIndex, queueLength, isPlaying){
// Configure song data
$('.nowPlaying .song')
.text(songName)
Expand Down Expand Up @@ -50,6 +50,9 @@ function controlInit(autoCallback) {
var percentage = Math.round(100 / playbackDuration * playbackPosition);
$('.progressbar .elapsed').css('width', percentage + '%');
$('.progressbar').slider('value', percentage);

// Configure player button
$('#playpause').attr('class', isPlaying ? 'pause' : 'play');
});

// Collect radio data
Expand Down
6 changes: 0 additions & 6 deletions javascript/notification.js
Expand Up @@ -60,9 +60,3 @@ function setUpNotification () {
setTimeout(window.close, 200);
});
}

chrome.extension.onRequest.addListener(
function (request, sender, sendResponse) {
$('#playpause').attr('class', request.isPlaying ? 'pause' : 'play');
}
);
2 changes: 0 additions & 2 deletions javascript/popup.js
Expand Up @@ -69,8 +69,6 @@ chrome.extension.onRequest.addListener(
showPopup();

scrollPlaylistToActiveSong();

$('#playpause').attr('class', request.isPlaying ? 'pause' : 'play');
}
);

Expand Down

0 comments on commit 75f97a8

Please sign in to comment.