-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
321 lines (296 loc) · 17.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!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
<br />
<br />
<div id="cultural_parms" style="float: left; width:50%">
Cultural Attributes<br />
<label class="form-params">Artist Hotttnesss </label>
<label for="_artist_hot_min">Min:</label><input type="text" id="_artist_hot_min" placeholder="0.0" size="4"/>
<label for="_artist_hot_max">Max:</label><input type="text" id="_artist_hot_max" placeholder="0.0" size="4"/>
<br />
<label class="form-params">Song Hotttnesss </label>
<label for="_song_hot_min">Min:</label><input type="text" id="_song_hot_min" placeholder="0.0" size="4"/>
<label for="_song_hot_max">Max:</label><input type="text" id="_song_hot_max" placeholder="0.0" size="4"/>
<br />
<label class="form-params" for="_variety">Variety:</label><input type="text" id="_variety" placeholder="0.3" size="4"/><br />
<label class="form-params" for="_adventurous">Adventurousness:</label><input type="text" id="_adventurous" size="4" value="0.2"/><br />
<label class="form-params" for="_xmas">Christmas:</label>
<input type="radio" name="_xmas" id="_xmas" value="" style="-webkit-appearance:radio !important;" checked>Default
<input type="radio" name="_xmas" id="_xmas" value="true" style="-webkit-appearance:radio !important;">Xmas
<input type="radio" name="_xmas" id="_xmas" value="false" style="-webkit-appearance:radio !important;">Not Xmas
<input type="radio" name="_xmas" id="_xmas" value="any" style="-webkit-appearance:radio !important;">Ignore<br />
<label class="form-params" for="_live">Live:</label>
<input type="radio" name="_live" id="_live" value="" style="-webkit-appearance:radio !important;" checked>Default
<input type="radio" name="_live" id="_live" value="true" style="-webkit-appearance:radio !important;">Live
<input type="radio" name="_live" id="_live" value="false" style="-webkit-appearance:radio !important;">Not Live
<input type="radio" name="_live" id="_live" value="any" style="-webkit-appearance:radio !important;">Ignore<br />
</div>
<div id="acoustic_parms" style="float: left; width: 50%">
Acoustic Attributes<br />
<label class="form-params">Speechiness </label>
<label for="_song_speech_min">Min:</label><input type="text" id="_song_speech_min" placeholder="0.0" size="4"/>
<label for="_song_speech_max">Max:</label><input type="text" id="_song_speech_max" placeholder="0.7" size="4"/><br />
<label class="form-params">Liveness </label>
<label for="_song_live_min">Min:</label><input type="text" id="_song_live_min" placeholder="0.0" size="4"/>
<label for="_song_live_max">Max:</label><input type="text" id="_song_live_max" placeholder="0.7" size="4"/> <br />
<label class="form-params">Tempo </label>
<label for="_song_tempo_min">Min:</label><input type="text" id="_song_tempo_min" placeholder="0" size="4"/>
<label for="_song_tempo_max">Max:</label><input type="text" id="_song_tempo_max" placeholder="240" size="4"/> <br />
<label class="form-params">Energy </label>
<label for="_song_energy_min">Min:</label><input type="text" id="_song_energy_min" placeholder="0.0" size="4"/>
<label for="_song_energy_max">Max:</label><input type="text" id="_song_energy_max" placeholder="1.0" size="4"/> <br />
<label class="form-params">Danceability </label>
<label for="_song_dance_min">Min:</label><input type="text" id="_song_dance_min" placeholder="0.0" size="4"/>
<label for="_song_dance_max">Max:</label><input type="text" id="_song_dance_max" placeholder="1.0" size="4"/> <br />
<label class="form-params">Loudness </label>
<label for="_song_loud_min">Min:</label><input type="text" id="_song_loud_min" placeholder="0.0" size="4"/>
<label for="_song_loud_max">Max:</label><input type="text" id="_song_loud_max" placeholder="1.0" size="4"/> <br />
<label class="form-params">Duration (sec) </label>
<label for="_song_duration_min">Min:</label><input type="text" id="_song_duration_min" placeholder="0" size="4"/>
<label for="_song_duration_max">Max:</label><input type="text" id="_song_duration_max" placeholder="360" size="4"/> <br />
<button class="button" id="_play" onclick="makePlaylist(); return false;">Let's go</button>
</div>
</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>Catalog Statistics</h3>
<button class="button" id="_generate_catalog_stats" onclick="generateCatalogStats();">Retrieve Catalog For Statistics</button><br /><br /><br />
<h4>Most-played artists</h4><br/>
<div id="_most_played_artists"></div><br /><br />
<h4>Most-played songs</h4><br/>
<div id="_most_played_songs"></div>
<h4>Banned artists</h4><br/>
<div id="_banned_artists"></div><br /><br />
<h4>Favorite artists</h4><br/>
<div id="_favorite_artists"></div><br /><br />
</div>
<div id="acoustic" 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; width="40%">
<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 />
<button class="button" id="_notxmas" onclick="makeNotXmas();">Not Xmas</button><br />
<button class="button" id="_notlive" onclick="makeNotLive();">Not Live</button><br />
</div>
<div id="song_facts" style="float: left; margin-left: 10px; width="30%">
<p id="art_fam">Artist Familiarity: <%= artFam.toFixed(2) %></p>
<p id="art_hot">Artist Hotttnesss: <%= artHot.toFixed(2) %></p>
<p id="song_hot">Song Hotttnesss: <%= songHot.toFixed(2) %></p>
<p id="song_energy">Energy: <%= songEnergy.toFixed(2) %></p>
<p id="song_danceability">Danceability: <%= songDance.toFixed(2) %></p>
<p id="song_tempo">Tempo: <%= songTempo.toFixed(0) %></p>
<p id="song_live">Liveness: <%= songLive.toFixed(2) %></p>
<p id="song_speech">Speechiness: <%= songSpeech.toFixed(2) %></p>
</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>
<b>Acoustic Steering</b><br/>
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 />
<b>Cultural Steering</b><br/>
Artist Familiarity: <a href="#" onclick="steer('artist_familiarity','lower');">Lower</a> <a href="#" onclick="steer('artist_familiarity','higher');">Higher</a><br />
Artist Hotttness: <a href="#" onclick="steer('artist_hotttnesss','lower');">Lower</a> <a href="#" onclick="steer('artist_hotttnesss','higher');">Higher</a><br />
Song Hotttness: <a href="#" onclick="steer('song_hotttnesss','lower');">Lower</a> <a href="#" onclick="steer('song_hotttnesss','higher');">Higher</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>