Merge saas-dev into soundcloud

This commit is contained in:
Duncan Sommerville 2015-06-10 16:08:52 -04:00
commit 459f9494c3
373 changed files with 6577 additions and 10376 deletions

View file

@ -11,7 +11,7 @@ echo sprintf(_('%1$s %2$s, the open radio software for scheduling and remote sta
$this->airtime_version)
?>
<br />
<br />© 2013
<br /<?php echo(gmdate('Y')); ?>
<?php
$companySiteAnchor = "<a href='" . COMPANY_SITE_URL . "' target='_blank'>"
. COMPANY_NAME . " " . COMPANY_SUFFIX

View file

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css">
<script src="<?php echo $this->jquery ?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery_custom ?>" type="text/javascript"></script>
<script src="<?php echo $this->widget_js ?>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#onAirToday").airtimeShowSchedule({
sourceDomain: "http://localhost",
text: {onAirToday:"On air today"},
updatePeriod: 5, //seconds
showLimit: 10
});
});
</script>
</head>
<body>
<div id="onAirToday"></div>
</body>
</html>

View file

@ -237,6 +237,18 @@
document.getElementById("stop_button").classList.toggle("hide_button");
}
$(document).ready(function() {
$(".play").click(function () {
if ($(this).hasClass("pause")) {
musesPlayer.stop();
} else {
musesPlayer.play();
}
$(this).toggleClass("pause");
});
});
// variables for updating the player's metadata
var time_to_next_track_starts = 0;
var metadataTimer = null;
@ -252,11 +264,11 @@
success: function(data) {
if (data.current === null) {
if (data.currentShow != null && data.currentShow.length != 0) {
// Master/show source have no current track but they do have a current show.
$("p.now_playing").html(data.currentShow[0].name);
if (data.currentShow != null && data.currentShow.length > 0) {
//Master/show source have no current track but they do have a current show.
$("p.now_playing").html("On Air:" + "<span>" + data.currentShow[0].name + "</span>");
} else {
$("p.now_playing").html("Offline");
$("p.now_playing").html("Off Air" + "<span>Offline</span>");
}
time_to_next_track_starts = 20000;
} else {
@ -294,6 +306,7 @@
metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts+3000);
}
</script>
<style type="text/css">
@ -310,31 +323,44 @@
<body>
<div class="airtime_player">
<div id="player" <?php if ($this->player_style == "basic") echo "style='display:block;'"; else echo "style='display:none'"; ?>>
<div class="airtime_player">
<div class="airtime_header">
<p class="station_name">fff</p>
</div>
<div class="airtime_box">
<div class="airtime_button">
<span id="play_button" class="play_button" onclick="musesPlayer.play()"></span>
<span id="stop_button" class="stop_button hide_button" onclick="musesPlayer.stop()"></span>
<div class="airtime_header">
<p class="station_name">fff</p>
</div>
<p class="now_playing"></p>
<div class="airtime_box">
<div class="airtime_button">
<span id="play_button" class="play_button" onclick="musesPlayer.play()"></span>
<span id="stop_button" class="stop_button hide_button" onclick="musesPlayer.stop()"></span>
</div>
<p class="now_playing"></p>
</div>
<div style="clear:both"></div>
<div class="airtime_schedule">
<p class="airtime_next">Next</p>
<ul class="schedule_list">
<li></li>
</ul>
</div>
<a class="airtime_pro" target="_blank" href="https://www.airtime.pro/">Powered by <span class="airtime-pro-orange">Airtime Pro</span></a>
</div>
</div>
<div style="clear:both"></div>
<div id="premium_player" <?php if ($this->player_style == "premium") echo "style='display:block;'"; else echo "style='display:none'"; ?>>
<div class="bottom_bar">
<div class="play cont_btn"></div>
<div class="airtime_schedule">
<p class="airtime_next">Next</p>
<ul class="schedule_list">
<li></li>
</ul>
<div class="on_air">
<p class="now_playing"></p>
</div>
</div>
<a class="airtime_pro" target="_blank" href="https://www.airtime.pro/">Powered by <span class="airtime-pro-orange">Airtime Pro</span></a>
</div>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css">
<script src="<?php echo $this->jquery ?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery_custom ?>" type="text/javascript"></script>
<script src="<?php echo $this->widget_js ?>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs li').click(function(){
var tab_id = $(this).attr('data-tab');
$('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active');
$(this).addClass('active');
$("#"+tab_id).addClass('active');
});
});
</script>
</head>
<body>
<div class="schedule tab_content current">
<ul class="tabs">
<?php
foreach($this->weeklyScheduleData as $day => $data) {
$activeClass = $this->currentDayOfMonth == $data["dayOfMonth"] ? "active" : "";
echo "<li class='".$activeClass."' data-tab='day-".$data["dayOfMonth"]."'>" . $data["dayOfWeek"] . "<span>" . $data["dayOfMonth"] . "</span></li>";
}?>
</ul>
<div class="schedule_content">
<?php
foreach($this->weeklyScheduleData as $day => $data) {
$activeClass = $this->currentDayOfMonth == $data["dayOfMonth"] ? "active" : "";
echo "<div id='day-".$data["dayOfMonth"]."' class='schedule_item ".$activeClass."'>";
foreach ($data["shows"] as $show => $showData) {
echo "<div class='row'>";
echo "<div class='time_grid'>".$showData["show_start_hour"].' - '.$showData["show_end_hour"]."</div>";
echo "<div class='name_grid'>".$showData["name"]."</div>";
echo "</div>";
}
echo "</div>";
}?>
</div>
<div class="weekly-schedule-widget-footer" <?php if ($this->widgetStyle == "premium") echo "style='display:none'"; ?>>
<a href="https://airtime.pro" target="_blank">Powered by <span>Airtime Pro</span></a>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,45 @@
<div id="widget-menu" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<h2><?php echo _("Widgets:"); ?></h2>
<a href="#player-widget">Player</a>
<a href="#weekly-schedule-widget">Weekly Schedule</a>
</div>
<div id="player-widget" class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="player_form" enctype="multipart/form-data">
<h2 style="float:left"><?php echo _("Player") ?></h2>
<div style="clear:both"></div>
<?php echo $this->player_error_msg; ?>
<?php echo $this->player_form; ?>
</form>
</div>
<br>
<div id="weekly-schedule-widget" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<h2 style="float:left"><?php echo _("Weekly Schedule") ?></h2>
<div style="clear:both"></div>
<div id="weekly-schedule-widget-error">
<?php echo $this->weekly_schedule_error_msg; ?>
</div>
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
<label>Preview:</label>
<div class="blah">
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe>
</div>
<div style="clear:both"></div>
<label>Embeddable Code:</label>
<textarea style="width:100%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe>
</textarea>
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
Adjust the height and width attributes to your desired size.
</div>
</div>

