Merge branch 'saas-dev' of github.com:sourcefabric/airtime into saas-dev

This commit is contained in:
Duncan Sommerville 2015-10-29 10:12:31 -04:00
commit 59ad4fd7f5
14 changed files with 93 additions and 12 deletions

View file

@ -110,7 +110,7 @@ $pages = array(
)
),
array(
'label' => "<i class='icon-briefcase icon-white'></i>"._('Billing'),
'label' => (Application_Model_Preference::GetPlanLevel()=="trial") ? "<i class='icon-star icon-orange'></i><span style='color: #ff5d1a'>"._('Upgrade')."</span>" : "<i class='icon-briefcase icon-white'></i>"._('Billing'),
'controller' => 'billing',
'action' => 'upgrade',
'resource' => 'billing',

View file

@ -24,7 +24,8 @@ class ApiController extends Zend_Controller_Action
"show-tracks",
"show-schedules",
"station-logo",
"show-logo"
"show-logo",
"stream-m3u"
);
if (Zend_Session::isStarted()) {
@ -1501,5 +1502,23 @@ class ApiController extends Zend_Controller_Action
$hint = Application_Common_UsabilityHints::getUsabilityHint($userPath);
$this->_helper->json->sendJson($hint);
}
public function streamM3uAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
header('Content-Type: application/x-mpegurl');
header('Content-Disposition: attachment; filename=stream.m3u');
$m3uFile = "#EXTM3U\r\n\r\n"; //Windows linebreaks eh
$stationName = Application_Model_Preference::GetStationName();
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
foreach ($streamData as $stream) {
$m3uFile .= "#EXTINF,".$stationName." - " . strtoupper($stream['codec']) . "\r\n";
$m3uFile .= $stream['url'] . "\r\n\r\n";
}
echo $m3uFile;
}
}

View file

@ -29,6 +29,7 @@ class EmbedController extends Zend_Controller_Action
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/player/muses.swf";
$this->view->metadata_api_url = Application_Common_HTTPHelper::getStationUrl() . "api/live-info";
$this->view->player_title = json_encode($this->view->escape($request->getParam('title')));
$this->view->jquery_i18n = Application_Common_HTTPHelper::getStationUrl() . "js/i18n/jquery.i18n.js?";
$styleParam = $request->getParam('style');
$player_style = isset($styleParam) ? $styleParam : "basic";

View file

@ -370,6 +370,9 @@ class LibraryController extends Zend_Controller_Action
if ($form->isValid($serialized)) {
$file->setDbColMetadata($serialized);
$this->view->status = true;
} else {
$this->view->status = false;
}
}

View file

@ -424,7 +424,12 @@ class LocaleController extends Zend_Controller_Action
": activate to sort column ascending",
": activate to sort column descending",
//End of datatables
"Welcome to the new Airtime Pro!" => _("Welcome to the new Airtime Pro!")
"Welcome to the new Airtime Pro!" => _("Welcome to the new Airtime Pro!"),
//embed player
"On Air" => _("On Air"),
"Off Air" => _("Off Air"),
"Offline" => _("Offline"),
"Nothing scheduled" => _("Nothing scheduled")
);
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

View file

