~oly/rhythmboxwebremote/trunk

« back to all changes in this revision

Viewing changes to themes/js/default.js

  • Committer: Oliver Marks
  • Date: 2012-05-20 15:45:35 UTC
  • Revision ID: oly@digitaloctave.com-20120520154535-m7m0n41g6p4a6lus
multi user search implemented needs testing, but looking good so far

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                                                sessionid=document.cookie.match(/sessionid=[^;]+/);
39
39
                                                var match=false;
40
40
                                                for(var i=0;i<data.search.length;i++){
41
 
                                                        console.log('sessionid='+data.search[i]+'---'+sessionid);
 
41
                                                        //console.log('sessionid='+data.search[i]+'---'+sessionid);
42
42
                                                        if ('sessionid='+data.search[i]==sessionid){
43
43
                                                                match=true
44
44
                                                        }
45
45
                                                }
46
46
                                                if(match){
47
47
                                                        $.ajax({
48
 
                                                                url:'/generate/search/search.htm',
 
48
                                                                url:'/results',
49
49
                                                                dataType:'html',
50
50
                                                                success:function(data){
51
51
                                                                        $('#search div').html(data);
65
65
                                        if(data.playing!=undefined){
66
66
                                                if(player_status!=data.playing){
67
67
                                                        player_status=data.playing;
68
 
                                                        console.log(player_status+' '+data.playing);
69
68
                                                        if (data.playing==1){
70
69
                                                                $('#play img').attr('src','/themes/'+theme+'/img/player_pause.png');
71
70
                                                        }else{
87
86
                });
88
87
        };
89
88
        
90
 
        function playlist(){
 
89
        /*function playlist(){
91
90
                $.ajax({
92
91
                        url:'/playlist/',
93
92
                        dataType:'html',
95
94
                                $('#playlist div').html(data);
96
95
                        }
97
96
                });
98
 
        }
 
97
        }*/
99
98
        
100
99
        //player controls ajax change
101
100
        $('#prev,#play,#next').click(function(e){
157
156
        $('#searchstring').keypress(function(event) {
158
157
                if ( event.which == 13 ) {
159
158
                        event.preventDefault();
160
 
                        $(this).load('/search/'+$('#searchtype > option:selected').val()+'/'+$(this).val());
 
159
                        $(this).load('/search/'+$('#searchtype > option:selected').val()+'/'+escape($(this).val()));
161
160
                }
162
161
        })
163
162