CC-2184: Hardcoded CSS path should be relative path instead
This commit is contained in:
parent
7165d1fa2e
commit
d32495d100
47 changed files with 366 additions and 340 deletions
|
@ -43,12 +43,32 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
$view->doctype('XHTML1_STRICT');
|
||||
}
|
||||
|
||||
protected function _initGlobals()
|
||||
{
|
||||
$view = $this->getResource('view');
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$view->headScript()->appendScript("var baseUrl = '$baseUrl'");
|
||||
|
||||
$user = Application_Model_User::GetCurrentUser();
|
||||
if (!is_null($user)){
|
||||
$userType = $user->getType();
|
||||
} else {
|
||||
$userType = "";
|
||||
}
|
||||
$view->headScript()->appendScript("var userType = '$userType';");
|
||||
|
||||
}
|
||||
|
||||
protected function _initHeadLink()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$view = $this->getResource('view');
|
||||
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$CC_CONFIG['base_dir'] = $baseUrl;
|
||||
|
||||
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
|
||||
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
@ -63,7 +83,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
global $CC_CONFIG;
|
||||
|
||||
$view = $this->getResource('view');
|
||||
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -72,7 +93,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
$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/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$view->headScript()->appendScript("var baseUrl='$baseUrl/'");
|
||||
$view->headScript()->appendScript("var baseUrl='$baseUrl'");
|
||||
|
||||
//scripts for now playing bar
|
||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -96,6 +117,15 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
|
||||
$view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
|
||||
if (Application_Model_Preference::GetPlanLevel() != "disabled"
|
||||
&& !($_SERVER['REQUEST_URI'] == $baseUrl.'/Dashboard/stream-player' ||
|
||||
strncmp($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview', strlen($baseUrl.'/audiopreview/audio-preview'))==0)) {
|
||||
$client_id = Application_Model_Preference::GetClientId();
|
||||
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
|
||||
$view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function _initViewHelpers()
|
||||
|
|
|
@ -63,4 +63,11 @@ class Application_Common_OsPath{
|
|||
|
||||
return join(DIRECTORY_SEPARATOR, $paths);
|
||||
}
|
||||
|
||||
public static function getBaseDir() {
|
||||
$baseUrl = dirname($_SERVER['SCRIPT_NAME']);
|
||||
if (strcmp($baseUrl, '/') ==0) $baseUrl = "";
|
||||
|
||||
return $baseUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$audioFileTitle = $this->_getParam('audioFileTitle');
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],
|
||||
|
@ -79,8 +78,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$playlistIndex = $this->_getParam('playlistIndex');
|
||||
$playlistID = $this->_getParam('playlistID');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -106,8 +104,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$blockIndex = $this->_getParam('blockIndex');
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -232,8 +229,8 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$showID = $this->_getParam('showID');
|
||||
$showIndex = $this->_getParam('showIndex');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = dirname($_SERVER['SCRIPT_NAME']);
|
||||
if (strcmp($baseUrl, '/') ==0) $baseUrl = "";
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -258,6 +255,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
*/
|
||||
public function getShowAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
@ -297,7 +295,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
throw new Exception("Unknown file type: $mime");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
|
||||
$elementMap['uri'] = $CC_CONFIG["base_dir"]."/api/get-media/file/".$track['item_id'];
|
||||
} else {
|
||||
$elementMap['uri'] = $track['filepath'];
|
||||
}
|
||||
|
|
|
@ -98,8 +98,7 @@ class DashboardController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.blue.monday.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->_helper->layout->setLayout('bare');
|
||||
|
@ -108,7 +107,7 @@ class DashboardController extends Zend_Controller_Action
|
|||
if ($logo) {
|
||||
$this->view->logo = "data:image/png;base64,$logo";
|
||||
} else {
|
||||
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
|
||||
$this->view->logo = $baseUrl."/css/images/airtime_logo_jp.png";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
@ -142,12 +142,14 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
public function contextMenuAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$id = $this->_getParam('id');
|
||||
$type = $this->_getParam('type');
|
||||
//playlist||timeline
|
||||
$screen = $this->_getParam('screen');
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$menu = array();
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
@ -182,8 +184,8 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
if ($isAdminOrPM) {
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
|
||||
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}");
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete");
|
||||
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}");
|
||||
}
|
||||
|
||||
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
|
||||
|
@ -208,8 +210,9 @@ class LibraryController extends Zend_Controller_Action
|
|||
$menu["edit"] = array("name"=> "Edit", "icon" => "edit");
|
||||
}
|
||||
}
|
||||
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete");
|
||||
}
|
||||
} elseif ($type == "stream") {
|
||||
|
||||
|
@ -224,9 +227,9 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($screen == "playlist") {
|
||||
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}");
|
||||
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}");
|
||||
}
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +255,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$text = "Upload to SoundCloud";
|
||||
}
|
||||
|
||||
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => "/library/upload-file-soundcloud/id/{$id}");
|
||||
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $CC_CONFIG['base_dir']."/library/upload-file-soundcloud/id/{$id}");
|
||||
}
|
||||
|
||||
if (empty($menu)) {
|
||||
|
|
|
@ -12,7 +12,11 @@ class LoginController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
if (Zend_Auth::getInstance()->hasIdentity()) {
|
||||
$request = $this->getRequest();
|
||||
|
||||
if (Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
|
||||
$this->_redirect('Showbuilder');
|
||||
}
|
||||
|
||||
|
@ -20,8 +24,8 @@ class LoginController extends Zend_Controller_Action
|
|||
$this->_helper->layout->setLayout('login');
|
||||
|
||||
$error = false;
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
|
@ -96,8 +100,8 @@ class LoginController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
if (!Application_Model_Preference::GetEnableSystemEmail()) {
|
||||
|
|
|
@ -15,7 +15,8 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
//default time is the last 24 hours.
|
||||
$now = time();
|
||||
|
@ -81,4 +82,5 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->history = $r["history"];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,8 +15,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/plupload/plupload.full.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
|
|
@ -22,10 +22,11 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->statusMsg = "";
|
||||
|
@ -74,7 +75,9 @@ class PreferenceController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
Logging::info($baseUrl);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->statusMsg = "";
|
||||
|
@ -134,8 +137,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -151,7 +154,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
|
|
|
@ -784,7 +784,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
if ($success) {
|
||||
$scheduler = new Application_Model_Scheduler();
|
||||
$scheduler->removeGaps($data['add_show_instance_id']);
|
||||
$showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find();
|
||||
foreach ($showInstances as $si) {
|
||||
$scheduler->removeGaps($si->getDbId());
|
||||
}
|
||||
$this->view->addNewShow = true;
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
} else {
|
||||
|
|
|
@ -18,12 +18,14 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$user = Application_Model_User::GetCurrentUser();
|
||||
$userType = $user->getType();
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||
|
||||
|
@ -62,8 +64,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version']),'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
@ -173,6 +174,8 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
public function contextMenuAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$id = $this->_getParam('id');
|
||||
$now = floatval(microtime(true));
|
||||
|
||||
|
@ -192,7 +195,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
|
||||
|
||||
//remove/truncate the item from the schedule
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/showbuilder/schedule-remove");
|
||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/showbuilder/schedule-remove");
|
||||
}
|
||||
|
||||
$this->view->items = $menu;
|
||||
|
|
|
@ -6,8 +6,7 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class UserController extends Zend_Controller_Action
|
|||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$js_files = array(
|
||||
'/js/datatables/js/jquery.dataTables.js?',
|
||||
|
|
|
@ -4,6 +4,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
// Set the method for the display form to POST
|
||||
$this->setMethod('post');
|
||||
|
||||
|
@ -137,7 +138,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
'ignore' => true,
|
||||
'class' => 'btn md-cancel',
|
||||
'label' => 'Cancel',
|
||||
'onclick' => 'javascript:document.location.href = "/Library"',
|
||||
'onclick' => 'javascript:document.location.href="'.$CC_CONFIG['base_dir'].'/Library"',
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
|
|
@ -6,7 +6,9 @@ class Application_Form_Preferences extends Zend_Form
|
|||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction('/Preference');
|
||||
global $CC_CONFIG;
|
||||
|
||||
$this->setAction($CC_CONFIG['base_dir'] . '/Preference');
|
||||
$this->setMethod('post');
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<?php echo $this->headScript() ?>
|
||||
<?php echo $this->headLink() ?>
|
||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||
<?php global $CC_CONFIG; ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -22,7 +23,7 @@
|
|||
$this->navigation()->menu()->setPartial($partial); ?>
|
||||
<div class="personal-block solo">
|
||||
<ul>
|
||||
<li><span class="name"><?php echo $this->loggedInAs()?></span> | <a href="/Login/logout">Logout</a></li>
|
||||
<li><span class="name"><?php echo $this->loggedInAs()?></span> | <a href=<?php echo $CC_CONFIG['base_dir'] . "/Login/logout"?>>Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -500,6 +500,7 @@ class Application_Model_Preference
|
|||
} else {
|
||||
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL;
|
||||
}
|
||||
|
||||
$outputArray['STATION_NAME'] = self::GetStationName();
|
||||
$outputArray['PHONE'] = self::GetPhone();
|
||||
$outputArray['EMAIL'] = self::GetEmail();
|
||||
|
|
|
@ -599,6 +599,7 @@ SQL;
|
|||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public static function getLibraryColumns()
|
||||
{
|
||||
return array("id", "track_title", "artist_name", "album_title",
|
||||
|
@ -609,9 +610,10 @@ SQL;
|
|||
"conductor", "replay_gain", "lptime" );
|
||||
}
|
||||
|
||||
|
||||
public static function searchLibraryFiles($datatables)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
|
||||
|
||||
$displayColumns = self::getLibraryColumns();
|
||||
|
@ -766,14 +768,14 @@ SQL;
|
|||
// ugly
|
||||
if ($type == "au") {
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
$row['image'] = '<img title="Track preview" src="/css/images/icon_audioclip.png">';
|
||||
$row['image'] = '<img title="Track preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_audioclip.png">';
|
||||
} elseif ($type == "pl") {
|
||||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
$row['image'] = '<img title="Playlist preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_playlist.png">';
|
||||
} elseif ($type == "st") {
|
||||
$row['audioFile'] = $row['id'];
|
||||
$row['image'] = '<img title="Webstream preview" src="/css/images/icon_webstream.png">';
|
||||
$row['image'] = '<img title="Webstream preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_webstream.png">';
|
||||
} elseif ($type == "bl") {
|
||||
$row['image'] = '<img title="Smart Block" src="/css/images/icon_smart-block.png">';
|
||||
$row['image'] = '<img title="Smart Block" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_smart-block.png">';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<img src="/css/images/big_gray_logo.png" width="287" height="109" alt="Airtime" class="gray-logo" />
|
||||
<div class="gray-logo"></div>
|
||||
<div class="text-content">
|
||||
<h2>Welcome to Airtime!</h2>
|
||||
<p>Here's how you can get started using Airtime to automate your broadcasts: </p>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</dt>
|
||||
<dd id="add_show_duration-element">
|
||||
<?php echo $this->element->getElement('add_show_duration') ?>
|
||||
<img id="icon-loader-small" src="/css/images/loader-small.gif" style="vertical-align:middle; display:none;"/>
|
||||
<img id="icon-loader-small"/>
|
||||
</dd>
|
||||
<?php if($this->element->getElement('add_show_duration')->hasErrors()){ ?>
|
||||
<ul class='errors'>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div id="import_status" class="library_import" style="display:none">File import in progress... <img src="/css/images/file_import_loader.gif"></img></div>
|
||||
<?php global $CC_CONFIG; ?>
|
||||
<div id="import_status" class="library_import" style="display:none">File import in progress...<img src=<?php echo $CC_CONFIG['base_dir'] . "/css/images/file_import_loader.gif"?>></img></div>
|
||||
<fieldset class="toggle" id="filter_options">
|
||||
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend>
|
||||
<div id="advanced_search" class="advanced_search form-horizontal"></div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
|
||||
<h2 style="float:left">Preferences</h2>
|
||||
<form method="post" action="/Preference/index" enctype="application/x-www-form-urlencoded">
|
||||
<?php global $CC_CONFIG; ?>
|
||||
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/index"?> enctype="application/x-www-form-urlencoded">
|
||||
|
||||
<div class="button-bar bottom" id="submit-element" style="float:right">
|
||||
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
|
||||
<h2 <?php if($this->enable_stream_conf == "true"){?>style="float:left"<?php }?>>Stream Settings</h2>
|
||||
<?php global $CC_CONFIG; ?>
|
||||
<?php if($this->enable_stream_conf == "true"){?>
|
||||
<form method="post" action="/Preference/stream-setting" enctype="application/x-www-form-urlencoded" onsubmit="return confirm('<?php echo $this->confirm_pypo_restart_text ?>');">
|
||||
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/stream-setting"?> enctype="application/x-www-form-urlencoded" onsubmit="return confirm('<?php echo $this->confirm_pypo_restart_text ?>');">
|
||||
<div class="button-bar bottom" id="submit-element" style="float:right">
|
||||
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
|
||||
<h2><?php echo $this->section_title?></h2>
|
||||
<form method="post" action="/Preference/support-setting" enctype="multipart/form-data">
|
||||
<?php global $CC_CONFIG; ?>
|
||||
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/support-setting"?> enctype="multipart/form-data">
|
||||
<div id="support-settings">
|
||||
<?php echo $this->statusMsg ?>
|
||||
<?php echo $this->form ?>
|
||||
|
|
|
@ -17,6 +17,7 @@ web_server_user = www-data
|
|||
airtime_dir = x
|
||||
base_url = localhost
|
||||
base_port = 80
|
||||
base_dir = ''
|
||||
|
||||
;How many hours ahead of time should Airtime playout engine (PYPO)
|
||||
;cache scheduled media files.
|
||||
|
|
|
@ -10,7 +10,8 @@ RewriteCond %{REQUEST_FILENAME} -l [OR]
|
|||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
RewriteBase /
|
||||
#RewriteBase /
|
||||
|
||||
|
||||
AddOutputFilterByType DEFLATE text/plain
|
||||
AddOutputFilterByType DEFLATE text/html
|
||||
|
|
|
@ -71,16 +71,16 @@ select {
|
|||
background-position:center;
|
||||
}
|
||||
#version-icon.outdated {
|
||||
background-image:url(/css/images/icon_outdated.png);
|
||||
background-image:url(images/icon_outdated.png);
|
||||
}
|
||||
#version-icon.update2 {
|
||||
background-image:url(/css/images/icon_update2.png);
|
||||
background-image:url(images/icon_update2.png);
|
||||
}
|
||||
#version-icon.update {
|
||||
background-image:url(/css/images/icon_update.png);
|
||||
background-image:url(images/icon_update.png);
|
||||
}
|
||||
#version-icon.uptodate {
|
||||
background-image:url(/css/images/icon_uptodate.png);
|
||||
background-image:url(images/icon_uptodate.png);
|
||||
}
|
||||
|
||||
#ui-tooltip-version a {
|
||||
|
@ -99,7 +99,7 @@ select {
|
|||
|
||||
display:inline-block; zoom:1; display:inline;
|
||||
width:14px; height:14px;
|
||||
background:url(/css/images/icon_info.png) 0 0 no-repeat;
|
||||
background:url(images/icon_info.png) 0 0 no-repeat;
|
||||
float:right; position:relative; top:2px; right:7px;
|
||||
line-height:16px !important;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ select {
|
|||
position: relative;
|
||||
display:inline-block; zoom:1;
|
||||
width:14px; height:14px;
|
||||
background:url(/css/images/icon_info.png) 0 0 no-repeat;
|
||||
background:url(images/icon_info.png) 0 0 no-repeat;
|
||||
top:2px; right:7px; left: 3px;
|
||||
line-height:16px !important;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ function playAllPlaylist(p_playlistID, p_playlistIndex) {
|
|||
if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) {
|
||||
play(p_playlistIndex);
|
||||
}else {
|
||||
buildplaylist("/audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
|
||||
buildplaylist(baseUrl+"/audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ function playBlock(p_blockId, p_blockIndex)
|
|||
if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) {
|
||||
play(p_blockIndex);
|
||||
} else {
|
||||
buildplaylist("/audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
|
||||
buildplaylist(baseUrl+"/audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ function playAllShow(p_showID, p_index) {
|
|||
if ( _idToPostionLookUp !== undefined && viewsShowID == p_showID ) {
|
||||
play(p_index);
|
||||
}else {
|
||||
buildplaylist("/audiopreview/get-show/showID/"+p_showID, p_index);
|
||||
buildplaylist(baseUrl+"/audiopreview/get-show/showID/"+p_showID, p_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,6 +123,7 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
var media;
|
||||
var index;
|
||||
var total = 0;
|
||||
|
||||
for(index in data) {
|
||||
if (data[index]['type'] == 0) {
|
||||
if (data[index]['element_mp3'] != undefined){
|
||||
|
|
|
@ -53,9 +53,7 @@ function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
|
|||
if(index != -1){
|
||||
audioFileTitle = audioFileTitle.substring(0,index);
|
||||
}
|
||||
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle+'/type/'+type);
|
||||
|
||||
openPreviewWindow(baseUrl+'/audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle+'/type/'+type);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -73,7 +71,7 @@ function open_playlist_preview(p_playlistID, p_playlistIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllPlaylist(p_playlistID, p_playlistIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID);
|
||||
openPreviewWindow(baseUrl+'/audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -84,7 +82,7 @@ function open_block_preview(p_blockId, p_blockIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playBlock(p_blockId, p_blockIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
|
||||
openPreviewWindow(baseUrl+'/audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -98,7 +96,7 @@ function open_show_preview(p_showID, p_showIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllShow(p_showID, p_showIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex);
|
||||
openPreviewWindow(baseUrl+'/audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ function controlSwitchLight(){
|
|||
}
|
||||
|
||||
function getScheduleFromServer(){
|
||||
$.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
|
||||
$.ajax({ url: baseUrl+"/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
|
||||
parseItems(data.entries);
|
||||
parseSourceStatus(data.source_status);
|
||||
parseSwitchStatus(data.switch_status);
|
||||
|
@ -398,7 +398,7 @@ function setSwitchListener(ele){
|
|||
var sourcename = $(ele).attr('id');
|
||||
var status_span = $(ele).find("span");
|
||||
var status = status_span.html();
|
||||
$.get("/Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
|
||||
$.get(baseUrl+"/Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
|
||||
if(data.error){
|
||||
alert(data.error);
|
||||
}else{
|
||||
|
@ -415,7 +415,7 @@ function setSwitchListener(ele){
|
|||
function kickSource(ele){
|
||||
var sourcename = $(ele).attr('id');
|
||||
|
||||
$.get("/Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){
|
||||
$.get(baseUrl+"/Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){
|
||||
if(data.error){
|
||||
alert(data.error);
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ function init() {
|
|||
|
||||
$('.listen-control-button').click(function() {
|
||||
if (stream_window == null || stream_window.closed)
|
||||
stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=158');
|
||||
stream_window=window.open(baseUrl+"/Dashboard/stream-player", 'name', 'width=400,height=158');
|
||||
stream_window.focus();
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -310,7 +310,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
mod.fnDeleteItems = function(aMedia) {
|
||||
|
||||
$.post("/library/delete",
|
||||
$.post(baseUrl+"/library/delete",
|
||||
{"format": "json", "media": aMedia},
|
||||
function(json){
|
||||
if (json.message !== undefined) {
|
||||
|
@ -479,7 +479,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"fnStateSave": function (oSettings, oData) {
|
||||
localStorage.setItem('datatables-library', JSON.stringify(oData));
|
||||
$.ajax({
|
||||
url: "/usersettings/set-library-datatable",
|
||||
url: baseUrl+"/usersettings/set-library-datatable",
|
||||
type: "POST",
|
||||
data: {settings : oData, format: "json"},
|
||||
dataType: "json"
|
||||
|
@ -520,7 +520,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
oData.iCreate = parseInt(oData.iCreate, 10);
|
||||
},
|
||||
|
||||
"sAjaxSource": "/Library/contents-feed",
|
||||
"sAjaxSource": baseUrl+"/Library/contents-feed",
|
||||
"sAjaxDataProp": "files",
|
||||
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
|
@ -604,7 +604,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
text: aData.track_title
|
||||
},
|
||||
ajax: {
|
||||
url: "/Library/get-file-metadata",
|
||||
url: baseUrl+"/Library/get-file-meta-data",
|
||||
type: "get",
|
||||
data: ({format: "html", id : aData.id, type: aData.ftype}),
|
||||
success: function(data, status) {
|
||||
|
@ -770,13 +770,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
};
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
callback = function() {
|
||||
var url = '/Playlist/edit';
|
||||
var url = baseUrl+'/Playlist/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
};
|
||||
} else if (data.ftype === "stream") {
|
||||
callback = function() {
|
||||
var url = '/Webstream/edit';
|
||||
var url = baseUrl+'/Webstream/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
}
|
||||
} else {
|
||||
|
@ -882,7 +882,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
request = $.ajax({
|
||||
url: "/library/context-menu",
|
||||
url: baseUrl+"/library/context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, type: data.ftype, format: "json", "screen": screen},
|
||||
dataType: "json",
|
||||
|
@ -905,7 +905,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}(AIRTIME || {}));
|
||||
|
||||
function checkImportStatus() {
|
||||
$.getJSON('/Preference/is-import-in-progress', function(data){
|
||||
$.getJSON(baseUrl+'/Preference/is-import-in-progress', function(data){
|
||||
var div = $('#import_status');
|
||||
var table = $('#library_display').dataTable();
|
||||
if (data == true){
|
||||
|
@ -938,7 +938,7 @@ function addProgressIcon(id) {
|
|||
|
||||
function checkLibrarySCUploadStatus(){
|
||||
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
var url = baseUrl+'/Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
|
@ -993,7 +993,7 @@ function addQtipToSCIcons(){
|
|||
content: {
|
||||
text: "Retrieving data from the server...",
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
success: function(json, status){
|
||||
|
@ -1019,7 +1019,7 @@ function addQtipToSCIcons(){
|
|||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
success: function(json, status){
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
var uploader;
|
||||
|
||||
$("#plupload_files").pluploadQueue({
|
||||
// General settings
|
||||
runtimes : 'gears, html5, html4',
|
||||
url : '/Plupload/upload/format/json',
|
||||
url : baseUrl+'/Plupload/upload/format/json',
|
||||
chunk_size : '5mb',
|
||||
unique_names : 'true',
|
||||
multiple_queues : 'true',
|
||||
|
@ -27,7 +28,7 @@ $(document).ready(function() {
|
|||
$("#plupload_error table").css("display", "inline-table");
|
||||
}else{
|
||||
var tempFileName = j.tempfilepath;
|
||||
$.get('/Plupload/copyfile/format/json/name/' +
|
||||
$.get(baseUrl+'/Plupload/copyfile/format/json/name/'+
|
||||
encodeURIComponent(file.name)+'/tempname/' +
|
||||
encodeURIComponent(tempFileName), function(json){
|
||||
var jr = jQuery.parseJSON(json);
|
||||
|
|
|
@ -66,7 +66,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
event.stopPropagation();
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-cue",
|
||||
url = baseUrl+"/Playlist/set-cue",
|
||||
cueIn = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
|
@ -103,7 +103,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
event.stopPropagation();
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-cue",
|
||||
url = baseUrl+"/Playlist/set-cue",
|
||||
cueOut = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
|
@ -142,7 +142,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-fade",
|
||||
url = baseUrl+"/Playlist/set-fade",
|
||||
fadeIn = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
|
@ -180,7 +180,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-fade",
|
||||
url = baseUrl+"/Playlist/set-fade",
|
||||
fadeOut = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
|
@ -264,7 +264,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
nameElement.text(nameElement.text().replace("\n", ""));
|
||||
|
||||
/* --until we decide whether Playlist name should autosave or not
|
||||
url = '/Playlist/set-playlist-name';
|
||||
|
||||
url = baseUrl+'/Playlist/set-playlist-name';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", name: nameElement.text(), modified: lastMod, type: type},
|
||||
|
@ -501,7 +502,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
else {
|
||||
$(this).addClass("ui-state-active");
|
||||
|
||||
var url = '/Playlist/get-playlist-fades';
|
||||
var url = baseUrl+'/Playlist/get-playlist-fades';
|
||||
$.post(url,
|
||||
{format: "json", modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
@ -538,7 +539,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$pl.on("blur", "span.spl_main_fade_in", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = "/Playlist/set-playlist-fades",
|
||||
var url = baseUrl+"/Playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeIn = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
|
@ -562,7 +563,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$pl.on("blur", "span.spl_main_fade_out", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = "/Playlist/set-playlist-fades",
|
||||
var url = baseUrl+"/Playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeOut = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
|
@ -623,7 +624,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//hide any previous errors (if any)
|
||||
$("#side_playlist .errors").empty().hide();
|
||||
|
||||
var url = 'Webstream/save';
|
||||
var url = baseUrl+'/Webstream/save';
|
||||
$.post(url,
|
||||
{format: "json", id:id, description: description, url:streamurl, length: length, name: name},
|
||||
function(json){
|
||||
|
@ -668,7 +669,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
var criteria = $('form').serializeArray(),
|
||||
block_name = $('#playlist_name_display').text(),
|
||||
block_desc = $('textarea[name="description"]').val(),
|
||||
save_action = 'Playlist/save',
|
||||
save_action = baseUrl+'/Playlist/save',
|
||||
obj_id = $('input[id="obj_id"]').val(),
|
||||
obj_type = $('#obj_type').val(),
|
||||
lastMod = getModified(),
|
||||
|
@ -793,7 +794,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
mod.fnNew = function() {
|
||||
var url = '/Playlist/new';
|
||||
var url = baseUrl+'/Playlist/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -806,7 +807,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
mod.fnWsNew = function() {
|
||||
var url = '/Webstream/new';
|
||||
var url = baseUrl+'/Webstream/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -818,8 +819,9 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
mod.fnNewBlock = function() {
|
||||
var url = '/Playlist/new';
|
||||
var url = baseUrl+'/Playlist/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -850,7 +852,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
id = (plid === undefined) ? getId() : plid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
url = '/Playlist/delete';
|
||||
url = baseUrl+'/Playlist/delete';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", ids: id, modified: lastMod, type: type},
|
||||
|
@ -867,7 +869,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
id = (wsid === undefined) ? getId() : wsid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
url = '/Webstream/delete';
|
||||
url = baseUrl+'/Webstream/delete';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", ids: id, modified: lastMod, type: type},
|
||||
|
@ -940,20 +942,20 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
mod.fnAddItems = function(aItems, iAfter, sAddType) {
|
||||
var sUrl = "/playlist/add-items";
|
||||
var sUrl = baseUrl+"/playlist/add-items";
|
||||
oData = {"aItems": aItems, "afterItem": iAfter, "type": sAddType};
|
||||
playlistRequest(sUrl, oData);
|
||||
};
|
||||
|
||||
mod.fnMoveItems = function(aIds, iAfter) {
|
||||
var sUrl = "/playlist/move-items",
|
||||
var sUrl = baseUrl+"/playlist/move-items",
|
||||
oData = {"ids": aIds, "afterItem": iAfter};
|
||||
|
||||
playlistRequest(sUrl, oData);
|
||||
};
|
||||
|
||||
mod.fnDeleteItems = function(aItems) {
|
||||
var sUrl = "/playlist/delete-items",
|
||||
var sUrl = baseUrl+"/playlist/delete-items",
|
||||
oData = {"ids": aItems};
|
||||
|
||||
playlistRequest(sUrl, oData);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
function doNotShowPopup(){
|
||||
$.get("/Usersettings/donotshowregistrationpopup", {format:"json"});
|
||||
$.get(baseUrl+"/Usersettings/donotshowregistrationpopup", {format:"json"});
|
||||
}
|
||||
|
||||
var dialog = $("#register_popup");
|
||||
|
@ -19,7 +19,7 @@ $(document).ready(function(){
|
|||
text: "Remind me in 1 week",
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
var url = '/Usersettings/remindme';
|
||||
var url = baseUrl+'/Usersettings/remindme';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format:"json"}
|
||||
|
@ -32,7 +32,7 @@ $(document).ready(function(){
|
|||
text: "Remind me never",
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
var url ='/Usersettings/remindme-never';
|
||||
var url =baseUrl+'/Usersettings/remindme-never';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format:"json"}
|
||||
|
|
|
@ -75,7 +75,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/Playouthistory/playout-history-feed",
|
||||
"sAjaxSource": baseUrl+"/Playouthistory/playout-history-feed",
|
||||
"sAjaxDataProp": "history",
|
||||
|
||||
"fnServerData": fnServerData,
|
||||
|
@ -94,7 +94,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>',
|
||||
|
||||
"oTableTools": {
|
||||
"sSwfPath": "/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
|
||||
"sSwfPath": baseUrl+"/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
|
||||
"aButtons": [
|
||||
"copy",
|
||||
{
|
||||
|
|
|
@ -13,8 +13,8 @@ function setWatchedDirEvents() {
|
|||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: '/css/img/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
systemImageUrl: baseUrl+'/css/img/',
|
||||
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
|
||||
title: 'Choose Storage Folder',
|
||||
basePath: '',
|
||||
requestMethod: 'POST',
|
||||
|
@ -33,8 +33,8 @@ function setWatchedDirEvents() {
|
|||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: '/css/img/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
systemImageUrl: baseUrl+'/css/img/',
|
||||
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
|
||||
title: 'Choose Folder to Watch',
|
||||
basePath: '',
|
||||
requestMethod: 'POST',
|
||||
|
@ -44,7 +44,7 @@ function setWatchedDirEvents() {
|
|||
var url, chosen;
|
||||
|
||||
if(confirm("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!")){
|
||||
url = "/Preference/change-stor-directory";
|
||||
url = baseUrl+"/Preference/change-stor-directory";
|
||||
chosen = $('#storageFolder').val();
|
||||
|
||||
$.post(url,
|
||||
|
@ -64,7 +64,7 @@ function setWatchedDirEvents() {
|
|||
$('#watchedFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
url = "/Preference/reload-watch-directory";
|
||||
url = baseUrl+"/Preference/reload-watch-directory";
|
||||
chosen = $('#watchedFolder').val();
|
||||
|
||||
$.post(url,
|
||||
|
@ -80,7 +80,7 @@ function setWatchedDirEvents() {
|
|||
|
||||
$('.selected-item').find('.ui-icon-refresh').click(function(){
|
||||
var folder = $(this).prev().text();
|
||||
$.get("/Preference/rescan-watch-directory", {format: "json", dir: folder});
|
||||
$.get(baseUrl+"/Preference/rescan-watch-directory", {format: "json", dir: folder});
|
||||
});
|
||||
|
||||
$('.selected-item').find('.ui-icon-close').click(function(){
|
||||
|
@ -88,7 +88,7 @@ function setWatchedDirEvents() {
|
|||
var row = $(this).parent();
|
||||
var folder = row.find('#folderPath').text();
|
||||
|
||||
url = "/Preference/remove-watch-directory";
|
||||
url = baseUrl+"/Preference/remove-watch-directory";
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: folder},
|
||||
|
|
|
@ -75,7 +75,7 @@ function showForIcecast(ele){
|
|||
}
|
||||
|
||||
function checkLiquidsoapStatus(){
|
||||
var url = '/Preference/get-liquidsoap-status/format/json';
|
||||
var url = baseUrl+'/Preference/get-liquidsoap-status/format/json';
|
||||
var id = $(this).attr("id");
|
||||
$.post(url, function(json){
|
||||
var json_obj = jQuery.parseJSON(json);
|
||||
|
@ -127,7 +127,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
|
||||
$.get(baseUrl+"/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -142,7 +142,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
|
||||
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -151,7 +151,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1})
|
||||
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1})
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -165,7 +165,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0})
|
||||
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0})
|
||||
event.preventDefault()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ function autoSelect(event, ui) {
|
|||
function findHosts(request, callback) {
|
||||
var search, url;
|
||||
|
||||
url = "/User/get-hosts";
|
||||
url = baseUrl+"/User/get-hosts";
|
||||
search = request.term;
|
||||
|
||||
var noResult = new Array();
|
||||
|
@ -397,7 +397,7 @@ function setAddShowEvents() {
|
|||
.fullCalendar('render');
|
||||
|
||||
$("#add-show-form").hide();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$.get(baseUrl+"/Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
@ -443,7 +443,7 @@ function setAddShowEvents() {
|
|||
applyPlatformOpacityRules: false
|
||||
});
|
||||
|
||||
var action = "/Schedule/"+String(addShowButton.attr("data-action"));
|
||||
var action = baseUrl+"/Schedule/"+String(addShowButton.attr("data-action"));
|
||||
|
||||
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
//addShowButton.removeClass("disabled");
|
||||
|
@ -463,7 +463,7 @@ function setAddShowEvents() {
|
|||
.fullCalendar('render');
|
||||
|
||||
$("#add-show-form").hide();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$.get(baseUrl+"/Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
@ -579,7 +579,7 @@ function setAddShowEvents() {
|
|||
var loadingIcon = $('#icon-loader-small');
|
||||
|
||||
loadingIcon.show();
|
||||
$.post("/Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
|
||||
$.post(baseUrl+"/Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
|
||||
$('#add_show_duration').val(JSON.parse(data));
|
||||
loadingIcon.hide();
|
||||
});
|
||||
|
|
|
@ -176,7 +176,7 @@ function viewDisplay( view ) {
|
|||
.fullCalendar( 'gotoDate', date );
|
||||
|
||||
//save slotMin value to db
|
||||
var url = '/Schedule/set-time-interval/format/json';
|
||||
var url = baseUrl+'/Schedule/set-time-interval/format/json';
|
||||
$.post(url, {timeInterval: slotMin});
|
||||
});
|
||||
|
||||
|
@ -201,7 +201,7 @@ function viewDisplay( view ) {
|
|||
}
|
||||
|
||||
//save view name to db
|
||||
var url = '/Schedule/set-time-scale/format/json';
|
||||
var url = baseUrl+'/Schedule/set-time-scale/format/json';
|
||||
$.post(url, {timeScale: view.name});
|
||||
}
|
||||
|
||||
|
@ -306,9 +306,7 @@ function eventAfterRender( event, element, view ) {
|
|||
}
|
||||
|
||||
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
|
||||
var url;
|
||||
|
||||
url = '/Schedule/move-show/format/json';
|
||||
var url = baseUrl+'/Schedule/move-show/format/json';
|
||||
|
||||
$.post(url,
|
||||
{day: dayDelta, min: minuteDelta, showInstanceId: event.id},
|
||||
|
@ -324,9 +322,7 @@ function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui
|
|||
}
|
||||
|
||||
function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view ) {
|
||||
var url;
|
||||
|
||||
url = '/Schedule/resize-show/format/json';
|
||||
var url = baseUrl+'/Schedule/resize-show/format/json';
|
||||
|
||||
$.post(url,
|
||||
{day: dayDelta, min: minuteDelta, showId: event.showId},
|
||||
|
@ -349,7 +345,7 @@ function getFullCalendarEvents(start, end, callback) {
|
|||
start_date = makeTimeStamp(start);
|
||||
end_date = makeTimeStamp(end);
|
||||
|
||||
url = '/Schedule/event-feed';
|
||||
url = baseUrl+'/Schedule/event-feed';
|
||||
|
||||
var d = new Date();
|
||||
|
||||
|
@ -359,7 +355,7 @@ function getFullCalendarEvents(start, end, callback) {
|
|||
}
|
||||
|
||||
function checkSCUploadStatus(){
|
||||
var url = '/Library/get-upload-to-soundcloud-status/format/json';
|
||||
var url = baseUrl+'/Library/get-upload-to-soundcloud-status/format/json';
|
||||
$("span[class*=progress]").each(function(){
|
||||
var id = $(this).attr("id");
|
||||
$.post(url, {format: "json", id: id, type:"show"}, function(json){
|
||||
|
@ -373,7 +369,7 @@ function checkSCUploadStatus(){
|
|||
}
|
||||
|
||||
function getCurrentShow(){
|
||||
var url = '/Schedule/get-current-show/format/json',
|
||||
var url = baseUrl+'/Schedule/get-current-show/format/json',
|
||||
id,
|
||||
$el;
|
||||
$.post(url, {format: "json"}, function(json) {
|
||||
|
@ -447,7 +443,7 @@ function addQtipToSCIcons(ele){
|
|||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
success: function(json, status){
|
||||
|
@ -473,7 +469,7 @@ function addQtipToSCIcons(ele){
|
|||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "show"}),
|
||||
success: function(json, status){
|
||||
|
|
|
@ -34,7 +34,7 @@ function checkShowLength(json) {
|
|||
|
||||
function confirmCancelShow(show_instance_id){
|
||||
if (confirm('Cancel Current Show?')) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
var url = baseUrl+"/Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: show_instance_id},
|
||||
|
@ -47,7 +47,7 @@ function confirmCancelShow(show_instance_id){
|
|||
|
||||
function confirmCancelRecordedShow(show_instance_id){
|
||||
if (confirm('Stop recording current show?')) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
var url = baseUrl+"/Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: show_instance_id},
|
||||
|
@ -60,7 +60,7 @@ function confirmCancelRecordedShow(show_instance_id){
|
|||
|
||||
function uploadToSoundCloud(show_instance_id){
|
||||
|
||||
var url = "/Schedule/upload-to-sound-cloud";
|
||||
var url = baseUrl+"/Schedule/upload-to-sound-cloud";
|
||||
var span = $(window.triggerElement).find(".recording");
|
||||
|
||||
$.post(url,
|
||||
|
@ -80,8 +80,7 @@ function uploadToSoundCloud(show_instance_id){
|
|||
}
|
||||
|
||||
function checkCalendarSCUploadStatus(){
|
||||
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
var url = baseUrl+'/Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
|
@ -289,7 +288,7 @@ function alertShowErrorAndReload(){
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
|
||||
$.ajax({ url: baseUrl+"/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
|
||||
, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
setInterval(checkCalendarSCUploadStatus, 5000);
|
||||
|
@ -459,7 +458,7 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/schedule/make-context-menu",
|
||||
url: baseUrl+"/schedule/make-context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, format: "json"},
|
||||
dataType: "json",
|
||||
|
|
|
@ -264,7 +264,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.disableUI();
|
||||
|
||||
$.post("/showbuilder/schedule-add",
|
||||
$.post(baseUrl+"/showbuilder/schedule-add",
|
||||
{"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -274,7 +274,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.disableUI();
|
||||
|
||||
$.post("/showbuilder/schedule-move",
|
||||
$.post(baseUrl+"/showbuilder/schedule-move",
|
||||
{"format": "json", "selectedItem": aSelect, "afterItem": aAfter},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -284,7 +284,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.disableUI();
|
||||
if (confirm("Delete selected item(s)?")) {
|
||||
$.post( "/showbuilder/schedule-remove",
|
||||
$.post( baseUrl+"/showbuilder/schedule-remove",
|
||||
{"items": aItems, "format": "json"},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -379,7 +379,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
localStorage.setItem('datatables-timeline', JSON.stringify(oData));
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-timeline-datatable",
|
||||
url: baseUrl+"/usersettings/set-timeline-datatable",
|
||||
type: "POST",
|
||||
data: {settings : oData, format: "json"},
|
||||
dataType: "json"
|
||||
|
@ -537,7 +537,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$image = $nRow.find('td.sb-image');
|
||||
//check if the file exists.
|
||||
if (aData.image === true) {
|
||||
$image.html('<img title="Track preview" src="/css/images/icon_audioclip.png"></img>')
|
||||
$image.html('<img title="Track preview" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>')
|
||||
.click(function() {
|
||||
open_show_preview(aData.instance, aData.pos);
|
||||
return false;
|
||||
|
@ -762,7 +762,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
"sDom": 'R<"dt-process-rel"r><"sb-padded"<"H"C>><"dataTables_scrolling sb-padded"t>',
|
||||
|
||||
"sAjaxDataProp": "schedule",
|
||||
"sAjaxSource": "/showbuilder/builder-feed"
|
||||
"sAjaxSource": baseUrl+"/showbuilder/builder-feed"
|
||||
});
|
||||
|
||||
$sbTable.find("tbody").on("click", "input:checkbox", function(ev) {
|
||||
|
@ -1001,7 +1001,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
if (confirm(msg)) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
var url = baseUrl+"/Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: data.instance},
|
||||
|
@ -1181,7 +1181,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
request = $.ajax({
|
||||
url: "/showbuilder/context-menu",
|
||||
url: baseUrl+"/showbuilder/context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, format: "json"},
|
||||
dataType: "json",
|
||||
|
|
|
@ -168,7 +168,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
schedTable.fnDraw();
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-now-playing-screen-settings",
|
||||
url: baseUrl+"/usersettings/set-now-playing-screen-settings",
|
||||
type: "POST",
|
||||
data: {settings : {library : true}, format: "json"},
|
||||
dataType: "json",
|
||||
|
@ -192,7 +192,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
schedTable.fnDraw();
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-now-playing-screen-settings",
|
||||
url: baseUrl+"/usersettings/set-now-playing-screen-settings",
|
||||
type: "POST",
|
||||
data: {settings : {library : false}, format: "json"},
|
||||
dataType: "json",
|
||||
|
@ -259,7 +259,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
$.ajax( {
|
||||
"dataType": "json",
|
||||
"type": "GET",
|
||||
"url": "/showbuilder/check-builder-feed",
|
||||
"url": baseUrl+"/showbuilder/check-builder-feed",
|
||||
"data": data,
|
||||
"success": function(json) {
|
||||
if (json.update === true) {
|
||||
|
|
|
@ -69,7 +69,7 @@ function success(data, textStatus, jqXHR){
|
|||
}
|
||||
|
||||
function updateStatus(getDiskInfo){
|
||||
$.getJSON( "api/status/format/json/diskinfo/"+getDiskInfo, null, success);
|
||||
$.getJSON( baseUrl+"/api/status/format/json/diskinfo/"+getDiskInfo, null, success);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,13 @@ function populateForm(entries){
|
|||
}
|
||||
|
||||
function rowClickCallback(row_id){
|
||||
$.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
|
||||
$.ajax({ url: baseUrl+'/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
|
||||
populateForm(data.entries);
|
||||
}});
|
||||
}
|
||||
|
||||
function removeUserCallback(row_id, nRow){
|
||||
$.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||
$.ajax({ url: baseUrl+'/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
|
||||
}});
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ $(document).ready(function() {
|
|||
$('#users_datatable').dataTable( {
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/User/get-user-data-table-info/format/json",
|
||||
"sAjaxSource": baseUrl+"/User/get-user-data-table-info/format/json",
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
|
|
|
@ -17,8 +17,9 @@ version_url = 'version/api_key/%%api_key%%'
|
|||
register_component = 'register-component/format/json/api_key/%%api_key%%/component/%%component%%'
|
||||
|
||||
# Hostname
|
||||
base_url = 'localhost'
|
||||
host = 'localhost'
|
||||
base_port = 80
|
||||
base_dir = ''
|
||||
|
||||
#############################
|
||||
## Config for Media Monitor
|
||||
|
|
|
@ -80,7 +80,7 @@ class AirtimeApiClient():
|
|||
response = urllib2.urlopen(url).read()
|
||||
successful_response = True
|
||||
except IOError, e:
|
||||
logger.error('Error Authenticating with remote server: %s', e)
|
||||
logger.error('Error Authenticating with remote server: %s %s', e, url)
|
||||
if isinstance(url, urllib2.Request):
|
||||
logger.debug(url.get_full_url())
|
||||
else:
|
||||
|
@ -148,11 +148,9 @@ class AirtimeApiClient():
|
|||
|
||||
def __get_airtime_version(self):
|
||||
logger = self.logger
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"],
|
||||
str(self.config["base_port"]), self.config["api_base"],
|
||||
self.config["version_url"])
|
||||
url= self.construct_url("version_url")
|
||||
|
||||
logger.debug("Trying to contact %s", url)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
|
||||
version = -1
|
||||
try:
|
||||
|
@ -207,10 +205,8 @@ class AirtimeApiClient():
|
|||
logger = self.logger
|
||||
|
||||
# Construct the URL
|
||||
export_url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["export_url"])
|
||||
|
||||
export_url = self.construct_url("export_url")
|
||||
logger.info("Fetching schedule from %s", export_url)
|
||||
export_url = export_url.replace('%%api_key%%', self.config["api_key"])
|
||||
|
||||
response = ""
|
||||
try:
|
||||
|
@ -241,12 +237,7 @@ class AirtimeApiClient():
|
|||
logger = self.logger
|
||||
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], \
|
||||
str(self.config["base_port"]), \
|
||||
self.config["api_base"], \
|
||||
self.config["notify_liquidsoap_started"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("notify_liquidsoap_started")
|
||||
|
||||
self.get_response_from_server(url, attempts=5)
|
||||
except Exception, e:
|
||||
|
@ -262,10 +253,10 @@ class AirtimeApiClient():
|
|||
logger = self.logger
|
||||
response = ''
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_start_playing_url"])
|
||||
schedule_id = data
|
||||
url = self.construct_url("update_start_playing_url")
|
||||
url = url.replace("%%media_id%%", str(media_id))
|
||||
logger.debug(url)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
|
||||
response = self.get_response_from_server(url, attempts = 5)
|
||||
response = json.loads(response)
|
||||
|
@ -290,9 +281,8 @@ class AirtimeApiClient():
|
|||
logger = self.logger
|
||||
response = None
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["show_schedule_url"])
|
||||
url = self.construct_url("show_schedule_url")
|
||||
logger.debug(url)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
response = self.get_response_from_server(url)
|
||||
|
||||
response = json.loads(response)
|
||||
|
@ -311,10 +301,9 @@ class AirtimeApiClient():
|
|||
retries = int(self.config["upload_retries"])
|
||||
retries_wait = int(self.config["upload_wait"])
|
||||
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_file_url"])
|
||||
url = self.construct_url("upload_file_url")
|
||||
|
||||
logger.debug(url)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
|
||||
for i in range(0, retries):
|
||||
logger.debug("Upload attempt: %s", i + 1)
|
||||
|
@ -346,9 +335,7 @@ class AirtimeApiClient():
|
|||
|
||||
response = ''
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["check_live_stream_auth"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("check_live_stream_auth")
|
||||
url = url.replace("%%username%%", username)
|
||||
url = url.replace("%%djtype%%", dj_type)
|
||||
url = url.replace("%%password%%", password)
|
||||
|
@ -365,7 +352,7 @@ class AirtimeApiClient():
|
|||
def construct_url(self,config_action_key):
|
||||
"""Constructs the base url for every request"""
|
||||
# TODO : Make other methods in this class use this this method.
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config[config_action_key])
|
||||
url = "http://%s:%s/%s/%s/%s" % (self.config["host"], str(self.config["base_port"]), self.config["base_dir"], self.config["api_base"], self.config[config_action_key])
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
return url
|
||||
|
||||
|
@ -405,10 +392,9 @@ class AirtimeApiClient():
|
|||
logger.info("Could not parse json from response: '%s'" % response)
|
||||
|
||||
if("error" not in response and is_record):
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["upload_recorded"])
|
||||
url = self.construct_url("upload_recorded")
|
||||
url = url.replace("%%fileid%%", str(response[u'id']))
|
||||
url = url.replace("%%showinstanceid%%", str(md['MDATA_KEY_TRACKNUMBER']))
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
response = json.loads(response)
|
||||
|
@ -498,9 +484,7 @@ class AirtimeApiClient():
|
|||
# Does this include the stor directory as well?
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["list_all_watched_dirs"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("list_all_watched_dirs")
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
response = json.loads(response)
|
||||
|
@ -514,9 +498,7 @@ class AirtimeApiClient():
|
|||
def add_watched_dir(self, path):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["add_watched_dir"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("add_watched_dir")
|
||||
url = url.replace("%%path%%", base64.b64encode(path))
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
|
@ -530,9 +512,7 @@ class AirtimeApiClient():
|
|||
def remove_watched_dir(self, path):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["remove_watched_dir"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("remove_watched_dir")
|
||||
url = url.replace("%%path%%", base64.b64encode(path))
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
|
@ -546,9 +526,7 @@ class AirtimeApiClient():
|
|||
def set_storage_dir(self, path):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["set_storage_dir"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("set_storage_dir")
|
||||
url = url.replace("%%path%%", base64.b64encode(path))
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
|
@ -562,9 +540,7 @@ class AirtimeApiClient():
|
|||
def get_stream_setting(self):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["get_stream_setting"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("get_stream_setting")
|
||||
response = self.get_response_from_server(url)
|
||||
response = json.loads(response)
|
||||
except Exception, e:
|
||||
|
@ -582,9 +558,7 @@ class AirtimeApiClient():
|
|||
def register_component(self, component):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["register_component"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("register_component")
|
||||
url = url.replace("%%component%%", component)
|
||||
self.get_response_from_server(url)
|
||||
except Exception, e:
|
||||
|
@ -593,9 +567,7 @@ class AirtimeApiClient():
|
|||
def notify_liquidsoap_status(self, msg, stream_id, time):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_liquidsoap_status"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("update_liquidsoap_status")
|
||||
msg = msg.replace('/', ' ')
|
||||
encoded_msg = urllib.quote(msg, '')
|
||||
url = url.replace("%%msg%%", encoded_msg)
|
||||
|
@ -609,9 +581,7 @@ class AirtimeApiClient():
|
|||
def notify_source_status(self, sourcename, status):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_source_status"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("update_source_status")
|
||||
url = url.replace("%%sourcename%%", sourcename)
|
||||
url = url.replace("%%status%%", status)
|
||||
|
||||
|
@ -625,9 +595,7 @@ class AirtimeApiClient():
|
|||
def update_file_system_mount(self, added_dir, removed_dir):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_fs_mount"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("update_fs_mount")
|
||||
|
||||
added_data_string = string.join(added_dir, ',')
|
||||
removed_data_string = string.join(removed_dir, ',')
|
||||
|
@ -651,9 +619,7 @@ class AirtimeApiClient():
|
|||
def handle_watched_dir_missing(self, dir):
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["handle_watched_dir_missing"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("handle_watched_dir_missing")
|
||||
url = url.replace("%%dir%%", base64.b64encode(dir))
|
||||
|
||||
response = self.get_response_from_server(url)
|
||||
|
@ -689,8 +655,7 @@ class AirtimeApiClient():
|
|||
|
||||
logger = self.logger
|
||||
try:
|
||||
url = "http://%(base_url)s:%(base_port)s/%(api_base)s/%(get_files_without_replay_gain)s/" % (self.config)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("get_files_without_replay_gain")
|
||||
url = url.replace("%%dir_id%%", dir_id)
|
||||
response = self.get_response_from_server(url)
|
||||
|
||||
|
@ -712,8 +677,7 @@ class AirtimeApiClient():
|
|||
|
||||
#http://localhost/api/update-replay-gain-value/
|
||||
try:
|
||||
url = "http://%(base_url)s:%(base_port)s/%(api_base)s/%(update_replay_gain_value)s/" % (self.config)
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = self.construct_url("update_replay_gain_value")
|
||||
data = urllib.urlencode({'data': json.dumps(pairs)})
|
||||
request = urllib2.Request(url, data)
|
||||
|
||||
|
@ -729,9 +693,8 @@ class AirtimeApiClient():
|
|||
external webstream
|
||||
"""
|
||||
try:
|
||||
url = "http://%(base_url)s:%(base_port)s/%(api_base)s/%(notify_webstream_data)s/" % (self.config)
|
||||
url = self.construct_url("notify_webstream_data")
|
||||
url = url.replace("%%media_id%%", str(media_id))
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
data = urllib.urlencode({'data': data})
|
||||
self.logger.debug(url)
|
||||
request = urllib2.Request(url, data)
|
||||
|
|
|
@ -14,10 +14,11 @@ if (substr($sapi_type, 0, 3) == 'cli') {
|
|||
$apiKey = $airtimeIni['general']['api_key'];
|
||||
$baseUrl = $airtimeIni['general']['base_url'];
|
||||
$base_port = $airtimeIni['general']['base_port'];
|
||||
$base_dir = $airtimeIni['general']['base_dir'];
|
||||
|
||||
|
||||
$status = AirtimeCheck::GetStatus($baseUrl, $base_port, $apiKey);
|
||||
$status = AirtimeCheck::GetStatus($baseUrl, $base_port, $base_dir, $apiKey);
|
||||
AirtimeCheck::PrintStatus($baseUrl, $base_port, $status);
|
||||
//AirtimeCheck::PrintStatus($baseUrl, $status);
|
||||
}
|
||||
|
||||
class AirtimeCheck {
|
||||
|
@ -102,9 +103,9 @@ class AirtimeCheck {
|
|||
return $headerInfo['Server'][0];
|
||||
}
|
||||
|
||||
public static function GetStatus($p_baseUrl, $p_basePort, $p_apiKey){
|
||||
public static function GetStatus($p_baseUrl, $p_basePort, $p_baseDir, $p_apiKey){
|
||||
|
||||
$url = "http://$p_baseUrl:$p_basePort/api/status/format/json/api_key/%%api_key%%";
|
||||
$url = "http://$p_baseUrl:$p_basePort/$p_baseDir/api/status/format/json/api_key/%%api_key%%";
|
||||
self::output_status("AIRTIME_STATUS_URL", $url);
|
||||
$url = str_replace("%%api_key%%", $p_apiKey, $url);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue