Browse Source

intuitive

windhamdavid 10 years ago
parent
commit
766880761f
2 changed files with 9 additions and 6 deletions
  1. 7 3
      js/fm.js
  2. 2 3
      page-music.php

+ 7 - 3
js/fm.js

@@ -598,13 +598,16 @@ amplitude_config = {
 function get_radio_tower() {
 function get_radio_tower() {
 	return '../../wp-content/themes/dw/img/radio.gif';
 	return '../../wp-content/themes/dw/img/radio.gif';
 }
 }
+function get_radio_none() {
+	return '../../wp-content/themes/dw/img/none.svg';
+}
 
 
 function radioTitle() {
 function radioTitle() {
- 
+	$('#radio').attr('src', get_radio_none()).fadeIn(100);
     var url = 'http://code.davidawindham.com:8008/status2.xsl';
     var url = 'http://code.davidawindham.com:8008/status2.xsl';
     var mountpoint = '/stream';
     var mountpoint = '/stream';
  
  
-    $.ajax({  type: 'GET',
+    $.ajax({ type: 'GET',
           url: url,
           url: url,
           async: true,
           async: true,
           jsonpCallback: 'parseMusic',
           jsonpCallback: 'parseMusic',
@@ -617,7 +620,8 @@ function radioTitle() {
 			$('#bitrate').text(json[mountpoint].bitrate); 
 			$('#bitrate').text(json[mountpoint].bitrate); 
 			$('#radio').attr('src', get_radio_tower()).fadeIn(100); 
 			$('#radio').attr('src', get_radio_tower()).fadeIn(100); 
         },
         },
-          error: function (e) {    console.log(e.message);  
+          error: function (e) { console.log(e.message);
+			  $('#radio').attr('src', get_radio_none()).fadeIn(100); 
         }
         }
     });
     });
 }
 }

+ 2 - 3
page-music.php

@@ -10,7 +10,6 @@ get_header(); ?>
 			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
 			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
 			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 				<div id="music" class="entry-content">
 				<div id="music" class="entry-content">
-					<h2 class="entry-title">Music</h2>
 					<div class="row">
 					<div class="row">
 						<div class="col-sm-12">							
 						<div class="col-sm-12">							
 							<?php class NowPlaying{
 							<?php class NowPlaying{
@@ -30,7 +29,7 @@ get_header(); ?>
 							            $songname = $track->name;
 							            $songname = $track->name;
 										$albumname = $track->album;
 										$albumname = $track->album;
 										$albumart = $track->album->image[2];
 										$albumart = $track->album->image[2];
-							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . $artist . ' - ' . $songname;
+							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . ' ' . $artist . ' - ' . $songname;
 							        }
 							        }
 							        else{
 							        else{
 							            return $this->noTrackPlayingMessage;
 							            return $this->noTrackPlayingMessage;
@@ -69,7 +68,7 @@ get_header(); ?>
 											</div>
 											</div>
 										</div>
 										</div>
 										<div class="panel-footer">
 										<div class="panel-footer">
-											<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
+											<h6 style="margin:0;"><?php echo $nowPlaying->getNowPlaying(); ?></h6>
 										</div>
 										</div>
 									</div>
 									</div>
 								</div>
 								</div>