Merge branch 'saas-dev-publishing' into saas-dev-publishing-episode-view

This commit is contained in:
Duncan Sommerville 2015-11-04 13:24:42 -05:00
commit ee19d90930
7 changed files with 524 additions and 67 deletions

View File

@ -32,7 +32,7 @@ define('AIRTIME_COPYRIGHT_DATE' , '2010-2015');
define('AIRTIME_REST_VERSION' , '1.1');
define('AIRTIME_API_VERSION' , '1.1');
// XXX: it's important that we upgrade this every time we add an upgrade!
define('AIRTIME_CODE_VERSION' , '2.5.15');
define('AIRTIME_CODE_VERSION' , '2.5.16');
// Defaults
define('DEFAULT_LOGO_PLACEHOLDER', 1);

View File

@ -13,14 +13,23 @@ class IndexController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headTitle(Application_Model_Preference::GetHeadTitle());
$this->view->headScript()->appendFile($baseUrl . 'js/libs/jquery-1.8.3.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendScript("$.i18n.setDictionary(general_dict)")
->appendScript("var baseUrl='$baseUrl'");
$this->view->headScript()->appendFile($baseUrl . 'js/libs/jquery-1.8.3.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendScript("$.i18n.setDictionary(general_dict)");
$this->view->headScript()->appendScript("var baseUrl='$baseUrl'");
//jplayer
$this->view->headScript()->appendFile($baseUrl.'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->setStylesheet($baseUrl.'css/radio-page/radio-page.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/embed/weekly-schedule-widget.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/radio-page/station-podcast.css?'.$CC_CONFIG['airtime_version']);
//jplayer control buttons
$this->view->headLink()->appendStylesheet($baseUrl.'css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('radio-page');

View File

@ -209,15 +209,6 @@
}
};
MusesPlayer.prototype.playPodcastTrack = function(url, codec) {
this.setCodec(codec);
this.setURL(url);
musesPlayer.play();
if ($('.play').hasClass("pause") === false) {
$('.play').addClass("pause");
}
}
// detects errors in FLASH mode
function musesCallback(event,value) {
switch (event) {
@ -362,14 +353,6 @@
}
function detachStreamMetadataFromPlayer() {
clearTimeout(metadataTimer);
}
function attachFileMetadataToPlayer(artist, title) {
$("p.now_playing").html(artist+"<span>"+title+"</span>");
}
</script>

View File

@ -1,17 +1,17 @@
<script language="JavaScript">
function autoResize(id){
var newheight;
var newwidth;
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
// Hack to get height in Firefox
if (newheight == 0) newheight = newheight = document.getElementById(id).contentWindow.document.documentElement.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
// Hack to get height in Firefox
if (newheight == 0) newheight = newheight = document.getElementById(id).contentWindow.document.documentElement.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
</script>
<div class="wrapper">
@ -31,13 +31,13 @@ document.getElementById(id).width= (newwidth) + "px";
<span class='login-img'></span>
</a>
</div>";
}?>
}?>
<div id="tab-1" class="schedule tab_content current">
<iframe onLoad="autoResize('schedule_iframe');" id="schedule_iframe" height="300px" scrolling="yes" 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->escape($this->stationName) ?></h1>
<p><?php echo $this->escape($this->stationDescription) ?></p>
@ -53,39 +53,135 @@ document.getElementById(id).width= (newwidth) + "px";
</div>
<?php
if ($this->displayRssTab) {?>
<div id="tab-4" class="station_rss tab_content">
<script type="text/javascript">
$.each(<?php echo $this->episodes ?>, function(index, value){
// map mime to format muses recognizes
// TODO: this doesn't make a difference
var metadata = value.CcFiles;
if (metadata.mime == "audio/mp3") {
metadata.mime = "mp3";
} else if (metadata.mime == "audio/vorbis") {
metadata.mime = "ogg";
}
if ($this->displayRssTab) {?>
<div id="tab-4" class="station_rss tab_content">
<div id="jquery_jplayer_1" class="jp-player">
</div>
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<li class="ui-state-default ui-corner-all jp-previous">
<span class="ui-icon ui-icon-seek-prev" tabindex="1"><?php echo _("previous") ?></span>
</li>
$("#tab-4").append("<div>"+metadata.artist_name+" - "+metadata.track_title+
" <a id='rss-download-link' href='"+value.download_url+"'>Download</a>" +
" <a id='rss-play-link' data-metaartist='"+metadata.artist_name+"' data-metatitle='"+metadata.track_title+"' data-streamurl='"+value.download_url+"' data-streamcodec='"+metadata.mime+"' href='#'>Play</a></div>");
});
<li class="ui-state-default ui-corner-all jp-play">
<span class="ui-icon ui-icon-play" tabindex="1"><?php echo _("play") ?></span>
</li>
$("a#rss-play-link").click(function() {
var file_url = $(this).attr("data-streamurl");
var file_codec = $(this).attr("data-streamcodec");
var artist_name = $(this).attr("data-metaartist");
var track_title = $(this).attr("data-metatitle");
//console.log(track_title);
<li class="ui-state-default ui-corner-all jp-pause">
<span class="ui-icon ui-icon-pause" tabindex="1"><?php echo _("pause") ?></span>
</li>
document.getElementById("player_iframe").contentWindow.musesPlayer.playPodcastTrack(file_url, file_codec);
document.getElementById("player_iframe").contentWindow.detachStreamMetadataFromPlayer();
document.getElementById("player_iframe").contentWindow.attachFileMetadataToPlayer(artist_name, track_title);
});
</script>
</div>
<li class="ui-state-default ui-corner-all jp-next">
<span class="ui-icon ui-icon-seek-next" tabindex="1"><?php echo _("next") ?></span>
</li>
<li class="ui-state-default ui-corner-all jp-stop">
<span class="ui-icon ui-icon-stop" tabindex="1"><?php echo _("stop") ?></span>
</li>
</ul>
<div class="jp-time-block">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-time-holder">
<div class="jp-current-time"></div>
</div>
</div>
<div class="jp-volume-block">
<div class="jp-mute">
<span class="ui-icon" tabindex="1" title="mute"><?php echo _("mute") ?></span>
</div>
<div class="jp-unmute">
<span class="ui-icon" tabindex="1" title="unmute"><?php echo _("unmute") ?></span>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-volume-max">
<span class="ui-icon" tabindex="1" title="max volume"><?php echo _("max volume") ?></span>
</div>
</div>
</div>
<div class="jp-playlist">
<ul>
<li></li>
</ul>
</div>
<div class="jp-no-solution">
<span><?php echo _("Update Required") ?></span>
<?php sprintf(_("To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s."),
"<a href='http://get.adobe.com/flashplayer/' target='_blank'>",
"</a>") ?>
</div>
</div>
</div>
<script type="text/javascript">
_playlist_jplayer = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
},[], //array of songs will be filled with below's json call
{
swfPath: baseUrl + "js/jplayer",
supplied: "oga, mp3, m4v, m4a, wav",
size: {
width: "0px",
height: "0px",
cssClass: "jp-video-270p"
},
playlistOptions: {
autoPlay: false,
loopOnPrevious: false,
shuffleOnLoop: true,
enableRemoveControls: false,
displayTime: 0,
addTime: 0,
removeTime: 0,
shuffleTime: 0
},
ready: function () {
var playlist = new Array();
var media;
$.each(<?php echo $this->episodes ?>, function (index, value) {
if (value.CcFiles.mime == "audio/mp3") {
media = {
title: value.CcFiles.track_title,
artist: value.CcFiles.artist_name,
mp3: value.download_url,
download_url: value.download_url
};
} else if (value.CcFiles.mime == "audio/vorbis") {
media = {
title: value.CcFiles.track_title,
artist: value.CcFiles.artist_name,
oga: value.download_url,
download_url: value.download_url
};
}
playlist.push(media);
});
_playlist_jplayer.setPlaylist(playlist);
// This is a big hack to attach the download and play buttons
// to the jplayer playlist items.
$(".jp-playlist").find("a.jp-playlist-item").each(function (i, obj) {
$(obj).after(" - <a id='rss-download-link' href='"+playlist[i].download_url+"'>Download</a>");
});
}
}
);
</script>
</div>
<?php
}
}
?>
<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>
@ -130,5 +226,6 @@ document.getElementById(id).width= (newwidth) + "px";
$("#"+tab_id).addClass('active');
});
})
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

View File

@ -0,0 +1,368 @@
@CHARSET "UTF-8";
/* Used to hide non-ui fields **/
span.audioFileID {
display:none;
}
span.audioFileTitle {
display:none;
}
span.audioFileArtist {
display:none;
}
span.playlistID {
display:none;
}
span.playlistIndex {
display:none;
}
span.showID {
display:none;
}
span.showIndex {
display:none;
}
/* End of non-ui fields **/
div.jp-audio,
div.jp-video {
/* Edit the font-size to counteract inherited font sizing.
* Eg. 1.25em = 1 / 0.8em
*/
font-size:1em; /* 1.25em for testing in site pages */ /* No parent CSS that can effect the size in the demos ZIP */
font-family: Arial,Helvetica,sans-serif;
line-height:1.6;
color: #9B9B9B;
position:relative;
border-color: #262526 #262526 #5E5E5E;
border-style: solid;
border-width: 1px;
}
div.jp-audio {
width:420px;
}
div.jp-video-270p {
width:100%;
}
div.jp-video-360p {
width:640px;
}
div.jp-interface {
position: relative;
background-color: #3D3D3D;
background: -moz-linear-gradient(top, #6E6E6E 0, #3a3a3a 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #6E6E6E), color-stop(100%, #3a3a3a));
width: 100%;
border-top: 1px solid #5a5a5a;
border-bottom: 1px solid #1a1a1a;
}
div.jp-audio div.jp-type-single div.jp-interface {
height:80px;
}
div.jp-audio div.jp-type-playlist div.jp-interface {
height:80px;
}
/* @group CONTROLS */
div.jp-interface ul.jp-controls {
float: left;
padding: 0;
margin: 0;
cursor: pointer;
position: relative;
top: 30px;
left: 10px;
}
div.jp-interface ul.jp-controls li {
list-style-type: none;
float: left;
padding: 1px 2px;
margin-right: 5px;
}
div.jp-interface ul.jp-controls li.jp-play,
div.jp-interface ul.jp-controls li.jp-pause {
padding: 6px 7px;
margin-top: -5px;
}
div.jp-mute span {
background: url("jplayer.png") 0 -90px no-repeat;
}
div.jp-mute span:hover {
background: url("jplayer.png") -30px -90px no-repeat;
}
div.jp-unmute span {
background: url("jplayer.png") -60px -90px no-repeat;
}
div.jp-unmute span:hover {
background: url("jplayer.png") -90px -90px no-repeat;
}
div.jp-volume-max span {
background: url("jplayer.png") 0 -112px no-repeat;
}
div.jp-volume-max span:hover {
background: url("jplayer.png") -30px -112px no-repeat;
}
/* @end */
/* @group progress bar */
div.jp-time-block {
position: absolute;
top: 32px;
left: 145px;
}
div.jp-progress {
overflow:hidden;
background-color: #393939;
}
div.jp-audio div.jp-progress {
height: 10px;
border-color: #262526 #262526 #5E5E5E;
border-style: solid;
border-width: 1px;
}
/*
div.jp-audio div.jp-type-single div.jp-progress {
left:110px;
width:186px;
}
*/
div.jp-audio div.jp-type-playlist div.jp-progress {
width: 170px;
}
div.jp-seek-bar {
background-color: #393939;
width:0px;
height:100%;
cursor: pointer;
}
div.jp-play-bar {
background-color: #FF6F01;
width:0px;
height:100%;
}
/* The seeking class is added/removed inside jPlayer */
div.jp-seeking-bg {
background: url("pbar-ani.gif");
}
/* @end */
/* @group volume controls */
li.jp-mute,
li.jp-unmute,
li.jp-volume-max {
margin-top: 2px;
}
div.jp-mute span,
div.jp-unmute span,
div.jp-volume-max span{
width: 17px;
height: 16px;
}
/*
div.jp-audio div.jp-type-single a.jp-mute,
div.jp-audio div.jp-type-single a.jp-unmute {
margin-left: 210px;
}
*/
div.jp-volume-block {
position: absolute;
top: 33px;
left: 350px;
width: 120px;
}
div.jp-mute,
div.jp-unmute,
div.jp-volume-bar,
div.jp-volume-max {
float: left;
cursor: pointer;
}
div.jp-volume-bar {
position: absolute;
overflow:hidden;
background-color: #393939;
width: 50px;
height:5px;
cursor: pointer;
margin-left: 20px;
margin-top: 2px;
}
div.jp-audio div.jp-volume-bar {
border-color: #262526 #262526 #5E5E5E;
border-style: solid;
border-width: 1px;
}
div.jp-volume-bar-value {
background-color: #FF6F01;
width:0px;
height:5px;
}
div.jp-volume-max {
margin-left: 65px;
}
/* @end */
/* @group current time and duration */
div.jp-current-time,
div.jp-duration {
width: 60px;
font-size: 1em;
}
div.jp-current-time {
float: left;
display: inline;
color: #FF6F01;
}
div.jp-duration {
float: right;
display: inline;
text-align: right;
color: #9B9B9B;
}
/* @end */
/* @group playlist */
div.jp-title {
font-weight:bold;
text-align:center;
}
div.jp-title,
div.jp-playlist {
width:100%;
background-color: #D8D8D8;
}
div.jp-type-single div.jp-title,
div.jp-type-playlist div.jp-title,
div.jp-type-single div.jp-playlist {
border-top:none;
}
div.jp-title ul,
div.jp-playlist ul {
list-style-type:none;
margin:0;
padding:0 20px;
}
div.jp-title li {
padding:5px 0;
font-weight:bold;
}
div.jp-playlist li {
padding:5px 0 4px 20px;
border-bottom:1px solid #eee;
}
div.jp-playlist li div {
display:inline;
}
/* Note that the first-child (IE6) and last-child (IE6/7/8) selectors do not work on IE */
div.jp-type-playlist div.jp-playlist li:last-child {
padding:5px 0 5px 20px;
border-bottom:none;
}
div.jp-type-playlist div.jp-playlist li.jp-playlist-current {
padding-left:7px;
}
div.jp-type-playlist div.jp-playlist a {
color: #333;
text-decoration: none;
}
div.jp-type-playlist div.jp-playlist a:hover {
color:#9B9B9B;
}
div.jp-type-playlist div.jp-playlist a.jp-playlist-current {
color: #FF6F01;
}
span.jp-artist {
font-size: 90%;
color:#9B9B9B;
margin-left: 5px;
}
/* @end */
div.jp-video-270p div.jp-video-play {
height:270px;
}
div.jp-video-360p div.jp-video-play {
height:360px;
}
div.jp-video-full div.jp-video-play {
height:100%;
z-index:1000;
}
div.jp-jplayer audio,
div.jp-jplayer {
width:0px;
height:0px;
}
div.jp-jplayer {
background-color: #000000;
}
/* @group NO SOLUTION error feedback */
.jp-no-solution {
position:absolute;
width:390px;
margin-left:-202px;
left:50%;
top: 10px;
padding:5px;
font-size:.8em;
background-color:#eee;
border:2px solid #009be3;
color:#000;
display:none;
}
.jp-no-solution a {
color:#000;
}
.jp-no-solution span {
font-size:1em;
display:block;
text-align:center;
font-weight:bold;
}
/* @end */