Merge branch 'saas-dev' into soundcloud

Conflicts:
	airtime_mvc/application/views/scripts/form/preferences.phtml
	airtime_mvc/public/js/airtime/preferences/preferences.js
This commit is contained in:
Duncan Sommerville 2015-06-26 10:37:30 -04:00
commit c44bae8140
18 changed files with 150 additions and 182 deletions

View file

@ -144,13 +144,14 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$view->headLink()->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version']); $view->headLink(array('rel' => 'icon', 'href' => $baseUrl . 'favicon.ico', 'type' => 'image/x-icon'), 'PREPEND')
$view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version'])
$view->headLink()->appendStylesheet($baseUrl . 'css/pro_dropdown_3.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version'])
$view->headLink()->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/pro_dropdown_3.css?' . $CC_CONFIG['airtime_version'])
$view->headLink()->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version'])
$view->headLink()->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version'])
$view->headLink()->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']); ->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version'])
->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']);
} }
protected function _initHeadScript() protected function _initHeadScript()
@ -161,22 +162,22 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$view->headScript()->appendFile($baseUrl . 'js/libs/jquery-1.8.3.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl . 'js/libs/jquery-1.8.3.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/libs/jquery-ui-1.8.24.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/libs/jquery-ui-1.8.24.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/bootstrap/bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/bootstrap/bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/libs/underscore-min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/libs/underscore-min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); // ->appendFile($baseUrl . 'js/libs/jquery.stickyPanel.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/qtip/jquery.qtip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/sprintf/sprintf-0.7-beta1.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/cookie/jquery.cookie.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')
->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
// $view->headScript()->appendFile($baseUrl . 'js/libs/jquery.stickyPanel.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendScript("$.i18n.setDictionary(general_dict)")
$view->headScript()->appendFile($baseUrl . 'js/qtip/jquery.qtip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendScript("var baseUrl='$baseUrl'");
$view->headScript()->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl . 'js/sprintf/sprintf-0.7-beta1.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl . 'js/cookie/jquery.cookie.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendScript("$.i18n.setDictionary(general_dict)");
$view->headScript()->appendScript("var baseUrl='$baseUrl'");
//These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone //These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone
//or the server's set timezone. //or the server's set timezone.
@ -193,14 +194,14 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
} }
//scripts for now playing bar //scripts for now playing bar
$view->headScript()->appendFile($baseUrl . 'js/airtime/airtime_bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl . 'js/airtime/airtime_bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/airtime/dashboard/helperfunctions.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/airtime/dashboard/helperfunctions.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/airtime/dashboard/dashboard.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/airtime/dashboard/dashboard.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/airtime/dashboard/versiontooltip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/airtime/dashboard/versiontooltip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/tipsy/jquery.tipsy.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/tipsy/jquery.tipsy.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/common.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/airtime/common/common.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); ->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if (!is_null($user)) { if (!is_null($user)) {
@ -210,23 +211,19 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
} }
$view->headScript()->appendScript("var userType = '$userType';"); $view->headScript()->appendScript("var userType = '$userType';");
if (array_key_exists('REQUEST_URI', $_SERVER)) { //Doesn't exist for unit tests if (array_key_exists('REQUEST_URI', $_SERVER) //Doesn't exist for unit tests
if (strpos($_SERVER['REQUEST_URI'], $baseUrl . 'Dashboard/stream-player') === false && strpos($_SERVER['REQUEST_URI'], 'Dashboard/stream-player') === false
&& strpos($_SERVER['REQUEST_URI'], $baseUrl . 'audiopreview/audio-preview') === false && strpos($_SERVER['REQUEST_URI'], 'audiopreview') === false
&& strpos($_SERVER['REQUEST_URI'], $baseUrl . 'audiopreview/playlist-preview') === false && $_SERVER['REQUEST_URI'] != "/") {
&& strpos($_SERVER['REQUEST_URI'], $baseUrl . 'audiopreview/block-preview') === false $plan_level = strval(Application_Model_Preference::GetPlanLevel());
&& $_SERVER['REQUEST_URI'] != "/" // Since the Hobbyist plan doesn't come with Live Chat support, don't enable it
) { if (Application_Model_Preference::GetLiveChatEnabled() && $plan_level !== 'hobbyist') {
$plan_level = strval(Application_Model_Preference::GetPlanLevel()); $client_id = strval(Application_Model_Preference::GetClientId());
// Since the Hobbyist plan doesn't come with Live Chat support, don't enable it $station_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (Application_Model_Preference::GetLiveChatEnabled() && $plan_level !== 'hobbyist') { $view->headScript()->appendScript("var livechat_client_id = '$client_id';\n" .
$client_id = strval(Application_Model_Preference::GetClientId()); "var livechat_plan_type = '$plan_level';\n" .
$station_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; "var livechat_station_url = 'http://$station_url';");
$view->headScript()->appendScript("var livechat_client_id = '$client_id';\n" . $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
"var livechat_plan_type = '$plan_level';\n" .
"var livechat_station_url = 'http://$station_url';");
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
}
} }
} }

