Permalink
Browse files

Renaming

  • Loading branch information...
1 parent c1522f9 commit 3541f7740bab0b1e128c0462018614a5fb79e7fb @gabriel committed Mar 8, 2010
Showing with 20 additions and 20 deletions.
  1. +6 −6 app/views/muxtape.mako
  2. +14 −14 public/javascripts/shrub.js
View
@@ -13,9 +13,9 @@
<div id="shrub-player" class="flash-player warn"><span>You need Javascript enabled and/or a recent version of Flash.</span></div>
<p>
- <a id="tape-play" href="" onClick="shrubTape.playTrack(shrubPlayer.getCurrentTrack(), true); return false;">Play</a>
- <a id="tape-stop" href="" onClick="shrubTape.stop(); return false;">Stop</a>
- <a id="tape-skip1" href="" onClick="shrubPlayer.jump(30); return false;">Jump</a>
+ <a id="tape-play" href="" onClick="ShrubTape.playTrack(ShrubPlayer.getCurrentTrack(), true); return false;">Play</a>
+ <a id="tape-stop" href="" onClick="ShrubTape.stop(); return false;">Stop</a>
+ <a id="tape-skip1" href="" onClick="ShrubPlayer.jump(30); return false;">Jump</a>
</p>
</div>
@@ -56,7 +56,7 @@
<script type="text/javascript">
// Callback from player.swf load
function playerReady(obj) {
- shrubPlayer.setPlayer(obj);
+ ShrubPlayer.setPlayer(obj);
}
</script>
@@ -71,13 +71,13 @@ var loadID3 = function() {
for(var i = 0, length = ${len(tracks)}; i < length; i++) {
(function(index) {
$("#song-" + index).click(function() {
- shrubTape.playTrack(index, true);
+ ShrubTape.playTrack(index, true);
});
})(i);
}
var id3Urls = ${base.to_json(id3_urls)};
- shrubTape.loadID3Urls(id3Urls);
+ ShrubTape.loadID3Urls(id3Urls);
};
$(document).ready(loadID3);
@@ -2,7 +2,7 @@
Player.
Controls and handles current state for the player.
*/
-var shrubPlayer = (function() {
+var ShrubPlayer = (function() {
var _player;
var _isReady = false;
@@ -86,12 +86,12 @@ var shrubPlayer = (function() {
var client = player.client;
//console.log("Player: " + id + ", version: " + version + ", client: " + client);
_player = document.getElementById(id);
- _player.addModelListener('STATE', 'shrubPlayer.updateState');
- _player.addModelListener('TIME', 'shrubPlayer.updateTime');
- _player.addControllerListener('ITEM', 'shrubPlayer.updateItem');
- _player.addModelListener('LOADED', 'shrubPlayer.updateLoaded');
- _player.addModelListener('ERROR', 'shrubPlayer.onError');
- _player.addModelListener('META', 'shrubPlayer.updateMeta');
+ _player.addModelListener('STATE', 'ShrubPlayer.updateState');
+ _player.addModelListener('TIME', 'ShrubPlayer.updateTime');
+ _player.addControllerListener('ITEM', 'ShrubPlayer.updateItem');
+ _player.addModelListener('LOADED', 'ShrubPlayer.updateLoaded');
+ _player.addModelListener('ERROR', 'ShrubPlayer.onError');
+ _player.addModelListener('META', 'ShrubPlayer.updateMeta');
_isReady = true;
},
@@ -106,7 +106,7 @@ var shrubPlayer = (function() {
},
play: function(index, options) {
- shrubPlayer.reset();
+ ShrubPlayer.reset();
var changed = false;
if (index >= 0 && _currentTrack != index) {
changed = true;
@@ -164,7 +164,7 @@ var shrubPlayer = (function() {
/*
Loads ID3 information, asynchronously and in order.
*/
-var shrubTape = (function() {
+var ShrubTape = (function() {
var _currentId3Index = -1;
var _urls;
@@ -191,7 +191,7 @@ var shrubTape = (function() {
$(name_id).html(id3.performer + " - " + id3.title);
if (!!id3.album) {
//var albumSearch = "http://www.amazon.com/s/ref=nb_ss_m?url=search-alias%3Dmusic-album&tag=ducktyper-20&field-keywords=" + id3.album;
- //"<a href='" + albumSearch + "' onClick='shrubPlayer.stop();'>" + id3.album + "</a>"
+ //"<a href='" + albumSearch + "' onClick='ShrubPlayer.stop();'>" + id3.album + "</a>"
$("#song-" + _currentId3Index + " .song-album").html(id3.album);
}
} else {
@@ -222,7 +222,7 @@ var shrubTape = (function() {
},
stop: function() {
- shrubPlayer.stop();
+ ShrubPlayer.stop();
// Reset all song positions
$("#tape-play").html("Play");
},
@@ -233,21 +233,21 @@ var shrubTape = (function() {
// If this song playing stop it
if (!toggle || node.hasClass("playing")) {
$("#songs .song").removeClass("playing");
- shrubPlayer.pause();
+ ShrubPlayer.pause();
$("#tape-play").html("Play");
if (toggle) return;
}
this.reset();
// Play node
- shrubPlayer.play(track, this);
+ ShrubPlayer.play(track, this);
$("#tape-play").html("Pause");
node.addClass("playing");
$("#song-" + track + " .song-position").show();
},
- // Listeners, in shrubPlayer.play(track, this);
+ // Listeners, in ShrubPlayer.play(track, this);
onPositionChange: function(track, time, percentage) {
//console.log("Position change: " + track + "; " + time + " (" + percentage + ")");

0 comments on commit 3541f77

Please sign in to comment.