Changed layout of sidebar content.

This commit is contained in:
=
2012-09-10 19:46:12 +01:00
parent d81c736d8e
commit 970b75c29a
12 changed files with 46 additions and 7 deletions

0
_working/create Normal file → Executable file
View File

0
manage.py Normal file → Executable file
View File

0
static/bin/sm/soundmanager2.swf Normal file → Executable file
View File

0
static/bin/sm/soundmanager2_debug.swf Normal file → Executable file
View File

0
static/bin/sm/soundmanager2_flash9.swf Normal file → Executable file
View File

0
static/bin/sm/soundmanager2_flash9_debug.swf Normal file → Executable file
View File

0
static/img/whats-on.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -30,6 +30,7 @@ window.HeaderView = Backbone.View.extend({
return this;
},
playLive:function () {
var ref = this;
dssSoundHandler.playLive();
_eventAggregator.trigger("track_playing")
var button = $(this.el).find('#header-play-pause-button');
@@ -37,7 +38,8 @@ window.HeaderView = Backbone.View.extend({
$.getJSON(
'ajax/live_now_playing/',
function (data) {
_eventAggregator.trigger("track_changed", data);
alert(data.title);
$(ref.el).find('#live-now-playing').text(data.title);
});
},
togglePlayState:function () {

View File

@@ -12,6 +12,11 @@ window.SidebarView = Backbone.View.extend({
_eventAggregator.bind("track_changed", this.trackChanged);
_eventAggregator.bind("track_playing", this.trackPlaying);
_eventAggregator.bind("track_paused", this.trackPaused);
$.getJSON(
'ajax/live_now_playing/',
function (data) {
$("#live-now-playing", this.el).text(data.title);
});
},
render: function(){
$(this.el).html(this.template());
@@ -35,7 +40,7 @@ window.SidebarView = Backbone.View.extend({
$(this.el).find('#header-play-button-icon').addClass('icon-play');
},
playLive:function () {
dssSoundHandler.playLive();
com.podnoms.player.playLive();
_eventAggregator.trigger("track_playing")
var button = $(this.el).find('#sidebar-play-pause-button-small');
var el = this.el;

View File

@@ -148,6 +148,24 @@ com.podnoms.player = {
}
});
},
playLive:function () {
var ref = this;
this._destroyCurrent(function () {
ref.currentSound = soundManager.createSound({
id:'com.podnoms.player-live',
url:com.podnoms.settings.liveStreamRoot,
volume:50,
stream:true,
useMovieStar:true
});
if (ref.currentSound) {
ref.currentSound.play();
}
else {
com.podnoms.utils.showError('Oooopsies', 'Error playing sound..');
}
});
},
play:function () {
this.currentSound.play();

0
static/js/libs/sm/soundmanager2.js Normal file → Executable file
View File

View File

@@ -19,22 +19,36 @@
<div class="row" id="side-player-area">
<div id="whats-on">
<h3>Now playing
</button>
</h3>
</div>
<div>
<h5>DSS Radio
<button id="sidebar-listen-live" class="btn btn-mini btn-primary push-right btn-inverse"
data-toggle="button" type="button">
Listen Live
</button>
</h3>
</h5>
</div>
<div class="side-player">
<span class="content">
<div>
You: <a href="#" id="now-playing">Nothing currently on</a>
</div>
<div>
Live: <span id="live-now-playing"></span>
<span id="live-now-playing"></span>
</div>
</span>
</div>
<div class="side-player">
<span class="content">
<div>
<span class="content">
<div>
<a href="#" id="now-playing">Nothing currently on</a>
</div>
</span>
</div>
</span>
</div>
</div>
<div class="row">
{% include 'inc/twitter.html' %}