View file

@ -133,6 +133,11 @@ $pages = array(
'action' => 'help', 'action' => 'help',
'resource' => 'dashboard' 'resource' => 'dashboard'
), ),
array(
'label' => _('FAQ'),
'uri' => "https://sourcefabricberlin.zendesk.com/hc/en-us/sections/200994309-Airtime-FAQ",
'target' => "_blank"
),
array( array(
'label' => _('User Manual'), 'label' => _('User Manual'),
'uri' => "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters", 'uri' => "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters",

View file

@ -138,8 +138,13 @@ class UserController extends Zend_Controller_Action
$formData['cu_last_name'] = "admin"; //ditto, avoid non-null DB constraint $formData['cu_last_name'] = "admin"; //ditto, avoid non-null DB constraint
} }
} }
$user->setFirstName($formData['cu_first_name']); if (isset($formData['cu_first_name'])) {
$user->setLastName($formData['cu_last_name']); $user->setFirstName($formData['cu_first_name']);
}
if (isset($formData['cu_last_name'])) {
$user->setLastName($formData['cu_last_name']);
}
// We don't allow 6 x's as a password. // We don't allow 6 x's as a password.
// The reason is because we use that as a password placeholder // The reason is because we use that as a password placeholder
// on the client side. // on the client side.

View file

@ -157,10 +157,13 @@ class Application_Form_EditUser extends Zend_Form
// We need to add the password identical validator here in case // We need to add the password identical validator here in case
// Zend version is less than 1.10.5 // Zend version is less than 1.10.5
public function isValid($data) { public function isValid($data)
$passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator( {
$data['cu_password']); if (isset($data['cu_password'])) {
$this->getElement('cu_passwordVerify')->addValidator($passwordIdenticalValidator); $passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator(
$data['cu_password']);
$this->getElement('cu_passwordVerify')->addValidator($passwordIdenticalValidator);
}
return parent::isValid($data); return parent::isValid($data);
} }
} }

View file

