Skip to content

Commit

Permalink
Set the playlist panel optional and display the infos panel by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien MANCA committed Apr 12, 2012
1 parent 80cec13 commit 11cb7a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ <h2>All the config settings :</h2>
mainId: 'player',
// Uri of the playlist in json format
playlistLocation: '/data/playlist.json',
// Display the informations panel
useInfos: true,
// Display the playlist panel
usePlaylist: true,
// Use audio transition at the beginning and the end of the track
useTransitions: true,
}
Expand Down
10 changes: 8 additions & 2 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'mainId', 'playlistLocation', 'theme'
);
$keys_boolean = array(
'enable', 'debugMode', 'autoPlay', 'useTransitions', 'useInfos'
'enable', 'debugMode', 'autoPlay', 'useTransitions', 'useInfos', 'usePlaylist'
);
$keys_int = array(
'animateDelay'
Expand Down Expand Up @@ -71,6 +71,8 @@
<br />animateDelay=5000</li>
<li><a href="index.php?useInfos=true&infos=duration,current,timer,position">Display the informations panel and choose the track informations<a>
<br />useInfos=true&infos=duration,current,timer,position</li>
<li><a href="index.php?usePlaylist=false&useInfos=false">Clean turntable with no distraction<a>
<br />usePlaylist=false&useInfos=false</li>
</ul>
<h2>All the config settings :</h2>
<pre>
Expand Down Expand Up @@ -102,8 +104,12 @@
mainId: 'player',
// Uri of the playlist in json format
playlistLocation: '/data/playlist.json',
// Display the informations panel
useInfos: true,
// Display the playlist panel
usePlaylist: true,
// Use audio transition at the beginning and the end of the track
useTransitions: true,
useTransitions: true,
}
</pre>
<footer>
Expand Down
13 changes: 9 additions & 4 deletions public/js/turntable-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ turntablePlayerEngine.prototype = {
infos: ["duration", "timer"], // Choices : duration, current, timer, position
logMethodNames: ["log", "debug", "warn", "info"], // Log informations in the console
theme: 'wood', // The name of the theme
useInfos: false, // Use the informations panel
useInfos: true, // Display the informations panel
usePlaylist: true, // Display the playlist panel
useTransitions: true, // Use the audio transitions

themes : { // The list of the available themes with their settings
Expand Down Expand Up @@ -671,7 +672,7 @@ turntablePlayerEngine.prototype = {
* Init the playlist
*/
initPlaylist : function () {
if (!this._playlist) {
if (this.options.usePlaylist && !this._playlist) {
var
self = this,
playlist = document.createElementNS('http://www.w3.org/1999/xhtml', 'div')
Expand Down Expand Up @@ -1141,7 +1142,9 @@ turntablePlayerEngine.prototype = {
switchOnTheButton : function () {
this._powerON = true;

this.toggleClass(this._playlistButtons[this._playlistIndex], 'active', 'add');
if (this.options.usePlaylist)
this.toggleClass(this._playlistButtons[this._playlistIndex], 'active', 'add');

this.toggleClass(document.getElementById('power'), 'active', 'add');
document.getElementById('power-on').checked = true;
},
Expand All @@ -1152,7 +1155,9 @@ turntablePlayerEngine.prototype = {
switchOffTheButton : function () {
this._powerON = false;

this.toggleClass(this._playlistButtons[this._playlistIndex], 'active', 'remove');
if (this.options.usePlaylist)
this.toggleClass(this._playlistButtons[this._playlistIndex], 'active', 'remove');

this.toggleClass(document.getElementById('power'), 'active', 'remove');
document.getElementById('power-off').checked = true;
},
Expand Down

0 comments on commit 11cb7a8

Please sign in to comment.