forked from dprodger/dynplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
244 lines (223 loc) · 11.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html>
<html>
<head>
<style>
@import url('sp://import/css/eve.css');
@import url('sp://dynplay/css/main.css');
@import url('sp://dynplay/css/github.css');
@import url('sp://import/css/shared.css');
@import url('sp://import/css/api.css');
</style>
<script src="sp://dynplay/js/jquery.min.js"></script>
<script src="sp://dynplay/js/underscore/underscore-min.js"></script>
<script src="sp://dynplay/js/backbone/backbone-min.js"></script>
<script src="sp://dynplay/js/rainbow-custom.min.js"></script>
<script src="sp://dynplay/js/enplayer.js"></script>
<script src="sp://dynplay/js/echonestsync.js"></script>
<script src="sp://dynplay/js/models/dynplay.js"></script>
<script src="sp://dynplay/js/models/artist.js"></script>
<script src="sp://dynplay/js/models/song.js"></script>
<script src="sp://dynplay/js/views/nowPlaying.js"></script>
<script src="sp://dynplay/js/views/artistUrls.js"></script>
<script src="sp://dynplay/js/views/biographies.js"></script>
<script src="sp://dynplay/js/raphael-min.js"></script>
<script>
jQuery.ajaxSettings.traditional = true;
$(document).ready(function () {
/* Instantiate the global sp object; include models & views */
initialize();
});
</script>
</head>
<body>
<div id="wrapper">
<div id="index" class="section">
<h1>Echo Nest Dynamic Radio</h1>
<div id="_controls">
<div id="_enter_seeds">
<form id="param_form">
<label for="_artist">Artist:</label><input type="text" id="_artist" placeholder="Seed artist" size="50"/>
<label for="_song_title">Song Title (optional):</label><input type="text" id="_song_title" placeholder="Seed song" size="50"/><br />
<label>Catalog:</label>
<input type="radio" name="cat_type" id="_cat_type" value="none" style="-webkit-appearance:radio !important;">None
<input type="radio" name="cat_type" id="_cat_type" value="update" style="-webkit-appearance:radio !important;">Update Only
<input type="radio" name="cat_type" id="_cat_type" value="seed" style="-webkit-appearance:radio !important;" checked>Artist/Song Seed
<input type="radio" name="cat_type" id="_cat_type" value="cat" style="-webkit-appearance:radio !important;">Catalog Only
<label for="_adventurous">Catalog Adventurousness:</label><input type="text" id="_adventurous" size="4" value="0.2"/>
<br />
<label for="_artist_hot">Artist Hot Min:</label><input type="text" id="_artist_hot" placeholder="0.0" size="4"/>
<label for="_song_hot">Song Hot Min:</label><input type="text" id="_song_hot" placeholder="0.0" size="4"/>
<label for="_variety">Variety:</label><input type="text" id="_variety" placeholder="0.3" size="4"/>
<button class="button" id="_play" onclick="makePlaylist(); return false;">Let's go</button>
</form>
</div>
<div id="_display_seeds" style="display:none;">
<p>You're listening to <b id="_disp_art_name">Bonobo</b> radio <span id="_disp_song_seed">, seeded with <b>Flite</b></span></p>
<button class="button" id="_enter_new" onclick="displayEnterNew()">Make a new playlist!</button>
</div>
<div class="now_playing_class" id="nowplaying">
</div>
<div id="tabs"><a href="#" onclick="displayTabs(0);">Playlist</a><a href="#" onclick="displayTabs(1);">Biography</a><a href="#" onclick="displayTabs(2);">Social</a><a href="#" onclick="displayTabs(3);">Images</a><a href="#" onclick=" displayTabs(4);">URLs</a></div>
<div class="tab-regions" id="tabarea_0" style="display:block;">
<div id="played-list">
</div>
</div>
<div class="tab-regions" id="tabarea_1" style="display:none;">
<div class="biographies-region" id="biographies_regions">
</div>
</div>
<div class="tab-regions" id="tabarea_2" style="display:none;">
<div id="social-region">
<h4>Recent Tweets</h4>
<div class="_recent_tweets"></div>
</div>
</div>
<div class="tab-regions" id="tabarea_3" style="display:none;">
<div id="images-region">
</div>
</div>
<div class="tab-regions" id="tabarea_4" style="display:none;">
<div class="urls-region" id="urls_regions">
</div>
</div>
</div>
</div><!-- /index -->
<div id="history" class="section" style="display:none;">
<div id="_diagnostics">
<br /><br /><h2>Summary/Diagnostic Information</h2>
<label for="_session_id">Echo Nest Session ID</label><input type="text" id="_session_id" placeholder="EN Session ID" size="50" /><br />
<div class="_en_site">
<a href="" >Open Session History in Browser</a>
</div>
<br /><br /><h2>Banned Items</h2>
<div id="banned">
<b>Banned Artists:</b><br />
<ul id="banned_artists"></ul>
<br /><br /><b>Banned Songs:</b><br />
<ul id="banned_songs"></ul>
</div>
<br /><br /><h2>Favorite Items</h2>
<div id="favorited">
<b>Favorite Artists:</b><br />
<ul id="favorite_artists"></ul>
<br /><br /><b>Favorite Songs:</b><br />
<ul id="favorite_songs"></ul>
<br /><br /><b>Rated Songs:</b><br />
<ul id="rated_songs"></ul>
</div>
</div>
</div> <!-- /history -->
<div id="config" class="section" style="display:none;">
<h1>Dynamic Playlist Configuration</h1>
<h2>System Configuration</h2>
<label for="_api_key" style="width:200px;border: 3px #ff0000;">API Key:</label><input type="text" id="_api_key" placeholder="" size="36"/>
<label for="_host" style="width:200px;border:1px #ff0000;">Host:</label><input type="text" id="_host" placeholder="" size="50"/>
<button class="button" id="_save_config" onclick="updateConfig();">Update Configuration!</button>
<br />
<br />
<br />
<h2>Taste Profile Configuration</h2>
<h3>Current Profile</h3>
Current Taste Profile: <span id="_catalog_name">None<span> <span id="_catalog_id">(None)</span> <a href="#" class="_en_catalog_site">View Raw Catalog</a>
<!-- <button class="button" id="_delete_existing_catalog" onclick="deleteExistingCatalog();">Delete Current Taste Profile</button> -->
<br /><br /><h3>Other Taste Profiles</h3>
<p>Select a different taste profile to begin logging session information to the new profile.</p><br />
<div class="_en_tp_list">I am here</div>
<br />
<br />
<h3>Create New Taste Profile</h3><label for="_new_cat_name" style="width:200px;border:1px #ff0000;">New Profile Name:</label><input type="text" id="_new_cat_name" placeholder="" size="50"/>
<button class="button" id="_create_new_catalog" onclick="createNewCatalog();">Create New Taste Profile</button>
</div>
<div id="stats" class="section" style="display:none;">
<h3>Section Breaks</h3>
<div id="break_section"></div>
<h3>Stats</h3>
<li id="pos" />
<li id="seg-num" />
<li id="seg-time" />
<li id="bar" />
<li id="beat" />
<li id="section" />
<li id="seg-dur" />
<li id="seg-conf" />
<li id="seg-loud" />
<li id="seg-pitch" />
<li id="seg-timbre" />
<br />
<!--
var pos = $("#pos");
var snum = $("#seg-num");
var stime = $("#seg-time");
var sbar = $("#bar");
var sbeat = $("#beat");
var sdur = $("#seg-dur");
var sconf = $("#seg-conf");
var sloud = $("#seg-loud");
var spitch = $("#seg-pitch");
var stimbre = $("#seg-timbre");
-->
</div>
</div><!-- /wrapper-->
</body>
<!-- templates for various views -->
<script type="text/template" id="now_playing_template">
<h2>Now Playing</h2>
<div id="trackinfo" style="float: left; width:30%">
<p id="np_artist">Artist: <%= artistName %></p>
<p id="np_song">Song: <%= songTitle %></p>
<p id="np_year">Year: <%= songYear %></p>
<p id="np_album">Album: <%= album %></p>
<p>Twitter: <a id="_twiturl" href="<%= twitterUrl %>"><%= twitterUrl %></a></p>
<p>Facebook: <a id="_fburl" href="<%= facebookUrl %>"><%= facebookUrl %></a></p>
</div>
<div id="np_cover" style="float: left;">
<%
//TODO: there must be a better way...
var coverImg = new ui.SPImage(cover);
var tmpNode = document.createElement("div");
tmpNode.appendChild(coverImg.node);
print(tmpNode.innerHTML);
tmpNode = coverImg = null;
%>
</div>
<div id="control_buttons" style="float: left; margin-left: 10px;">
<button class="button" id="_skip" onclick="skipTrack();">Skip</button><br />
<button class="button" id="_favartist" onclick="favoriteArtist();">Favorite Artist</button><br />
<button class="button" id="_favsong" onclick="favoriteSong();">Favorite Song</button><br />
<button class="button" id="_spotstar" onclick="spotifyStar();">Spotify Star</button><br />
<button class="button" id="_banartist" onclick="banArtist();">Ban Artist</button><br />
<button class="button" id="_bansong" onclick="banSong();">Ban Song</button><br />
</div>
<div style="clear:both;"></div>
<div id="controls">
Rate this song:<br/>
Hate (1)<input type="range" name="_song_rating" min="1" max="10" value="" onclick="rateSong();"/>Love (10)<br/>
</div>
<br /><h3>Steering</h3>
Energy: <a href="#" onclick="steer('energy','lower');">Lower</a> <a href="#" onclick="steer('energy','higher');">Higher</a><br />
Tempo: <a href="#" onclick="steer('tempo','slower');">Slower</a> <a href="#" onclick="steer('tempo','faster');">Faster</a><br />
</script>
<script type="text/template" id="urls_template">
<ul>
<li>Wikipedia: <a href='<%= wikiUrl %>'><%= wikiUrl %></a></li>
<li>Last.fm: <a href='<%= lastUrl %>'><%= lastUrl %></a></li>
<li>AOL: <a href='<%= aolUrl %>'><%= aolUrl %></a></li>
<li>MySpace: <a href='<%= myspaceUrl %>'><%= myspaceUrl %></a></li>
<li>Amazon: <a href='<%= amazonUrl %>'><%= amazonUrl %></a></li>
<li>iTunes: <a href='<%= itunesUrl %>'><%= itunesUrl %></a></li>
<li>Musicbrainz: <a href='<%= mbUrl %>'><%= mbUrl %></a></li>
</ul>
</script>
<script type="text/template" id="biographies_template">
<h3>Location</h3>
<p><%= location %></p><br /><br />
<h3>Wikipedia</h3>
<p><%= wikiBio %></p>
<a href="<%= wikiUrl %>"><%= wikiUrl %></a>
<br /><br />
<h3>Last.fm</h3>
<p><%= lastBio %></p>
<a href="<%= lastUrl %>"><%= lastUrl %></a>
<br /><br />
</script>
</html>