@ -117,16 +117,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
)); ));
$this->addElement($third_party_api); $this->addElement($third_party_api);
// Add the description element
$this->addElement('textarea', 'widgetCode', array(
'label' => 'Javascript Code:',
'required' => false,
'readonly' => true,
'style' => 'font-family: Consolas, "Liberation Mono", Courier,
monospace;',
'value' => self::getWidgetCode(),
));
$locale = new Zend_Form_Element_Select("locale"); $locale = new Zend_Form_Element_Select("locale");
$locale->setLabel(_("Default Language")); $locale->setLabel(_("Default Language"));
$locale->setMultiOptions(Application_Model_Locale::getLocales()); $locale->setMultiOptions(Application_Model_Locale::getLocales());
@ -148,48 +138,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$this->addElement($week_start_day); $this->addElement($week_start_day);
} }
private static function getWidgetCode() {
$host = $_SERVER['SERVER_NAME'];
$code = <<<CODE
<!-- READ THESE INSTRUCTIONS CAREFULLY:
Step 1 of 2: Paste these next 4 lines in the <head> section of your HTML page -->
<script src="https://$host/widgets/js/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="https://$host/widgets/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
<script src="https://$host/widgets/js/jquery.showinfo.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://$host/widgets/css/airtime-widgets.css"></link>
<!-- Step 2 of 2: Paste these remaining lines in the <body> section of your HTML page -->
<div id="headerLiveHolder" style="border: 1px solid #999999; padding: 10px;"></div>
<div id="onAirToday"></div>
<div id="scheduleTabs"></div>
<script type="text/javascript">
$(document).ready(function() {
$("#headerLiveHolder").airtimeLiveInfo({
sourceDomain: "http://$host",
updatePeriod: 20 //seconds
});
$("#onAirToday").airtimeShowSchedule({
sourceDomain: "http://$host",
updatePeriod: 5, //seconds
showLimit: 10
});
$("#scheduleTabs").airtimeWeekSchedule({
sourceDomain:"http://$host",
updatePeriod: 600 //seconds
});
var d = new Date().getDay();
$('#scheduleTabs').tabs({selected: d === 0 ? 6 : d-1, fx: { opacity: 'toggle' }});
});
</script>
CODE;
return $code;
}
private function getWeekStartDays() private function getWeekStartDays()
{ {
$days = array( $days = array(

View file

@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo $this->headTitle() ?> <?php echo $this->headTitle() ?>
<?php echo $this->headLink() ?> <?php echo $this->headLink() ?>
<?php echo $this->headScript() ?> <?php echo $this->headScript() ?>
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?> <?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>

View file

@ -8,6 +8,7 @@
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'>
<script type="text/javascript"> <script type="text/javascript">
var RETRY_DELAY_MSECS = 2000; //Delay before trying to reconnect to stream after an error.
var MAX_MOBILE_SCREEN_WIDTH = 760; var MAX_MOBILE_SCREEN_WIDTH = 760;
// We are creating a custom player object that acts as a wrapper // We are creating a custom player object that acts as a wrapper
@ -31,6 +32,7 @@
'title': 'test', 'title': 'test',
'bgcolor': '#FFFFFF', 'bgcolor': '#FFFFFF',
'skin': 'mcclean', 'skin': 'mcclean',
'reconnectTime' : 2000, //Doesn't seem to do anything
'width': 180, 'width': 180,
'height': 60 'height': 60
}; };
@ -64,21 +66,19 @@
if (!this.flashDetect) { if (!this.flashDetect) {
MRP.html.audio.addEventListener('error', function failed(e) { MRP.html.audio.addEventListener('error', function failed(e) {
var streamUrl = "";
if (musesPlayer.playerMode == "auto") {
var nextAvailableStream = musesPlayer.getNextAvailableStream();
streamUrl = nextAvailableStream["url"];
} else {
streamUrl = musesPlayer.settings.url;
}
switch (e.target.error.code) { switch (e.target.error.code) {
case e.target.error.MEDIA_ERR_NETWORK: case e.target.error.MEDIA_ERR_NETWORK:
// If there is a network error keep retrying to connect // If there is a network error keep retrying to connect
// to a stream. // to a stream.
var stream; musesPlayer.deferredPlay(streamUrl, RETRY_DELAY_MSECS);
if (musesPlayer.playerMode == "auto") {
var nextAvailableStream = musesPlayer.getNextAvailableStream();
stream = nextAvailableStream["url"];
} else {
stream = musesPlayer.settings.url;
}
var audio = $(MRP.html.audio);
audio[0].src = stream;
audio[0].load();
audio[0].play();
break; break;
case e.target.error.MEDIA_ERR_DECODE: case e.target.error.MEDIA_ERR_DECODE:
// If there was a corruption error or a problem with the browser // If there was a corruption error or a problem with the browser
@ -92,11 +92,7 @@
// or the max number of listeners has been reached // or the max number of listeners has been reached
// retry connection with the next available stream. // retry connection with the next available stream.
if (musesPlayer.playerMode == "auto") { if (musesPlayer.playerMode == "auto") {
var nextAvailableStream = musesPlayer.getNextAvailableStream(); musesPlayer.deferredPlay(nextAvailableStream["url"], RETRY_DELAY_MSECS);
var audio = $(MRP.html.audio);
audio[0].src = nextAvailableStream["url"];;
audio[0].load();
audio[0].play();
} else { } else {
// If in manual mode and the current stream format is not supported // If in manual mode and the current stream format is not supported
// or the max number of listeners has been reached // or the max number of listeners has been reached
@ -179,27 +175,44 @@
MRP.setUrl(url); MRP.setUrl(url);
}; };
/** Retry playback after a few seconds (used to throttle attempts to reconnect/play). */
MusesPlayer.prototype.deferredPlay = function(streamUrl, delayMSec) {
if (!this.flashDetect) {
setTimeout(function() {
var audio = $(MRP.html.audio);
audio[0].src = streamUrl;
audio[0].load();
audio[0].play();
}, delayMSec);
} else {
setTimeout(function() {
musesPlayer.setURL(streamUrl);
musesPlayer.play();
}, delayMSec);
}
};
// detects errors in FLASH mode // detects errors in FLASH mode
function musesCallback(event,value) { function musesCallback(event,value) {
switch (event) { switch (event) {
case "ioError": case "ioError":
// problem connecting to stream // problem connecting to stream
var stream; var streamUrl = "";
if (musesPlayer.playerMode == "auto") { if (musesPlayer.playerMode == "auto") {
stream = musesPlayer.getNextAvailableStream(); streamUrl = musesPlayer.getNextAvailableStream()["url"];
musesPlayer.setURL(stream["url"]);
} else { } else {
stream = musesPlayer.settings.url; streamUrl = musesPlayer.settings.url;
musesPlayer.setURL(stream);
} }
musesPlayer.play();
//Retry playback but only after sleeping for a bit, to avoid spinning.
musesPlayer.deferredPlay(streamUrl, RETRY_DELAY_MSECS);
break; break;
case "securityError": case "securityError":
// max listeners reached // max listeners reached
if (musesPlayer.playerMode == "auto") { if (musesPlayer.playerMode == "auto") {
var stream = musesPlayer.getNextAvailableStream(); var stream = musesPlayer.getNextAvailableStream();
musesPlayer.setURL(stream["url"]); musesPlayer.deferredPlay(stream["url"], RETRY_DELAY_MSECS);
musesPlayer.play();
} else { } else {
// If in manual mode and there is a problem connecting to // If in manual mode and there is a problem connecting to
// the stream display an error and stop play back. // the stream display an error and stop play back.
@ -275,7 +288,14 @@
} else { } else {
var artist = data.current.name.split(" - ")[0]; var artist = data.current.name.split(" - ")[0];
var track = data.current.name.split(" - ")[1]; var track = data.current.name.split(" - ")[1];
$("p.now_playing").html(artist + "<span>" + track + "</span>"); var nowPlayingHtml = "";
if (artist) {
nowPlayingHtml += artist;
}
if (track) {
nowPlayingHtml += "<span>" + track + "</span>";
}
$("p.now_playing").html(nowPlayingHtml);
var current_track_end_time = new Date(data.current.ends); var current_track_end_time = new Date(data.current.ends);
if (current_track_end_time == "Invalid Date" || isNaN(current_track_end_time)) { if (current_track_end_time == "Invalid Date" || isNaN(current_track_end_time)) {

View file

@ -8,17 +8,14 @@
<?php echo $this->element->getSubform('preferences_tunein') ?> <?php echo $this->element->getSubform('preferences_tunein') ?>
</div> </div>
<?php //No soundcloud stuff on Airtime Pro -- Albert ?>
<h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span><?php echo _("SoundCloud Settings") ?></h3> <h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span><?php echo _("SoundCloud Settings") ?></h3>
<div class="collapsible-content" id="soundcloud-settings"> <div class="collapsible-content" id="soundcloud-settings">
<?php echo $this->element->getSubform('preferences_soundcloud') ?> <?php echo $this->element->getSubform('preferences_soundcloud') ?>
</div> </div>
<!-- Hide the 'dangerous settings' by default -->
<h3 class="collapsible-header" id="dangerous-heading"><span class="arrow-icon"></span><?php echo _("Dangerous Options") ?></h3> <h3 class="collapsible-header closed" id="dangerous-heading"><span class="arrow-icon"></span><?php echo _("Dangerous Options") ?></h3>
<div class="collapsible-content" id="dangerous-settings"> <div class="collapsible-content" id="dangerous-settings" style="display:none;">
<?php echo $this->element->getSubform('preferences_danger') ?> <?php echo $this->element->getSubform('preferences_danger') ?>
</div> </div>

View file

@ -37,7 +37,5 @@
<?php echo $this->element->getElement('thirdPartyApi')->render() ?> <?php echo $this->element->getElement('thirdPartyApi')->render() ?>
<?php echo $this->element->getElement('widgetCode')->render() ?>
</dl> </dl>
</fieldset> </fieldset>

View file

@ -1841,7 +1841,6 @@ span.errors.sp-errors{
} }
.collapsible-content { .collapsible-content {
margin-top:-1px; margin-top:-1px;
display:none;
} }
.collapsible-header .arrow-icon, .collapsible-header-disabled .arrow-icon { .collapsible-header .arrow-icon, .collapsible-header-disabled .arrow-icon {
display:block; display:block;
@ -1853,9 +1852,8 @@ span.errors.sp-errors{
top:8px; top:8px;
} }
.collapsible-header.closed .arrow-icon, collapsible-header-disabled.close .arrow-icon { .collapsible-header.closed .arrow-icon, .collapsible-header-disabled.close .arrow-icon {
background-position: 0 -11px !important; background-position: 0 -11px !important;
} }
#schedule-add-show .button-bar { #schedule-add-show .button-bar {
height: 28px; height: 28px;

View file

@ -198,7 +198,7 @@ function buildplaylist(p_url, p_playIndex) {
width = 490; width = 490;
} }
window.resizeTo(width, height); window.resizeTo(width, height);
}); });
} }
@ -247,6 +247,4 @@ function playOne(uri, mime) {
_playlist_jplayer.setPlaylist(playlist); _playlist_jplayer.setPlaylist(playlist);
_playlist_jplayer.play(0); _playlist_jplayer.play(0);
} }
window.resizeTo(490, 167);
} }

View file

@ -143,7 +143,8 @@ function open_show_preview(p_showID, p_showIndex) {
} }
function openPreviewWindow(url) { function openPreviewWindow(url) {
_preview_window = window.open(url, $.i18n._('Audio Player'), 'width=450,height=100,scrollbars=yes'); // Hardcoding this here is kinda gross, but the alternatives aren't much better...
_preview_window = window.open(url, $.i18n._('Audio Player'), 'width=482,height=110,scrollbars=yes');
return false; return false;
} }
@ -155,4 +156,4 @@ function removeSuccessMsg() {
var $status = $('.success'); var $status = $('.success');
$status.fadeOut("slow", function(){$status.empty()}); $status.fadeOut("slow", function(){$status.empty()});
} }

View file

@ -6,7 +6,9 @@ var AIRTIME = (function(AIRTIME) {
$libTable, $libTable,
LIB_SELECTED_CLASS = "lib-selected", LIB_SELECTED_CLASS = "lib-selected",
chosenItems = {}, chosenItems = {},
visibleChosenItems = {}; visibleChosenItems = {},
$previouslySelected;
// we need to know whether the criteria value is string or // we need to know whether the criteria value is string or
// numeric in order to provide a single textbox or range textboxes // numeric in order to provide a single textbox or range textboxes
@ -859,28 +861,35 @@ var AIRTIME = (function(AIRTIME) {
}); });
$libTable.find("tbody").on("click", "input[type=checkbox]", function(ev) { $libTable.find("tbody").on("click", "input[type=checkbox]", function(ev) {
var $cb = $(this), var $cb = $(this),
$prev,
$tr = $cb.parents("tr"), $tr = $cb.parents("tr"),
$trs; // Get the ID of the selected row
$rowId = $tr.attr("id");
if ($cb.is(":checked")) { if ($cb.is(":checked")) {
if (ev.shiftKey && $previouslySelected !== undefined) {
if (ev.shiftKey) { // If the selected row comes before the previously selected row,
$prev = $libTable.find("tbody").find("tr."+LIB_SELECTED_CLASS).eq(-1); // we want to select previous rows, otherwise we select next
$trs = $prev.nextUntil($tr); if ($previouslySelected.prevAll("#"+$rowId).length !== 0) {
$previouslySelected.prevUntil($tr).each(function(i, el){
$trs.each(function(i, el){ mod.selectItem($(el));
mod.selectItem($(el)); });
}); } else {
$previouslySelected.nextUntil($tr).each(function(i, el){
mod.selectItem($(el));
});
}
} }
mod.selectItem($tr); mod.selectItem($tr);
// Remember this row so we can properly multiselect
$previouslySelected = $tr;
} }
else { else {
mod.deselectItem($tr); mod.deselectItem($tr);
} }
}); });
// begin context menu initialization. // begin context menu initialization.

View file

@ -113,25 +113,6 @@ function setMsAuthenticationFieldsReadonly(ele) {
} }
} }
function setCollapsibleWidgetJsCode() {
var x = function() {
var val = $('input:radio[name=thirdPartyApi]:checked').val();
if (val == "1") {
//show js textarea
$('#widgetCode-label').show("fast");
$('#widgetCode-element').show("fast");
} else {
if ($('#widgetCode-label').is(":visible")) {
//hide js textarea
$('#widgetCode-label').hide();
$('#widgetCode-element').hide();
}
}
}
x();
$('#thirdPartyApi-element input').click(x);
}
function removeLogo() { function removeLogo() {
$.post(baseUrl+'Preference/remove-logo', function(json){}); $.post(baseUrl+'Preference/remove-logo', function(json){});
location.reload(); location.reload();
@ -151,7 +132,7 @@ $(document).ready(function() {
$(this).next().toggle('fast'); $(this).next().toggle('fast');
$(this).toggleClass("closed"); $(this).toggleClass("closed");
return false; return false;
}).next().hide(); });
if ($("#tunein-settings").find(".errors").length > 0) { if ($("#tunein-settings").find(".errors").length > 0) {
$(".collapsible-content#tunein-settings").show(); $(".collapsible-content#tunein-settings").show();
@ -178,7 +159,6 @@ $(document).ready(function() {
setSystemFromEmailReadonly(); setSystemFromEmailReadonly();
setConfigureMailServerListener(); setConfigureMailServerListener();
setEnableSystemEmailsListener(); setEnableSystemEmailsListener();
setCollapsibleWidgetJsCode();
setTuneInSettingsReadonly(); setTuneInSettingsReadonly();
setTuneInSettingsListener(); setTuneInSettingsListener();
setSoundCloudSettingsListener(); setSoundCloudSettingsListener();

View file

@ -35,7 +35,7 @@ def postinst():
os.chmod('/var/log/airtime', 0775) os.chmod('/var/log/airtime', 0775)
# Create the Celery user # Create the Celery user
call(['adduser', '--no-create-home', '--home', '/var/lib/celery', '--gecos', '""', '--disabled-login', 'celery']) call(['adduser', '--no-create-home', '--home', '/var/lib/celery', '--gecos', '', '--disabled-login', 'celery'])
# Add celery to the www-data group # Add celery to the www-data group
call(['usermod', '-G', 'www-data', '-a', 'celery']) call(['usermod', '-G', 'www-data', '-a', 'celery'])

View file

@ -150,6 +150,7 @@ class ListenerStat(Thread):
self.logger.error('Exception: %s', e) self.logger.error('Exception: %s', e)
time.sleep(120) time.sleep(120)
self.logger.info('ListenerStat thread exiting')
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -5,6 +5,8 @@ from Queue import Empty
import logging import logging
import shutil import shutil
import time
import traceback
import os import os
import sys import sys
import stat import stat
@ -203,5 +205,10 @@ class PypoFile(Thread):
""" """
Entry point of the thread Entry point of the thread
""" """
self.main() try: self.main()
except Exception, e:
top = traceback.format_exc()
self.logger.error('PypoFile Exception: %s', top)
time.sleep(5)
self.logger.info('PypoFile thread exiting')

View file

@ -153,4 +153,5 @@ class PypoPush(Thread):
top = traceback.format_exc() top = traceback.format_exc()
self.logger.error('Pypo Push Exception: %s', top) self.logger.error('Pypo Push Exception: %s', top)
time.sleep(5) time.sleep(5)
self.logger.info('PypoPush thread exiting')