Browse Source

intuitive

windhamdavid 4 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() {
 	return '../../wp-content/themes/dw/img/radio.gif';
 }
+function get_radio_none() {
+	return '../../wp-content/themes/dw/img/none.svg';
+}
 
 function radioTitle() {
- 
+	$('#radio').attr('src', get_radio_none()).fadeIn(100);
     var url = 'http://code.davidawindham.com:8008/status2.xsl';
     var mountpoint = '/stream';
  
-    $.ajax({  type: 'GET',
+    $.ajax({ type: 'GET',
           url: url,
           async: true,
           jsonpCallback: 'parseMusic',
@@ -617,7 +620,8 @@ function radioTitle() {
 			$('#bitrate').text(json[mountpoint].bitrate); 
 			$('#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(); ?>
 			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 				<div id="music" class="entry-content">
-					<h2 class="entry-title">Music</h2>
 					<div class="row">
 						<div class="col-sm-12">							
 							<?php class NowPlaying{
@@ -30,7 +29,7 @@ get_header(); ?>
 							            $songname = $track->name;
 										$albumname = $track->album;
 										$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{
 							            return $this->noTrackPlayingMessage;
@@ -69,7 +68,7 @@ get_header(); ?>
 											</div>
 										</div>
 										<div class="panel-footer">
-											<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
+											<h6 style="margin:0;"><?php echo $nowPlaying->getNowPlaying(); ?></h6>
 										</div>
 									</div>
 								</div>