@ -169,6 +169,26 @@ class Application_Form_EditAudioMD extends Zend_Form
));
$this->addElement($language);
$validCuePattern = '/^(?:[0-9]{1,2}:)?(?:[0-9]{1,2}:)?[0-9]{1,6}(\.\d{1,6})?$/';
$cueIn = new Zend_Form_Element_Text('cuein');
$cueIn->class = 'input_text';
$cueIn->setLabel("Cue In:");
$cueInValidator = Application_Form_Helper_ValidationTypes::overrideRegexValidator(
$validCuePattern, _(sprintf("Specify cue in time in the format %s", "(hh:mm:)ss(.dddddd)"))
);
$cueIn->setValidators(array($cueInValidator));
$this->addElement($cueIn);
$cueOut = new Zend_Form_Element_Text('cueout');
$cueOut->class = 'input_text';
$cueOut->setLabel('Cue Out:');
$cueOutValidator = Application_Form_Helper_ValidationTypes::overrideRegexValidator(
$validCuePattern, _(sprintf("Specify cue out time in the format %s", "(hh:mm:)ss(.dddddd)"))
);
$cueOut->setValidators(array($cueOutValidator));
$this->addElement($cueOut);
// Add the submit button
$this->addElement('button', 'editmdsave', array(
'ignore' => true,

View file

@ -5,8 +5,12 @@
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css">
<script src="<?php echo $this->mrp_js?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery_i18n?>" type="text/javascript"></script>
<script src="/locale/general-translation-table" type="text/javascript"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'>
<script type="text/javascript">
$.i18n.setDictionary(general_dict);
var RETRY_DELAY_MSECS = 2000; //Delay before trying to reconnect to stream after an error.
var MAX_MOBILE_SCREEN_WIDTH = 760;
@ -280,9 +284,9 @@
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("On Air:" + "<span>" + data.currentShow[0].name + "</span>");
$("p.now_playing").html($.i18n._("On Air") + "<span>" + data.currentShow[0].name + "</span>");
} else {
$("p.now_playing").html("Off Air" + "<span>Offline</span>");
$("p.now_playing").html($.i18n._("Off Air") + "<span>"+ $.i18n._("Offline") + "</span>");
}
time_to_next_track_starts = 20000;
} else {
@ -311,7 +315,7 @@
}
if (data.next === null) {
$("ul.schedule_list").find("li").html("Nothing scheduled");
$("ul.schedule_list").find("li").html($.i18n._("Nothing scheduled"));
} else {
$("ul.schedule_list").find("li").html(data.next.name);
}
@ -364,7 +368,7 @@
<div style="clear:both"></div>
<div class="airtime_schedule">
<p class="airtime_next">Next</p>
<p class="airtime_next"><?php echo _("Next") ?></p>
<ul class="schedule_list">
<li></li>
</ul>

View file

@ -9,8 +9,8 @@
</div>
<div id="player_instructions">
Customize the player by configuring the options below. When you are done,
copy the embeddable code below and paste it into your website's HTML.
<?php echo _("Customize the player by configuring the options below. When you are done,
copy the embeddable code below and paste it into your website's HTML.") ?>
</div>
<?php echo $this->element->getElement('player_title')->render(); ?>

View file

@ -415,6 +415,7 @@ textarea {
font-size: 14px;
margin: 0 0 10px;
max-width: 280px;
}
/* Playlist/Block/Webstream Editors */

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -8,6 +8,15 @@
float: left;
}
#edit-md-dialog ul.errors {
clear: both;
float: none;
}
#edit-md-dialog dd input.input_text {
width: auto;
}
.spl_sortable,.spl_sortable>li,.side_playlist>div,#spl_editor,.spl_artist,.spl_cue_in,.spl_fade_in,.spl_cue_out,.spl_fade_out
{
clear: left;

View file

@ -3781,6 +3781,11 @@ hr {
margin-right: 4px;
}
.icon-orange {
margin-right: 4px;
background-image: url("img/glyphicons-halflings-orange.png");
}
.nav-ui-icon-formatter {
width:16px !important;
display:inline;

View file

@ -2,6 +2,10 @@
function isAudioSupported(mime){
var audio = new Audio();
if ((typeof mime) !== "string" || (mime === null)) {
return false;
}
var bMime = null;
if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) {
bMime = 'audio/ogg; codecs="vorbis"';

View file

@ -513,15 +513,24 @@ var AIRTIME = (function(AIRTIME){
newTab.wrapper.find(".md-save").on("click", function() {
var file_id = newTab.wrapper.find('#file_id').val(),
data = newTab.wrapper.find("#edit-md-dialog form").serializeArray();
$.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function() {
$.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function(resp) {
newTab.wrapper.find("#edit-md-dialog").parent().html(resp.html);
// don't redraw the library table if we are on calendar page
// we would be on calendar if viewing recorded file metadata
if ($("#schedule_calendar").length === 0) {
oTable.fnStandingRedraw();
}
if (resp.status === true) {
AIRTIME.playlist.closeTab();
}
//re-initialize events since we changed the html
initFileMdEvents(newTab);
});
AIRTIME.playlist.closeTab();
});
newTab.wrapper.find('#edit-md-dialog').on("keyup", function(event) {
@ -529,6 +538,7 @@ var AIRTIME = (function(AIRTIME){
newTab.wrapper.find('.md-save').click();
}
});
}
function openPlaylist(json) {