Commit 42f0a16d authored by Jonas Haraldsson's avatar Jonas Haraldsson

move js code block to player.tpl

parent 2f80bc65
......@@ -5,15 +5,6 @@
{include file='flattr.tpl'}
{include file='player.tpl'}
<div id='error'></div>
<script type="text/javascript">
$(document).ready(function() {ldelim}
{if isset($this_user)}
playerInit(false, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", "{$radio_session}");
{else}
playerInit(false, false, false, "{$radio_session}");
{/if}
{rdelim});
</script>
<br /><br />
<div id='flattrstream' style='width: 50%; display: none;'>
<div id='flattr'></div>
......
......@@ -74,3 +74,20 @@
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {ldelim}
{if $playlist == 'track'}
var playlist = [{ldelim}"artist" : "{$track->artist_name|escape:'javascript'}", "album" : "{$track->album_name|escape:'javascript'}", "track" : "{$track->name|escape:'javascript'}", "url" : "{$track->streamurl}"{rdelim}];
var radio_session = false;
{else}
var playlist = false;
var radio_session = "{$radio_session}";
{/if}
{if isset($this_user)}
playerInit(playlist, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", radio_session);
{else}
playerInit(playlist, false, false, radio_session);
{/if}
{rdelim});
</script>
......@@ -7,17 +7,7 @@
{if $track->streamable}
<div id='player-container'>
{include file='player.tpl'}
<script type="text/javascript">
$(document).ready(function() {ldelim}
var playlist = [{ldelim}"artist" : "{$track->artist_name|escape:'javascript'}", "album" : "{$track->album_name|escape:'javascript'}", "track" : "{$track->name|escape:'javascript'}", "url" : "{$track->streamurl}"{rdelim}];
{if isset($this_user)}
playerInit(playlist, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", false);
{else}
playerInit(playlist, false, false, false);
{/if}
{rdelim});
</script>
{include file='player.tpl' playlist='track'}
</div>
{/if}
......
......@@ -9,17 +9,7 @@
</h4>
<div id='player-container' style='float: none; text-align: center;'>
{include file='player.tpl'}
<script type="text/javascript">
$(document).ready(function() {ldelim}
{if isset($this_user)}
playerInit(false, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", "{$radio_session}");
{else}
playerInit(false, false, false, "{$radio_session}");
{/if}
{rdelim});
</script>
</div>
</center>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment