CC-2908: Add "Live Stream" title to live stream popup window

-custom logo
This commit is contained in:
martin 2011-10-04 17:18:36 -04:00
parent 7dd14efe27
commit 929e29182b
8 changed files with 79 additions and 50 deletions

View file

@ -19,6 +19,13 @@ class DashboardController extends Zend_Controller_Action
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.blue.monday.css'); $this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.blue.monday.css');
$this->_helper->layout->setLayout('bare'); $this->_helper->layout->setLayout('bare');
$logo = Application_Model_Preference::GetStationLogo();
if($logo){
$this->view->logo = "data:image/png;base64,$logo";
} else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
}
} }
public function helpAction() public function helpAction()

View file

@ -42,11 +42,11 @@ $(document).ready(function(){
?> ?>
}); });
</script> </script>
<div class="jp-logo"></div> <div class="jp-logo"><img id="logo-img" onload='resizeToMaxHeight(this, 67);' src="<?php echo $this->logo ?>" /></div>
<div class="jp-stream"> <div class="jp-stream">
<div class="jp-stream-text">Select stream:</div> <div class="jp-stream-text">Select stream:</div>
<form id="form1" method="post" action="">
<form id="form1" method="post" action="">
<select id="combo-box"> <select id="combo-box">
<?php <?php
foreach($ids as $id) { foreach($ids as $id) {

View file

@ -140,7 +140,7 @@
<dd id="Logo-element"> <dd id="Logo-element">
<?php if($this->element->getView()->logoImg){?> <?php if($this->element->getView()->logoImg){?>
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div> <div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
<?php }?> <?php }?>
<?php echo $this->element->getElement('Logo') ?> <?php echo $this->element->getElement('Logo') ?>

View file

@ -134,7 +134,7 @@
</dt> </dt>
<dd id="Logo-element" class="block-display clearfix"> <dd id="Logo-element" class="block-display clearfix">
<?php if($this->element->getView()->logoImg){?> <?php if($this->element->getView()->logoImg){?>
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div> <div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
<?php }?> <?php }?>
<?php echo $this->element->getElement('Logo') ?> <?php echo $this->element->getElement('Logo') ?>

View file

@ -222,3 +222,41 @@ function audioPreview(filename, elemID){
$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause"); $('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
} }
function resizeImg(ele, targetWidth, targetHeight){
var img = $(ele);
var width = ele.width;
var height = ele.height;
// resize img proportionaly
if( width > height && width > targetWidth){
var ratio = targetWidth/width;
img.css("width", targetHeight+"px");
var newHeight = height * ratio;
img.css("height", newHeight+"px");
}else if( width < height && height > targetHeight){
var ratio = targetHeight/height;
img.css("height", targetHeight+"px");
var newWidth = width * ratio;
img.css("width", newWidth+"px");
}else if( width == height && width > targetWidth){
img.css("height", targetHeight+"px");
img.css("width", targetWidth+"px" );
}
}
function resizeToMaxHeight(ele, targetHeight){
var img = $(ele);
var width = ele.width;
var height = ele.height;
// resize img proportionaly
if( height > targetHeight){
var ratio = targetHeight/height;
img.css("height", targetHeight+"px");
var newWidth = width * ratio;
img.css("width", newWidth+"px");
}
}

View file

@ -102,27 +102,25 @@ $(document).ready(function(){
}); });
}); });
function resizeImg(ele){ function resizeImg(ele, targetWidth, targetHeight){
var img = $(ele); var img = $(ele);
var width = ele.width; var width = ele.width;
var height = ele.height; var height = ele.height;
// resize img proportionaly // resize img proportionaly
if( width > height && width > 430){ if( width > height && width > targetWidth){
var ratio = 430/width; var ratio = targetWidth/width;
img.css("width", "430px"); img.css("width", targetHeight+"px");
var newHeight = height * ratio; var newHeight = height * ratio;
img.css("height", newHeight); img.css("height", newHeight);
}else if( width < height && height > targetHeight){
}else if( width < height && height > 430){ var ratio = targetHeight/height;
var ratio = 430/height; img.css("height", targetHeight+"px");
img.css("height", "430px");
var newWidth = width * ratio; var newWidth = width * ratio;
img.css("width", newWidth); img.css("width", newWidth);
}else if( width == height && width > 430){ }else if( width == height && width > targetWidth){
img.css("height", "430px"); img.css("height", targetHeight+"px");
img.css("width", "430px" ); img.css("width", targetWidth+"px" );
} }
} }

View file

@ -10,31 +10,6 @@ function showErrorSections() {
} }
} }
function resizeImg(ele){
var img = $(ele);
var width = ele.width;
var height = ele.height;
// resize img proportionaly
if( width > height && width > 450){
var ratio = 450/width;
img.css("width", "450px");
var newHeight = height * ratio;
img.css("height", newHeight );
}else if( width < height && height > 450){
var ratio = 450/height;
img.css("height", "450px");
var newWidth = width * ratio;
img.css("width", newWidth );
}else if( width == height && width > 450){
img.css("height", "450px");
img.css("width", "450px" );
}
}
$(document).ready(function() { $(document).ready(function() {
var form = $("form"); var form = $("form");

View file

@ -41,11 +41,22 @@
.jp-logo{ .jp-logo{
width:400px; width:400px;
height: 67px; height: 67px;
background:#282828 url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px; /* background:#282828 url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px;
background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -moz-radial-gradient(200px 0px, circle cover, rgba(70,70,70,1) 0%, rgba(40,40,40,1) 90%); background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -moz-radial-gradient(200px 0px, circle cover, rgba(70,70,70,1) 0%, rgba(40,40,40,1) 90%);
background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -webkit-radial-gradient(170px 20px, rgba(70,70,70,1) 0%,rgba(40,40,40,1) 70%); background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -webkit-radial-gradient(170px 20px, rgba(70,70,70,1) 0%,rgba(40,40,40,1) 70%); */
background:#282828 no-repeat 120px 14px;
background: no-repeat 120px 14px, -moz-radial-gradient(200px 0px, circle cover, rgba(70,70,70,1) 0%, rgba(40,40,40,1) 90%);
background: no-repeat 120px 14px, -webkit-radial-gradient(170px 20px, rgba(70,70,70,1) 0%,rgba(40,40,40,1) 70%);
display:block; display:block;
} }
.jp-logo img{
display: block;
margin-left: auto;
margin-right: auto;
}
.jp-stream { .jp-stream {
height: 27px; height: 27px;
display:block; display:block;