View file

@ -12,7 +12,15 @@
<!-- <button id="logo-remove-btn" value="Remove" class="btn">Remove</button>-->
<div id="Logo-img-container">
<img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" />
<?php
$logoImg = $this->element->getView()->logoImg;
if ($logoImg === DEFAULT_LOGO_PLACEHOLDER) {
$src = DEFAULT_LOGO_FILE;
} else {
$src = "data:image/png;base64,".$logoImg;
}
?>
<img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='resizeImg(this, 450, 450);' src="<?php echo $src ?>" />
</div>
<?php echo $this->element->getElement('locale')->render() ?>

View file

@ -0,0 +1,66 @@
<div class="wrapper">
<div class="bck_cover"></div>
<?php if ($this->stationLogo === DEFAULT_LOGO_PLACEHOLDER) {
echo "<a href='#' class='logo'><img src='".$this->baseUrl.DEFAULT_LOGO_FILE."'></a>";
} else {
echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?>
<div id="tab-1" class="schedule tab_content current">
<iframe id="schedule_iframe" height="400px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program?style=premium"?>></iframe>
</div>
<div id="tab-2" class="about_us tab_content">
<h1><?php echo $this->stationName ?></h1>
<p><?php echo $this->stationDescription ?></p>
</div>
<div id="tab-3" class="login tab_content">
<h2>Login</h2>
<form action="demo_form.asp">
<input type="text" name="FirstName" value="username"><br>
<input type="text" name="Password" value="password"><br>
<input type="submit" value="Login">
</form>
</div>
<iframe id="player_iframe" frameborder="0" width="100%" style="bottom:0px; left:0px; position:fixed; right:0px;" src=<?php echo $this->stationUrl."embed/player?stream=auto&style=premium";?>></iframe>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#player_iframe").load(function () {
$("#player_iframe").contents().find('.bottom_bar').append("<a class='login_btn button' target='_parent' href='/login'></a>");
$("#player_iframe").contents().find('.bottom_bar').append("<div class='about_us_btn button' data-tab='tab-2'></div>");
$("#player_iframe").contents().find('.bottom_bar').append("<div class='schedule_btn button current' data-tab='tab-1'></div>");
$("#player_iframe").contents().find('.bottom_bar .button').not('.login_btn').click(function(){
var tab_id = $(this).attr('data-tab');
$("#player_iframe").contents().find('.bottom_bar .button').removeClass('current');
$('.tab_content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
});
});
// schedule widget tabs
$('.tabs li').click(function(){
var tab_id = $(this).attr('data-tab');
$('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active');
$(this).addClass('active');
$("#"+tab_id).addClass('active');
});
})
</script>

