diff --git a/server/djrandom/frontend/static/js/djr.min.js b/server/djrandom/frontend/static/js/djr.min.js index 1e0fb84952d436897e96a74aab3d724b8bf1b069..ab4ad99916aaf9e15ce36378cb4d45f69f642ee2 100644 --- a/server/djrandom/frontend/static/js/djr.min.js +++ b/server/djrandom/frontend/static/js/djr.min.js @@ -17,4 +17,5 @@ b);d.removeChunk(b)});e.find(".chunk_inner .song").hover(function(){$(this).find djr.Player.prototype.play=function(a){djr.debug("play "+a);this.cur_song&&(this.old_songs.push(this.cur_song),this.old_songs.length>5&&this.old_songs.shift());this.cur_song=a;$(".song").removeClass("playing");$("#song_"+a).addClass("playing");this.player.jPlayer("setMedia",{mp3:"/dl/"+a}).jPlayer("play");var b=$("#song_"+a+" .artist").text(),c=$("#song_"+a+" .album").text();$("#jp_playlist_1").html($("#song_"+a+" .title").text()+"<br>"+b+"<br><small>"+c+"</small>");b="/album_image/"+escape(b)+"/"+ escape(c);$("#albumart_fs").attr("src",b);$("#albumart_fs").fullBg();$("#albumart_fs").show();this.backend.nowPlaying(a,this.old_songs)};djr.Player.prototype.nextSong=function(){this.play(this.playlist.getNextSong(this.cur_song))};djr.Player.prototype.streamCurrentPlaylist=function(){};djr.state={backend:null,player:null}; djr.init=function(){djr.state.backend=new djr.Backend;djr.state.player=new djr.Player(djr.state.backend,"#djr_player");$("#playlistClearBtn").click(function(){djr.state.player.clearPlaylist()});$("#playlistStreamBtn").click(function(){djr.state.player.streamCurrentPlaylist()});$("#playlistExtendBtn").click(function(){djr.state.player.extendCurrentPlaylist()});$("#playlistLast25").click(function(){djr.state.player.lastPlaylist(25)});$("#playlistRandom").click(function(){djr.state.player.randomPlaylist(25)}); -$("#playlistMost").click(function(){djr.state.player.mostPlayedPlaylist(25)});$("#albumart_fs").load(function(){$(this).fullBg();$(this).show()})};djr.player=function(){return djr.state.player};djr.debug=function(a){$("#debug").append(a+"<br>")}; +$("#playlistMost").click(function(){djr.state.player.mostPlayedPlaylist(25)});$("#wikiDiv").click(function(){var a=$("#song_"+djr.state.player.cur_song+" .title").text();$("#wikipedia").display=="none"?a!=""&&(a=a.split(" ").join("+"),$("#wikipedia").attr("src","http://en.wikipedia.org/wiki/Special:Search?search="+a+"&go=Go"),window.frames.wikipedia.location.reload(),$("#wikipedia").show()):$("#wikipedia").attr("display","none")});$("#googleDiv").click(function(){var a=$("#song_"+djr.state.player.cur_song+ +" .title").text();$("#google").display=="none"?a!=""&&(a=a.split(" ").join("+"),$("#google").attr("src","http://www.google.ie/#hl=en&q="+a),window.frames.google.location.reload(),$("#google").show()):$("#google").attr("display","none")});$("#albumart_fs").load(function(){$(this).fullBg();$(this).show()})};djr.player=function(){return djr.state.player};djr.debug=function(a){$("#debug").append(a+"<br>")}; diff --git a/server/djrandom/frontend/static/js/djr/player.js b/server/djrandom/frontend/static/js/djr/player.js index e2b07fba581bcfbe3044477a93849cd6cbcb6e45..6f9ff0b34646b7a1c5e0b9d3966d14941e5c861b 100644 --- a/server/djrandom/frontend/static/js/djr/player.js +++ b/server/djrandom/frontend/static/js/djr/player.js @@ -310,6 +310,33 @@ djr.init = function () { djr.state.player.mostPlayedPlaylist(25); }); + $('#wikiDiv').click(function () { + var stitle = $('#song_' + djr.state.player.cur_song + ' .title').text(); + if ( $('#wikipedia').display == 'none' ) { + if ( stitle != "" ) { + stitle = stitle.split(' ').join('+'); + $('#wikipedia').attr("src","http://en.wikipedia.org/wiki/Special:Search?search=" + stitle + "&go=Go"); + window.frames["wikipedia"].location.reload(); + $('#wikipedia').show(); + } + } else { + $('#wikipedia').attr('display', 'none' ); + } + }); + $('#googleDiv').click(function () { + var stitle = $('#song_' + djr.state.player.cur_song + ' .title').text(); + if ( $('#google').display == 'none' ) { + if ( stitle != "" ) { + stitle = stitle.split(' ').join('+'); + $('#google').attr("src","http://www.google.ie/#hl=en&q=" + stitle); + window.frames["google"].location.reload(); + $('#google').show(); + } + } else { + $('#google').attr('display', 'none' ); + } + }); + // Set the album art image to auto-fullscreen on load. $('#albumart_fs').load(function() { $(this).fullBg(); diff --git a/server/djrandom/frontend/templates/index.html b/server/djrandom/frontend/templates/index.html index 4effb65ac0b1888d2114ae8307256010dcfb57ca..024daa95a4c63206639897df1768230af70b974b 100644 --- a/server/djrandom/frontend/templates/index.html +++ b/server/djrandom/frontend/templates/index.html @@ -74,13 +74,14 @@ DJ:Random </ul> </div> <div id="jp_info" class="jp_info" > - <div id="jp_wiki" class="song" > - + <div id="wikiDiv" class="song" > + <div id="wikibtn" >Wikipedia Info</div> <iframe id="wikipedia" width="100%" height="300" style="display: none" > <p>Your browser does not support iframes.</p> </iframe> </div> - <div id="jp_google" class="song" > + <div id="googleDiv" class="song" > + <div id="googlebtn" >Google Info</div> <iframe id="google" width="100%" height="300" style="display: none" > <p>Your browser does not support iframes.</p> </iframe>