SAAS-885, SAAS-857, SAAS-878 - Cosmetic fixes, remove js widget box in preferences

This commit is contained in:
Duncan Sommerville 2015-06-25 14:13:09 -04:00
parent 616cf143d5
commit 6fb9c6a30c
6 changed files with 46 additions and 104 deletions

View file

@ -139,13 +139,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()
@ -156,22 +157,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.
@ -188,14 +189,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)) {
@ -205,23 +206,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

@ -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

@ -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

@ -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;
} }