View file

@ -1,12 +0,0 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" id="player_form" enctype="multipart/form-data">
<h2 style="float:left"><?php echo _("Embeddable Player") ?></h2>
<div style="clear:both"></div>
<?php echo $this->errorMsg; ?>
<?php echo $this->form; ?>
</form>
</div>

View file

@ -1,8 +1,178 @@
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
<head>
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
</head>
<tbody>
<tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th>
</tr>
</tbody>
</table>
<?php
$phpDependencies = checkPhpDependencies();
$externalServices = checkExternalServices();
$zend = $phpDependencies["zend"];
$postgres = $phpDependencies["postgres"];
$database = $externalServices["database"];
$rabbitmq = $externalServices["rabbitmq"];
$pypo = $externalServices["pypo"];
$liquidsoap = $externalServices["liquidsoap"];
$mediamonitor = $externalServices["media-monitor"];
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
$r2 = array_reduce($externalServices, "booleanReduce", true);
$result = $r1 && $r2;
?>
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
<thead>
<tr class="ui-state-default strong">
<td><?php echo _("Service") ?></td>
<td><?php echo _("Description") ?></td>
<td><?php echo _("Status") ?></td>
</tr>
</thead>
<tbody>
<!--
<tr class="odd">
<td><?php echo sprintf(_("%s Version"), PRODUCT_NAME) ?></td>
<td>1.9.3</td>
<td>&nbsp;</td>
</tr>
-->
<tr>
<td class="component">
Zend
</td>
<td class="description">
Zend MVC Framework
</td>
<td class="solution <?php if ($zend) {echo 'check';?>">
<?php
} else {
?>">
<b>Ubuntu</b>: try running <code>sudo apt-get install libzend-framework-php</code>
<br/><b>Debian</b>: try running <code>sudo apt-get install zendframework</code>
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
Postgres
</td>
<td class="description">
PDO and PostgreSQL libraries
</td>
<td class="solution <?php if ($postgres) {echo 'check';?>">
<?php
} else {
?>">
Try running <code>sudo apt-get install php5-pgsql</code>
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
Database
</td>
<td class="description">
Database configuration for Airtime
</td>
<td class="solution <?php if ($database) {echo 'check';?>">
<?php
} else {
?>">
Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly.
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
RabbitMQ
</td>
<td class="description">
RabbitMQ configuration for Airtime
</td>
<td class="solution <?php if ($rabbitmq) {echo 'check';?>">
<?php
} else {
?>">
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-media-monitor, airtime-pypo,
and airtime-uploads.
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
Media Monitor
</td>
<td class="description">
Airtime media-monitor service
</td>
<td class="solution <?php if ($mediamonitor) {echo 'check';?>">
<?php
} else {
?>">
Check that the airtime-media-monitor service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-media-monitor</code><br/>
If not, try <br/><code>sudo service airtime-media-monitor start</code>
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
Pypo
</td>
<td class="description">
Airtime playout service
</td>
<td class="solution <?php if ($pypo) {echo 'check';?>">
<?php
} else {
?>">
Check that the airtime-playout service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/>
If not, try <br/><code>sudo service airtime-playout restart</code>
<?php
}
?>
</td>
</tr>
<tr>
<td class="component">
Liquidsoap
</td>
<td class="description">
Airtime liquidsoap service
</td>
<td class="solution <?php if ($liquidsoap) {echo 'check';?>">
<?php
} else {
?>">
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
If not, try <br/><code>sudo service airtime-liquidsoap restart</code>
<?php
}
?>
</td>
</tr>
<tr id="partitions" class="even">
<th colspan="5"><?php echo _("Disk Space") ?></th>
</tr>
</tbody>
</table>