style(legacy): format (#2039)

This commit is contained in:
Jonas L 2022-08-10 13:38:19 +02:00 committed by GitHub
parent 7082c9693d
commit 1550d44ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
122 changed files with 18369 additions and 15819 deletions

View File

@ -32,7 +32,7 @@ repos:
hooks: hooks:
- id: prettier - id: prettier
files: \.(md|mdx|yml|yaml|js|jsx|ts|tsx|json|css)$ files: \.(md|mdx|yml|yaml|js|jsx|ts|tsx|json|css)$
exclude: ^legacy/public exclude: ^legacy/public(?!/js/airtime)
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.34.0 rev: v2.34.0

View File

@ -21,7 +21,10 @@
$scs = $this->SourceConnectionStatus(); $scs = $this->SourceConnectionStatus();
?> ?>
<?php echo $this->partial('partialviews/header.phtml', array( <?php echo $this->partial('partialviews/header.phtml', array(
"live_dj_switch" => $sss['live_dj'], "live_dj_connection" => $scs['live_dj'], "master_dj_switch" => $sss['master_dj'], "master_dj_connection" => $scs['master_dj'], "live_dj_switch" => $sss['live_dj'],
"live_dj_connection" => $scs['live_dj'],
"master_dj_switch" => $sss['master_dj'],
"master_dj_connection" => $scs['master_dj'],
"scheduled_play_switch" => $sss['scheduled_play'] "scheduled_play_switch" => $sss['scheduled_play']
)) ?> )) ?>
<?php $partial = array('menu.phtml', 'default'); <?php $partial = array('menu.phtml', 'default');

View File

@ -1,28 +1,28 @@
<div id="jquery_jplayer_1" class="jp-jplayer"></div> <div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio"> <div id="jp_container_1" class="jp-audio">
<?php if (isset($this->playlistID)): ?> <?php if (isset($this->playlistID)) : ?>
<span class='playlistID'><?php echo "$this->playlistID" ?></span> <span class='playlistID'><?php echo "$this->playlistID" ?></span>
<span class='playlistIndex'><?php echo "$this->playlistIndex" ?></span> <span class='playlistIndex'><?php echo "$this->playlistIndex" ?></span>
<?php elseif (isset($this->blockId)): ?> <?php elseif (isset($this->blockId)) : ?>
<span class='blockId' style="display: none;"><?php echo "$this->blockId" ?></span> <span class='blockId' style="display: none;"><?php echo "$this->blockId" ?></span>
<span class='blockIndex' style="display: none;"><?php echo "$this->blockIndex" ?></span> <span class='blockIndex' style="display: none;"><?php echo "$this->blockIndex" ?></span>
<?php elseif (isset($this->uri)): ?> <?php elseif (isset($this->uri)) : ?>
<span class='audioUri' style="display: none;"><?php echo "$this->uri" ?></span> <span class='audioUri' style="display: none;"><?php echo "$this->uri" ?></span>
<span class='audioMime' style="display: none;"><?php echo "$this->mime" ?></span> <span class='audioMime' style="display: none;"><?php echo "$this->mime" ?></span>
<span class='audioFileTitle'><?php echo "$this->audioFileTitle" ?></span> <span class='audioFileTitle'><?php echo "$this->audioFileTitle" ?></span>
<span class='audioFileArtist'><?php echo "$this->audioFileArtist" ?></span> <span class='audioFileArtist'><?php echo "$this->audioFileArtist" ?></span>
<?php elseif (isset($this->showID)): ?> <?php elseif (isset($this->showID)) : ?>
<span class='showID'><?php echo "$this->showID" ?></span> <span class='showID'><?php echo "$this->showID" ?></span>
<span class='showIndex'><?php echo "$this->showIndex" ?></span> <span class='showIndex'><?php echo "$this->showIndex" ?></span>
<?php endif;?> <?php endif; ?>
<div class="jp-type-playlist"> <div class="jp-type-playlist">
<div class="jp-gui jp-interface"> <div class="jp-gui jp-interface">
<ul class="jp-controls"> <ul class="jp-controls">
<?php if ($this->type != "audioclip"): ?> <?php if ($this->type != "audioclip") : ?>
<li class="ui-state-default ui-corner-all jp-previous"> <li class="ui-state-default ui-corner-all jp-previous">
<span class="ui-icon ui-icon-seek-prev" tabindex="1"><?php echo _("previous") ?></span> <span class="ui-icon ui-icon-seek-prev" tabindex="1"><?php echo _("previous") ?></span>
</li> </li>
<?php endif;?> <?php endif; ?>
<li class="ui-state-default ui-corner-all jp-play"> <li class="ui-state-default ui-corner-all jp-play">
<span class="ui-icon ui-icon-play" tabindex="1"><?php echo _("play") ?></span> <span class="ui-icon ui-icon-play" tabindex="1"><?php echo _("play") ?></span>
@ -32,11 +32,11 @@
<span class="ui-icon ui-icon-pause" tabindex="1"><?php echo _("pause") ?></span> <span class="ui-icon ui-icon-pause" tabindex="1"><?php echo _("pause") ?></span>
</li> </li>
<?php if ($this->type != "audioclip"): ?> <?php if ($this->type != "audioclip") : ?>
<li class="ui-state-default ui-corner-all jp-next"> <li class="ui-state-default ui-corner-all jp-next">
<span class="ui-icon ui-icon-seek-next" tabindex="1"><?php echo _("next") ?></span> <span class="ui-icon ui-icon-seek-next" tabindex="1"><?php echo _("next") ?></span>
</li> </li>
<?php endif;?> <?php endif; ?>
<li class="ui-state-default ui-corner-all jp-stop"> <li class="ui-state-default ui-corner-all jp-stop">
<span class="ui-icon ui-icon-stop" tabindex="1"><?php echo _("stop") ?></span> <span class="ui-icon ui-icon-stop" tabindex="1"><?php echo _("stop") ?></span>
@ -50,9 +50,9 @@
</div> </div>
<div class="jp-time-holder"> <div class="jp-time-holder">
<div class="jp-current-time"></div> <div class="jp-current-time"></div>
<?php if ($this->type == "audioclip"): ?> <?php if ($this->type == "audioclip") : ?>
<div class="jp-duration"></div> <div class="jp-duration"></div>
<?php endif;?> <?php endif; ?>
</div> </div>
</div> </div>
<div class="jp-volume-block"> <div class="jp-volume-block">
@ -77,9 +77,11 @@
</div> </div>
<div class="jp-no-solution"> <div class="jp-no-solution">
<span><?php echo _("Update Required") ?></span> <span><?php echo _("Update Required") ?></span>
<?php sprintf(_("To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s."), <?php sprintf(
_("To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s."),
"<a href='http://get.adobe.com/flashplayer/' target='_blank'>", "<a href='http://get.adobe.com/flashplayer/' target='_blank'>",
"</a>") ?> "</a>"
) ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,28 +1,34 @@
<div class="text-content"> <div class="text-content">
<h2><?php echo _("About") ?></h2> <h2><?php echo _("About") ?></h2>
<p> <p>
<?php <?php
$productSiteAnchor = "<a href='" . PRODUCT_SITE_URL . "' target='_blank'>" $productSiteAnchor = "<a href='" . PRODUCT_SITE_URL . "' target='_blank'>"
. PRODUCT_NAME . PRODUCT_NAME
. "</a>"; . "</a>";
echo sprintf(_('%1$s %2$s, the open radio software for scheduling and remote station management.'), echo sprintf(
$productSiteAnchor, _('%1$s %2$s, the open radio software for scheduling and remote station management.'),
$this->airtime_version) $productSiteAnchor,
?> $this->airtime_version
<br /> )
<br />© <?php echo(gmdate('Y')); ?> ?>
<?php <br />
$companySiteAnchor = "<a href='" . COMPANY_SITE_URL . "' target='_blank'>" <br />© <?php echo (gmdate('Y')); ?>
. COMPANY_NAME . " " . COMPANY_SUFFIX <?php
. "</a>"; $companySiteAnchor = "<a href='" . COMPANY_SITE_URL . "' target='_blank'>"
$licenseAnchor = "<a href='" . LICENSE_URL . "' target='_blank'>" . COMPANY_NAME . " " . COMPANY_SUFFIX
. LICENSE_VERSION . "</a>";
. "</a>"; $licenseAnchor = "<a href='" . LICENSE_URL . "' target='_blank'>"
echo sprintf(_('%1$s %2$s is distributed under the %3$s'), . LICENSE_VERSION
$companySiteAnchor, PRODUCT_NAME, $licenseAnchor) . "</a>";
?> echo sprintf(
</p> _('%1$s %2$s is distributed under the %3$s'),
$companySiteAnchor,
PRODUCT_NAME,
$licenseAnchor
)
?>
</p>
</div> </div>
<br> <br>
<br> <br>

View File

@ -1,24 +1,32 @@
<div class="text-content"> <div class="text-content">
<h2><?php echo sprintf(_("Welcome to %s!"), PRODUCT_NAME) ?></h2> <h2><?php echo sprintf(_("Welcome to %s!"), PRODUCT_NAME) ?></h2>
<p><?php echo sprintf(_("Here's how you can get started using %s to automate your broadcasts: "), PRODUCT_NAME)?></p> <p><?php echo sprintf(_("Here's how you can get started using %s to automate your broadcasts: "), PRODUCT_NAME) ?></p>
<ol> <ol>
<li><h4><?php echo _("Upload audio tracks");?></h4> <li>
<?php echo _("Click the 'Upload' button in the left corner to upload tracks to your library.")?></li> <h4><?php echo _("Upload audio tracks"); ?></h4>
<li><h4><?php echo _("Schedule a show");?></h4> <?php echo _("Click the 'Upload' button in the left corner to upload tracks to your library.") ?>
<?php echo _("Click on 'Calendar' in the navigation bar on the left. From there click the '+ New Show' button and fill out the required fields.")?></li> </li>
<li><h4><?php echo _("Add tracks to your show"); ?></h4> <li>
<?php echo _("Click on your show in the calendar and select 'Schedule Show'. In the popup window drag tracks into your show."); ?> <h4><?php echo _("Schedule a show"); ?></h4>
</li> <?php echo _("Click on 'Calendar' in the navigation bar on the left. From there click the '+ New Show' button and fill out the required fields.") ?>
</li>
<li>
<h4><?php echo _("Add tracks to your show"); ?></h4>
<?php echo _("Click on your show in the calendar and select 'Schedule Show'. In the popup window drag tracks into your show."); ?>
</li>
</ol> </ol>
<p><strong><?php echo _("Now you're good to go!")?></strong><br /> <p><strong><?php echo _("Now you're good to go!") ?></strong><br />
<?php <?php
$userManualAnchorOpen = "<a href='" . USER_MANUAL_URL . "' target='_blank'>"; $userManualAnchorOpen = "<a href='" . USER_MANUAL_URL . "' target='_blank'>";
echo sprintf(_("For more detailed help, read the %suser manual%s."), echo sprintf(
$userManualAnchorOpen, "</a>") _("For more detailed help, read the %suser manual%s."),
$userManualAnchorOpen,
"</a>"
)
?> ?>
</p> </p>
</div> </div>

View File

@ -1,99 +1,99 @@
<div id="content" class="jp-container"> <div id="content" class="jp-container">
<h1><?php echo _("Live stream") ?></h1> <h1><?php echo _("Live stream") ?></h1>
<a id="popup-link" href="#"><?php echo _("Share") ?></a> <a id="popup-link" href="#"><?php echo _("Share") ?></a>
<?php $ids = Application_Model_StreamSetting::getEnabledStreamIds(); ?> <?php $ids = Application_Model_StreamSetting::getEnabledStreamIds(); ?>
<script> <script>
function setjPlayer(url, type, serverType){ function setjPlayer(url, type, serverType) {
var obj = new Object(); var obj = new Object();
obj[type] = url; obj[type] = url;
if(serverType == 'shoutcast'){ if (serverType == 'shoutcast') {
obj[type] = url + ";stream/1"; obj[type] = url + ";stream/1";
} }
$("#jquery_jplayer_1").jPlayer("destroy"); $("#jquery_jplayer_1").jPlayer("destroy");
$("#jquery_jplayer_1").jPlayer({ $("#jquery_jplayer_1").jPlayer({
ready: function () { ready: function() {
$(this).jPlayer("setMedia", obj).jPlayer("play"); $(this).jPlayer("setMedia", obj).jPlayer("play");
}, },
ended: function (event) { ended: function(event) {
$(this).jPlayer("play"); $(this).jPlayer("play");
}, },
swfPath: "/js/jplayer/", swfPath: "/js/jplayer/",
supplied: type, supplied: type,
wmode: "window" wmode: "window"
}); });
}
$(document).ready(function(){
$("#combo-box").change(function(eventObject){
var elem = $("#combo-box option:selected");
setjPlayer(elem.attr("data-url"), elem.attr("data-type"), elem.attr("server-type"));
});
<?php
if (count($ids) > 0){
$id = $ids[0];
$streamData = Application_Model_StreamSetting::getStreamData($id);
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
$type = $streamData["${id}_type"];
$serverType = $streamData["${id}_output"];
if ($type == "ogg")
$type = "oga";
echo "setjPlayer('$url', '$type', '$serverType');";
} }
?>
$("#popup-link").click(function() { $(document).ready(function() {
$("#popup-share").show("slow");
$("#popup-share-link").val($("#combo-box option:selected").attr("data-url"));
});
$("#popup-close").click(function() { $("#combo-box").change(function(eventObject) {
$("#popup-share").hide("slow"); var elem = $("#combo-box option:selected");
}); setjPlayer(elem.attr("data-url"), elem.attr("data-type"), elem.attr("server-type"));
}); });
</script>
<div class="jp-logo"><img id="logo-img" onload='resizeToMaxHeight(this, 40);' src="<?php echo $this->logo ?>" /></div>
<div id="popup-share">
<a class="close-round" href="#" id="popup-close"></a>
<input id="popup-share-link" type="text" readonly="readonly"/>
</div>
<div class="jp-stream stream-player-label">
<div class="jp-stream-text"><?php echo _("Select stream:"); ?></div>
<form id="form1" method="post" action=""> <?php
<select id="combo-box"> if (count($ids) > 0) {
<?php $id = $ids[0];
foreach($ids as $id) { $streamData = Application_Model_StreamSetting::getStreamData($id);
$streamData = Application_Model_StreamSetting::getStreamData($id); $url = "http://" . $streamData["${id}_host"] . ":" . $streamData["${id}_port"] . "/" . $streamData["${id}_mount"];
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"]; $type = $streamData["${id}_type"];
$type = $streamData["${id}_type"]; $serverType = $streamData["${id}_output"];
$serverType = $streamData["${id}_output"]; if ($type == "ogg")
if ($type == "ogg") $type = "oga";
$type = "oga"; echo "setjPlayer('$url', '$type', '$serverType');";
}
?>
$label = "(".$streamData["${id}_host"].") ".$streamData["${id}_description"]." - ".$streamData["${id}_bitrate"]." kbit/s"; $("#popup-link").click(function() {
echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s' server-type='%s'>%s</option>", $id, $url, $type, $serverType, $label); $("#popup-share").show("slow");
} $("#popup-share-link").val($("#combo-box option:selected").attr("data-url"));
?> });
</select>
</form>
</div>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio"> $("#popup-close").click(function() {
<div class="jp-type-single"> $("#popup-share").hide("slow");
<div id="jp_interface_1" class="jp-gui jp-interface"> });
<ul class="jp-controls"> });
<li><a title="mute" tabindex="1" class="jp-mute" href="javascript:;"><?php echo _("mute") ?></a></li> </script>
<li><a title="unmute" tabindex="1" class="jp-unmute" href="javascript:;"><?php echo _("unmute") ?></a></li> <div class="jp-logo"><img id="logo-img" onload='resizeToMaxHeight(this, 40);' src="<?php echo $this->logo ?>" /></div>
</ul> <div id="popup-share">
<div class="jp-volume-bar"> <a class="close-round" href="#" id="popup-close"></a>
<div class="jp-volume-bar-value"></div> <input id="popup-share-link" type="text" readonly="readonly" />
</div> </div>
</div> <div class="jp-stream stream-player-label">
<div id="jp_playlist_1" class="jp-playlist"></div> <div class="jp-stream-text"><?php echo _("Select stream:"); ?></div>
<form id="form1" method="post" action="">
<select id="combo-box">
<?php
foreach ($ids as $id) {
$streamData = Application_Model_StreamSetting::getStreamData($id);
$url = "http://" . $streamData["${id}_host"] . ":" . $streamData["${id}_port"] . "/" . $streamData["${id}_mount"];
$type = $streamData["${id}_type"];
$serverType = $streamData["${id}_output"];
if ($type == "ogg")
$type = "oga";
$label = "(" . $streamData["${id}_host"] . ") " . $streamData["${id}_description"] . " - " . $streamData["${id}_bitrate"] . " kbit/s";
echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s' server-type='%s'>%s</option>", $id, $url, $type, $serverType, $label);
}
?>
</select>
</form>
</div>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-single">
<div id="jp_interface_1" class="jp-gui jp-interface">
<ul class="jp-controls">
<li><a title="mute" tabindex="1" class="jp-mute" href="javascript:;"><?php echo _("mute") ?></a></li>
<li><a title="unmute" tabindex="1" class="jp-unmute" href="javascript:;"><?php echo _("unmute") ?></a></li>
</ul>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
</div>
<div id="jp_playlist_1" class="jp-playlist"></div>
</div>
</div> </div>
</div>

View File

@ -2,11 +2,11 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css"> <link rel="stylesheet" href="<?php echo $this->css ?>" type="text/css">
<script src="<?php echo $this->playerhtml5_js?>" type="text/javascript"></script> <script src="<?php echo $this->playerhtml5_js ?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery?>" type="text/javascript"></script> <script src="<?php echo $this->jquery ?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery_i18n?>" type="text/javascript"></script> <script src="<?php echo $this->jquery_i18n ?>" type="text/javascript"></script>
<script src="/locale/general-translation-table" type="text/javascript"></script> <script src="/locale/general-translation-table" type="text/javascript"></script>
<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">
@ -15,15 +15,15 @@
var MAX_MOBILE_SCREEN_WIDTH = 760; var MAX_MOBILE_SCREEN_WIDTH = 760;
var Html5Player = function() { var Html5Player = function() {
var id_element=getRandomIdPlayer(3000); var id_element = getRandomIdPlayer(3000);
this.mobileDetect = this.mobileDetect(); this.mobileDetect = this.mobileDetect();
this.playerMode = "<?php echo $this->playerMode ?>"; this.playerMode = "<?php echo $this->playerMode ?>";
this.settings = { this.settings = {
'elementId': id_element, // leave alone 'elementId': id_element, // leave alone
'autoplay': false, // or true (only works on some browsers) 'autoplay': false, // or true (only works on some browsers)
'forceHTTPS': false, // or true if the stream is in SSL (beware of the listening port, usually 8000) 'forceHTTPS': false, // or true if the stream is in SSL (beware of the listening port, usually 8000)
'replacePort': false, // false for disabled or '8000' as the usual start port, forces to specify replacePortTo. 'replacePort': false, // false for disabled or '8000' as the usual start port, forces to specify replacePortTo.
'replacePortTo': '' // either '' to use the default port of the browser (80/http, 443/https) or '8443' to force the port of the stream. 'replacePortTo': '' // either '' to use the default port of the browser (80/http, 443/https) or '8443' to force the port of the stream.
}; };
if (this.playerMode == "manual") { if (this.playerMode == "manual") {
@ -33,8 +33,8 @@
this.settings.url = <?php echo $this->streamURL ?>; this.settings.url = <?php echo $this->streamURL ?>;
this.settings.codec = "<?php echo $this->codec ?>"; this.settings.codec = "<?php echo $this->codec ?>";
} else if (this.playerMode == "auto") { } else if (this.playerMode == "auto") {
this.availableMobileStreamQueue = <?php echo $this->availableMobileStreams?>; this.availableMobileStreamQueue = <?php echo $this->availableMobileStreams ?>;
this.availableDesktopStreamQueue = <?php echo $this->availableDesktopStreams?>; this.availableDesktopStreamQueue = <?php echo $this->availableDesktopStreams ?>;
var stream = this.getNextAvailableStream(); var stream = this.getNextAvailableStream();
this.settings.url = stream["url"]; this.settings.url = stream["url"];
this.settings.codec = stream["codec"]; this.settings.codec = stream["codec"];
@ -43,10 +43,10 @@
// Create the Muses player object // Create the Muses player object
playerhtml5_insert(this.settings); playerhtml5_insert(this.settings);
playerhtml5_audio = document.getElementById(id_element); playerhtml5_audio = document.getElementById(id_element);
if(playerhtml5_audio.played==true) togglePlayStopButton(); if (playerhtml5_audio.played == true) togglePlayStopButton();
// Configure player title // Configure player title
var player_title = <?php echo $this->player_title?>; var player_title = <?php echo $this->player_title ?>;
if (player_title === null) { if (player_title === null) {
$(".airtime_header").hide(); $(".airtime_header").hide();
$(".airtime_player").css('height', '150px'); $(".airtime_player").css('height', '150px');
@ -119,13 +119,14 @@
playerhtml5_audio.pause(); playerhtml5_audio.pause();
togglePlayStopButton(); togglePlayStopButton();
}; };
function togglePlayStopButton() { function togglePlayStopButton() {
document.getElementById("play_button").classList.toggle("hide_button"); document.getElementById("play_button").classList.toggle("hide_button");
document.getElementById("stop_button").classList.toggle("hide_button"); document.getElementById("stop_button").classList.toggle("hide_button");
} }
$(document).ready(function() { $(document).ready(function() {
$(".play").click(function () { $(".play").click(function() {
if ($(this).hasClass("pause")) { if ($(this).hasClass("pause")) {
html5Player.stop(); html5Player.stop();
} else { } else {
@ -144,9 +145,13 @@
// and attaches it to the player UI. // and attaches it to the player UI.
// //
// The metadata is fetched when the current track is about to end. // The metadata is fetched when the current track is about to end.
function attachStreamMetadataToPlayer(){ function attachStreamMetadataToPlayer() {
$.ajax({url: "<?php echo $this->metadata_api_url?>", $.ajax({
data: {type:"interval",limit:"5"}, url: "<?php echo $this->metadata_api_url ?>",
data: {
type: "interval",
limit: "5"
},
dataType: "jsonp", dataType: "jsonp",
success: function(data) { success: function(data) {
@ -155,7 +160,7 @@
//Master/show source have no current track but they do have a current show. //Master/show source have no current track but they do have a current show.
$("p.now_playing").html($.i18n._("On Air") + "<span>" + data.currentShow[0].name + "</span>"); $("p.now_playing").html($.i18n._("On Air") + "<span>" + data.currentShow[0].name + "</span>");
} else { } else {
$("p.now_playing").html($.i18n._("Off Air") + "<span>"+ $.i18n._("Offline") + "</span>"); $("p.now_playing").html($.i18n._("Off Air") + "<span>" + $.i18n._("Offline") + "</span>");
} }
time_to_next_track_starts = 20000; time_to_next_track_starts = 20000;
} else { } else {
@ -197,12 +202,10 @@
} }
// Add 3 seconds to the timeout so Airtime has time to update the metadata before we fetch it // Add 3 seconds to the timeout so Airtime has time to update the metadata before we fetch it
metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts+3000); metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts + 3000);
} }
</script> </script>
<style type="text/css"> <style type="text/css">
@ -212,59 +215,66 @@
not work. It has to be "visible" on the page. As a hacky work around we not work. It has to be "visible" on the page. As a hacky work around we
set the height and width to 1px so users will not see it. set the height and width to 1px so users will not see it.
*/ */
#html5player_skin{width:0; height:0; overflow: hidden;} #html5player_skin {
width: 0;
height: 0;
overflow: hidden;
}
</style> </style>
</head> </head>
<body> <body>
<div id="player" <?php if ($this->player_style == "basic") echo "style='display:block;'"; else echo "style='display:none'"; ?>> <div id="player" <?php if ($this->player_style == "basic") echo "style='display:block;'";
<div class="airtime_player"> else echo "style='display:none'"; ?>>
<div class="airtime_player">
<div class="airtime_header"> <div class="airtime_header">
<p class="station_name">fff</p> <p class="station_name">fff</p>
</div>
<div class="airtime_box">
<div class="airtime_button">
<span id="play_button" class="play_button" onclick="html5Player.play()"></span>
<span id="stop_button" class="stop_button hide_button" onclick="html5Player.stop()"></span>
</div> </div>
<p class="now_playing"></p>
</div> <div class="airtime_box">
<div style="clear:both"></div> <div class="airtime_button">
<span id="play_button" class="play_button" onclick="html5Player.play()"></span>
<span id="stop_button" class="stop_button hide_button" onclick="html5Player.stop()"></span>
</div>
<p class="now_playing"></p>
<div class="airtime_schedule"> </div>
<p class="airtime_next"><?php echo _("Next") ?></p>
<ul class="schedule_list">
<li></li>
</ul>
</div>
<a class="airtime_pro" target="_blank" href="<?php echo PRODUCT_SITE_URL; ?>"><?php printf(_('Powered by %s'), PRODUCT_NAME); ?></a>
</div> <div style="clear:both"></div>
</div>
<div id="premium_player" <?php if ($this->player_style == "premium") echo "style='display:block;'"; else echo "style='display:none'"; ?>> <div class="airtime_schedule">
<div class="bottom_bar"> <p class="airtime_next"><?php echo _("Next") ?></p>
<div class="play cont_btn"></div> <ul class="schedule_list">
<li></li>
</ul>
</div>
<a class="airtime_pro" target="_blank" href="<?php echo PRODUCT_SITE_URL; ?>"><?php printf(_('Powered by %s'), PRODUCT_NAME); ?></a>
<div class="on_air">
<p class="now_playing"></p>
</div> </div>
</div> </div>
</div> <div id="premium_player" <?php if ($this->player_style == "premium") echo "style='display:block;'";
else echo "style='display:none'"; ?>>
<div class="bottom_bar">
<div class="play cont_btn"></div>
<div id="html5player_skin"> <div class="on_air">
<script type="text/javascript"> <p class="now_playing"></p>
var html5Player = new Html5Player(); </div>
</script> </div>
</div>
</div>
<div id="html5player_skin">
<script type="text/javascript">
var html5Player = new Html5Player();
</script>
</div>
</body> </body>
</html> </html>

View File

@ -2,16 +2,16 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css"> <link rel="stylesheet" href="<?php echo $this->css ?>" type="text/css">
<script src="<?php echo $this->jquery ?>" type="text/javascript"></script> <script src="<?php echo $this->jquery ?>" type="text/javascript"></script>
<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 src="/js/libs/handlebars.min.js"></script> <script src="/js/libs/handlebars.min.js"></script>
</head> </head>
<body> <body>
<div id="wpBody" class="schedule tab_content current"> <div id="wpBody" class="schedule tab_content current">
<script id="wpWidget" type="text/x-handlebars-template"> <script id="wpWidget" type="text/x-handlebars-template">
<ul class="tabs"> <ul class="tabs">
{{#each this}} {{#each this}}
<li> <li>
{{dayOfWeek}}<span>{{dayOfMonth}}</span> {{dayOfWeek}}<span>{{dayOfMonth}}</span>
@ -40,65 +40,70 @@
<a href="<?php echo PRODUCT_SITE_URL; ?>" target="_blank"><?php printf(_('Powered by %s'), PRODUCT_NAME); ?></a> <a href="<?php echo PRODUCT_SITE_URL; ?>" target="_blank"><?php printf(_('Powered by %s'), PRODUCT_NAME); ?></a>
</div> </div>
</script> </script>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
let importSchedule = <?php echo $this->schedule_data; ?>; // Object prepared in JSON, w/o API call let importSchedule = <?php echo $this->schedule_data; ?>; // Object prepared in JSON, w/o API call
let cleanSchedule = []; let cleanSchedule = [];
// Insert shows into correct locations in importShows array (work-around for API v.1) // Insert shows into correct locations in importShows array (work-around for API v.1)
let importShows = importSchedule["shows"]; let importShows = importSchedule["shows"];
importShows.forEach(element => { importShows.forEach(element => {
// Convert timestamps to JS (sec -> millisec) // Convert timestamps to JS (sec -> millisec)
var start_date = new Date(element.starts_timestamp*1000); var start_date = new Date(element.starts_timestamp * 1000);
var end_date = new Date(element.ends_timestamp*1000); var end_date = new Date(element.ends_timestamp * 1000);
// Check date of show so we know where to assign it to // Check date of show so we know where to assign it to
var format_start_date = start_date.getFullYear() + "-" + (start_date.getMonth()+1) + "-" + start_date.getDate(); var format_start_date = start_date.getFullYear() + "-" + (start_date.getMonth() + 1) + "-" + start_date.getDate();
// Assign show to correct location // Assign show to correct location
if (importSchedule["weekDays"][format_start_date] !== undefined) { if (importSchedule["weekDays"][format_start_date] !== undefined) {
importSchedule["weekDays"][format_start_date]["shows"].push( importSchedule["weekDays"][format_start_date]["shows"].push({
{ "show_start_hour": start_date.toLocaleTimeString([], {
"show_start_hour": start_date.toLocaleTimeString([], { hour: 'numeric', minute : 'numeric' }), hour: 'numeric',
"show_end_hour": end_date.toLocaleTimeString([], { hour: 'numeric', minute : 'numeric' }), minute: 'numeric'
}),
"show_end_hour": end_date.toLocaleTimeString([], {
hour: 'numeric',
minute: 'numeric'
}),
"name": element.name "name": element.name
}); });
} }
});
// Re-arraying data into a Handlebars-friendly format
for (var i = 0; i <= 6; i++) {
cleanSchedule.push(Object.values(importSchedule.weekDays)[i]);
}
// Checker
Handlebars.registerHelper('noShowsCheck', function(obj){
return obj.length == 0;
});
// Templating with Handlebars.js
var wpWidget = document.querySelector('#wpWidget').innerHTML;
var wpTemplate = Handlebars.compile(wpWidget);
var compiledHTML = wpTemplate(cleanSchedule);
document.querySelector('#wpBody').innerHTML = compiledHTML;
// Tabs logic
$(document).ready(function() {
//initialize first day to active
$('.tabs').find("li").first().addClass("active");
$('.schedule_content').find('.schedule_item').first().addClass("active");
$('.tabs li').click(function(){
//var tab_id = $(this).attr('data-tab');
var tab_id = "day-"+$(this).find('span').text();
$('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active');
$(this).addClass('active');
$("#"+tab_id).addClass('active');
}); });
});
</script> // Re-arraying data into a Handlebars-friendly format
for (var i = 0; i <= 6; i++) {
cleanSchedule.push(Object.values(importSchedule.weekDays)[i]);
}
// Checker
Handlebars.registerHelper('noShowsCheck', function(obj) {
return obj.length == 0;
});
// Templating with Handlebars.js
var wpWidget = document.querySelector('#wpWidget').innerHTML;
var wpTemplate = Handlebars.compile(wpWidget);
var compiledHTML = wpTemplate(cleanSchedule);
document.querySelector('#wpBody').innerHTML = compiledHTML;
// Tabs logic
$(document).ready(function() {
//initialize first day to active
$('.tabs').find("li").first().addClass("active");
$('.schedule_content').find('.schedule_item').first().addClass("active");
$('.tabs li').click(function() {
//var tab_id = $(this).attr('data-tab');
var tab_id = "day-" + $(this).find('span').text();
$('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active');
$(this).addClass('active');
$("#" + tab_id).addClass('active');
});
});
</script>
</body> </body>
</html> </html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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" />
<title><?php echo _("An error has occurred.") ?></title> <title><?php echo _("An error has occurred.") ?></title>
<?php echo $this->headLink(); ?> <?php echo $this->headLink(); ?>
</head> </head>
<body> <body>
<div class="error-content" id="error-400"> <div class="error-content" id="error-400">
<h2><?php echo _("Bad Request!")?></h2> <h2><?php echo _("Bad Request!") ?></h2>
<p><?php echo _("The requested action is not supported!")?></p> <p><?php echo _("The requested action is not supported!") ?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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" />
<title><?php echo _("An error has occurred.") ?></title> <title><?php echo _("An error has occurred.") ?></title>
<?php echo $this->headLink(); ?> <?php echo $this->headLink(); ?>
</head> </head>
<body> <body>
<div class="error-content" id="error-403"> <div class="error-content" id="error-403">
<h2><?php echo _("Access Denied!")?></h2> <h2><?php echo _("Access Denied!") ?></h2>
<p><?php echo _("You do not have permission to access this page!")?></p> <p><?php echo _("You do not have permission to access this page!") ?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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" />
<title><?php echo _("An error has occurred.") ?></title> <title><?php echo _("An error has occurred.") ?></title>
<?php echo $this->headLink(); ?> <?php echo $this->headLink(); ?>
</head> </head>
<body> <body>
<div class="error-content" id="error-404"> <div class="error-content" id="error-404">
<h2><?php echo _("Page not found!")?></h2> <h2><?php echo _("Page not found!") ?></h2>
<p><?php echo _("We couldn't find the page you were looking for.")?></p> <p><?php echo _("We couldn't find the page you were looking for.") ?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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" />
<title><?php echo _("An error has occurred.") ?></title> <title><?php echo _("An error has occurred.") ?></title>
<?php echo $this->headLink(); ?> <?php echo $this->headLink(); ?>
</head> </head>
<body> <body>
<div class="error-content" id="error-500"> <div class="error-content" id="error-500">
<h2><?php echo _("Oops!")?></h2> <h2><?php echo _("Oops!") ?></h2>
<p><?php echo _("Something went wrong!")?></p> <p><?php echo _("Something went wrong!") ?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,18 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <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" />
<title><?php echo _("An error has occurred.") ?></title> <title><?php echo _("An error has occurred.") ?></title>
<?php echo $this->headLink(); ?> <?php echo $this->headLink(); ?>
</head> </head>
<body> <body>
<div class="error-content"> <div class="error-content">
<h2><?php echo $this->escape($this->message)?></h2> <h2><?php echo $this->escape($this->message) ?></h2>
<p><?php echo _("Looks like the page you were looking for doesn't exist!")?></p> <p><?php echo _("Looks like the page you were looking for doesn't exist!") ?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -2,7 +2,7 @@
<dl> <dl>
<dt id="add_show_has_autoplaylist_label"> <dt id="add_show_has_autoplaylist_label">
<label for="add_show_has_autoplaylist_label"> <label for="add_show_has_autoplaylist_label">
<?php echo $this->element->getElement('add_show_has_autoplaylist')->getLabel()?> <?php echo $this->element->getElement('add_show_has_autoplaylist')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd> <dd>
@ -10,24 +10,24 @@
<span class="show_autoplaylist_help_icon" aria-describedby="ui-tooltip-2"></span> <span class="show_autoplaylist_help_icon" aria-describedby="ui-tooltip-2"></span>
</dd> </dd>
<div id="add_show_playlist_dropdown"> <div id="add_show_playlist_dropdown">
<p><?php echo _("Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>"); ?></p> <p><?php echo _("Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>"); ?></p>
<dt id="add_show_autoplaylist_id"> <dt id="add_show_autoplaylist_id">
<label for="add_show_autoplaylist_id" class="required"> <label for="add_show_autoplaylist_id" class="required">
<?php echo $this->element->getElement('add_show_autoplaylist_id')->getLabel()?> <?php echo $this->element->getElement('add_show_autoplaylist_id')->getLabel() ?>
</label> </label>
</dt>
<dd>
<?php echo $this->element->getElement('add_show_autoplaylist_id') ?>
</div>
<div id="add_show_autoplaylist_repeat">
<dt id="add_show_autoplaylist_repeat_label">
<label for="add_show_autoplaylist_repeat_label">
<?php echo $this->element->getElement('add_show_autoplaylist_repeat')->getLabel()?>
</label>
</dt> </dt>
<dd> <dd>
<?php echo $this->element->getElement('add_show_autoplaylist_repeat') ?> <?php echo $this->element->getElement('add_show_autoplaylist_id') ?>
</div>
<div id="add_show_autoplaylist_repeat">
<dt id="add_show_autoplaylist_repeat_label">
<label for="add_show_autoplaylist_repeat_label">
<?php echo $this->element->getElement('add_show_autoplaylist_repeat')->getLabel() ?>
</label>
</dt>
<dd>
<?php echo $this->element->getElement('add_show_autoplaylist_repeat') ?>
</dd> </dd>
</div> </div>

View File

@ -1,6 +1,8 @@
<dt id="<?php echo $this->element->getName() ?>-label" class="<?php echo $this->class ?>"> <dt id="<?php echo $this->element->getName() ?>-label" class="<?php echo $this->class ?>">
<?php echo $this->formLabel($this->element->getName(), <?php echo $this->formLabel(
$this->element->getLabel()) ?> $this->element->getName(),
$this->element->getLabel()
) ?>
</dt> </dt>
<dd id="<?php echo $this->element->getName() ?>-element" class="<?php echo $this->class ?>"> <dd id="<?php echo $this->element->getName() ?>-element" class="<?php echo $this->class ?>">
<?php echo $this->{$this->element->helper}( <?php echo $this->{$this->element->helper}(
@ -8,8 +10,8 @@
$this->element->getValue(), $this->element->getValue(),
$this->element->getAttribs() $this->element->getAttribs()
) ?> ) ?>
<?php if($this->element->hasErrors()) { <?php if ($this->element->hasErrors()) {
echo $this->formErrors($this->element->getMessages()); echo $this->formErrors($this->element->getMessages());
} }
?> ?>
</dd> </dd>

View File

@ -15,5 +15,5 @@
<?php echo $this->element->getElement("show_source_port")->render() ?> <?php echo $this->element->getElement("show_source_port")->render() ?>
<?php echo $this->element->getElement("show_source_mount")->render() ?> <?php echo $this->element->getElement("show_source_mount")->render() ?>
</fieldset> </fieldset>
</dl> </dl>
</fieldset> </fieldset>

View File

@ -1,44 +1,48 @@
<fieldset id="add_show_rebroadcast_absolute"> <fieldset id="add_show_rebroadcast_absolute">
<dl> <dl>
<dt id="add_show_hosts_rebroadcast_day-label" class="block-display"> <dt id="add_show_hosts_rebroadcast_day-label" class="block-display">
<label for="add_show_rebroadcast_day" class="optional"><?php echo _("Choose Days:"); ?></label> <label for="add_show_rebroadcast_day" class="optional"><?php echo _("Choose Days:"); ?></label>
</dt> </dt>
<dd id="add_show_rebroadcast_day-element" class="block-display clearfix"> <dd id="add_show_rebroadcast_day-element" class="block-display clearfix">
<ul class="formrow-repeat"> <ul class="formrow-repeat">
<?php for($i=1; $i<=10; $i++): ?> <?php for ($i = 1; $i <= 10; $i++) : ?>
<li <?php if(($i > 1) <li <?php if (($i > 1)
&& ($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getValue() == "" && ($this->element->getElement('add_show_rebroadcast_date_absolute_' . $i)->getValue() == ""
&& $this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getValue() == "")){echo 'style=display:none';} ?>> && $this->element->getElement('add_show_rebroadcast_time_absolute_' . $i)->getValue() == "")
<?php echo $this->element->getElement('add_show_rebroadcast_date_absolute_'.$i) ?> ) {
<span class="inline-text">@</span> echo 'style=display:none';
<?php echo $this->element->getElement('add_show_rebroadcast_time_absolute_'.$i) ?> } ?>>
<?php if($i > 1): ?> <?php echo $this->element->getElement('add_show_rebroadcast_date_absolute_' . $i) ?>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_absolute_<?php echo $i ?>"> <span class="inline-text">@</span>
<span class="ui-icon ui-icon-closethick"></span> <?php echo $this->element->getElement('add_show_rebroadcast_time_absolute_' . $i) ?>
<span class="ui-button-text"><?php echo _("Remove") ?></span> <?php if ($i > 1) : ?>
</a> <a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_absolute_<?php echo $i ?>">
<?php endif; ?> <span class="ui-icon ui-icon-closethick"></span>
<?php if(($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->hasErrors()) <span class="ui-button-text"><?php echo _("Remove") ?></span>
|| ($this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->hasErrors())) : ?> </a>
<ul class='errors'> <?php endif; ?>
<?php $errors = array_merge( <?php if (($this->element->getElement('add_show_rebroadcast_date_absolute_' . $i)->hasErrors())
$this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getMessages(), || ($this->element->getElement('add_show_rebroadcast_time_absolute_' . $i)->hasErrors())
$this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getMessages() ) : ?>
<ul class='errors'>
<?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_absolute_' . $i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_absolute_' . $i)->getMessages()
); );
?> ?>
<?php foreach($errors as $error): ?> <?php foreach ($errors as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day"> <a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">
<span class="ui-icon ui-icon-plusthick"></span> <span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text"><?php echo _("Add") ?></span> <span class="ui-button-text"><?php echo _("Add") ?></span>
</a> </a>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>

View File

@ -1,45 +1,49 @@
<fieldset id="add_show_rebroadcast_relative"> <fieldset id="add_show_rebroadcast_relative">
<dl> <dl>
<dt id="add_show_hosts_rebroadcast_repeat_day-label" class="block-display"> <dt id="add_show_hosts_rebroadcast_repeat_day-label" class="block-display">
<label for="add_show_rebroadcast_repeat_day" class="optional"><?php echo _("Repeat Days:"); ?></label> <label for="add_show_rebroadcast_repeat_day" class="optional"><?php echo _("Repeat Days:"); ?></label>
</dt> </dt>
<dd id="add_show_rebroadcast_repeat_day-element" class="block-display clearfix"> <dd id="add_show_rebroadcast_repeat_day-element" class="block-display clearfix">
<ul class="formrow-repeat"> <ul class="formrow-repeat">
<?php for($i=1; $i<=10; $i++): ?> <?php for ($i = 1; $i <= 10; $i++) : ?>
<li <?php if(($i > 1) <li <?php if (($i > 1)
&& ($this->element->getElement('add_show_rebroadcast_date_'.$i)->getValue() == "" && ($this->element->getElement('add_show_rebroadcast_date_' . $i)->getValue() == ""
&& $this->element->getElement('add_show_rebroadcast_time_'.$i)->getValue() == "")){echo 'style=display:none';} ?>> && $this->element->getElement('add_show_rebroadcast_time_' . $i)->getValue() == "")
<?php echo $this->element->getElement('add_show_rebroadcast_date_'.$i) ?> ) {
<span class="inline-text">@</span> echo 'style=display:none';
<?php echo $this->element->getElement('add_show_rebroadcast_time_'.$i) ?> } ?>>
<?php if($i > 1): ?> <?php echo $this->element->getElement('add_show_rebroadcast_date_' . $i) ?>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_<?php echo $i ?>"> <span class="inline-text">@</span>
<span class="ui-icon ui-icon-closethick"></span> <?php echo $this->element->getElement('add_show_rebroadcast_time_' . $i) ?>
<span class="ui-button-text"><?php echo _("Remove") ?></span> <?php if ($i > 1) : ?>
</a> <a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_<?php echo $i ?>">
<?php endif; ?> <span class="ui-icon ui-icon-closethick"></span>
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors()) <span class="ui-button-text"><?php echo _("Remove") ?></span>
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?> </a>
<ul class='errors'> <?php endif; ?>
<?php $errors = array_merge( <?php if (($this->element->getElement('add_show_rebroadcast_date_' . $i)->hasErrors())
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(), || ($this->element->getElement('add_show_rebroadcast_time_' . $i)->hasErrors())
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages() ) : ?>
); <ul class='errors'>
?> <?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_' . $i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_' . $i)->getMessages()
);
?>
<?php foreach($errors as $error): ?> <?php foreach ($errors as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day"> <a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">
<span class="ui-icon ui-icon-plusthick"></span> <span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text"><?php echo _("Add") ?></span> <span class="ui-button-text"><?php echo _("Add") ?></span>
</a> </a>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>

View File

@ -1,6 +1,8 @@
<dt id="<?php echo $this->element->getName() ?>-label" class="<?php echo $this->class ?>"> <dt id="<?php echo $this->element->getName() ?>-label" class="<?php echo $this->class ?>">
<?php echo $this->formLabel($this->element->getName(), <?php echo $this->formLabel(
$this->element->getLabel()) ?> $this->element->getName(),
$this->element->getLabel()
) ?>
</dt> </dt>
<dd id="<?php echo $this->element->getName() ?>-element"> <dd id="<?php echo $this->element->getName() ?>-element">
<?php echo $this->{$this->element->helper}( <?php echo $this->{$this->element->helper}(
@ -9,5 +11,7 @@
$this->element->getAttribs() $this->element->getAttribs()
) ?> ) ?>
<?php if($this->element->hasErrors()) { echo $this->formErrors($this->element->getMessages());} ?> <?php if ($this->element->hasErrors()) {
echo $this->formErrors($this->element->getMessages());
} ?>
</dd> </dd>

View File

@ -2,7 +2,7 @@
<dl> <dl>
<dt id="add_show_start_now-label"> <dt id="add_show_start_now-label">
<label for="add_show_start_now"> <label for="add_show_start_now">
<?php echo $this->element->getElement('add_show_start_now')->getLabel()?> <?php echo $this->element->getElement('add_show_start_now')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd> <dd>
@ -12,29 +12,30 @@
<dt id="add_show_start_date-label"> <dt id="add_show_start_date-label">
<label for="add_show_start_date" class="required"> <label for="add_show_start_date" class="required">
<?php //echo $this->element->getElement('add_show_start_date')->getLabel()?> <?php //echo $this->element->getElement('add_show_start_date')->getLabel()
?>
</label> </label>
</dt> </dt>
<dd> <dd>
<?php echo $this->element->getElement('add_show_start_date') ?> <?php echo $this->element->getElement('add_show_start_date') ?>
<?php echo $this->element->getElement('add_show_start_time') ?> <?php echo $this->element->getElement('add_show_start_time') ?>
</dd> </dd>
<?php if($this->element->getElement('add_show_start_date')->hasErrors() || $this->element->getElement('add_show_start_time')->hasErrors()){ ?> <?php if ($this->element->getElement('add_show_start_date')->hasErrors() || $this->element->getElement('add_show_start_time')->hasErrors()) { ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('add_show_start_date')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('add_show_start_date')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach($this->element->getElement('add_show_start_time')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('add_show_start_time')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php } ?> <?php } ?>
<dt id="add_show_end_date_no_repeat-label"> <dt id="add_show_end_date_no_repeat-label">
<label for="add_show_end_date_no_repeat" class="required"> <label for="add_show_end_date_no_repeat" class="required">
<?php echo $this->element->getElement('add_show_end_date_no_repeat')->getLabel()?> <?php echo $this->element->getElement('add_show_end_date_no_repeat')->getLabel() ?>
</label> </label>
</dt> </dt>
@ -42,15 +43,15 @@
<?php echo $this->element->getElement('add_show_end_date_no_repeat') ?> <?php echo $this->element->getElement('add_show_end_date_no_repeat') ?>
<?php echo $this->element->getElement('add_show_end_time') ?> <?php echo $this->element->getElement('add_show_end_time') ?>
</dd> </dd>
<?php if($this->element->getElement('add_show_end_date_no_repeat')->hasErrors() || $this->element->getElement('add_show_end_time')->hasErrors()){ ?> <?php if ($this->element->getElement('add_show_end_date_no_repeat')->hasErrors() || $this->element->getElement('add_show_end_time')->hasErrors()) { ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('add_show_end_date_no_repeat')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('add_show_end_date_no_repeat')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach($this->element->getElement('add_show_end_time')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('add_show_end_time')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php } ?> <?php } ?>
<dt id="add_show_duration-label"> <dt id="add_show_duration-label">
<label for="add_show_duration" class="optional"> <label for="add_show_duration" class="optional">
@ -59,14 +60,14 @@
</dt> </dt>
<dd id="add_show_duration-element"> <dd id="add_show_duration-element">
<?php echo $this->element->getElement('add_show_duration') ?> <?php echo $this->element->getElement('add_show_duration') ?>
<img id="icon-loader-small"/> <img id="icon-loader-small" />
</dd> </dd>
<?php if($this->element->getElement('add_show_duration')->hasErrors()){ ?> <?php if ($this->element->getElement('add_show_duration')->hasErrors()) { ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('add_show_duration')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('add_show_duration')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php } ?> <?php } ?>
<dt id="add_show_timezone-label"> <dt id="add_show_timezone-label">
@ -85,5 +86,5 @@
<dd id="add_show_repeats-element"> <dd id="add_show_repeats-element">
<?php echo $this->element->getElement('add_show_repeats') ?> <?php echo $this->element->getElement('add_show_repeats') ?>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>

View File

@ -3,7 +3,7 @@
<?php echo $this->element->getElement('his_time_start') ?> <?php echo $this->element->getElement('his_time_start') ?>
<?php echo $this->element->getElement('his_date_end') ?> <?php echo $this->element->getElement('his_date_end') ?>
<?php echo $this->element->getElement('his_time_end') ?> <?php echo $this->element->getElement('his_time_end') ?>
<div id="his_submit" class=" btn btn-small" title="<?php echo _("Filter History")?>"> <div id="his_submit" class=" btn btn-small" title="<?php echo _("Filter History") ?>">
<i class="icon-white icon-search"></i><span><?php echo _("Filter History")?></span> <i class="icon-white icon-search"></i><span><?php echo _("Filter History") ?></span>
</div> </div>
</div> </div>

View File

@ -1,37 +1,37 @@
<form> <form>
<?php $form = $this->element ?> <?php $form = $this->element ?>
<dl class="zend_form"> <dl class="zend_form">
<?php $name = "his_file_id"; ?> <?php $name = "his_file_id"; ?>
<dd id="<?php echo $name;?>-element"> <dd id="<?php echo $name; ?>-element">
<?php echo $form->getElement($name); ?> <?php echo $form->getElement($name); ?>
</dd> </dd>
<?php foreach ($form->getSubForm('his_file_template') as $index=>$el): ?> <?php foreach ($form->getSubForm('his_file_template') as $index => $el) : ?>
<?php $name = $el->getName(); ?> <?php $name = $el->getName(); ?>
<dt id="<?php echo $name;?>-label"> <dt id="<?php echo $name; ?>-label">
<label for="<?php echo $name;?>"><?php echo $el->getLabel() ?></label> <label for="<?php echo $name; ?>"><?php echo $el->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $name;?>-element"> <dd id="<?php echo $name; ?>-element">
<?php echo $el ?> <?php echo $el ?>
<?php if ($el->hasErrors()): ?> <?php if ($el->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($el->getMessages() as $error): ?> <?php foreach ($el->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach; ?>
<dd id="submitButtons-element">
<?php foreach (array("his_file_save", "his_file_cancel") as $name) : ?>
<?php echo $form->getElement($name); ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </dd>
<?php endif; ?>
</dd>
<?php endforeach; ?>
<dd id="submitButtons-element"> </dl>
<?php foreach (array("his_file_save", "his_file_cancel") as $name): ?>
<?php echo $form->getElement($name); ?>
<?php endforeach;?>
</dd>
</dl>
</form> </form>

View File

@ -1,86 +1,86 @@
<form> <form>
<?php $form = $this->element ?> <?php $form = $this->element ?>
<dl class="zend_form"> <dl class="zend_form">
<?php $formErrors = $form->getErrorMessages() ?> <?php $formErrors = $form->getErrorMessages() ?>
<?php if (count($formErrors) > 0) : ?> <?php if (count($formErrors) > 0) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach ($formErrors as $error): ?> <?php foreach ($formErrors as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php $name = "his_item_id"; ?>
<dd id="<?php echo $name; ?>-element">
<?php echo $form->getElement($name); ?>
</dd>
<?php foreach (array("his_item_starts", "his_item_ends") as $name) : ?>
<dt id="<?php echo $name; ?>-label">
<label for="<?php echo $name; ?>"><?php echo $form->getElement($name)->getLabel() ?></label>
</dt>
<dd id="<?php echo $name; ?>-element">
<div class="well">
<div id="<?php echo $name; ?>_datetimepicker" class="input-append date">
<?php echo $form->getElement($name) ?>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
</div>
<?php if ($form->getElement($name)->hasErrors()) : ?>
<ul class='errors'>
<?php foreach ($form->getElement($name)->getMessages() as $error) : ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach; ?> <?php endforeach; ?>
</ul>
<?php endif; ?>
<?php $name = "his_item_id"; ?> <dd id="his_choose_instance">
<dd id="<?php echo $name;?>-element"> <div>
<?php echo $form->getElement($name); ?> <label for="<?php echo $name; ?>"><?php echo _("Choose Show Instance") ?></label>
</dd>
<?php foreach (array("his_item_starts", "his_item_ends") as $name): ?>
<dt id="<?php echo $name;?>-label">
<label for="<?php echo $name;?>"><?php echo $form->getElement($name)->getLabel() ?></label>
</dt>
<dd id="<?php echo $name;?>-element">
<div class="well">
<div id="<?php echo $name;?>_datetimepicker" class="input-append date">
<?php echo $form->getElement($name) ?>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div> </div>
</div> <div>
<?php if ($form->getElement($name)->hasErrors()) : ?> <?php $select = $form->getElement("his_instance_select"); ?>
<ul class='errors'> <?php if (isset($select)) : ?>
<?php foreach ($form->getElement($name)->getMessages() as $error): ?> <?php echo $select; ?>
<li><?php echo $error; ?></li> <?php else : ?>
<select id="his_instance_select">
<option value="0"><?php echo _("No Show") ?></option>
</select>
<?php endif; ?>
<button class="btn" type="button" id="his_instance_retrieve"><?php echo _("Find") ?></button>
</div>
</dd>
<?php foreach ($form->getSubForm('his_item_template') as $index => $el) : ?>
<?php $name = $el->getName(); ?>
<dt id="<?php echo $name; ?>-label">
<label for="<?php echo $name; ?>"><?php echo $el->getLabel() ?></label>
</dt>
<dd id="<?php echo $name; ?>-element">
<?php echo $el ?>
<?php if ($el->hasErrors()) : ?>
<ul class='errors'>
<?php foreach ($el->getMessages() as $error) : ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach; ?>
<dd id="submitButtons-element">
<?php foreach (array("his_item_save", "his_item_cancel") as $name) : ?>
<?php echo $form->getElement($name); ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </dd>
<?php endif; ?>
</dd>
<?php endforeach;?>
<dd id="his_choose_instance"> </dl>
<div>
<label for="<?php echo $name;?>"><?php echo _("Choose Show Instance") ?></label>
</div>
<div>
<?php $select = $form->getElement("his_instance_select"); ?>
<?php if (isset($select)): ?>
<?php echo $select; ?>
<?php else: ?>
<select id="his_instance_select">
<option value="0"><?php echo _("No Show") ?></option>
</select>
<?php endif; ?>
<button class="btn" type="button" id="his_instance_retrieve"><?php echo _("Find") ?></button>
</div>
</dd>
<?php foreach ($form->getSubForm('his_item_template') as $index=>$el): ?>
<?php $name = $el->getName(); ?>
<dt id="<?php echo $name;?>-label">
<label for="<?php echo $name;?>"><?php echo $el->getLabel() ?></label>
</dt>
<dd id="<?php echo $name;?>-element">
<?php echo $el ?>
<?php if ($el->hasErrors()): ?>
<ul class='errors'>
<?php foreach($el->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<?php endforeach; ?>
<dd id="submitButtons-element">
<?php foreach (array("his_item_save", "his_item_cancel") as $name): ?>
<?php echo $form->getElement($name); ?>
<?php endforeach;?>
</dd>
</dl>
</form> </form>

View File

@ -1,165 +1,165 @@
<h2><?php echo _("My Profile") ?></h2> <h2><?php echo _("My Profile") ?></h2>
<div id="current-user-container"> <div id="current-user-container">
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded"> <form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
<dl class="zend_form"> <dl class="zend_form">
<?php echo $this->element->getElement('cu_user_id') ?> <?php echo $this->element->getElement('cu_user_id') ?>
<dt id="cu-username-label"> <dt id="cu-username-label">
<label><?php echo $this->element->getElement('cu_login')->getLabel() ?> <label><?php echo $this->element->getElement('cu_login')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-username-element"> <dd id="cu-username-element">
<?php echo $this->element->getElement('cu_login') ?> <?php echo $this->element->getElement('cu_login') ?>
<?php if($this->element->getElement('cu_login')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_login')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_login')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_login')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-password-label"> <dt id="cu-password-label">
<label><?php echo $this->element->getElement('cu_password')->getLabel() ?> <label><?php echo $this->element->getElement('cu_password')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-password-element"> <dd id="cu-password-element">
<?php echo $this->element->getElement('cu_password') ?> <?php echo $this->element->getElement('cu_password') ?>
<?php if($this->element->getElement('cu_password')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_password')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_password')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_password')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-passwordVerify-label"> <dt id="cu-passwordVerify-label">
<label><?php echo $this->element->getElement('cu_passwordVerify')->getLabel() ?> <label><?php echo $this->element->getElement('cu_passwordVerify')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-passwordVerify-element"> <dd id="cu-passwordVerify-element">
<?php echo $this->element->getElement('cu_passwordVerify') ?> <?php echo $this->element->getElement('cu_passwordVerify') ?>
<?php if($this->element->getElement('cu_passwordVerify')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_passwordVerify')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_passwordVerify')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_passwordVerify')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-firstname-label"> <dt id="cu-firstname-label">
<label><?php echo $this->element->getElement('cu_first_name')->getLabel() ?> <label><?php echo $this->element->getElement('cu_first_name')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-firstname-element"> <dd id="cu-firstname-element">
<?php echo $this->element->getElement('cu_first_name') ?> <?php echo $this->element->getElement('cu_first_name') ?>
<?php if($this->element->getElement('cu_first_name')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_first_name')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_first_name')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_first_name')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-lastname-label"> <dt id="cu-lastname-label">
<label><?php echo $this->element->getElement('cu_last_name')->getLabel() ?> <label><?php echo $this->element->getElement('cu_last_name')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-lastname-element"> <dd id="cu-lastname-element">
<?php echo $this->element->getElement('cu_last_name') ?> <?php echo $this->element->getElement('cu_last_name') ?>
<?php if($this->element->getElement('cu_last_name')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_last_name')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_last_name')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_last_name')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-email-label"> <dt id="cu-email-label">
<label><?php echo $this->element->getElement('cu_email')->getLabel() ?> <label><?php echo $this->element->getElement('cu_email')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-email-element"> <dd id="cu-email-element">
<?php echo $this->element->getElement('cu_email') ?> <?php echo $this->element->getElement('cu_email') ?>
<?php if($this->element->getElement('cu_email')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_email')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_email')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_email')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-cell_phone-label"> <dt id="cu-cell_phone-label">
<label><?php echo $this->element->getElement('cu_cell_phone')->getLabel() ?> <label><?php echo $this->element->getElement('cu_cell_phone')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-cell_phone-element"> <dd id="cu-cell_phone-element">
<?php echo $this->element->getElement('cu_cell_phone') ?> <?php echo $this->element->getElement('cu_cell_phone') ?>
<?php if($this->element->getElement('cu_cell_phone')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_cell_phone')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_cell_phone')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_cell_phone')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-skype-label"> <dt id="cu-skype-label">
<label><?php echo $this->element->getElement('cu_skype')->getLabel() ?> <label><?php echo $this->element->getElement('cu_skype')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-skype-element"> <dd id="cu-skype-element">
<?php echo $this->element->getElement('cu_skype') ?> <?php echo $this->element->getElement('cu_skype') ?>
<?php if($this->element->getElement('cu_skype')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_skype')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_skype')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_skype')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-jabber-label"> <dt id="cu-jabber-label">
<label><?php echo $this->element->getElement('cu_jabber')->getLabel() ?> <label><?php echo $this->element->getElement('cu_jabber')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-jabber-element"> <dd id="cu-jabber-element">
<?php echo $this->element->getElement('cu_jabber') ?> <?php echo $this->element->getElement('cu_jabber') ?>
<?php if($this->element->getElement('cu_jabber')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_jabber')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_jabber')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_jabber')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-locale-label"> <dt id="cu-locale-label">
<label><?php echo $this->element->getElement('cu_locale')->getLabel() ?> <label><?php echo $this->element->getElement('cu_locale')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-locale-element"> <dd id="cu-locale-element">
<?php echo $this->element->getElement('cu_locale') ?> <?php echo $this->element->getElement('cu_locale') ?>
<?php if($this->element->getElement('cu_locale')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_locale')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_locale')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_locale')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="cu-timezone-label"> <dt id="cu-timezone-label">
<label><?php echo $this->element->getElement('cu_timezone')->getLabel() ?> <label><?php echo $this->element->getElement('cu_timezone')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="cu-timezone-element"> <dd id="cu-timezone-element">
<?php echo $this->element->getElement('cu_timezone') ?> <?php echo $this->element->getElement('cu_timezone') ?>
<?php if($this->element->getElement('cu_timezone')->hasErrors()) : ?> <?php if ($this->element->getElement('cu_timezone')->hasErrors()) : ?>
<ul class='errors edit-user-errors'> <ul class='errors edit-user-errors'>
<?php foreach($this->element->getElement('cu_timezone')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('cu_timezone')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<?php echo $this->element->getElement('csrf') ?> <?php echo $this->element->getElement('csrf') ?>
</dl> </dl>
<button type="submit" id="cu_save_user" class="btn right-floated"><?php echo _("Save")?></button> <button type="submit" id="cu_save_user" class="btn right-floated"><?php echo _("Save") ?></button>
</form> </form>
</div> </div>

View File

@ -3,7 +3,7 @@
<dt id="username-label"> <dt id="username-label">
<label for="username" class="required"> <label for="username" class="required">
<?php echo $this->element->getElement('username')->getLabel() ?> <?php echo $this->element->getElement('username')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="username-element"> <dd id="username-element">
@ -12,7 +12,7 @@
<dt id="password-label"> <dt id="password-label">
<label for="password" class="required"> <label for="password" class="required">
<?php echo $this->element->getElement('password')->getLabel() ?> <?php echo $this->element->getElement('password')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="password-element"> <dd id="password-element">
@ -21,7 +21,7 @@
<dt id="locale-label"> <dt id="locale-label">
<label for="locale" class="required"> <label for="locale" class="required">
<?php echo $this->element->getElement('locale')->getLabel() ?> <?php echo $this->element->getElement('locale')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="locale-element"> <dd id="locale-element">

View File

@ -2,34 +2,34 @@
<dl class="zend_form"> <dl class="zend_form">
<dt id="new-password-label"> <dt id="new-password-label">
<label for="new-password" class="required"> <label for="new-password" class="required">
<?php echo $this->element->getElement('password')->getLabel() ?> <?php echo $this->element->getElement('password')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="new-password-element"> <dd id="new-password-element">
<?php echo $this->element->getElement('password') ?> <?php echo $this->element->getElement('password') ?>
</dd> </dd>
<?php if($this->element->getElement('password')->hasErrors()): ?> <?php if ($this->element->getElement('password')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('password')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('password')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<dt id="confirm-password-label"> <dt id="confirm-password-label">
<label for="confirm-password" class="required"> <label for="confirm-password" class="required">
<?php echo $this->element->getElement('password_confirm')->getLabel() ?> <?php echo $this->element->getElement('password_confirm')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="confirm-password-element"> <dd id="confirm-password-element">
<?php echo $this->element->getElement('password_confirm') ?> <?php echo $this->element->getElement('password_confirm') ?>
</dd> </dd>
<?php if($this->element->getElement('password_confirm')->hasErrors()): ?> <?php if ($this->element->getElement('password_confirm')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('password_confirm')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('password_confirm')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
<dt id="submit-label">&nbsp;</dt> <dt id="submit-label">&nbsp;</dt>

View File

@ -2,15 +2,15 @@
<form enctype="application/x-www-form-urlencoded" method="post" action=""> <form enctype="application/x-www-form-urlencoded" method="post" action="">
<dl class="zend_form"> <dl class="zend_form">
<p><?php echo(_("Please enter both your username and email address.")); ?></p> <p><?php echo (_("Please enter both your username and email address.")); ?></p>
<dt id="username-label"> <dt id="username-label">
<label for="username" class="required"> <label for="username" class="required">
<?php echo $this->element->getElement('username')->getLabel() ?> <?php echo $this->element->getElement('username')->getLabel() ?>
</label> </label>
</dt> </dt>
<dd id="username-element"> <dd id="username-element">
<?php echo $this->element->getElement('username') ?> <?php echo $this->element->getElement('username') ?>
</dd> </dd>
</dt> </dt>
<dt id="email-label"> <dt id="email-label">
@ -21,9 +21,9 @@
<dd id="email-element"> <dd id="email-element">
<?php echo $this->element->getElement('email') ?> <?php echo $this->element->getElement('email') ?>
</dd> </dd>
<?php if ($this->element->getElement('email')->hasErrors()): ?> <?php if ($this->element->getElement('email')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach ($this->element->getElement('email')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('email')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
@ -36,8 +36,8 @@
<dd id="cancel-element"> <dd id="cancel-element">
<a href="<?php echo($this->baseUrl('login')); ?>"> <a href="<?php echo ($this->baseUrl('login')); ?>">
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button> <button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo (_("Back")); ?></button>
</a> </a>
</dd> </dd>
</dl> </dl>

View File

@ -1,19 +1,15 @@
<style type="text/css"> <style type="text/css">
.player-title {
width: 70px;
border-style: none float: left;
}
.player-title { .preview-label {
width: 70px; line-height: 60px;
border-style: none border-style: none float: left;
float: left; font-size: 20px;
} color: #fff
}
.preview-label {
line-height: 60px;
border-style: none
float: left;
font-size: 20px;
color: #fff
}
</style> </style>
<fieldset class="padded"> <fieldset class="padded">
<dl class="zend_form"> <dl class="zend_form">
@ -38,7 +34,8 @@
<?php echo $this->element->getElement('player_embed_src')->render(); ?> <?php echo $this->element->getElement('player_embed_src')->render(); ?>
<?php //echo $this->element->getElement('player_display_track_metadata'); ?> <?php //echo $this->element->getElement('player_display_track_metadata');
?>
<table id="player_compatibility_chart" style="text-align:center; position:relative; top:40px;"> <table id="player_compatibility_chart" style="text-align:center; position:relative; top:40px;">
<th colspan="5" style="text-align:center"><?php echo _("Stream Compatibility") ?></th> <th colspan="5" style="text-align:center"><?php echo _("Stream Compatibility") ?></th>

View File

@ -9,12 +9,12 @@
<?php echo $this->element->getElement('stationLogoRemove')->render() ?> <?php echo $this->element->getElement('stationLogoRemove')->render() ?>
<!-- <button id="logo-remove-btn" value="Remove" class="btn">Remove</button>--> <!-- <button id="logo-remove-btn" value="Remove" class="btn">Remove</button>-->
<div id="Logo-img-container"> <div id="Logo-img-container">
<?php <?php
$logoImg = $this->element->getView()->logoImg; $logoImg = $this->element->getView()->logoImg;
$src = "data:image/png;base64,".$logoImg; $src = "data:image/png;base64," . $logoImg;
?> ?>
<img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='/*resizeImg(this, 450, 450);*/' src="<?php echo $src ?>" /> <img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='/*resizeImg(this, 450, 450);*/' src="<?php echo $src ?>" />
</div> </div>

View File

@ -19,7 +19,7 @@
<a href=# id="connection_url_override" style="font-size: 12px;"><?php echo _("Override") ?></a>&nbsp;&nbsp; <a href=# id="connection_url_override" style="font-size: 12px;"><?php echo _("Override") ?></a>&nbsp;&nbsp;
<span class="override_help_icon"></span></br> <span class="override_help_icon"></span></br>
<div id="master_dj_connection_url_actions" style="display:none">&nbsp;&nbsp; <div id="master_dj_connection_url_actions" style="display:none">&nbsp;&nbsp;
<a href=# id="ok" style="font-size: 12px;"><?php echo _("OK") ?></a>&nbsp;&nbsp;<a href=# id="reset" style="font-size: 12px;"><?php echo _("RESET"); ?></a> <a href=# id="ok" style="font-size: 12px;"><?php echo _("OK") ?></a>&nbsp;&nbsp;<a href=# id="reset" style="font-size: 12px;"><?php echo _("RESET"); ?></a>
</div> </div>
</span> </span>
<?php echo $this->element->getElement("master_source_port")->render() ?> <?php echo $this->element->getElement("master_source_port")->render() ?>
@ -32,12 +32,12 @@
<?php echo _("DJs can use these settings in their broadcasting software to broadcast live only during shows assigned to them.") ?> <?php echo _("DJs can use these settings in their broadcasting software to broadcast live only during shows assigned to them.") ?>
</p> </p>
<span id="stream_url"> <span id="stream_url">
<?php echo $this->element->getElement("show_source_host")->render() ?> <?php echo $this->element->getElement("show_source_host")->render() ?>
<a href=# id="connection_url_override" style="font-size: 12px;"><?php echo _("Override") ?></a>&nbsp;&nbsp; <a href=# id="connection_url_override" style="font-size: 12px;"><?php echo _("Override") ?></a>&nbsp;&nbsp;
<span class="override_help_icon"></span> <span class="override_help_icon"></span>
</br> </br>
<div id="live_dj_connection_url_actions" style="display:none; float:left">&nbsp;&nbsp; <div id="live_dj_connection_url_actions" style="display:none; float:left">&nbsp;&nbsp;
<a href=# id="ok" style="font-size: 12px;"><?php echo _("OK") ?></a>&nbsp;&nbsp;<a href=# id="reset" style="font-size: 12px;"><?php echo _("RESET"); ?></a> <a href=# id="ok" style="font-size: 12px;"><?php echo _("OK") ?></a>&nbsp;&nbsp;<a href=# id="reset" style="font-size: 12px;"><?php echo _("RESET"); ?></a>
</div> </div>
</span> </span>
<?php echo $this->element->getElement("show_source_port")->render() ?> <?php echo $this->element->getElement("show_source_port")->render() ?>

View File

@ -1,7 +1,7 @@
<fieldset class="padded"> <fieldset class="padded">
<dl class="zend_form"> <dl class="zend_form">
<?php if($this->element->getElement("enable_tunein")->hasErrors()) { <?php if ($this->element->getElement("enable_tunein")->hasErrors()) {
echo $this->element->getElement('enable_tunein')->renderErrors(); echo $this->element->getElement('enable_tunein')->renderErrors();
} }
?> ?>

View File

@ -6,17 +6,18 @@
</dt> </dt>
<dd id="storageFolder-element" class="block-display"> <dd id="storageFolder-element" class="block-display">
<?php echo $this->element->getElement('storageFolder') ?> <?php echo $this->element->getElement('storageFolder') ?>
<input id="storageFolder-selection" type="button" value="<?php echo _("Choose folder")?>"></input> <input id="storageFolder-selection" type="button" value="<?php echo _("Choose folder") ?>"></input>
<input id="storageFolder-ok" type="button" value="<?php echo _("Set")?>"></input> <input id="storageFolder-ok" type="button" value="<?php echo _("Set") ?>"></input>
<?php if($this->element->getElement('storageFolder')->hasErrors()) : ?> <?php if ($this->element->getElement('storageFolder')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('storageFolder')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('storageFolder')->getMessages() as $error) : ?>
<li><?php echo $this->escape($error); ?></li> <li><?php echo $this->escape($error); ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dd class="block-display selected-item"><strong><?php echo _("Current Import Folder:"); ?></strong><?php $stor = Application_Model_MusicDir::getStorDir(); echo $stor->getDirectory(); ?></dd> <dd class="block-display selected-item"><strong><?php echo _("Current Import Folder:"); ?></strong><?php $stor = Application_Model_MusicDir::getStorDir();
echo $stor->getDirectory(); ?></dd>
<dt id="watchedFolder-label" class="block-display"> <dt id="watchedFolder-label" class="block-display">
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label> <label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
@ -24,11 +25,11 @@
</dt> </dt>
<dd id="watchedFolder-element" class="block-display"> <dd id="watchedFolder-element" class="block-display">
<?php echo $this->element->getElement('watchedFolder') ?> <?php echo $this->element->getElement('watchedFolder') ?>
<input id="watchedFolder-selection" type="button" value="<?php echo _("Choose folder")?>"></input> <input id="watchedFolder-selection" type="button" value="<?php echo _("Choose folder") ?>"></input>
<input id="watchedFolder-ok" type="button" value="<?php echo _("Add")?>"></input> <input id="watchedFolder-ok" type="button" value="<?php echo _("Add") ?>"></input>
<?php if($this->element->getElement('watchedFolder')->hasErrors()) : ?> <?php if ($this->element->getElement('watchedFolder')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('watchedFolder')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('watchedFolder')->getMessages() as $error) : ?>
<li><?php echo $this->escape($error); ?></li> <li><?php echo $this->escape($error); ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
@ -36,15 +37,15 @@
</dd> </dd>
<?php $watched_dirs = Application_Model_MusicDir::getWatchedDirs(null, true); ?> <?php $watched_dirs = Application_Model_MusicDir::getWatchedDirs(null, true); ?>
<?php if (count($watched_dirs) > 0): ?> <?php if (count($watched_dirs) > 0) : ?>
<?php foreach($watched_dirs as $watched_dir): ?> <?php foreach ($watched_dirs as $watched_dir) : ?>
<dd class="block-display selected-item"> <dd class="block-display selected-item">
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath" style="display:block; width:350px"><?php echo htmlspecialchars($watched_dir->getDirectory());?></span></span> <?php echo ($watched_dir->getExistsFlag()) ? "" : "<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>" ?><span id="folderPath" style="display:block; width:350px"><?php echo htmlspecialchars($watched_dir->getDirectory()); ?></span></span>
<span title="<?php echo sprintf(_("Rescan watched directory (This is useful if it is network mount and may be out of sync with %s)"), PRODUCT_NAME)?>" class="ui-icon ui-icon-refresh"></span> <span title="<?php echo sprintf(_("Rescan watched directory (This is useful if it is network mount and may be out of sync with %s)"), PRODUCT_NAME) ?>" class="ui-icon ui-icon-refresh"></span>
<span title="<?php echo _("Remove watched directory")?>" class="ui-icon ui-icon-close"></span> <span title="<?php echo _("Remove watched directory") ?>" class="ui-icon ui-icon-close"></span>
</dd> </dd>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php else : ?>
<dd class="block-display selected-item"> <dd class="block-display selected-item">
<span><?php echo _("You are not watching any media folders."); ?></span> <span><?php echo _("You are not watching any media folders."); ?></span>
</dd> </dd>

View File

@ -9,7 +9,7 @@
<?php echo $this->element->getElement('setup_timezone')->render(); ?> <?php echo $this->element->getElement('setup_timezone')->render(); ?>
</dl> </dl>
</fieldset> </fieldset>
<p style="margin-bottom: 0px; text-align: center;"><?php echo _("You can change these later in your preferences and user settings.");?></p> <p style="margin-bottom: 0px; text-align: center;"><?php echo _("You can change these later in your preferences and user settings."); ?></p>
</form> </form>
</div> </div>

View File

@ -9,8 +9,13 @@
<?php echo $this->element->getElement('sb_show_filter') ?> <?php echo $this->element->getElement('sb_show_filter') ?>
<!-- --><?php //if ($this->element->getElement('sb_my_shows')):?> <!-- --><?php //if ($this->element->getElement('sb_my_shows')):
<!-- <label>--><?php //echo $this->element->getElement('sb_my_shows')->getLabel(); ?><!--</label>--> ?>
<!-- --><?php //echo $this->element->getElement('sb_my_shows'); ?> <!-- <label>--><?php //echo $this->element->getElement('sb_my_shows')->getLabel();
<!-- --><?php //endif;?> ?>
<!--</label>-->
<!-- --><?php //echo $this->element->getElement('sb_my_shows');
?>
<!-- --><?php //endif;
?>
</div> </div>

View File

@ -1,65 +1,66 @@
<form class="smart-block-form" method="post" action=""> <form class="smart-block-form" method="post" action="">
<dl class='zend_form search-criteria'> <dl class='zend_form search-criteria'>
<div id='sp-success' class='success' style='display:none'></div> <div id='sp-success' class='success' style='display:none'></div>
<dt><label><?php echo(_("Search Criteria:"));?></label></dt> <dt><label><?php echo (_("Search Criteria:")); ?></label></dt>
<dd id='sp_criteria-element' class='criteria-element'> <dd id='sp_criteria-element' class='criteria-element'>
<?php for ($i = 0; $i < $this->criteriasLength; $i++) { <?php for ($i = 0; $i < $this->criteriasLength; $i++) {
// modRowMap holds the number of modifier rows for each criteria element // modRowMap holds the number of modifier rows for each criteria element
// i.e. if we have 'Album contains 1' and 'Album contains 2' the modRowMap // i.e. if we have 'Album contains 1' and 'Album contains 2' the modRowMap
// for Album is 2 // for Album is 2
?> ?>
<?php for ($j = 0; $j < $this->modRowMap[$i]; $j++) { <?php for ($j = 0; $j < $this->modRowMap[$i]; $j++) {
// determine if logic label should be 'and' or 'or' // determine if logic label should be 'and' or 'or'
if ($this->modRowMap[$i] > 1 && $j != $this->modRowMap[$i]-1) $logicLabel = _('or'); if ($this->modRowMap[$i] > 1 && $j != $this->modRowMap[$i] - 1) $logicLabel = _('or');
else $logicLabel = _('and'); else $logicLabel = _('and');
$disabled = $this->element->getElement("sp_criteria_field_".$i."_".$j)->getAttrib('disabled') == 'disabled'?true:false; $disabled = $this->element->getElement("sp_criteria_field_" . $i . "_" . $j)->getAttrib('disabled') == 'disabled' ? true : false;
// determine if the next row is disabled and only display the logic label if it isn't // determine if the next row is disabled and only display the logic label if it isn't
if ($j == $this->modRowMap[$i]-1 && $i < 25) { if ($j == $this->modRowMap[$i] - 1 && $i < 25) {
$n = $i+1; $n = $i + 1;
$nextIndex = $n."_0"; $nextIndex = $n . "_0";
} elseif ($j+1 <= $this->modRowMap[$i]-1) { } elseif ($j + 1 <= $this->modRowMap[$i] - 1) {
$n = $j+1; $n = $j + 1;
$nextIndex = $i."_".$n; $nextIndex = $i . "_" . $n;
}
$nextDisabled = $this->element->getElement("sp_criteria_field_" . $nextIndex)->getAttrib('disabled') == 'disabled' ? true : false;
?>
<div <?php if (/*($i > 0) && */$disabled) {
echo 'style="display:none"';
} ?> class="search-row-<?php echo $logicLabel ?>">
<?php echo $this->element->getElement("sp_criteria_field_" . $i . "_" . $j) ?>
<?php echo $this->element->getElement("sp_criteria_modifier_" . $i . "_" . $j) /* @todo finish this */ ?>
} <?php echo $this->element->getElement("sp_criteria_value_" . $i . "_" . $j) ?>
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false; <span class='sp_text_font' id="datetime_select" <?php echo $this->element->getElement("sp_criteria_datetime_select_" . $i . "_" . $j)->getAttrib("disabled") == "disabled" ? 'style="display:none;"' : "" ?>><?php echo $this->element->getElement('sp_criteria_datetime_select_' . $i . "_" . $j) ?><?php echo _(" ago "); ?></span>
?>
<div <?php if (/*($i > 0) && */ $disabled) {
echo 'style="display:none"';
}?> class="search-row-<?php echo $logicLabel ?>">
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) /* @todo finish this */?>
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?> <a <?php if ($disabled) {
<span class='sp_text_font' id="datetime_select" <?php echo $this->element->getElement("sp_criteria_datetime_select_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo $this->element->getElement('sp_criteria_datetime_select_'.$i."_".$j) ?><?php echo _(" ago "); ?></span> echo 'style=display:none';
} ?> class='modifier_add_link' id='modifier_add_<?php echo $i ?>'>
+ <?php echo (_("New Modifier")); ?>
</a>
<a <?php if ($disabled) { echo 'style=display:none'; } ?> class='modifier_add_link' id='modifier_add_<?php echo $i ?>'> <span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_" . $i . "_" . $j)->getAttrib("disabled") == "disabled" ? 'style="display:none;"' : "" ?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_' . $i . "_" . $j) ?></span>
+ <?php echo(_("New Modifier")); ?> <span class='sp_text_font' id="extra_datetime_select" <?php echo $this->element->getElement("sp_criteria_extra_datetime_select_" . $i . "_" . $j)->getAttrib("disabled") == "disabled" ? 'style="display:none;"' : "" ?>><?php echo $this->element->getElement('sp_criteria_extra_datetime_select_' . $i . "_" . $j) ?><?php echo _(" ago "); ?></span>
</a>
<span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_'.$i."_".$j) ?></span> <a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'>
<span class='sp_text_font' id="extra_datetime_select" <?php echo $this->element->getElement("sp_criteria_extra_datetime_select_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo $this->element->getElement('sp_criteria_extra_datetime_select_'.$i."_".$j) ?><?php echo _(" ago "); ?></span> <i class='icon-white icon-remove spl-no-r-margin'></i>
</a>
<span class='db-logic-label' <?php if ($nextDisabled) echo 'style="display:none"'; ?>>
<?php echo $logicLabel; ?>
</span>
<a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'> <?php if ($this->element->getElement("sp_criteria_field_" . $i . "_" . $j)->hasErrors()) : ?>
<i class='icon-white icon-remove spl-no-r-margin'></i> <?php foreach ($this->element->getElement("sp_criteria_field_" . $i . "_" . $j)->getMessages() as $error) : ?>
</a> <span class='errors sp-errors'>
<span class='db-logic-label' <?php if ($nextDisabled) echo 'style="display:none"';?>> <?php echo $error; ?>
<?php echo $logicLabel;?> </span>
</span> <?php endforeach; ?>
<?php endif; ?>
</div>
<?php } ?>
<?php if($this->element->getElement("sp_criteria_field_".$i."_".$j)->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_criteria_field_".$i."_".$j)->getMessages() as $error): ?>
<span class='errors sp-errors'>
<?php echo $error; ?>
</span>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php } ?> <?php } ?>
<a class='btn btn-small btn-new' id='criteria_add'><i class='icon-white icon-plus'></i><?php echo (_("New Criteria")); ?></a>
<?php } ?>
<a class='btn btn-small btn-new' id='criteria_add'><i class='icon-white icon-plus'></i><?php echo(_("New Criteria")); ?></a>
</dd> </dd>
</dl> </dl>
<dl> <dl>
@ -67,13 +68,13 @@
<label class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></label> <label class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></label>
</dt> </dt>
<dd id='sp_limit-element'> <dd id='sp_limit-element'>
<?php echo $this->element->getElement('sp_limit_value')?> <?php echo $this->element->getElement('sp_limit_value') ?>
<?php echo $this->element->getElement('sp_limit_options') ?> <?php echo $this->element->getElement('sp_limit_options') ?>
<?php if($this->element->getElement("sp_limit_value")->hasErrors()) : ?> <?php if ($this->element->getElement("sp_limit_value")->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_limit_value")->getMessages() as $error): ?> <?php foreach ($this->element->getElement("sp_limit_value")->getMessages() as $error) : ?>
<span class='errors sp-errors'> <span class='errors sp-errors'>
<?php echo $error; ?> <?php echo $error; ?>
</span> </span>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
@ -88,14 +89,16 @@
</label> </label>
</dt> </dt>
<dd id='sp_type-element'> <dd id='sp_type-element'>
<?php $i=0; <?php $i = 0;
$value = $this->element->getElement('sp_type')->getValue(); $value = $this->element->getElement('sp_type')->getValue();
foreach ($this->element->getElement('sp_type')->getMultiOptions() as $radio) : ?> foreach ($this->element->getElement('sp_type')->getMultiOptions() as $radio) : ?>
<label class='sp-label' for='sp_type-<?php echo $i?>'> <label class='sp-label' for='sp_type-<?php echo $i ?>'>
<input type="radio" value="<?php echo $i ?>" id="sp_type-<?php echo $i ?>" name="sp_type" <?php if($i == $value){echo 'checked="checked"';}?> ><?php echo $radio ?> <input type="radio" value="<?php echo $i ?>" id="sp_type-<?php echo $i ?>" name="sp_type" <?php if ($i == $value) {
echo 'checked="checked"';
} ?>><?php echo $radio ?>
</label> </label>
<?php $i = $i + 1; ?> <?php $i = $i + 1; ?>
<?php endforeach; ?> <?php endforeach; ?>
<span class='playlist_type_help_icon'></span> <span class='playlist_type_help_icon'></span>
</dd> </dd>
@ -105,12 +108,12 @@
<label class='sp_text_font'><?php echo $this->element->getElement('sp_repeat_tracks')->getLabel() ?></label> <label class='sp_text_font'><?php echo $this->element->getElement('sp_repeat_tracks')->getLabel() ?></label>
</dt> </dt>
<dd id='sp_repeat_tracks-element'> <dd id='sp_repeat_tracks-element'>
<?php echo $this->element->getElement('sp_repeat_tracks')?> <?php echo $this->element->getElement('sp_repeat_tracks') ?>
<?php if($this->element->getElement("sp_repeat_tracks")->hasErrors()) : ?> <?php if ($this->element->getElement("sp_repeat_tracks")->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_repeat_tracks")->getMessages() as $error): ?> <?php foreach ($this->element->getElement("sp_repeat_tracks")->getMessages() as $error) : ?>
<span class='errors sp-errors'> <span class='errors sp-errors'>
<?php echo $error; ?> <?php echo $error; ?>
</span> </span>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<span class='repeat_tracks_help_icon'></span> <span class='repeat_tracks_help_icon'></span>
@ -121,12 +124,12 @@
<label class='sp_text_font'><?php echo $this->element->getElement('sp_overflow_tracks')->getLabel() ?></label> <label class='sp_text_font'><?php echo $this->element->getElement('sp_overflow_tracks')->getLabel() ?></label>
</dt> </dt>
<dd id='sp_overflow_tracks-element'> <dd id='sp_overflow_tracks-element'>
<?php echo $this->element->getElement('sp_overflow_tracks')?> <?php echo $this->element->getElement('sp_overflow_tracks') ?>
<?php if($this->element->getElement("sp_overflow_tracks")->hasErrors()) : ?> <?php if ($this->element->getElement("sp_overflow_tracks")->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_overflow_tracks")->getMessages() as $error): ?> <?php foreach ($this->element->getElement("sp_overflow_tracks")->getMessages() as $error) : ?>
<span class='errors sp-errors'> <span class='errors sp-errors'>
<?php echo $error; ?> <?php echo $error; ?>
</span> </span>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<span class='overflow_tracks_help_icon'></span> <span class='overflow_tracks_help_icon'></span>
@ -134,15 +137,15 @@
</dl> </dl>
<dl> <dl>
<dt> <dt>
<label class='sp_text_font'><?php echo $this->element->getElement('sp_sort_options')->getLabel();?></label> <label class='sp_text_font'><?php echo $this->element->getElement('sp_sort_options')->getLabel(); ?></label>
</dt> </dt>
<dd id='sp_sort-element'> <dd id='sp_sort-element'>
<?php echo $this->element->getElement('sp_sort_options') ?> <?php echo $this->element->getElement('sp_sort_options') ?>
<?php if($this->element->getElement("sp_sort_options")->hasErrors()) : ?> <?php if ($this->element->getElement("sp_sort_options")->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_sort_options")->getMessages() as $error): ?> <?php foreach ($this->element->getElement("sp_sort_options")->getMessages() as $error) : ?>
<span class='errors sp-errors'> <span class='errors sp-errors'>
<?php echo $error; ?> <?php echo $error; ?>
</span> </span>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</dd> </dd>

View File

@ -1,214 +1,214 @@
<?php <?php
$s_name = "s".$this->stream_number; $s_name = "s" . $this->stream_number;
?> ?>
<h3 class="collapsible-header <?php echo $this->enabled == 0?"closed":""?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number?></h3> <h3 class="collapsible-header <?php echo $this->enabled == 0 ? "closed" : "" ?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number ?></h3>
<div class="stream-setting-content" <?php echo $this->enabled == 0?'style="display: none;':''?> id="<?php echo $s_name?>-config"> <div class="stream-setting-content" <?php echo $this->enabled == 0 ? 'style="display: none;' : '' ?> id="<?php echo $s_name ?>-config">
<fieldset class="padded"> <fieldset class="padded">
<dl class="zend_form clearfix"> <dl class="zend_form clearfix">
<dd id="<?php echo $s_name?>Liquidsoap-error-msg-element" class="liquidsoap_status"> <dd id="<?php echo $s_name ?>Liquidsoap-error-msg-element" class="liquidsoap_status">
<?php echo $this->liquidsoap_error_msg?> <?php echo $this->liquidsoap_error_msg ?>
</dd> </dd>
<dt id="<?php echo $s_name?>Enabled-label"> <dt id="<?php echo $s_name ?>Enabled-label">
<label for="<?php echo $s_name?>Enabled"><?php echo $this->element->getElement('enable')->getLabel() ?></label> <label for="<?php echo $s_name ?>Enabled"><?php echo $this->element->getElement('enable')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Enabled-element"> <dd id="<?php echo $s_name ?>Enabled-element">
<?php echo $this->element->getElement('enable')?> <?php echo $this->element->getElement('enable') ?>
</dd> </dd>
<dt id="<?php echo $s_name?>Mobile-label"> <dt id="<?php echo $s_name ?>Mobile-label">
<label for="<?php echo $s_name?>Mobile"><?php echo $this->element->getElement('mobile')->getLabel() ?></label> <label for="<?php echo $s_name ?>Mobile"><?php echo $this->element->getElement('mobile')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Mobile-element"> <dd id="<?php echo $s_name ?>Mobile-element">
<?php echo $this->element->getElement('mobile')?> <?php echo $this->element->getElement('mobile') ?>
</dd> </dd>
<dt id="<?php echo $s_name?>Type-label"> <dt id="<?php echo $s_name ?>Type-label">
<label for="<?php echo $s_name?>Type"><?php echo $this->element->getElement('type')->getLabel()?></label> <label for="<?php echo $s_name ?>Type"><?php echo $this->element->getElement('type')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Type-element"> <dd id="<?php echo $s_name ?>Type-element">
<?php echo $this->element->getElement('type')?> <?php echo $this->element->getElement('type') ?>
<span class='stream_type_help_icon'></span> <span class='stream_type_help_icon'></span>
</dd> </dd>
<dt id="<?php echo $s_name?>Bitrate-label"> <dt id="<?php echo $s_name ?>Bitrate-label">
<label for="<?php echo $s_name?>Bitrate"><?php echo $this->element->getElement('bitrate')->getLabel()?></label> <label for="<?php echo $s_name ?>Bitrate"><?php echo $this->element->getElement('bitrate')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Bitrate-element"> <dd id="<?php echo $s_name ?>Bitrate-element">
<?php echo $this->element->getElement('bitrate')?> <?php echo $this->element->getElement('bitrate') ?>
</dd> </dd>
<dt id="outputServer-label"> <dt id="outputServer-label">
<label for="outputServer"><?php echo $this->element->getElement('host')->getLabel()?><span class="info-text-small"> <label for="outputServer"><?php echo $this->element->getElement('host')->getLabel() ?><span class="info-text-small">
<?php echo _("(Required)")?></span> :</label> <?php echo _("(Required)") ?></span> :</label>
</dt> </dt>
<dd id="outputServer-element"> <dd id="outputServer-element">
<?php echo $this->element->getElement('host')?> <?php echo $this->element->getElement('host') ?>
<?php if($this->element->getElement('host')->hasErrors()) : ?> <?php if ($this->element->getElement('host')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('host')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('host')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="outputPort-label"> <dt id="outputPort-label">
<label for="outputPort"><?php echo $this->element->getElement('port')->getLabel()?><span class="info-text-small"> <label for="outputPort"><?php echo $this->element->getElement('port')->getLabel() ?><span class="info-text-small">
<?php echo _("(Required)")?></span> :</label> <?php echo _("(Required)") ?></span> :</label>
</dt> </dt>
<dd id="outputPort-element"> <dd id="outputPort-element">
<?php echo $this->element->getElement('port')?> <?php echo $this->element->getElement('port') ?>
<?php if($this->element->getElement('port')->hasErrors()) : ?> <?php if ($this->element->getElement('port')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('port')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('port')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="<?php echo $s_name?>Output-label"> <dt id="<?php echo $s_name ?>Output-label">
<label for="<?php echo $s_name?>Output"><?php echo $this->element->getElement('output')->getLabel()?></label> <label for="<?php echo $s_name ?>Output"><?php echo $this->element->getElement('output')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Output-element"> <dd id="<?php echo $s_name ?>Output-element">
<?php echo $this->element->getElement('output')?> <?php echo $this->element->getElement('output') ?>
</dd> </dd>
<dt id="<?php echo $s_name?>Channels-label"> <dt id="<?php echo $s_name ?>Channels-label">
<label for="<?php echo $s_name?>Channels"><?php echo $this->element->getElement('channels')->getLabel()?></label> <label for="<?php echo $s_name ?>Channels"><?php echo $this->element->getElement('channels')->getLabel() ?></label>
</dt> </dt>
<dd id="<?php echo $s_name?>Channels-element"> <dd id="<?php echo $s_name ?>Channels-element">
<?php echo $this->element->getElement('channels')?> <?php echo $this->element->getElement('channels') ?>
</dd> </dd>
<fieldset class="padded top-margin display_field toggle closed" id="output_setting"> <fieldset class="padded top-margin display_field toggle closed" id="output_setting">
<legend style="cursor: pointer;"> <legend style="cursor: pointer;">
<span class="ui-icon ui-icon-triangle-2-n-s"></span> <span class="ui-icon ui-icon-triangle-2-n-s"></span>
<?php echo _("Additional Options")?> <?php echo _("Additional Options") ?>
</legend> </legend>
<dl class="zend_form"> <dl class="zend_form">
<dt id="outputUser-label"> <dt id="outputUser-label">
<label for="outputUser"><?php echo $this->element->getElement('user')->getLabel()?> : <label for="outputUser"><?php echo $this->element->getElement('user')->getLabel() ?> :
<span class='stream_username_help_icon'></span> <span class='stream_username_help_icon'></span>
</label> </label>
</dt> </dt>
<dd id="outputUser-element"> <dd id="outputUser-element">
<?php echo $this->element->getElement('user')?> <?php echo $this->element->getElement('user') ?>
<?php if($this->element->getElement('user')->hasErrors()) : ?> <?php if ($this->element->getElement('user')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('user')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('user')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="outputPassword-label"> <dt id="outputPassword-label">
<label class="optional" for="outputPassword"><?php echo $this->element->getElement('pass')->getLabel()?> :</label> <label class="optional" for="outputPassword"><?php echo $this->element->getElement('pass')->getLabel() ?> :</label>
</dt> </dt>
<dd id="outputPassword-element" class="clearfix"> <dd id="outputPassword-element" class="clearfix">
<?php echo $this->element->getElement('pass')?> <?php echo $this->element->getElement('pass') ?>
<?php if($this->element->getElement('pass')->hasErrors()) : ?> <?php if ($this->element->getElement('pass')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('pass')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('pass')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="adminUser-label"> <dt id="adminUser-label">
<label for="outputUser"><?php echo $this->element->getElement('admin_user')->getLabel()?> : <label for="outputUser"><?php echo $this->element->getElement('admin_user')->getLabel() ?> :
<span class='admin_username_help_icon'></span> <span class='admin_username_help_icon'></span>
</label> </label>
</dt> </dt>
<dd id="adminUser-element"> <dd id="adminUser-element">
<?php echo $this->element->getElement('admin_user')?> <?php echo $this->element->getElement('admin_user') ?>
<?php if($this->element->getElement('admin_user')->hasErrors()) : ?> <?php if ($this->element->getElement('admin_user')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('admin_user')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('admin_user')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="adminPassword-label"> <dt id="adminPassword-label">
<label class="optional" for="outputPassword"><?php echo $this->element->getElement('admin_pass')->getLabel()?> :</label> <label class="optional" for="outputPassword"><?php echo $this->element->getElement('admin_pass')->getLabel() ?> :</label>
</dt> </dt>
<dd id="adminPassword-element" class="clearfix"> <dd id="adminPassword-element" class="clearfix">
<?php echo $this->element->getElement('admin_pass')?> <?php echo $this->element->getElement('admin_pass') ?>
<?php if($this->element->getElement('admin_pass')->hasErrors()) : ?> <?php if ($this->element->getElement('admin_pass')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('admin_pass')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('admin_pass')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt class="block-display info-block"> <dt class="block-display info-block">
<?php echo _("The following info will be displayed to listeners in their media player:")?> <?php echo _("The following info will be displayed to listeners in their media player:") ?>
</dt> </dt>
<dt id="stationName-label"> <dt id="stationName-label">
<label for="stationName"><?php echo $this->element->getElement('name')->getLabel()?> :</label> <label for="stationName"><?php echo $this->element->getElement('name')->getLabel() ?> :</label>
</dt> </dt>
<dd id="stationName-element" class="clearfix"> <dd id="stationName-element" class="clearfix">
<?php echo $this->element->getElement('name')?> <?php echo $this->element->getElement('name') ?>
<?php if($this->element->getElement('name')->hasErrors()) : ?> <?php if ($this->element->getElement('name')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('name')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('name')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="stationDescription-label"> <dt id="stationDescription-label">
<label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel()?> :</label> <label for="stationDescription"><?php echo $this->element->getElement('description')->getLabel() ?> :</label>
</dt> </dt>
<dd id="stationDescription-element" class="clearfix"> <dd id="stationDescription-element" class="clearfix">
<?php echo $this->element->getElement('description')?> <?php echo $this->element->getElement('description') ?>
<?php if($this->element->getElement('description')->hasErrors()) : ?> <?php if ($this->element->getElement('description')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('description')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('description')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="stationURL-label"> <dt id="stationURL-label">
<label for="stationURL"><?php echo $this->element->getElement('url')->getLabel()?> :</label> <label for="stationURL"><?php echo $this->element->getElement('url')->getLabel() ?> :</label>
</dt> </dt>
<dd id="stationURL-element" class="clearfix"> <dd id="stationURL-element" class="clearfix">
<?php echo $this->element->getElement('url')?> <?php echo $this->element->getElement('url') ?>
<span class="info-text-small"><?php echo _("(Your radio station website)")?></span> <span class="info-text-small"><?php echo _("(Your radio station website)") ?></span>
<?php if($this->element->getElement('url')->hasErrors()) : ?> <?php if ($this->element->getElement('url')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('url')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('url')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="outputGenre-label"> <dt id="outputGenre-label">
<label for="outputGenre"><?php echo $this->element->getElement('genre')->getLabel()?> :</label> <label for="outputGenre"><?php echo $this->element->getElement('genre')->getLabel() ?> :</label>
</dt> </dt>
<dd id="outputGenre-element"> <dd id="outputGenre-element">
<?php echo $this->element->getElement('genre')?> <?php echo $this->element->getElement('genre') ?>
<?php if($this->element->getElement('genre')->hasErrors()) : ?> <?php if ($this->element->getElement('genre')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('genre')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('genre')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="outputMountpoint-label"> <dt id="outputMountpoint-label">
<label for="outputMountpoint"><?php echo $this->element->getElement('mount')->getLabel()?> :</label> <label for="outputMountpoint"><?php echo $this->element->getElement('mount')->getLabel() ?> :</label>
</dt> </dt>
<dd id="outputMountpoint-element"> <dd id="outputMountpoint-element">
<?php echo $this->element->getElement('mount')?> <?php echo $this->element->getElement('mount') ?>
<?php if($this->element->getElement('mount')->hasErrors()) : ?> <?php if ($this->element->getElement('mount')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('mount')->getMessages() as $error): ?> <?php foreach ($this->element->getElement('mount')->getMessages() as $error) : ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
<dt id="outputStreamURL-label"> <dt id="outputStreamURL-label">
@ -217,6 +217,6 @@
<dd id="outputStreamURL-element"> <dd id="outputStreamURL-element">
<span id="stream_url" class="static_text"></span> <span id="stream_url" class="static_text"></span>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
</div> </div>

View File

@ -1,16 +1,16 @@
<script language="JavaScript"> <script language="JavaScript">
function autoResize(id){ function autoResize(id) {
var newheight; var newheight;
var newwidth; var newwidth;
if(document.getElementById){ if (document.getElementById) {
newheight=document.getElementById(id).contentWindow.document.body.scrollHeight; newheight = document.getElementById(id).contentWindow.document.body.scrollHeight;
// Hack to get height in Firefox // Hack to get height in Firefox
if (newheight == 0) newheight = newheight = document.getElementById(id).contentWindow.document.documentElement.scrollHeight; if (newheight == 0) newheight = newheight = document.getElementById(id).contentWindow.document.documentElement.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth; newwidth = document.getElementById(id).contentWindow.document.body.scrollWidth;
} }
document.getElementById(id).height= (newheight) + "px"; document.getElementById(id).height = (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px"; document.getElementById(id).width = (newwidth) + "px";
} }
</script> </script>
@ -19,12 +19,12 @@
<div class="bck_cover"></div> <div class="bck_cover"></div>
<?php if ($this->stationLogo === DEFAULT_LOGO_PLACEHOLDER) { <?php if ($this->stationLogo === DEFAULT_LOGO_PLACEHOLDER) {
echo "<a href='#' class='logo'><img src='".DEFAULT_LOGO_FILE."'></a>"; echo "<a href='#' class='logo'><img src='" . DEFAULT_LOGO_FILE . "'></a>";
} else { } else {
echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>"; echo "<a href='#' class='logo'><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?> } ?>
<?php if ($this->displayLoginButton): ?> <?php if ($this->displayLoginButton) : ?>
<div class='login-btn'> <div class='login-btn'>
<a href='/login' target='_parent'> <a href='/login' target='_parent'>
<span><?php echo _('Login'); ?></span> <span><?php echo _('Login'); ?></span>
@ -53,7 +53,7 @@
</div> </div>
<?php <?php
if ($this->displayRssTab) {?> if ($this->displayRssTab) { ?>
<div id="tab-4" class="podcast tab_content"> <div id="tab-4" class="podcast tab_content">
<div class="rss-title-wrapper"> <div class="rss-title-wrapper">
<div id="rss-subscribe"> <div id="rss-subscribe">
@ -67,78 +67,79 @@
<div id="jquery_jplayer_1" class="jp-player"> <div id="jquery_jplayer_1" class="jp-player">
</div> </div>
<div class="podcast_bck"> <div class="podcast_bck">
<div id="jp_container_1" class="jp-audio"> <div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist"> <div class="jp-type-playlist">
<div class="current-track track-overflow"><?php echo _("Now Playing:") ?><span class="track-overflow"></span></div> <div class="current-track track-overflow"><?php echo _("Now Playing:") ?><span class="track-overflow"></span></div>
<div class="jp-gui jp-interface"> <div class="jp-gui jp-interface">
<div class="playbar playbar-buttons"> <div class="playbar playbar-buttons">
<ul class="jp-controls rss-buttons"> <ul class="jp-controls rss-buttons">
<li class="ui-corner-all jp-play"> <li class="ui-corner-all jp-play">
<span class="icon-play icon-white" tabindex="1"><?php /*echo _("play") */?></span> <span class="icon-play icon-white" tabindex="1"><?php /*echo _("play") */ ?></span>
</li> </li>
<li class="ui-corner-all jp-pause"> <li class="ui-corner-all jp-pause">
<span class="icon-pause icon-white" tabindex="1"><?php /*echo _("pause") */?></span> <span class="icon-pause icon-white" tabindex="1"><?php /*echo _("pause") */ ?></span>
</li> </li>
<li class="ui-corner-all jp-stop"> <li class="ui-corner-all jp-stop">
<span class="icon-stop icon-white" tabindex="1"><?php /*echo _("stop") */?></span> <span class="icon-stop icon-white" tabindex="1"><?php /*echo _("stop") */ ?></span>
</li> </li>
</ul> </ul>
</div> </div>
<div class="playbar playbar-progress"> <div class="playbar playbar-progress">
<div class="jp-time-block"> <div class="jp-time-block">
<div class="jp-progress"> <div class="jp-progress">
<div class="jp-seek-bar"> <div class="jp-seek-bar">
<div class="jp-play-bar"></div> <div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-time-holder">
<div class="jp-current-time"></div>
</div>
</div> </div>
</div> </div>
<div class="jp-time-holder">
<div class="jp-current-time"></div> <div class="playbar playbar-progress">
<div class="jp-volume-block">
<div class="jp-mute">
<span class="ui-icon" tabindex="1" title="mute"><?php /*echo _("mute") */ ?></span>
</div>
<div class="jp-unmute">
<span class="ui-icon" tabindex="1" title="unmute"><?php /*echo _("unmute") */ ?></span>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-volume-max">
<span class="ui-icon" tabindex="1" title="max volume"><?php /*echo _("max volume") */ ?></span>
</div>
</div>
</div> </div>
</div> </ul>
</div> </div>
<div class="playbar playbar-progress"> <div class="rss-tracks">
<div class="jp-volume-block"> <ul class="jp-playlist">
<div class="jp-mute"> </ul>
<span class="ui-icon" tabindex="1" title="mute"><?php /*echo _("mute") */?></span>
</div>
<div class="jp-unmute">
<span class="ui-icon" tabindex="1" title="unmute"><?php /*echo _("unmute") */?></span>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-volume-max">
<span class="ui-icon" tabindex="1" title="max volume"><?php /*echo _("max volume") */?></span>
</div>
</div> </div>
</div>
</ul>
</div> <ul class="pagination">
<div class="rss-tracks">
<ul class="jp-playlist">
</ul> </ul>
</div> </div>
<ul class="pagination">
</ul>
</div> </div>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var playlist; var playlist;
function buildJplayerPlaylist(page, data) { function buildJplayerPlaylist(page, data) {
playlist = new Array(); playlist = new Array();
var media; var media;
$('.rss-tracks ul').html(''); $('.rss-tracks ul').html('');
$.each(data[Object.keys(data)[page]], function (index, value) { $.each(data[Object.keys(data)[page]], function(index, value) {
var media_mime_supported = true; var media_mime_supported = true;
media = { media = {
title: value.CcFiles.track_title, title: value.CcFiles.track_title,
@ -157,12 +158,12 @@
media_mime_supported = false; media_mime_supported = false;
} }
var podcast_title_link = "<a class='podcast_title jp-playlist-item' tabindex='0' href='#'>"+value.CcFiles.track_title+"</a>"; var podcast_title_link = "<a class='podcast_title jp-playlist-item' tabindex='0' href='#'>" + value.CcFiles.track_title + "</a>";
var podcast_title_no_link = "<div class='podcast_title'>"+value.CcFiles.track_title+"</div>"; var podcast_title_no_link = "<div class='podcast_title'>" + value.CcFiles.track_title + "</div>";
var playlist_metadata = "<span class='podcast_date'>"+value.publication_date+"</span>" + var playlist_metadata = "<span class='podcast_date'>" + value.publication_date + "</span>" +
"<span class='podcast_length'>"+value.CcFiles.length+"</span>" + "<span class='podcast_length'>" + value.CcFiles.length + "</span>" +
"<span class='podcast_desc_btn'>Description</span>" + "<span class='podcast_desc_btn'>Description</span>" +
"<div class='podcast_desc'>"+value.CcFiles.description+"</div>"; "<div class='podcast_desc'>" + value.CcFiles.description + "</div>";
if (media_mime_supported) { if (media_mime_supported) {
playlist.push(media); playlist.push(media);
@ -171,9 +172,9 @@
playlist_item += podcast_title_link + playlist_metadata; playlist_item += podcast_title_link + playlist_metadata;
playlist_item += "<div class='podcast_btn_group'>"+ playlist_item += "<div class='podcast_btn_group'>" +
"<span class='podcast_play podcast_action_btn'><a href='#' id='rss-track' data-rss-playlist-id='"+index+"'><img src='css/radio-page/img/podcast_play.png'></a></span>" + "<span class='podcast_play podcast_action_btn'><a href='#' id='rss-track' data-rss-playlist-id='" + index + "'><img src='css/radio-page/img/podcast_play.png'></a></span>" +
"<span class='podcast_download podcast_action_btn'><a id='rss-download-link' href='"+value.download_url+"'><img src='css/radio-page/img/podcast_download.png'></a></span> </div></div></li>"; "<span class='podcast_download podcast_action_btn'><a id='rss-download-link' href='" + value.download_url + "'><img src='css/radio-page/img/podcast_download.png'></a></span> </div></div></li>";
} else { } else {
// add empty media item to playlist so indexes stay inline with the corret // add empty media item to playlist so indexes stay inline with the corret
@ -182,9 +183,9 @@
var playlist_item = "<div class='playlist-item-no-preview podcast_info'>"; var playlist_item = "<div class='playlist-item-no-preview podcast_info'>";
playlist_item += podcast_title_no_link + playlist_metadata; playlist_item += podcast_title_no_link + playlist_metadata;
playlist_item += "<div class='podcast_btn_group'>"+ playlist_item += "<div class='podcast_btn_group'>" +
"<span class='podcast_no_play'><img src='css/radio-page/img/podcast_no_play.png'></span>" + "<span class='podcast_no_play'><img src='css/radio-page/img/podcast_no_play.png'></span>" +
"<span class='podcast_download podcast_action_btn'><a id='rss-download-link' href='"+value.download_url+"'><img src='css/radio-page/img/podcast_download.png'></a></span> </div></div>"; "<span class='podcast_download podcast_action_btn'><a id='rss-download-link' href='" + value.download_url + "'><img src='css/radio-page/img/podcast_download.png'></a></span> </div></div>";
} }
$('.rss-tracks ul').append(playlist_item); $('.rss-tracks ul').append(playlist_item);
@ -196,7 +197,7 @@
// we have to set the player to play the first track on page load // we have to set the player to play the first track on page load
// or else the play button won't work at first. make sure nothing // or else the play button won't work at first. make sure nothing
// is playing first // is playing first
if($("#jquery_jplayer_1").data().jPlayer.status.paused == true){ if ($("#jquery_jplayer_1").data().jPlayer.status.paused == true) {
// jPlayer is not currently playing // jPlayer is not currently playing
_playlist_jplayer.play(0); _playlist_jplayer.play(0);
$("#jquery_jplayer_1").jPlayer("stop"); $("#jquery_jplayer_1").jPlayer("stop");
@ -211,7 +212,7 @@
return false; return false;
}); });
$('.podcast_desc_btn').click(function(){ $('.podcast_desc_btn').click(function() {
$(this).toggleClass('current'); $(this).toggleClass('current');
$(this).next('.podcast_desc').slideToggle(); $(this).next('.podcast_desc').slideToggle();
}); });
@ -221,7 +222,7 @@
_playlist_jplayer = new jPlayerPlaylist({ _playlist_jplayer = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1", jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1" cssSelectorAncestor: "#jp_container_1"
},[], //array of songs will be filled with below's json call }, [], //array of songs will be filled with below's json call
{ {
swfPath: baseUrl + "js/jplayer", swfPath: baseUrl + "js/jplayer",
supplied: "oga, mp3, m4v, m4a, wav", supplied: "oga, mp3, m4v, m4a, wav",
@ -240,7 +241,7 @@
removeTime: 0, removeTime: 0,
shuffleTime: 0 shuffleTime: 0
}, },
ready: function () { ready: function() {
var episodes = <?php echo $this->episodes ?>; var episodes = <?php echo $this->episodes ?>;
var empty_podcast_message = "<?php echo $this->emptyPodcastMessage ?>"; var empty_podcast_message = "<?php echo $this->emptyPodcastMessage ?>";
@ -252,14 +253,14 @@
// update current track metadata on player bar // update current track metadata on player bar
$("#jquery_jplayer_1").bind(jQuery.jPlayer.event.play, function (event) { $("#jquery_jplayer_1").bind(jQuery.jPlayer.event.play, function(event) {
var current = _playlist_jplayer.current; var current = _playlist_jplayer.current;
$('.current-track span').html(playlist[current].title); $('.current-track span').html(playlist[current].title);
}); });
// build pagination menu // build pagination menu
var pages = "<li data-page-index='0'><</li>"; var pages = "<li data-page-index='0'><</li>";
$.each(episodes, function (index, value) { $.each(episodes, function(index, value) {
var page_number = +index + 1; var page_number = +index + 1;
pages += "<li data-page-index='" + index + "'>" + page_number + "</li>"; pages += "<li data-page-index='" + index + "'>" + page_number + "</li>";
}); });
@ -269,7 +270,7 @@
$("ul.pagination").find("li:contains('1')").addClass('current'); $("ul.pagination").find("li:contains('1')").addClass('current');
// pagination click // pagination click
$("ul.pagination li").click(function () { $("ul.pagination li").click(function() {
buildJplayerPlaylist($(this).attr("data-page-index"), episodes); buildJplayerPlaylist($(this).attr("data-page-index"), episodes);
$(this).siblings().removeClass('current'); $(this).siblings().removeClass('current');
if ($(this).text() === "<") { if ($(this).text() === "<") {
@ -283,7 +284,7 @@
}); });
//turn off player bar when podcast track is played //turn off player bar when podcast track is played
$("a.jp-playlist-item, .jp-play, .podcast_play").click(function () { $("a.jp-playlist-item, .jp-play, .podcast_play").click(function() {
if ($("#player_iframe").contents().find('.play').hasClass('pause')) { if ($("#player_iframe").contents().find('.play').hasClass('pause')) {
$("#player_iframe").contents().find('.play').click(); $("#player_iframe").contents().find('.play').click();
} }
@ -292,7 +293,6 @@
} }
} }
); );
</script> </script>
</div> </div>
<?php <?php
@ -304,11 +304,11 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function() {
$("#player_iframe").load(function () { $("#player_iframe").load(function() {
$("#player_iframe").contents().find('.bottom_bar').append("<div class='flex_spacer' data-tab='tab-1'></div>"); $("#player_iframe").contents().find('.bottom_bar').append("<div class='flex_spacer' data-tab='tab-1'></div>");
$("#player_iframe").contents().find('.bottom_bar').append("<div class='schedule_btn button current' data-tab='tab-1'></div>"); $("#player_iframe").contents().find('.bottom_bar').append("<div class='schedule_btn button current' data-tab='tab-1'></div>");
@ -316,26 +316,26 @@
<?php <?php
// Is there a better way to do this? // Is there a better way to do this?
if ($this->displayRssTab) {?> if ($this->displayRssTab) { ?>
$("#player_iframe").contents().find('.bottom_bar').append("<div class='station_rss_btn button' data-tab='tab-4'></div>"); $("#player_iframe").contents().find('.bottom_bar').append("<div class='station_rss_btn button' data-tab='tab-4'></div>");
<?php <?php
} }
?> ?>
$("#player_iframe").contents().find('.bottom_bar .button').click(function(){ $("#player_iframe").contents().find('.bottom_bar .button').click(function() {
var tab_id = $(this).attr('data-tab'); var tab_id = $(this).attr('data-tab');
$("#player_iframe").contents().find('.bottom_bar .button').removeClass('current'); $("#player_iframe").contents().find('.bottom_bar .button').removeClass('current');
$('.tab_content').removeClass('current'); $('.tab_content').removeClass('current');
window.scrollTo(0,0); window.scrollTo(0, 0);
$(this).addClass('current'); $(this).addClass('current');
$("#"+tab_id).addClass('current'); $("#" + tab_id).addClass('current');
}); });
//turn off jplayer if it's playing and someone clicks to play the player bar //turn off jplayer if it's playing and someone clicks to play the player bar
$("#player_iframe").contents().find('.play').click(function () { $("#player_iframe").contents().find('.play').click(function() {
if ($('.jp-play').is(':hidden')) { if ($('.jp-play').is(':hidden')) {
$('.jp-pause').click(); $('.jp-pause').click();
} }
@ -343,16 +343,15 @@
}); });
// schedule widget tabs // schedule widget tabs
$('.tabs li').click(function(){ $('.tabs li').click(function() {
var tab_id = $(this).attr('data-tab'); var tab_id = $(this).attr('data-tab');
$('.tabs li').removeClass('active'); $('.tabs li').removeClass('active');
$('.schedule_item').removeClass('active'); $('.schedule_item').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
$("#"+tab_id).addClass('active'); $("#" + tab_id).addClass('active');
}); });
}); });
</script> </script>

View File

@ -13,24 +13,24 @@
<div class="track-edit-right-wrapper"> <div class="track-edit-right-wrapper">
<div class="track-edit-right"> <div class="track-edit-right">
<div class="inner_track_editor_title" style="width: 100%;"> <div class="inner_track_editor_title" style="width: 100%;">
<h2 style="line-height: 26px !important;"><span class="title_obj_name"><?php echo($this->title); ?></span></h2> <h2 style="line-height: 26px !important;"><span class="title_obj_name"><?php echo ($this->title); ?></span></h2>
<h3 style="line-height: 2px !important;"><span class=""><?php echo($this->artist_name); ?></span></h3> <h3 style="line-height: 2px !important;"><span class=""><?php echo ($this->artist_name); ?></span></h3>
</div> </div>
</div> </div>
</div> </div>
<div class="track-edit-left"> <div class="track-edit-left">
<div class="artwork-upload" data-id="<?php echo($this->id); ?>"> <div class="artwork-upload" data-id="<?php echo ($this->id); ?>">
<div class="artwork-edit"> <div class="artwork-edit">
<input type='file' class="artworkUpload artwork-uploaded-<?php echo($this->id); ?>" id="artworkUpload-<?php echo ($this->id); ?>" data-id="<?php echo($this->id); ?>" accept=".png, .jpg, .jpeg" /> <input type='file' class="artworkUpload artwork-uploaded-<?php echo ($this->id); ?>" id="artworkUpload-<?php echo ($this->id); ?>" data-id="<?php echo ($this->id); ?>" accept=".png, .jpg, .jpeg" />
<label for="artworkUpload-<?php echo ($this->id); ?>"></label> <label for="artworkUpload-<?php echo ($this->id); ?>"></label>
</div> </div>
<div id="artwork-preview" class="artwork-preview"> <div id="artwork-preview" class="artwork-preview">
<div class="artwork-preview-<?php echo($this->id); ?>" id="artworkPreview" style="background-image: url(<?php echo $get_artwork; ?>);"> <div class="artwork-preview-<?php echo ($this->id); ?>" id="artworkPreview" style="background-image: url(<?php echo $get_artwork; ?>);">
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<a href="#" class="delete-artwork" data-id="<?php echo($this->id); ?>" style="font-size: 11px;">Remove</a> <a href="#" class="delete-artwork" data-id="<?php echo ($this->id); ?>" style="font-size: 11px;">Remove</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -4,56 +4,122 @@ foreach ($this->md as $key => &$value) {
$value = $this->escape($value); $value = $this->escape($value);
} }
?> ?>
<?php if($this->type == "audioclip") : ?> <?php if ($this->type == "audioclip") : ?>
<table class='library-track-md'> <table class='library-track-md'>
<tr><td><?php echo _("Title:"); ?></td><td><?php echo ($this->md["MDATA_KEY_TITLE"]);?></td></tr> <tr>
<tr><td><?php echo _("Creator:"); ?></td><td><?php echo ($this->md["MDATA_KEY_CREATOR"]);?></td></tr> <td><?php echo _("Title:"); ?></td>
<tr><td><?php echo _("Album:"); ?></td><td><?php echo ($this->md["MDATA_KEY_SOURCE"]);?></td></tr> <td><?php echo ($this->md["MDATA_KEY_TITLE"]); ?></td>
<tr><td><?php echo _("Track:"); ?></td><td><?php echo ($this->md["MDATA_KEY_TRACKNUMBER"]);?></td></tr> </tr>
<tr><td><?php echo _("Length:"); ?></td><td><?php echo ($this->md["MDATA_KEY_DURATION"]);?></td></tr> <tr>
<tr><td class='file-md-qtip-nowrap'><?php echo _("Sample Rate:"); ?></td><td><?php echo ($this->md["MDATA_KEY_SAMPLERATE"]);?></td></tr> <td><?php echo _("Creator:"); ?></td>
<tr><td><?php echo _("Bit Rate:"); ?></td><td><?php echo ($this->md["MDATA_KEY_BITRATE"]);?></td></tr> <td><?php echo ($this->md["MDATA_KEY_CREATOR"]); ?></td>
<tr><td><?php echo _("Mood:"); ?></td><td><?php echo ($this->md["MDATA_KEY_MOOD"]);?></td></tr> </tr>
<tr><td><?php echo _("Genre:"); ?></td><td><?php echo ($this->md["MDATA_KEY_GENRE"]);?></td></tr> <tr>
<tr><td><?php echo _("Year:"); ?></td><td><?php echo ($this->md["MDATA_KEY_YEAR"]);?></td></tr> <td><?php echo _("Album:"); ?></td>
<tr><td><?php echo _("Label:"); ?></td><td><?php echo ($this->md["MDATA_KEY_LABEL"]);?></td></tr> <td><?php echo ($this->md["MDATA_KEY_SOURCE"]); ?></td>
<tr><td><?php echo _("BPM:"); ?></td><td><?php echo ($this->md["MDATA_KEY_BPM"]);?></td></tr> </tr>
<tr><td><?php echo _("Composer:"); ?></td><td><?php echo ($this->md["MDATA_KEY_COMPOSER"]);?></td></tr> <tr>
<tr><td><?php echo _("Conductor:"); ?></td><td><?php echo ($this->md["MDATA_KEY_CONDUCTOR"]);?></td></tr> <td><?php echo _("Track:"); ?></td>
<tr><td><?php echo _("Copyright:"); ?></td><td><?php echo ($this->md["MDATA_KEY_COPYRIGHT"]);?></td></tr> <td><?php echo ($this->md["MDATA_KEY_TRACKNUMBER"]); ?></td>
<tr><td><?php echo _("Isrc Number:"); ?></td><td><?php echo ($this->md["MDATA_KEY_ISRC"]);?></td></tr> </tr>
<tr><td><?php echo _("Website:"); ?></td><td><?php echo ($this->md["MDATA_KEY_URL"]);?></td></tr> <tr>
<tr><td><?php echo _("Artwork:"); ?></td><td><?php echo ($this->md["MDATA_KEY_ARTWORK"]);?></td></tr> <td><?php echo _("Length:"); ?></td>
<tr><td><?php echo _("Artwork Data:"); ?></td><td><?php echo ($this->md["MDATA_KEY_ARTWORK_DATA"]);?></td></tr> <td><?php echo ($this->md["MDATA_KEY_DURATION"]); ?></td>
<tr><td><?php echo _("Language:"); ?></td><td><?php echo ($this->md["MDATA_KEY_LANGUAGE"]);?></td></tr> </tr>
<tr><td><?php echo _("Track Type:"); ?></td><td><?php echo ($this->md["MDATA_KEY_TRACK_TYPE"]);?></td></tr> <tr>
<tr><td class='file-md-qtip-nowrap'><?php echo _("File Path:"); ?></td><td><?php echo ($this->md["MDATA_KEY_FILEPATH"]);?></td></tr> <td class='file-md-qtip-nowrap'><?php echo _("Sample Rate:"); ?></td>
</table> <td><?php echo ($this->md["MDATA_KEY_SAMPLERATE"]); ?></td>
</tr>
<tr>
<td><?php echo _("Bit Rate:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_BITRATE"]); ?></td>
</tr>
<tr>
<td><?php echo _("Mood:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_MOOD"]); ?></td>
</tr>
<tr>
<td><?php echo _("Genre:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_GENRE"]); ?></td>
</tr>
<tr>
<td><?php echo _("Year:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_YEAR"]); ?></td>
</tr>
<tr>
<td><?php echo _("Label:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_LABEL"]); ?></td>
</tr>
<tr>
<td><?php echo _("BPM:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_BPM"]); ?></td>
</tr>
<tr>
<td><?php echo _("Composer:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_COMPOSER"]); ?></td>
</tr>
<tr>
<td><?php echo _("Conductor:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_CONDUCTOR"]); ?></td>
</tr>
<tr>
<td><?php echo _("Copyright:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_COPYRIGHT"]); ?></td>
</tr>
<tr>
<td><?php echo _("Isrc Number:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_ISRC"]); ?></td>
</tr>
<tr>
<td><?php echo _("Website:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_URL"]); ?></td>
</tr>
<tr>
<td><?php echo _("Artwork:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_ARTWORK"]); ?></td>
</tr>
<tr>
<td><?php echo _("Artwork Data:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_ARTWORK_DATA"]); ?></td>
</tr>
<tr>
<td><?php echo _("Language:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_LANGUAGE"]); ?></td>
</tr>
<tr>
<td><?php echo _("Track Type:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_TRACK_TYPE"]); ?></td>
</tr>
<tr>
<td class='file-md-qtip-nowrap'><?php echo _("File Path:"); ?></td>
<td><?php echo ($this->md["MDATA_KEY_FILEPATH"]); ?></td>
</tr>
</table>
<?php endif; ?> <?php endif; ?>
<?php if($this->type == "playlist" || $this->type == "block") : ?> <?php if ($this->type == "playlist" || $this->type == "block") : ?>
<div class='file-md-qtip-left'> <div class='file-md-qtip-left'>
<span><?php echo _("Name:"); ?></span><span><?php echo ($this->md["dc:title"]);?></span><br /> <span><?php echo _("Name:"); ?></span><span><?php echo ($this->md["dc:title"]); ?></span><br />
<span><?php echo _("Creator:"); ?></span><span><?php echo ($this->md["dc:creator"]);?></span><br /> <span><?php echo _("Creator:"); ?></span><span><?php echo ($this->md["dc:creator"]); ?></span><br />
<?php if ($this->type == "block" && $this->blType == "Dynamic") { ?> <?php if ($this->type == "block" && $this->blType == "Dynamic") { ?>
<span><?php echo _("Length:"); ?></span><span><?php echo $this->block->getLength();?></span><br /> <span><?php echo _("Length:"); ?></span><span><?php echo $this->block->getLength(); ?></span><br />
<?php } else { ?> <?php } else { ?>
<span><?php echo _("Length:"); ?></span><span><?php echo ($this->md["dcterms:extent"]);?></span><br /> <span><?php echo _("Length:"); ?></span><span><?php echo ($this->md["dcterms:extent"]); ?></span><br />
<?php } ?>
<span><?php echo _("Description:"); ?></span><span><?php echo ($this->md["dc:description"]); ?></span>
</div>
<?php if ($this->type == "playlist") { ?>
<div class='file-md-qtip-legend'>
<span class='webstream'>o</span> <span><?php echo _("Web Stream"); ?></span><br />
<span class='dynamic'>o</span> <span><?php echo _("Dynamic Smart Block"); ?></span><br />
<span class='static'>o</span> <span><?php echo _("Static Smart Block"); ?></span><br />
<span>o</span> <span><?php echo _("Audio Track"); ?></span>
</div>
<?php } ?> <?php } ?>
<span><?php echo _("Description:"); ?></span><span><?php echo ($this->md["dc:description"]);?></span>
</div>
<?php if ($this->type == "playlist") { ?> <?php if ($this->type == "playlist" || ($this->type == "block" && $this->blType == "Static")) { ?>
<div class='file-md-qtip-legend'>
<span class='webstream'>o</span> <span><?php echo _("Web Stream"); ?></span><br />
<span class='dynamic'>o</span> <span><?php echo _("Dynamic Smart Block"); ?></span><br />
<span class='static'>o</span> <span><?php echo _("Static Smart Block"); ?></span><br />
<span>o</span> <span><?php echo _("Audio Track"); ?></span>
</div>
<?php } ?>
<?php if ($this->type == "playlist" || ($this->type == "block" && $this->blType == "Static")) {?>
<?php <?php
//XSS exploit prevention //XSS exploit prevention
/*foreach ($this->contents as &$item) { /*foreach ($this->contents as &$item) {
@ -68,74 +134,75 @@ foreach ($this->md as $key => &$value) {
<div class='file-md-qtip-left'><span><?php echo _("Static Smart Block Contents: "); ?></span></div> <div class='file-md-qtip-left'><span><?php echo _("Static Smart Block Contents: "); ?></span></div>
<?php } ?> <?php } ?>
<table class='library-get-file-md'> <table class='library-get-file-md'>
<?php foreach($this->contents as $row) : ?> <?php foreach ($this->contents as $row) : ?>
<?php <?php
$titleMaxStrLen = 35; $titleMaxStrLen = 35;
if (mb_strlen($row["track_title"], 'UTF-8') > $titleMaxStrLen) { if (mb_strlen($row["track_title"], 'UTF-8') > $titleMaxStrLen) {
$row["track_title"] = mb_substr($row["track_title"], 0, 34, 'UTF-8')."..."; $row["track_title"] = mb_substr($row["track_title"], 0, 34, 'UTF-8') . "...";
} }
$artistMaxStrLen = 22; $artistMaxStrLen = 22;
if (mb_strlen($row["creator"], 'UTF-8') > $artistMaxStrLen) { if (mb_strlen($row["creator"], 'UTF-8') > $artistMaxStrLen) {
$row["creator"] = mb_substr($row["creator"], 0, 21, 'UTF-8')."..."; $row["creator"] = mb_substr($row["creator"], 0, 21, 'UTF-8') . "...";
} }
?> ?>
<?php if ($row["type"] == 2) { <?php if ($row["type"] == 2) {
$bl = new Application_Model_Block($row["item_id"]); $bl = new Application_Model_Block($row["item_id"]);
$isStatic = $bl->isStatic(); ?> $isStatic = $bl->isStatic(); ?>
<tr class='file-md-qtip-playlist <?php if ($isStatic) echo 'static'; else echo 'dynamic';?>'> <tr class='file-md-qtip-playlist <?php if ($isStatic) echo 'static';
<td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td> else echo 'dynamic'; ?>'>
<td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td> <td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td>
<td class='file-md-qtip-row-width-small'><?php echo $bl->getLength(); ?></td> <td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td>
</tr> <td class='file-md-qtip-row-width-small'><?php echo $bl->getLength(); ?></td>
<?php } else if ($row["type"] == 1) {?> </tr>
<tr class='file-md-qtip-playlist webstream'> <?php } else if ($row["type"] == 1) { ?>
<td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td> <tr class='file-md-qtip-playlist webstream'>
<td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td> <td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td>
<td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td> <td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td>
</tr> <td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td>
<?php } else { ?> </tr>
<tr> <?php } else { ?>
<td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td> <tr>
<td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td> <td class='file-md-qtip-row-width-title file-md-qtip-nowrap'><?php echo $row["track_title"] ?></td>
<td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td> <td class='file-md-qtip-row-width-artist file-md-qtip-nowrap'><?php echo $row["creator"] ?></td>
</tr> <td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td>
<?php } ?> </tr>
<?php endforeach; ?> <?php } ?>
<?php endforeach; ?>
</table> </table>
<?php } elseif ($this->blType == "Dynamic") { ?> <?php } elseif ($this->blType == "Dynamic") { ?>
<div class='file-md-qtip-left'><span><?php echo _("Dynamic Smart Block Criteria: "); ?></span></div> <div class='file-md-qtip-left'><span><?php echo _("Dynamic Smart Block Criteria: "); ?></span></div>
<table class='library-get-file-md table-small'> <table class='library-get-file-md table-small'>
<?php foreach ($this->contents["crit"] as &$criterias) : ?> <?php foreach ($this->contents["crit"] as &$criterias) : ?>
<?php foreach ($criterias as &$crit ) : ?> <?php foreach ($criterias as &$crit) : ?>
<?php <?php
// XSS exploit prevention // XSS exploit prevention
//$crit["value"] = htmlspecialchars($crit["value"]); //$crit["value"] = htmlspecialchars($crit["value"]);
//$crit["extra"] = htmlspecialchars($crit["extra"]); //$crit["extra"] = htmlspecialchars($crit["extra"]);
$valMaxStrLen = 25; $valMaxStrLen = 25;
if (strlen($crit["value"]) > $valMaxStrLen) { if (strlen($crit["value"]) > $valMaxStrLen) {
$crit["value"] = substr($crit["value"], 0, 24)."..."; $crit["value"] = substr($crit["value"], 0, 24) . "...";
} }
$critMaxStrLen = 13; $critMaxStrLen = 13;
if (strlen($crit["display_name"]) > $critMaxStrLen) { if (strlen($crit["display_name"]) > $critMaxStrLen) {
$crit["display_name"] = substr($crit["display_name"], 0, 12)."..."; $crit["display_name"] = substr($crit["display_name"], 0, 12) . "...";
} }
$modMaxStrLen = 16; $modMaxStrLen = 16;
if (strlen($crit["modifier"]) > $modMaxStrLen) { if (strlen($crit["modifier"]) > $modMaxStrLen) {
$crit["modifier"] = substr($crit["modifier"], 0, 15)."..."; $crit["modifier"] = substr($crit["modifier"], 0, 15) . "...";
} }
?> ?>
<tr> <tr>
<td class='file-md-qtip-criteria-width-small file-md-qtip-nowrap'><?php echo $crit["display_name"] ?></td> <td class='file-md-qtip-criteria-width-small file-md-qtip-nowrap'><?php echo $crit["display_name"] ?></td>
<td class='file-md-qtip-criteria-width-small file-md-qtip-nowrap'><?php echo $crit["modifier"] ?></td> <td class='file-md-qtip-criteria-width-small file-md-qtip-nowrap'><?php echo $crit["modifier"] ?></td>
<td class='file-md-qtip-criteria-width file-md-qtip-nowrap'><?php echo $crit["value"] ?> <td class='file-md-qtip-criteria-width file-md-qtip-nowrap'><?php echo $crit["value"] ?>
<?php if (isset($crit["extra"])) { ?> <?php if (isset($crit["extra"])) { ?>
to <?php echo $crit["extra"] ?></td> to <?php echo $crit["extra"] ?></td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php endforeach; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endforeach; ?>
<tr> <tr>
<td><?php echo _("Limit to ") ?></td> <td><?php echo _("Limit to ") ?></td>
<td><?php echo $this->contents["limit"]["value"] ?> <?php echo $this->contents["limit"]["modifier"] ?></td> <td><?php echo $this->contents["limit"]["value"] ?> <?php echo $this->contents["limit"]["modifier"] ?></td>
@ -146,11 +213,11 @@ foreach ($this->md as $key => &$value) {
<?php if ($this->type == "stream") : ?> <?php if ($this->type == "stream") : ?>
<div><span><?php echo _("Name:"); ?></span><span><?php echo ($this->md["name"]);?></span></div> <div><span><?php echo _("Name:"); ?></span><span><?php echo ($this->md["name"]); ?></span></div>
<div><span><?php echo _("Length:"); ?></span><span><?php echo ($this->md["length"]);?></span></div> <div><span><?php echo _("Length:"); ?></span><span><?php echo ($this->md["length"]); ?></span></div>
<div><span><?php echo _("Creator:"); ?></span><span><?php echo ($this->md["login"]);?></span></div> <div><span><?php echo _("Creator:"); ?></span><span><?php echo ($this->md["login"]); ?></span></div>
<div><span><?php echo _("Description:"); ?></span><span><?php echo ($this->md["description"]);?></span></div> <div><span><?php echo _("Description:"); ?></span><span><?php echo ($this->md["description"]); ?></span></div>
<div><span><?php echo _("URL:"); ?></span><span><?php echo ($this->md["url"]);?></span></div> <div><span><?php echo _("URL:"); ?></span><span><?php echo ($this->md["url"]); ?></span></div>
<?php endif; ?> <?php endif; ?>

View File

@ -9,18 +9,18 @@ if ($this->showPlaylist) {
$display = "display:none"; $display = "display:none";
} }
?> ?>
<div class="side_playlist pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;<?php echo $display?>"> <div class="side_playlist pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;<?php echo $display ?>">
<?php if ($this->type == 'block') { <?php if ($this->type == 'block') {
echo $this->render('playlist/smart-block.phtml'); echo $this->render('playlist/smart-block.phtml');
} else if ($this->type == 'playlist') { } else if ($this->type == 'playlist') {
echo $this->render('playlist/playlist.phtml'); echo $this->render('playlist/playlist.phtml');
} else if ($this->type == 'stream') { } else if ($this->type == 'stream') {
echo $this->render('webstream/webstream.phtml'); echo $this->render('webstream/webstream.phtml');
} else { } else {
echo $this->render('webstream/webstream.phtml'); echo $this->render('webstream/webstream.phtml');
//throw new Exception("Unrecognized type: '{$this->type}'"); //throw new Exception("Unrecognized type: '{$this->type}'");
} }
?> ?>
</div> </div>

View File

@ -7,12 +7,12 @@
</div> </div>
<div class="inner_editor_wrapper"> <div class="inner_editor_wrapper">
<form class="media-metadata"> <form class="media-metadata">
<input ng-value="media.id" class="obj_id" type="hidden"/> <input ng-value="media.id" class="obj_id" type="hidden" />
<label class="publish-md-field"><?php echo _("Title:") ?></label> <label class="publish-md-field"><?php echo _("Title:") ?></label>
<input disabled ng-model="media.track_title" type="text"/> <input disabled ng-model="media.track_title" type="text" />
<label class="publish-md-field"><?php echo _("Creator:") ?></label> <label class="publish-md-field"><?php echo _("Creator:") ?></label>
<input disabled ng-model="media.artist_name" type="text"/> <input disabled ng-model="media.artist_name" type="text" />
<label class="publish-md-field"><?php echo _("Description:") ?></label> <label class="publish-md-field"><?php echo _("Description:") ?></label>
<textarea disabled ng-model="media.description"></textarea> <textarea disabled ng-model="media.description"></textarea>

View File

@ -1,5 +1,5 @@
<div id="listenerstat_content" class="alpha-block padded"> <div id="listenerstat_content" class="alpha-block padded">
<H2><?php echo _("Listeners")?></H2> <H2><?php echo _("Listeners") ?></H2>
<div id="flot_placeholder" style="height:300px;margin:0px 50px 0px 50px"></div> <div id="flot_placeholder" style="height:300px;margin:0px 50px 0px 50px"></div>
<div id="legend" style="width:600px;height:70px;margin:0px 50px 0px 50px"></div> <div id="legend" style="width:600px;height:70px;margin:0px 50px 0px 50px"></div>
<div id="date_form" style="float:left; margin:0px 0px"> <div id="date_form" style="float:left; margin:0px 0px">
@ -7,11 +7,13 @@
<?php echo $this->date_form; ?> <?php echo $this->date_form; ?>
</div> </div>
<div id="errorStatus" style="float:right; width: 400px"> <div id="errorStatus" style="float:right; width: 400px">
<h3><?php echo _("Stream Data Collection Status")?></h3> <h3><?php echo _("Stream Data Collection Status") ?></h3>
<fieldset class="padded stream-setting-global"> <fieldset class="padded stream-setting-global">
<?php foreach ($this->errorStatus as $k=>$v) {?> <?php foreach ($this->errorStatus as $k => $v) { ?>
<div class='stream-status <?php echo ($v == 'OK')? 'status-good' : 'status-error' ?>'><p><?php echo $k?>: <?php echo $v?></p></div> <div class='stream-status <?php echo ($v == 'OK') ? 'status-good' : 'status-error' ?>'>
<?php }?> <p><?php echo $k ?>: <?php echo $v ?></p>
</div>
<?php } ?>
</fieldset> </fieldset>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>

View File

@ -1,5 +1,5 @@
<div id="showlistenerstat_content" class="alpha-block padded"> <div id="showlistenerstat_content" class="alpha-block padded">
<H2><?php echo _("Listeners")?></H2> <H2><?php echo _("Listeners") ?></H2>
<div class="error_window"></div> <div class="error_window"></div>
<div id="date_form" style="float:left; margin:0px 0px"> <div id="date_form" style="float:left; margin:0px 0px">
<h3 style="padding-left: 0px"><?php echo _("Date Range") ?></h3> <h3 style="padding-left: 0px"><?php echo _("Date Range") ?></h3>
@ -9,12 +9,12 @@
<table id="show_builder_table" cellpadding="0" cellspacing="0" class="datatable"></table> <table id="show_builder_table" cellpadding="0" cellspacing="0" class="datatable"></table>
<table cellspacing="0" cellpadding="0" style="" id="show_stats_datatable" class="datatable"> <table cellspacing="0" cellpadding="0" style="" id="show_stats_datatable" class="datatable">
<thead> <thead>
<tr> <tr>
<th><?php echo _("Show Name") ?></th> <th><?php echo _("Show Name") ?></th>
<th><?php echo _("Air Date") ?></th> <th><?php echo _("Air Date") ?></th>
<th><?php echo _("Average Listeners")?></th> <th><?php echo _("Average Listeners") ?></th>
<th><?php echo _("Maximum Number of Listeners")?></th> <th><?php echo _("Maximum Number of Listeners") ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>

View File

@ -1,13 +1,13 @@
<div class="login_box"> <div class="login_box">
<div class="logobox">&nbsp;</div> <div class="logobox">&nbsp;</div>
<h2><?php echo _("Login") ?></h2> <h2><?php echo _("Login") ?></h2>
<div id="login" class="login-content clearfix"> <div id="login" class="login-content clearfix">
<?php if(isset($this->demo) && $this->demo == 1){?> <?php if (isset($this->demo) && $this->demo == 1) { ?>
<p style="font-weight:bold"> <p style="font-weight:bold">
<?php echo sprintf(_("Welcome to the %s demo! You can log in using the username 'admin' and the password 'admin'."), PRODUCT_NAME)?> <?php echo sprintf(_("Welcome to the %s demo! You can log in using the username 'admin' and the password 'admin'."), PRODUCT_NAME) ?>
</p> </p>
<?php }?> <?php } ?>
<p class="light" style='<?php echo $this->error?"color:#902d2d;font-size:11px;padding:2px 4px;background:#c6b4b4;margin-bottom:2px;border:1px solid #c83f3f;":""?>'><?php echo $this->message; ?></p> <p class="light" style='<?php echo $this->error ? "color:#902d2d;font-size:11px;padding:2px 4px;background:#c6b4b4;margin-bottom:2px;border:1px solid #c83f3f;" : "" ?>'><?php echo $this->message; ?></p>
<?php echo $this->form; ?> <?php echo $this->form; ?>
</div> </div>
</div> </div>

View File

@ -3,7 +3,7 @@
<h2><?php echo _("New password") ?></h2> <h2><?php echo _("New password") ?></h2>
<div id="login" class="login-content clearfix"> <div id="login" class="login-content clearfix">
<p class="light"><?php echo _("Please enter and confirm your new password in the fields below."); ?></p> <p class="light"><?php echo _("Please enter and confirm your new password in the fields below."); ?></p>
<?php echo $this->form; ?> <?php echo $this->form; ?>
</div> </div>
</div> </div>

View File

@ -7,8 +7,8 @@
<br> <br>
<dl class="zend-form"> <dl class="zend-form">
<dd id="cancel-element"> <dd id="cancel-element">
<a href="<?php echo($this->baseUrl('login')); ?>"> <a href="<?php echo ($this->baseUrl('login')); ?>">
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button> <button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo (_("Back")); ?></button>
</a> </a>
</dd> </dd>
</dl> </dl>

View File

@ -1,6 +1,6 @@
<ol class="navigation"> <ol class="navigation">
<?php foreach ($this->container as $page) : ?> <?php foreach ($this->container as $page) : ?>
<?php <?php
// Host users do not have access to the General Preferences // Host users do not have access to the General Preferences
// therefor we need to manually change the page parameters // therefor we need to manually change the page parameters
// to point to the first allowed item in the Preferences // to point to the first allowed item in the Preferences
@ -8,38 +8,43 @@
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
$isHost = $user->isUserType(array(UTYPE_HOST)); $isHost = $user->isUserType(array(UTYPE_HOST));
if ($isHost && $page->getTitle() === 'Settings') { if ($isHost && $page->getTitle() === 'Settings') {
$page->set('resource', 'usersettings'); $page->set('resource', 'usersettings');
$page->set('controller', 'user'); $page->set('controller', 'user');
$page->set('action','edit-user'); $page->set('action', 'edit-user');
} }
?> ?>
<?php if($this->navigation()->accept($page)) : ?> <?php if ($this->navigation()->accept($page)) : ?>
<li class="top <?php if($page->isActive(true)){echo 'active';} ?>"> <li class="top <?php if ($page->isActive(true)) {
<?php if($page->hasPages()) : ?> echo 'active';
<a class="top_link" href="<?php echo $page->getHref(); ?>"> } ?>">
<span class="down"><?php echo $page->getClass(); echo _($page->getLabel()); ?></span> <?php if ($page->hasPages()) : ?>
</a> <a class="top_link" href="<?php echo $page->getHref(); ?>">
<ul class="sub"> <span class="down"><?php echo $page->getClass();
echo _($page->getLabel()); ?></span>
</a>
<ul class="sub">
<?php foreach ($page->getPages() as $sub) : <?php foreach ($page->getPages() as $sub) :
if($sub->getId() == "manage_folder"){ if ($sub->getId() == "manage_folder") {
continue; continue;
} ?> } ?>
<?php if($this->navigation()->accept($sub)) : ?> <?php if ($this->navigation()->accept($sub)) : ?>
<li> <li>
<a href="<?php echo $sub->getHref(); ?>" <?php echo ($sub->getTarget() != "")?"target=\"".$sub->getTarget()."\"":""; ?>><?php echo $page->getClass(); echo _($sub->getLabel()); ?></a> <a href="<?php echo $sub->getHref(); ?>" <?php echo ($sub->getTarget() != "") ? "target=\"" . $sub->getTarget() . "\"" : ""; ?>><?php echo $page->getClass();
</li> echo _($sub->getLabel()); ?></a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php else : ?>
<a class="top_link" href="<?php echo $page->getHref(); ?>">
<span><?php echo $page->getClass();
echo _($page->getLabel()); ?></span>
</a>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> </li>
</ul> <?php endif; ?>
<?php else: ?> <?php endforeach; ?>
<a class="top_link" href="<?php echo $page->getHref(); ?>">
<span><?php echo $page->getClass(); echo _($page->getLabel()); ?></span>
</a>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ol> </ol>

View File

@ -9,25 +9,26 @@
<div class="text-row"><strong><?php echo _("Previous:"); ?></strong> <span id='previous'></span> <span id='prev-length'></span></div> <div class="text-row"><strong><?php echo _("Previous:"); ?></strong> <span id='previous'></span> <span id='prev-length'></span></div>
<div class="now-playing-info song"> <div class="now-playing-info song">
<div class="time-flow"><span class="song-length" id="song-length"></span><span class="time-elapsed" id="time-elapsed"></span><span class="time-remaining" id="time-remaining"></span></div> <div class="time-flow"><span class="song-length" id="song-length"></span><span class="time-elapsed" id="time-elapsed"></span><span class="time-remaining" id="time-remaining"></span></div>
<span id='current'></span></div> <span id='current'></span>
</div>
<div class="progressbar"> <div class="progressbar">
<div class="progress-song" id="progress-bar" style="width:0%;"></div> <div class="progress-song" id="progress-bar" style="width:0%;"></div>
</div> </div>
<div class="text-row next-song"><strong><?php echo _("Next:"); ?></strong> <span id='next'></span> <span id='next-length'></span></div> <div class="text-row next-song"><strong><?php echo _("Next:"); ?></strong> <span id='next'></span> <span id='next-length'></span></div>
</div> </div>
<div class="show-block"> <div class="show-block">
<div class="text-row">&nbsp;</div> <div class="text-row">&nbsp;</div>
<div class="now-playing-info show"> <div class="now-playing-info show">
<div class="recording-show" style="display: none;"></div> <div class="recording-show" style="display: none;"></div>
<span id="playlist"></span> <span id="playlist"></span>
<span id="show-length" class="show-length"></span> <span id="show-length" class="show-length"></span>
</div>
<div class="progressbar">
<div class="progress-show" id='progress-show' style="width:0%;"></div>
</div>
</div> </div>
<div class="progressbar">
<div class="progress-show" id='progress-show' style="width:0%;"></div>
</div>
</div>
<div class="source-info-block"> <div class="source-info-block">
<h3><?php echo _("Source Streams") ?></h3> <h3><?php echo _("Source Streams") ?></h3>
<ul style="padding-top: 10px;"> <ul style="padding-top: 10px;">
<li> <li>
<div id="master_dj_div" class="source-label"> <div id="master_dj_div" class="source-label">
@ -35,31 +36,31 @@
<?php echo _("Master Source") ?> <?php echo _("Master Source") ?>
</div> </div>
<div class="line-to-switch"></div> <div class="line-to-switch"></div>
<a href="#" id="master_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->master_dj_switch?></span></a> <a href="#" id="master_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->master_dj_switch ?></span></a>
<div class="line-to-on-air"></div> <div class="line-to-on-air"></div>
</li> </li>
<li> <li>
<div id="live_dj_div" class="source-label"> <div id="live_dj_div" class="source-label">
<a id="live_dj" class="source-kick-button" onclick="kickSource(this)"></a> <a id="live_dj" class="source-kick-button" onclick="kickSource(this)"></a>
<?php echo _("Show Source")?> <?php echo _("Show Source") ?>
</div> </div>
<div class="line-to-switch"></div> <div class="line-to-switch"></div>
<a href="#" id="live_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->live_dj_switch?></span></a> <a href="#" id="live_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->live_dj_switch ?></span></a>
<div class="line-to-on-air"></div> <div class="line-to-on-air"></div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="on-air-block"> <div class="on-air-block">
<h3>&nbsp;</h3> <h3>&nbsp;</h3>
<div class="on-air-info off" id="on-air-info"><?php echo _("ON AIR") ?></div> <div class="on-air-info off" id="on-air-info"><?php echo _("ON AIR") ?></div>
<a href="#" class="listen-control-button"><span><?php echo _("Listen") ?></span></a> <a href="#" class="listen-control-button"><span><?php echo _("Listen") ?></span></a>
</div> </div>
<div class="time-info-block pull-right"> <div class="time-info-block pull-right">
<div class="time" id="time"></div> <div class="time" id="time"></div>
<div class="personal-block"> <div class="personal-block">
<a id="current-user" href=<?php echo $this->baseUrl . "/user/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a> <a id="current-user" href=<?php echo $this->baseUrl . "/user/edit-user" ?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a>
<span>|</span> <span>|</span>
<a href=<?php echo $this->baseUrl . "/login/logout"?>><?php echo _("Logout")?></a> <a href=<?php echo $this->baseUrl . "/login/logout" ?>><?php echo _("Logout") ?></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,9 @@
<?php if ($this->objType == "block") { $displayText = "smart block"; } else { $displayText = $this->escape($this->objType); } ?> <?php if ($this->objType == "block") {
$displayText = "smart block";
} else {
$displayText = $this->escape($this->objType);
} ?>
<h3>You do not have permission to edit this <?php echo $displayText; ?>.</h3> <h3>You do not have permission to edit this <?php echo $displayText; ?>.</h3>
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/> <input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>" />
<input class='obj_type' type='hidden' value="<?php echo $this->escape($this->objType); ?>"/> <input class='obj_type' type='hidden' value="<?php echo $this->escape($this->objType); ?>" />
<input type="hidden" class="playlist_name_display" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>"> <input type="hidden" class="playlist_name_display" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>">

View File

@ -7,17 +7,17 @@ if (isset($this->obj)) {
<?php if (isset($this->obj)) : ?> <?php if (isset($this->obj)) : ?>
<div class="inner_editor_title"> <div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName; <H2><?php echo (_("Editing ")); ?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2> else echo $this->escape($this->obj->getName()); ?></span>"</H2>
</div> </div>
<div class="inner_editor_wrapper"> <div class="inner_editor_wrapper">
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/> <input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>" />
<input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"/> <input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>" />
<input class='obj_type' type='hidden' value='playlist'/> <input class='obj_type' type='hidden' value='playlist' />
<dl class="zend_form playlist_editor"> <dl class="zend_form playlist_editor">
<dt> <dt>
<label><?php echo(_("Name:")); ?></label> <label><?php echo (_("Name:")); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" class="playlist_name_display" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>"> <input type="text" class="playlist_name_display" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>">
@ -28,13 +28,14 @@ if (isset($this->obj)) {
</dd> </dd>
</dl> </dl>
<?php //echo $this->form; ?> <?php //echo $this->form;
?>
</div> </div>
<div class="ui-widget-header fg-toolbar btn-toolbar clearfix"> <div class="ui-widget-header fg-toolbar btn-toolbar clearfix">
<h4 class="obj_length"><?php echo($this->length); ?></h4> <h4 class="obj_length"><?php echo ($this->length); ?></h4>
<h4 class="obj_length_label"><?php echo(_("Duration:"));?></h4> <h4 class="obj_length_label"><?php echo (_("Duration:")); ?></h4>
<div class='btn-group'> <div class='btn-group'>
<button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button> <button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button>
@ -67,8 +68,8 @@ if (isset($this->obj)) {
</div> </div>
<ul class="spl_sortable"> <ul class="spl_sortable">
<?php $this->contents = $contents; <?php $this->contents = $contents;
echo $this->render('playlist/update.phtml') ?> echo $this->render('playlist/update.phtml') ?>
</ul> </ul>
<div class="btn-toolbar clearfix"> <div class="btn-toolbar clearfix">
<div class="btn-group pull-right"> <div class="btn-group pull-right">

View File

@ -1,18 +1,14 @@
<dl id="spl_cue_editor" class="inline-list"> <dl id="spl_cue_editor" class="inline-list">
<dd data-uri="<?php echo $this->uri; ?>"> <dd data-uri="<?php echo $this->uri; ?>">
<input type="button" class="pl-waveform-cues-btn" value="<?php echo _("Show Waveform")?>"></input> <input type="button" class="pl-waveform-cues-btn" value="<?php echo _("Show Waveform") ?>"></input>
</dd> </dd>
<dt><?php echo _("Cue In: "); ?><span class='spl_cue_hint'><?php echo _("(hh:mm:ss.t)")?></span></dt> <dt><?php echo _("Cue In: "); ?><span class='spl_cue_hint'><?php echo _("(hh:mm:ss.t)") ?></span></dt>
<dd id="spl_cue_in_<?php echo $this->id; ?>" class="spl_cue_in" <dd id="spl_cue_in_<?php echo $this->id; ?>" class="spl_cue_in" data-cue-in="<?php echo $this->cueIn; ?>" data-cue-sec="<?php echo $this->cueInSec; ?>">
data-cue-in="<?php echo $this->cueIn; ?>"
data-cue-sec="<?php echo $this->cueInSec; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span> <span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span>
</dd> </dd>
<dd class="edit-error"></dd> <dd class="edit-error"></dd>
<dt><?php echo _("Cue Out: "); ?><span class='spl_cue_hint'><?php echo _("(hh:mm:ss.t)")?></span></dt> <dt><?php echo _("Cue Out: "); ?><span class='spl_cue_hint'><?php echo _("(hh:mm:ss.t)") ?></span></dt>
<dd id="spl_cue_out_<?php echo $this->id; ?>" class="spl_cue_out" <dd id="spl_cue_out_<?php echo $this->id; ?>" class="spl_cue_out" data-cue-out="<?php echo $this->cueOut; ?>" data-cue-sec="<?php echo $this->cueOutSec; ?>">
data-cue-out="<?php echo $this->cueOut; ?>"
data-cue-sec="<?php echo $this->cueOutSec; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span> <span contenteditable="true" class="spl_text_input"><?php echo $this->cueOut; ?></span>
</dd> </dd>
<dd class="edit-error"></dd> <dd class="edit-error"></dd>

View File

@ -1,31 +1,23 @@
<dl id="spl_editor" class="inline-list"> <dl id="spl_editor" class="inline-list">
<dd> <dd>
<input type="button" class="pl-waveform-fades-btn" value="<?php echo _("Show Waveform")?>"></input> <input type="button" class="pl-waveform-fades-btn" value="<?php echo _("Show Waveform") ?>"></input>
</dd> </dd>
<?php if ($this->item1Type == 0) {?> <?php if ($this->item1Type == 0) { ?>
<dt><?php echo _("Fade out: "); ?><span class='spl_cue_hint'><?php echo _("(ss.t)")?></span></dt> <dt><?php echo _("Fade out: "); ?><span class='spl_cue_hint'><?php echo _("(ss.t)") ?></span></dt>
<dd id="spl_fade_out_<?php echo $this->item1; ?>" class="spl_fade_out" <dd id="spl_fade_out_<?php echo $this->item1; ?>" class="spl_fade_out" data-fadeout="<?php echo $this->item1Url; ?>" data-cuein="<?php echo $this->cueIn1; ?>" data-cueout="<?php echo $this->cueOut1; ?>" data-length="<?php echo $this->fadeOut; ?>" data-type="logarithmic" data-item="<?php echo $this->item1; ?>">
data-fadeout="<?php echo $this->item1Url; ?>" <span contenteditable="true" class="spl_text_input"><?php echo $this->fadeOut; ?></span>
data-cuein="<?php echo $this->cueIn1; ?>" </dd>
data-cueout="<?php echo $this->cueOut1; ?>" <dd class="edit-error"></dd>
data-length="<?php echo $this->fadeOut; ?>" <?php }
data-type="logarithmic" if (isset($this->item2Url)) { ?>
data-item="<?php echo $this->item1; ?>"> <dt><?php echo _("Fade in: "); ?><span class='spl_cue_hint'><?php echo _("(ss.t)") ?></span></dt>
<span contenteditable="true" class="spl_text_input"><?php echo $this->fadeOut; ?></span> <dd id="spl_fade_in_<?php echo $this->item2; ?>" class="spl_fade_in" data-fadein="<?php echo $this->item2Url; ?>" data-offset="<?php if ($this->item1Type == 0) {
</dd> echo $this->offset;
<dd class="edit-error"></dd> } else {
<?php } echo 0;
if (isset($this->item2Url)) {?> } ?>" data-cuein="<?php echo $this->cueIn2; ?>" data-cueout="<?php echo $this->cueOut2; ?>" data-length="<?php echo $this->fadeIn; ?>" data-type="logarithmic" data-item="<?php echo $this->item2; ?>">
<dt><?php echo _("Fade in: "); ?><span class='spl_cue_hint'><?php echo _("(ss.t)")?></span></dt> <span contenteditable="true" class="spl_text_input"><?php echo $this->fadeIn; ?></span>
<dd id="spl_fade_in_<?php echo $this->item2; ?>" class="spl_fade_in" </dd>
data-fadein="<?php echo $this->item2Url; ?>" <dd class="edit-error"></dd>
data-offset="<?php if ($this->item1Type == 0) { echo $this->offset; } else { echo 0; } ?>" <?php } ?>
data-cuein="<?php echo $this->cueIn2; ?>"
data-cueout="<?php echo $this->cueOut2; ?>" data-length="<?php echo $this->fadeIn; ?>"
data-type="logarithmic"
data-item="<?php echo $this->item2; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->fadeIn; ?></span>
</dd>
<dd class="edit-error"></dd>
<?php }?>
</dl> </dl>

View File

@ -7,23 +7,23 @@ if (isset($this->obj)) {
<?php if (isset($this->obj)) : ?> <?php if (isset($this->obj)) : ?>
<div class="inner_editor_title"> <div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName; <H2><?php echo (_("Editing ")); ?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2> else echo $this->escape($this->obj->getName()); ?></span>"</H2>
</div> </div>
<div class="inner_editor_wrapper smart-block-form"> <div class="inner_editor_wrapper smart-block-form">
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/> <input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>" />
<input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"/> <input class="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>" />
<input class='obj_type' type='hidden' value='block'/> <input class='obj_type' type='hidden' value='block' />
<dl class="zend_form playlist_editor"> <dl class="zend_form playlist_editor">
<dt> <dt>
<label><?php echo(_("Name:")); ?></label> <label><?php echo (_("Name:")); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" class="playlist_name_display" contenteditable="true" value="<?php <input type="text" class="playlist_name_display" contenteditable="true" value="<?php
if (isset($this->unsavedName)) echo $this->unsavedName; if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName()); else echo $this->escape($this->obj->getName());
?>"> ?>">
</dd> </dd>
</dl> </dl>
@ -34,9 +34,9 @@ if (isset($this->obj)) {
<dt id="description-label"><label for="description"><?php echo _("Description:") ?></label></dt> <dt id="description-label"><label for="description"><?php echo _("Description:") ?></label></dt>
<dd id="description-element"> <dd id="description-element">
<textarea cols="24" rows="3" id="description" name="description"><?php <textarea cols="24" rows="3" id="description" name="description"><?php
if (isset($this->unsavedDesc)) echo $this->unsavedDesc; if (isset($this->unsavedDesc)) echo $this->unsavedDesc;
else echo $this->obj->getDescription(); else echo $this->obj->getDescription();
?></textarea> ?></textarea>
</dd> </dd>
</dl> </dl>
</div> </div>
@ -44,17 +44,17 @@ if (isset($this->obj)) {
</div> </div>
<div class="ui-widget-header fg-toolbar btn-toolbar clearfix"> <div class="ui-widget-header fg-toolbar btn-toolbar clearfix">
<h4 class="obj_length"><?php echo($this->length); ?></h4> <h4 class="obj_length"><?php echo ($this->length); ?></h4>
<h4 class="obj_length_label"><?php echo(_("Duration:"));?></h4> <h4 class="obj_length_label"><?php echo (_("Duration:")); ?></h4>
<div class='btn-group'> <div class='btn-group'>
<button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button> <button class="btn toggle-editor-form" title='<?php echo _("Toggle Details") ?>' type="button"><span class="icon-white spl-no-r-margin icon-chevron-up"></span></button>
</div> </div>
<div class='btn-group'> <div class='btn-group'>
<?php echo $this->form->getElement('generate_button');?> <?php echo $this->form->getElement('generate_button'); ?>
</div> </div>
<div class='btn-group'> <div class='btn-group'>
<?php echo $this->form->getElement('shuffle_button');?> <?php echo $this->form->getElement('shuffle_button'); ?>
</div> </div>
<div class='btn-group'> <div class='btn-group'>
<button id="spl_crossfade" class="btn crossfade-main-button"> <button id="spl_crossfade" class="btn crossfade-main-button">
@ -72,17 +72,19 @@ if (isset($this->obj)) {
<dl id="spl_editor-main" class="inline-list"> <dl id="spl_editor-main" class="inline-list">
<dt><?php echo _("Fade in: "); ?></dt> <dt><?php echo _("Fade in: "); ?></dt>
<dd> <dd>
<input class="spl_main_fade_in playlist_main_fade_input" value="0" /><span class='spl_cue_hint'> seconds</span></dd> <input class="spl_main_fade_in playlist_main_fade_input" value="0" /><span class='spl_cue_hint'> seconds</span>
</dd>
<dd class="edit-error"></dd> <dd class="edit-error"></dd>
<dt><?php echo _("Fade out: "); ?></dt> <dt><?php echo _("Fade out: "); ?></dt>
<dd><input class="spl_main_fade_out playlist_main_fade_input" value="0" /><span class='spl_cue_hint'> seconds</span></dd></dd> <dd><input class="spl_main_fade_out playlist_main_fade_input" value="0" /><span class='spl_cue_hint'> seconds</span></dd>
</dd>
<dd class="edit-error"></dd> <dd class="edit-error"></dd>
</dl> </dl>
</div> </div>
<ul class="spl_sortable"> <ul class="spl_sortable">
<?php $this->contents = $contents; <?php $this->contents = $contents;
echo $this->render('playlist/update.phtml') ?> echo $this->render('playlist/update.phtml') ?>
</ul> </ul>
<div class="btn-toolbar clearfix"> <div class="btn-toolbar clearfix">
<div class="btn-group pull-right"> <div class="btn-group pull-right">
@ -91,9 +93,10 @@ if (isset($this->obj)) {
<div class='btn-group pull-right'> <div class='btn-group pull-right'>
<button class="btn" title='Save smart block&#39s title, description, and criteria' type="button" id="save_button"><?php echo _("Save") ?></button> <button class="btn" title='Save smart block&#39s title, description, and criteria' type="button" id="save_button"><?php echo _("Save") ?></button>
</div> </div>
<div id='sp-success-saved' class='success' style='display:none'><span</div> <div id='sp-success-saved' class='success' style='display:none'>
</div> <span< /div>
</div>
<?php else : ?> <?php else : ?>
<div><?php echo _("No smart block currently open") ?></div> <div><?php echo _("No smart block currently open") ?></div>
<?php endif; ?> <?php endif; ?>

View File

@ -5,164 +5,163 @@ $isPlaylist = ($this->obj instanceof Application_Model_Playlist);
if ($isSmartBlock && $this->showPoolCount) { ?> if ($isSmartBlock && $this->showPoolCount) { ?>
<div class='sp_text_font sp_text_font_bold'> <div class='sp_text_font sp_text_font_bold'>
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'> <span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
<?php <?php
echo $this->poolCount; echo $this->poolCount;
echo ngettext(" track matches your search criteria.", " tracks match your search criteria.", $this->poolCount); echo ngettext(" track matches your search criteria.", " tracks match your search criteria.", $this->poolCount);
?> ?>
</span> </span>
<?php if ($this->poolCount > 0) { ?> <?php if ($this->poolCount > 0) { ?>
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span> <span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
<?php } <?php } else { ?>
else { ?>
<span class='sp-warning-icon' id='sp_pool_count_icon'></span> <span class='sp-warning-icon' id='sp_pool_count_icon'></span>
<?php } ?> <?php } ?>
</div> </div>
<?php <?php
} }
if (count($items) && ($isSmartBlock || $isPlaylist)) : ?> if (count($items) && ($isSmartBlock || $isPlaylist)) : ?>
<?php $i = 0; ?> <?php $i = 0; ?>
<?php if ($isSmartBlock && !($this->obj->isStatic())) { <?php if ($isSmartBlock && !($this->obj->isStatic())) {
echo _("</br>This is only a preview of possible content generated by the smart block based upon the above criteria.");} echo _("</br>This is only a preview of possible content generated by the smart block based upon the above criteria.");
?> }
<?php foreach($items as $item) : ?>
$staticBlock = null; <?php foreach ($items as $item) :
$nextFileUrl = null; $staticBlock = null;
if ($item['type'] == 2) { $nextFileUrl = null;
$bl= new Application_Model_Block($item['item_id']); if ($item['type'] == 2) {
$staticBlock = $bl->isStatic(); $bl = new Application_Model_Block($item['item_id']);
$fileUrl = null; $staticBlock = $bl->isStatic();
} $fileUrl = null;
else if ($item['type'] == 1) { } else if ($item['type'] == 1) {
$fileUrl = null; $fileUrl = null;
} } else if ($item['type'] == 0) {
else if ($item['type'] == 0) { $audiofile = Application_Model_StoredFile::RecallById($item['item_id']);
$audiofile = Application_Model_StoredFile::RecallById($item['item_id']); $fileUrl = $audiofile->getFileUrl();
$fileUrl = $audiofile->getFileUrl(); }
}
if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) { if (($i < count($items) - 1) && ($items[$i + 1]['type'] == 0)) {
$nextAudiofile = Application_Model_StoredFile::RecallById($items[$i+1]['item_id']); $nextAudiofile = Application_Model_StoredFile::RecallById($items[$i + 1]['item_id']);
$nextFileUrl = $nextAudiofile->getFileUrl(); $nextFileUrl = $nextAudiofile->getFileUrl();
} }
?> ?>
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["id"]; ?>"> <li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["id"]; ?>">
<div class="list-item-container"> <div class="list-item-container">
<?php if ($item['type'] == 0 && $item['exists']):?> <?php if ($item['type'] == 0 && $item['exists']) : ?>
<div class="big_play" audioFile="<?php echo $item["id"]; ?>" data-mime-type="<?php echo $item["mime"]; ?>"> <div class="big_play" audioFile="<?php echo $item["id"]; ?>" data-mime-type="<?php echo $item["mime"]; ?>">
<span class="ui-icon ui-icon-play"></span> <span class="ui-icon ui-icon-play"></span>
</div>
<?php elseif ($item['type'] == 1 && $item['exists']) : ?>
<div class="big_play" data-mime-type="<?php echo $item["mime"]; ?>">
<span class="ui-icon ui-icon-play"></span>
</div>
<?php elseif ($item['type'] == 2 && $item['exists']) : ?>
<div class="big_play" blockId="<?php echo $item["item_id"]; ?>" blocktype="<?php echo $staticBlock ? "static" : "dynamic" ?>">
<span class="ui-icon ui-icon-play"></span>
</div>
<?php else : ?>
<div class="big_play ui-state-hover">
<span class="ui-icon ui-icon-alert"></span>
</div>
<?php endif; ?>
<div class="text-row top">
<span class="spl_playlength"><?php echo $item["length"] ?></span>
<?php if ($item['type'] == 0) { ?>
<!-- <span class="spl_cue ui-state-default"></span> -->
<?php } else if ($item['type'] == 2) {
if ($staticBlock) { ?>
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"] ?>">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<?php echo _("Expand Static Block") ?>
</span>
<?php } else { ?>
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"] ?>">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<?php echo _("Expand Dynamic Block") ?>
</span>
<?php }
} ?>
<span class="spl_title"><?php echo $item['track_title'] ?></span>
</div>
<div class="text-row">
<span class="spl_artist"><?php echo $item['creator'] ?></span>
<span class="spl_offset"><?php echo $item["offset"] ?></span>
</div>
<?php //create the crossfade icon.
if (($i < count($items) - 1) && !($items[$i]['type'] == 2 && $items[$i + 1]['type'])) :
?>
<!-- <div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div> -->
<?php endif; ?>
<span id="remove_<?php echo $item["id"] ?>" class="ui-icon ui-icon-closethick"></span>
</div> </div>
<?php elseif ($item['type'] == 1 && $item['exists']): ?> <?php if ($item['type'] == 0) { ?>
<div class="big_play" data-mime-type="<?php echo $item["mime"]; ?>"> <div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none">
<span class="ui-icon ui-icon-play"></span> <?php echo $this->partial('playlist/set-cue.phtml', array(
</div> 'id' => $item["id"],
<?php elseif ($item['type'] == 2 && $item['exists']): ?> 'cueIn' => $item['cuein'],
<div class="big_play" blockId="<?php echo $item["item_id"]; ?>" blocktype="<?php echo $staticBlock?"static":"dynamic"?>"> 'cueOut' => $item['cueout'],
<span class="ui-icon ui-icon-play"></span> 'cueInSec' => $item['cueInSec'],
</div> 'cueOutSec' => $item['cueOutSec'],
<?php else:?> 'uri' => $fileUrl,
<div class="big_play ui-state-hover"> 'origLength' => $item['orig_length']
<span class="ui-icon ui-icon-alert"></span> )); ?>
</div> </div>
<?php endif; ?> <?php } ?>
<div class="text-row top">
<span class="spl_playlength"><?php echo $item["length"] ?></span>
<?php if ($item['type'] == 0) {?> <?php //create a fade editor box
<!-- <span class="spl_cue ui-state-default"></span> --> //(fadeout of current position + fade in of next position)
<?php } else if ($item['type'] == 2) { if (($i < count($items) - 1) && !($items[$i]['type'] == 2 && $items[$i + 1]['type'])) :
if ($staticBlock) {?>
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"]?>">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<?php echo _("Expand Static Block")?>
</span>
<?php } else { ?>
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"]?>">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<?php echo _("Expand Dynamic Block")?>
</span>
<?php }
} ?>
<span class="spl_title"><?php echo $item['track_title'] ?></span>
</div>
<div class="text-row">
<span class="spl_artist"><?php echo $item['creator'] ?></span>
<span class="spl_offset"><?php echo $item["offset"]?></span>
</div>
<?php //create the crossfade icon.
if (($i < count($items) -1) && !($items[$i]['type'] == 2 && $items[$i+1]['type'])):
?> ?>
<!-- <div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div> --> <div id="crossfade_<?php echo $i ?>-<?php echo $i + 1 ?>" class="crossfade clearfix" style="display: none">
<?php
$vars = array(
'item1' => $items[$i]['id'],
'fadeOut' => $items[$i]['fadeout'],
'fadeIn' => $items[$i + 1]['fadein'],
'item1Type' => $items[$i]['type'],
'cueIn1' => $items[$i]['cueInSec'],
'cueOut1' => $items[$i]['cueOutSec'],
'item1Url' => $fileUrl
);
$item2 = array(
'item2Url' => $nextFileUrl,
'item2' => $items[$i + 1]['id'],
'item2Type' => $items[$i + 1]['type'],
'offset' => $items[$i]['trackSec'] - $items[$i + 1]['trackoffset'],
'cueIn2' => $items[$i + 1]['cueInSec'],
'cueOut2' => $items[$i + 1]['cueOutSec']
);
if (isset($nextFileUrl)) {
$vars = $vars + $item2;
}
echo $this->partial('playlist/set-fade.phtml', $vars);
?>
</div>
<?php endif; ?> <?php endif; ?>
<span id="remove_<?php echo $item["id"] ?>" class="ui-icon ui-icon-closethick"></span> <?php if ($item['type'] == 2) { ?>
</div> <ul style='display:none' id="block_<?php echo $item["id"] ?>_info" class="smart-block-info expand-block-separate"></ul>
<?php if ($item['type'] == 0) {?> <?php } ?>
<div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none"> </li>
<?php echo $this->partial('playlist/set-cue.phtml', array( <?php $i = $i + 1; ?>
'id' => $item["id"], <?php endforeach; ?>
'cueIn' => $item['cuein'],
'cueOut' => $item['cueout'],
'cueInSec' => $item['cueInSec'],
'cueOutSec' => $item['cueOutSec'],
'uri' => $fileUrl,
'origLength' => $item['orig_length'])); ?>
</div>
<?php }?>
<?php //create a fade editor box
//(fadeout of current position + fade in of next position)
if(($i < count($items) -1) && !($items[$i]['type'] == 2 && $items[$i+1]['type'])):
?>
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none">
<?php
$vars = array(
'item1' => $items[$i]['id'],
'fadeOut' => $items[$i]['fadeout'],
'fadeIn' => $items[$i+1]['fadein'],
'item1Type' => $items[$i]['type'],
'cueIn1' => $items[$i]['cueInSec'],
'cueOut1' => $items[$i]['cueOutSec'],
'item1Url' => $fileUrl
);
$item2 = array(
'item2Url' => $nextFileUrl,
'item2' => $items[$i+1]['id'],
'item2Type' => $items[$i+1]['type'],
'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'],
'cueIn2' => $items[$i+1]['cueInSec'],
'cueOut2' => $items[$i+1]['cueOutSec']
);
if (isset($nextFileUrl)) {
$vars = $vars + $item2;
}
echo $this->partial('playlist/set-fade.phtml', $vars);
?>
</div>
<?php endif; ?>
<?php if ($item['type'] == 2) {?>
<ul style='display:none' id="block_<?php echo $item["id"]?>_info" class="smart-block-info expand-block-separate"></ul>
<?php } ?>
</li>
<?php $i = $i+1; ?>
<?php endforeach; ?>
<?php else : ?> <?php else : ?>
<div class="spl_empty"> <div class="spl_empty">
<?php <?php
if ($this->obj instanceof Application_Model_Block) { if ($this->obj instanceof Application_Model_Block) {
if ($this->obj->isStatic()) { if ($this->obj->isStatic()) {
echo _("Choose some search criteria above and click Generate to create this playlist."); echo _("Choose some search criteria above and click Generate to create this playlist.");
} else {
echo _("A track list will be generated when you schedule this smart block into a show.");
}
} else { } else {
echo _("A track list will be generated when you schedule this smart block into a show."); echo _("Drag tracks here from your library to add them to the playlist");
} }
} else { ?>
echo _("Drag tracks here from your library to add them to the playlist"); </div>
}
?>
</div>
<?php endif; ?> <?php endif; ?>

View File

@ -1 +1 @@
<?php echo $this->form; ?> <?php echo $this->form;

View File

@ -1,22 +1,22 @@
<div id="history_content" class=" alpha-block padded"> <div id="history_content" class=" alpha-block padded">
<h2><?php echo(_("Playout History"));?></h2> <h2><?php echo (_("Playout History")); ?></h2>
<?php echo $this->date_form; ?> <?php echo $this->date_form; ?>
<div id="his-tabs"> <div id="his-tabs">
<ul> <ul>
<?php if ($this->userType != UTYPE_HOST): ?> <?php if ($this->userType != UTYPE_HOST) : ?>
<li><a href="#his-tabs-1"><?php echo _("Log Sheet"); ?></a></li> <li><a href="#his-tabs-1"><?php echo _("Log Sheet"); ?></a></li>
<li><a href="#his-tabs-2"><?php echo _("File Summary"); ?></a></li> <li><a href="#his-tabs-2"><?php echo _("File Summary"); ?></a></li>
<?php endif; ?> <?php endif; ?>
<li><a href="#his-tabs-3"><?php echo _("Show Summary"); ?></a></li> <li><a href="#his-tabs-3"><?php echo _("Show Summary"); ?></a></li>
</ul> </ul>
<?php if ($this->userType != UTYPE_HOST): ?> <?php if ($this->userType != UTYPE_HOST) : ?>
<div id="his-tabs-1"> <div id="his-tabs-1">
<table id="history_table_list" cellpadding="0" cellspacing="0" class="datatable"></table> <table id="history_table_list" cellpadding="0" cellspacing="0" class="datatable"></table>
</div> </div>
<div id="his-tabs-2"> <div id="his-tabs-2">
<table id="history_table_aggregate" cellpadding="0" cellspacing="0" class="datatable"></table> <table id="history_table_aggregate" cellpadding="0" cellspacing="0" class="datatable"></table>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div id="his-tabs-3"> <div id="his-tabs-3">
<div id="history_show_summary"></div> <div id="history_show_summary"></div>

View File

@ -1,65 +1,69 @@
<div id="history_template" class="prefpanel alpha-block padded-strong"> <div id="history_template" class="prefpanel alpha-block padded-strong">
<div> <div>
<h2><?php echo(_("Playout History Templates"));?></h2> <h2><?php echo (_("Playout History Templates")); ?></h2>
<div><h4><?php echo _("Log Sheet Templates") ?></h4></div> <div>
<h4><?php echo _("Log Sheet Templates") ?></h4>
</div>
<button id="new_item_template" class="btn btn-new"><?php echo _("New Log Sheet Template") ?></button> <button id="new_item_template" class="btn btn-new"><?php echo _("New Log Sheet Template") ?></button>
<ul id="template_list"> <ul id="template_list">
<?php if (count($this->template_list) == 0): ?> <?php if (count($this->template_list) == 0) : ?>
<li><?php echo _("No Log Sheet Templates") ?></li> <li><?php echo _("No Log Sheet Templates") ?></li>
<?php endif; ?> <?php endif; ?>
<?php foreach ($this->template_list as $id=>$name): ?> <?php foreach ($this->template_list as $id => $name) : ?>
<?php if (in_array($id, $this->configured)): ?> <?php if (in_array($id, $this->configured)) : ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured"> <li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>"> <a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>">
<?php echo $name; ?> <?php echo $name; ?>
</a> </a>
<i class="icon icon-ok"></i> <i class="icon icon-ok"></i>
<?php else: ?> <?php else : ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>"> <li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>"> <a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>">
<?php echo $name; ?> <?php echo $name; ?>
</a> </a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistorytemplate/delete-template/id/{$id}"); ?>"> <a class="template_remove" href="<?php echo $this->baseUrl("Playouthistorytemplate/delete-template/id/{$id}"); ?>">
<i class="icon icon-trash"></i> <i class="icon icon-trash"></i>
</a> </a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistorytemplate/set-template-default/format/json/id/{$id}"); ?>"> <a class="template_default" href="<?php echo $this->baseUrl("Playouthistorytemplate/set-template-default/format/json/id/{$id}"); ?>">
<?php echo _("Set Default") ?> <?php echo _("Set Default") ?>
</a> </a>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
<br><br> <br><br>
<div> <div>
<div><h4><?php echo _("File Summary Templates") ?></h4></div> <div>
<h4><?php echo _("File Summary Templates") ?></h4>
</div>
<button id="new_file_template" class="btn btn-new"><?php echo _("New File Summary Template") ?></button> <button id="new_file_template" class="btn btn-new"><?php echo _("New File Summary Template") ?></button>
<ul id="template_file"> <ul id="template_file">
<?php if (count($this->template_file) == 0): ?> <?php if (count($this->template_file) == 0) : ?>
<li><?php echo _("No File Summary Templates") ?></li> <li><?php echo _("No File Summary Templates") ?></li>
<?php endif; ?> <?php endif; ?>
<?php foreach ($this->template_file as $id=>$name): ?> <?php foreach ($this->template_file as $id => $name) : ?>
<?php if (in_array($id, $this->configured)): ?> <?php if (in_array($id, $this->configured)) : ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured"> <li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>"> <a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>">
<?php echo $name; ?> <?php echo $name; ?>
</a> </a>
<i class="icon icon-ok"></i> <i class="icon icon-ok"></i>
<?php else: ?> <?php else : ?>
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>"> <li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>"> <a class="template_name" href="<?php echo $this->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); ?>">
<?php echo $name; ?> <?php echo $name; ?>
</a> </a>
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistorytemplate/delete-template/id/{$id}"); ?>"> <a class="template_remove" href="<?php echo $this->baseUrl("Playouthistorytemplate/delete-template/id/{$id}"); ?>">
<i class="icon icon-trash"></i> <i class="icon icon-trash"></i>
</a> </a>
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistorytemplate/set-template-default/format/json/id/{$id}"); ?>"> <a class="template_default" href="<?php echo $this->baseUrl("Playouthistorytemplate/set-template-default/format/json/id/{$id}"); ?>">
<?php echo _("Set Default") ?> <?php echo _("Set Default") ?>
</a> </a>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -1,44 +1,38 @@
<?php if ($this->template_type == Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?> <?php if ($this->template_type == Application_Service_HistoryService::TEMPLATE_TYPE_FILE) : ?>
<h4><?php echo _("Creating File Summary Template") ?></h4> <h4><?php echo _("Creating File Summary Template") ?></h4>
<?php else: ?> <?php else : ?>
<h4><?php echo _("Creating Log Sheet Template") ?></h4> <h4><?php echo _("Creating Log Sheet Template") ?></h4>
<?php endif; ?> <?php endif; ?>
<div class="template_name_wrap"> <div class="template_name_wrap">
<label> <label>
<?php echo _("Name") ?> <?php echo _("Name") ?>
<input id="template_name" type="text" value="<?php echo $this->template_name; ?>"> <input id="template_name" type="text" value="<?php echo $this->template_name; ?>">
</label> </label>
<?php $i = 0; <?php $i = 0;
$usedFileMD = array(); $usedFileMD = array();
?> ?>
<ul class="template_item_list"> <ul class="template_item_list">
<?php foreach ($this->template_fields as $field): ?> <?php foreach ($this->template_fields as $field) : ?>
<?php if($field["isFileMd"]) { <?php if ($field["isFileMd"]) {
$usedFileMD[] = $field["name"]; $usedFileMD[] = $field["name"];
} ?> } ?>
<li id="<?php echo "field_".$i?>" <li id="<?php echo "field_" . $i ?>" data-id="<?php echo isset($field["id"]) ? $field["id"] : ""; ?>" data-name="<?php echo $field["name"] ?>" data-label="<?php echo $field["label"] ?>" data-type="<?php echo $field["type"] ?>" data-filemd="<?php echo var_export($field["isFileMd"], true) ?>" class="<?php echo ($field["isFileMd"]) ? 'field_filemd' : 'field_other' ?>">
data-id="<?php echo isset($field["id"]) ? $field["id"] : ""; ?>" <span><?php echo $field["label"] ?></span>
data-name="<?php echo $field["name"]?>" <span><?php echo $field["type"] ?></span>
data-label="<?php echo $field["label"]?>" <?php if (!in_array($field["name"], $this->required_fields)) : ?>
data-type="<?php echo $field["type"]?>" <span class="template_item_remove">
data-filemd="<?php echo var_export($field["isFileMd"], true)?>" <i class="icon icon-trash"></i>
class="<?php echo ($field["isFileMd"]) ? 'field_filemd' : 'field_other' ?>"> </span>
<span><?php echo $field["label"]?></span> <?php endif; ?>
<span><?php echo $field["type"]?></span> </li>
<?php if(!in_array($field["name"], $this->required_fields)): ?> <?php $i++; ?>
<span class="template_item_remove">
<i class="icon icon-trash"></i>
</span>
<?php endif; ?>
</li>
<?php $i++; ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
<div class="add_more"> <div class="add_more">
@ -46,41 +40,38 @@
<p><?php echo _("Add more elements") ?>:</p> <p><?php echo _("Add more elements") ?>:</p>
<ul class="template_file_md"> <ul class="template_file_md">
<?php foreach ($this->fileMD as $md): ?> <?php foreach ($this->fileMD as $md) : ?>
<?php if(in_array($md["name"], $usedFileMD)) { <?php if (in_array($md["name"], $usedFileMD)) {
continue; continue;
} ?> } ?>
<li id="<?php echo "md_".$md["name"]?>" <li id="<?php echo "md_" . $md["name"] ?>" data-name="<?php echo $md["name"] ?>" data-type="<?php echo $md["type"] ?>" data-label="<?php echo $md["label"] ?>">
data-name="<?php echo $md["name"]?>" <?php echo $md["label"] ?>
data-type="<?php echo $md["type"]?>" <a class="field_add" href="#"><i class="icon icon-plus"></i></a>
data-label="<?php echo $md["label"]?>"> </li>
<?php echo $md["label"] ?> <?php endforeach; ?>
<a class="field_add" href="#"><i class="icon icon-plus"></i></a>
</li>
<?php endforeach; ?>
</ul> </ul>
<?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?> <?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE) : ?>
<div class="template_item_add"> <div class="template_item_add">
<input type="text" placeholder="<?php echo _("Add New Field") ?>"> <input type="text" placeholder="<?php echo _("Add New Field") ?>">
<select> <select>
<?php foreach ($this->fields as $field): ?> <?php foreach ($this->fields as $field) : ?>
<option value="<?php echo $field; ?>"><?php echo _($field); ?></option> <option value="<?php echo $field; ?>"><?php echo _($field); ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<button class="btn"> <button class="btn">
<i class="icon-white icon-plus"></i> <i class="icon-white icon-plus"></i>
<?php echo _("Add") ?> <?php echo _("Add") ?>
</button> </button>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div> <div>
<?php if (!in_array($this->template_id, $this->configured)): ?> <?php if (!in_array($this->template_id, $this->configured)) : ?>
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Set Default Template") ?></button> <button id="template_set_default" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Set Default Template") ?></button>
<?php endif; ?> <?php endif; ?>
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Save") ?></button> <button id="template_item_save" data-template="<?php echo $this->template_id; ?>" class="btn"><?php echo _("Save") ?></button>
</div> </div>

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: asantoni * User: asantoni
@ -8,6 +9,6 @@
?> ?>
<div class="content-pane" style="width: 100%"> <div class="content-pane" style="width: 100%">
<?php require(__DIR__."/featureupgrade.phtml"); ?> <?php require(__DIR__ . "/featureupgrade.phtml"); ?>
</div> </div>

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: asantoni * User: asantoni
@ -7,7 +8,7 @@
*/ */
?> ?>
<?php require(__DIR__."/featureupgrade.phtml"); ?> <?php require(__DIR__ . "/featureupgrade.phtml"); ?>
<div class="angular_wrapper" ng-controller="Publish"> <div class="angular_wrapper" ng-controller="Publish">

View File

@ -6,10 +6,10 @@
</div> </div>
<div class="inner_editor_wrapper"> <div class="inner_editor_wrapper">
<form class="podcast-metadata"> <form class="podcast-metadata">
<input ng-value="podcast.id" class="obj_id" type="hidden"/> <input ng-value="podcast.id" class="obj_id" type="hidden" />
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label for="podcast_name"><?php echo _("Podcast Name: ") ?></label> <label for="podcast_name"><?php echo _("Podcast Name: ") ?></label>
<input name="podcast_name" type="text" ng-model="podcast.title" value={{podcast.title}} > <input name="podcast_name" type="text" ng-model="podcast.title" value={{podcast.title}}>
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label for="podcast_url"><?php echo _("Podcast URL: ") ?></label> <label for="podcast_url"><?php echo _("Podcast URL: ") ?></label>
@ -18,10 +18,10 @@
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label for="podcast_auto_ingest"><?php echo _("Download latest episodes:") ?></label> <label for="podcast_auto_ingest"><?php echo _("Download latest episodes:") ?></label>
<div> <div>
<input name="podcast_auto_ingest" id="podcast_auto_ingest" ng-model="podcast.auto_ingest" type="checkbox"/> <input name="podcast_auto_ingest" id="podcast_auto_ingest" ng-model="podcast.auto_ingest" type="checkbox" />
</div> </div>
</div> </div>
<div class="podcast-metadata-row" > <div class="podcast-metadata-row">
<label><?php echo _("Scheduling:") ?></label> <label><?php echo _("Scheduling:") ?></label>
<div> <div>
<button ng-click="createSmartblock()" class="btn" type="button" name="smartblock"> <button ng-click="createSmartblock()" class="btn" type="button" name="smartblock">
@ -33,7 +33,7 @@
</form> </form>
</div> </div>
<table class="datatable podcast_episodes" cellpadding="0" cellspacing="0"></table> <table class="datatable podcast_episodes" cellpadding="0" cellspacing="0"></table>
<div class="btn-toolbar clearfix"> <div class="btn-toolbar clearfix">
<div class="btn-group pull-right"> <div class="btn-group pull-right">

View File

@ -9,7 +9,7 @@
</label> </label>
</td> </td>
<td style="text-align: right"> <td style="text-align: right">
<input id="podcast_url_field" type="url" name="url" size="40" style="margin-left: 10px; margin-bottom: 10px;" placeholder="http://example.com/podcast.xml"/> <input id="podcast_url_field" type="url" name="url" size="40" style="margin-left: 10px; margin-bottom: 10px;" placeholder="http://example.com/podcast.xml" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -15,18 +15,18 @@
</div> </div>
<form class="podcast-metadata"> <form class="podcast-metadata">
<?php echo $this->form->getElement('csrf') ?> <?php echo $this->form->getElement('csrf') ?>
<input ng-value="podcast.id" class="obj_id" type="hidden"/> <input ng-value="podcast.id" class="obj_id" type="hidden" />
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("General Fields") ?></h3> <h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("General Fields") ?></h3>
<div class="collapsible-content"> <div class="collapsible-content">
<fieldset class="padded"> <fieldset class="padded">
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Name") ?></label> <label><?php echo _("Name") ?></label>
<input name="podcast_name" ng-model="podcast.title" type="text"/> <input name="podcast_name" ng-model="podcast.title" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Creator") ?></label> <label><?php echo _("Creator") ?></label>
<input name="podcast_creator" ng-model="podcast.creator" type="text"/> <input name="podcast_creator" ng-model="podcast.creator" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
@ -37,20 +37,20 @@
<label><?php echo _("Language") ?></label> <label><?php echo _("Language") ?></label>
<select name="podcast_language" ng-model="podcast.language"> <select name="podcast_language" ng-model="podcast.language">
<?php <?php
foreach(Application_Common_LocaleHelper::getISO6391LanguageCodes() as $code=>$lang) { foreach (Application_Common_LocaleHelper::getISO6391LanguageCodes() as $code => $lang) {
echo "<option value='$code'>$lang</option>"; echo "<option value='$code'>$lang</option>";
} }
?> ?>
</select> </select>
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Copyright") ?></label> <label><?php echo _("Copyright") ?></label>
<input name="podcast_copyright" ng-model="podcast.copyright" type="text"/> <input name="podcast_copyright" ng-model="podcast.copyright" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Link") ?></label> <label><?php echo _("Link") ?></label>
<input name="podcast_link" ng-model="podcast.link" type="url"/> <input name="podcast_link" ng-model="podcast.link" type="url" />
</div> </div>
</fieldset> </fieldset>
</div> </div>
@ -60,12 +60,12 @@
<fieldset class="padded"> <fieldset class="padded">
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Author") ?></label> <label><?php echo _("Author") ?></label>
<input name="podcast_itunes_author" ng-model="podcast.itunes_author" type="text"/> <input name="podcast_itunes_author" ng-model="podcast.itunes_author" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Keywords") ?></label> <label><?php echo _("Keywords") ?></label>
<input name="podcast_itunes_keywords" ng-model="podcast.itunes_keywords" type="text"/> <input name="podcast_itunes_keywords" ng-model="podcast.itunes_keywords" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
@ -80,12 +80,12 @@
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Category") ?></label> <label><?php echo _("Category") ?></label>
<input name="podcast_itunes_category" ng-model="podcast.itunes_category" type="text"/> <input name="podcast_itunes_category" ng-model="podcast.itunes_category" type="text" />
</div> </div>
<div class="podcast-metadata-row"> <div class="podcast-metadata-row">
<label><?php echo _("Explicit") ?></label> <label><?php echo _("Explicit") ?></label>
<input name="podcast_itunes_explicit" ng-model="podcast.itunes_explicit" type="checkbox"/> <input name="podcast_itunes_explicit" ng-model="podcast.itunes_explicit" type="checkbox" />
</div> </div>
</fieldset> </fieldset>
</div> </div>
@ -114,10 +114,14 @@
</div> </div>
<p id="station_podcast_help_text"> <p id="station_podcast_help_text">
<?php echo(sprintf(_("For detailed information on what these metadata fields mean, please see the %sRSS specification%s <?php echo (sprintf(
_("For detailed information on what these metadata fields mean, please see the %sRSS specification%s
or %sApple's podcasting documentation%s."), or %sApple's podcasting documentation%s."),
'<a href="http://cyber.law.harvard.edu/rss/rss.html#requiredChannelElements">', '</a>', '<a href="http://cyber.law.harvard.edu/rss/rss.html#requiredChannelElements">',
'<a target="_blank" href="http://www.apple.com/ca/itunes/podcasts/specs.html">', "</a>")); ?> '</a>',
'<a target="_blank" href="http://www.apple.com/ca/itunes/podcasts/specs.html">',
"</a>"
)); ?>
</p> </p>
</form> </form>
@ -135,7 +139,7 @@
</div> </div>
</div> </div>
<script> <script>
$(document).ready(function () { $(document).ready(function() {
<?php echo "var podcast = " . $this->podcast . ";" ?> <?php echo "var podcast = " . $this->podcast . ";" ?>
AIRTIME.podcast.podcastApp.value('podcast', podcast); AIRTIME.podcast.podcastApp.value('podcast', podcast);
AIRTIME.podcast.podcastApp.value('tab', null); AIRTIME.podcast.podcastApp.value('tab', null);

View File

@ -1,4 +1,4 @@
<div id="watched-folder-section" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong manage-folders"> <div id="watched-folder-section" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong manage-folders">
<h2><?php echo _("Manage Media Folders") ?></h2> <h2><?php echo _("Manage Media Folders") ?></h2>
<?php echo $this->form; ?> <?php echo $this->form; ?>
</div> </div>

View File

@ -16,8 +16,8 @@
<?php <?php
if (!$this->addNewShow) { if (!$this->addNewShow) {
$this->when->getElement('add_show_timezone')->setOptions(array('disabled' => true)); $this->when->getElement('add_show_timezone')->setOptions(array('disabled' => true));
?> ?>
<input type="hidden" name="add_show_timezone" id="add_show_timezone" value=<?php echo $this->when->getElement('add_show_timezone')->getValue()?>> <input type="hidden" name="add_show_timezone" id="add_show_timezone" value=<?php echo $this->when->getElement('add_show_timezone')->getValue() ?>>
<?php <?php
} }
?> ?>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->entries; echo $this->entries;
?>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->data; echo $this->data;
?>

View File

@ -1,15 +1,14 @@
<table id="schedule_block_table"> <table id="schedule_block_table">
<tr> <tr>
<td> <td>
<form id="add-show-form" method="post" action="" style="display:none;"> <form id="add-show-form" method="post" action="" style="display:none;">
<?php if($this->preloadShowForm){ <?php if ($this->preloadShowForm) {
echo $this->render('schedule/add-show-form.phtml'); echo $this->render('schedule/add-show-form.phtml');
}?> } ?>
</form> </form>
</td> </td>
<td id="schedule_calendar_cell"> <td id="schedule_calendar_cell">
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div> <div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -1,31 +1,35 @@
<div id="show_content_dialog"> <div id="show_content_dialog">
<div><?php echo $this->additionalShowInfo; ?></div> <div><?php echo $this->additionalShowInfo; ?></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
<tr> <tr>
<th><?php echo _("Start") ?></th> <th><?php echo _("Start") ?></th>
<th><?php echo _("Title") ?></th> <th><?php echo _("Title") ?></th>
<th><?php echo _("Creator") ?></th> <th><?php echo _("Creator") ?></th>
<th><?php echo _("Album") ?></th> <th><?php echo _("Album") ?></th>
<th><?php echo _("Length") ?></th> <th><?php echo _("Length") ?></th>
<th><?php echo _("Genre") ?></th> <th><?php echo _("Genre") ?></th>
</tr> </tr>
<?php $i=0; ?> <?php $i = 0; ?>
<?php foreach($this->showContent as $row): ?> <?php foreach ($this->showContent as $row) : ?>
<tr id="au_<?php echo $row["item_id"] ?>" class="<?php if($i&1){echo "even";}else{echo "odd";}?>"> <tr id="au_<?php echo $row["item_id"] ?>" class="<?php if ($i & 1) {
<td><?php echo $row["starts"] ?></td> echo "even";
<td><?php echo $this->escape($row["track_title"]) ?></td> } else {
<td><?php echo $this->escape($row["creator"]) ?></td> echo "odd";
<td><?php echo $this->escape($row["album"]) ?></td> } ?>">
<td class="library_length"><?php echo $row["length"] ?></td> <td><?php echo $row["starts"] ?></td>
<td><?php echo $row["genre"] ?></td> <td><?php echo $this->escape($row["track_title"]) ?></td>
</tr> <td><?php echo $this->escape($row["creator"]) ?></td>
<?php $i=$i+1; ?> <td><?php echo $this->escape($row["album"]) ?></td>
<?php endforeach; ?> <td class="library_length"><?php echo $row["length"] ?></td>
</table> <td><?php echo $row["genre"] ?></td>
<br/> </tr>
<div id="show_time_info"> <?php $i = $i + 1; ?>
<span id="show_time_filled" class="time"><?php echo $this->timeFilled; ?></span> <?php endforeach; ?>
<div id="show_progressbar"></div> </table>
<span id="show_length" class="time"><?php echo $this->showLength; ?></span> <br />
</div> <div id="show_time_info">
<span id="show_time_filled" class="time"><?php echo $this->timeFilled; ?></span>
<div id="show_progressbar"></div>
<span id="show_length" class="time"><?php echo $this->showLength; ?></span>
</div>
</div> </div>

View File

@ -1,13 +1,15 @@
<div><!-- jQuery UI changes the styling on the outermost div; use a blank div so as not to break the .wrapper styling--> <div>
<!-- jQuery UI changes the styling on the outermost div; use a blank div so as not to break the .wrapper styling-->
<div class="wrapper"> <div class="wrapper">
<div id="media_selector_wrapper"> <div id="media_selector_wrapper">
<?php $subnavPrefix = ""; require_once APPLICATION_PATH . "/views/scripts/partialviews/dashboard-sub-nav.php"; ?> <?php $subnavPrefix = "";
require_once APPLICATION_PATH . "/views/scripts/partialviews/dashboard-sub-nav.php"; ?>
</div> </div>
<?php echo $this->csrf ?> <?php echo $this->csrf ?>
<div id="library_content" class="lib-content tabs content-pane wide-panel"> <div id="library_content" class="lib-content tabs content-pane wide-panel">
<div> <div>
<h2 id="library_title"><?php echo _("Dashboard")." - " ?><span id="library_filter"></span></h2> <h2 id="library_title"><?php echo _("Dashboard") . " - " ?><span id="library_filter"></span></h2>
</div> </div>
<div class="panel-header-calendar"> <div class="panel-header-calendar">
<div id="advanced-options" class="btn-group"> <div id="advanced-options" class="btn-group">

View File

@ -2,7 +2,7 @@
<div id="library_content" class="lib-content tabs content-pane wide-panel"> <div id="library_content" class="lib-content tabs content-pane wide-panel">
<div> <div>
<h2 id="library_title"><?php echo _("Dashboard")." - " ?><span id="library_filter"></span></h2> <h2 id="library_title"><?php echo _("Dashboard") . " - " ?><span id="library_filter"></span></h2>
</div> </div>
<div class="panel-header"> <div class="panel-header">
<div id="advanced-options" class="btn-group"> <div id="advanced-options" class="btn-group">

View File

@ -3,22 +3,22 @@
</head> </head>
<?php <?php
$phpDependencies = checkPhpDependencies(); $phpDependencies = checkPhpDependencies();
$externalServices = checkExternalServices(); $externalServices = checkExternalServices();
$postgres = $phpDependencies["postgres"]; $postgres = $phpDependencies["postgres"];
$database = $externalServices["database"]; $database = $externalServices["database"];
$rabbitmq = $externalServices["rabbitmq"]; $rabbitmq = $externalServices["rabbitmq"];
$pypo = $externalServices["pypo"]; $pypo = $externalServices["pypo"];
$liquidsoap = $externalServices["liquidsoap"]; $liquidsoap = $externalServices["liquidsoap"];
$analyzer = $externalServices["analyzer"]; $analyzer = $externalServices["analyzer"];
$celery = $externalServices['celery']; $celery = $externalServices['celery'];
$api = $externalServices['api']; $api = $externalServices['api'];
$r1 = array_reduce($phpDependencies, "booleanReduce", true); $r1 = array_reduce($phpDependencies, "booleanReduce", true);
$r2 = array_reduce($externalServices, "booleanReduce", true); $r2 = array_reduce($externalServices, "booleanReduce", true);
$result = $r1 && $r2; $result = $r1 && $r2;
?> ?>
<table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable"> <table width="60%" cellpadding="0" cellspacing="0" border="0" class="statustable">
@ -41,14 +41,15 @@
<td class="description"> <td class="description">
<?php echo _("PDO and PostgreSQL libraries") ?> <?php echo _("PDO and PostgreSQL libraries") ?>
</td> </td>
<td class="solution <?php if ($postgres) {echo 'check';?>"> <td class="solution <?php if ($postgres) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
Try running <code>sudo apt-get install php7-pgsql</code> Try running <code>sudo apt-get install php7-pgsql</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -58,16 +59,17 @@
<td class="description"> <td class="description">
<?php echo _("Database configuration for LibreTime") ?> <?php echo _("Database configuration for LibreTime") ?>
</td> </td>
<td class="solution <?php if ($database) {echo 'check';?>"> <td class="solution <?php if ($database) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
Make sure you aren't missing any of the Postgres dependencies in the table above. Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in If your dependencies check out, make sure your database configuration settings in
<code>/etc/libretime/config.yml</code> are correct and the LibreTime database was installed correctly. <code>/etc/libretime/config.yml</code> are correct and the LibreTime database was installed correctly.
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -77,18 +79,19 @@
<td class="description"> <td class="description">
<?php echo _("RabbitMQ configuration for LibreTime") ?> <?php echo _("RabbitMQ configuration for LibreTime") ?>
</td> </td>
<td class="solution <?php if ($rabbitmq) {echo 'check';?>"> <td class="solution <?php if ($rabbitmq) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
Make sure RabbitMQ is installed correctly, and that your settings in /etc/libretime/config.yml Make sure RabbitMQ is installed correctly, and that your settings in /etc/libretime/config.yml
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code> are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-analyzer, airtime-pypo, <code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-analyzer, airtime-pypo,
and airtime-uploads. and airtime-uploads.
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -98,17 +101,18 @@
<td class="description"> <td class="description">
<?php echo _("LibreTime media analyzer service") ?> <?php echo _("LibreTime media analyzer service") ?>
</td> </td>
<td class="solution <?php if ($analyzer) {echo 'check';?>"> <td class="solution <?php if ($analyzer) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
<?php echo _("Check that the libretime-analyzer service is installed correctly in ") ?><code>/etc/systemd/system/</code>, <?php echo _("Check that the libretime-analyzer service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with ") ?> <?php echo _(" and ensure that it's running with ") ?>
<br/><code>systemctl status libretime-analyzer</code><br/> <br /><code>systemctl status libretime-analyzer</code><br />
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-analyzer</code> <?php echo _("If not, try ") ?><br /><code>sudo systemctl restart libretime-analyzer</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -118,17 +122,18 @@
<td class="description"> <td class="description">
<?php echo _("LibreTime playout service") ?> <?php echo _("LibreTime playout service") ?>
</td> </td>
<td class="solution <?php if ($pypo) {echo 'check';?>"> <td class="solution <?php if ($pypo) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
<?php echo _("Check that the libretime-playout service is installed correctly in ") ?><code>/etc/systemd/system/</code>, <?php echo _("Check that the libretime-playout service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with ") ?> <?php echo _(" and ensure that it's running with ") ?>
<br/><code>systemctl status libretime-playout</code><br/> <br /><code>systemctl status libretime-playout</code><br />
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-playout</code> <?php echo _("If not, try ") ?><br /><code>sudo systemctl restart libretime-playout</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -138,17 +143,18 @@
<td class="description"> <td class="description">
<?php echo _("LibreTime liquidsoap service") ?> <?php echo _("LibreTime liquidsoap service") ?>
</td> </td>
<td class="solution <?php if ($liquidsoap) {echo 'check';?>" > <td class="solution <?php if ($liquidsoap) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
<?php echo _("Check that the libretime-liquidsoap service is installed correctly in ") ?><code>/etc/systemd/system/</code>, <?php echo _("Check that the libretime-liquidsoap service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with ") ?> <?php echo _(" and ensure that it's running with ") ?>
<br/><code>systemctl status libretime-liquidsoap</code><br/> <br /><code>systemctl status libretime-liquidsoap</code><br />
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-liquidsoap</code> <?php echo _("If not, try ") ?><br /><code>sudo systemctl restart libretime-liquidsoap</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -158,17 +164,18 @@
<td class="description"> <td class="description">
<?php echo _("LibreTime Celery Task service") ?> <?php echo _("LibreTime Celery Task service") ?>
</td> </td>
<td class="solution <?php if ($celery) {echo 'check';?>" > <td class="solution <?php if ($celery) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
<?php echo _("Check that the libretime-celery service is installed correctly in ") ?><code>/etc/systemd/system/</code>, <?php echo _("Check that the libretime-celery service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with ") ?> <?php echo _(" and ensure that it's running with ") ?>
<br/><code>systemctl status libretime-celery</code><br/> <br /><code>systemctl status libretime-celery</code><br />
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-celery</code> <?php echo _("If not, try ") ?><br /><code>sudo systemctl restart libretime-celery</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -178,17 +185,18 @@
<td class="description"> <td class="description">
<?php echo _("LibreTime API service") ?> <?php echo _("LibreTime API service") ?>
</td> </td>
<td class="solution <?php if ($api) {echo 'check';?>" > <td class="solution <?php if ($api) {
echo 'check'; ?>">
<?php <?php
} else { } else {
?>"> ?>">
<?php echo _("Check that the libretime-api service is installed correctly in ") ?><code>/etc/systemd/system/</code>, <?php echo _("Check that the libretime-api service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
<?php echo _(" and ensure that it's running with ") ?> <?php echo _(" and ensure that it's running with ") ?>
<br/><code>systemctl status libretime-api</code><br/> <br /><code>systemctl status libretime-api</code><br />
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-api</code> <?php echo _("If not, try ") ?><br /><code>sudo systemctl restart libretime-api</code>
<?php <?php
} }
?> ?>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -1,4 +1,3 @@
<div class="ui-widget prefpanel clearfix padded-strong tracktype-management"> <div class="ui-widget prefpanel clearfix padded-strong tracktype-management">
<h2><?php echo _("Manage Track Types") ?></h2> <h2><?php echo _("Manage Track Types") ?></h2>
@ -8,7 +7,7 @@
<div class="button-holder"> <div class="button-holder">
<button type="button" id="add_tracktype_button" name="search_add_group" class="ui-button ui-widget ui-button-text-icon-primary btn"> <button type="button" id="add_tracktype_button" name="search_add_group" class="ui-button ui-widget ui-button-text-icon-primary btn">
<span class="ui-icon ui-icon-plusthick"></span> <span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text"><?php echo _("New Track Type")?></span> <span class="ui-button-text"><?php echo _("New Track Type") ?></span>
</button> </button>
</div> </div>
@ -17,9 +16,9 @@
<tr> <tr>
<th><?php echo _("id") ?></th> <th><?php echo _("id") ?></th>
<th><?php echo _("Code") ?></th> <th><?php echo _("Code") ?></th>
<th><?php echo _("Label")?></th> <th><?php echo _("Label") ?></th>
<th><?php echo _("Description")?></th> <th><?php echo _("Description") ?></th>
<th><?php echo _("Visibility")?></th> <th><?php echo _("Visibility") ?></th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</thead> </thead>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->entries; echo $this->entries;
?>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->entries; echo $this->entries;
?>

View File

@ -7,7 +7,7 @@
<div class="button-holder"> <div class="button-holder">
<button type="button" id="add_user_button" name="search_add_group" class="ui-button ui-widget ui-button-text-icon-primary btn"> <button type="button" id="add_user_button" name="search_add_group" class="ui-button ui-widget ui-button-text-icon-primary btn">
<span class="ui-icon ui-icon-plusthick"></span> <span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text"><?php echo _("New User")?></span> <span class="ui-button-text"><?php echo _("New User") ?></span>
</button> </button>
</div> </div>
@ -16,9 +16,9 @@
<tr> <tr>
<th><?php echo _("id") ?></th> <th><?php echo _("id") ?></th>
<th><?php echo _("Username") ?></th> <th><?php echo _("Username") ?></th>
<th><?php echo _("First Name")?></th> <th><?php echo _("First Name") ?></th>
<th><?php echo _("Last Name")?></th> <th><?php echo _("Last Name") ?></th>
<th><?php echo _("User Type")?></th> <th><?php echo _("User Type") ?></th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</thead> </thead>

View File

@ -1,4 +1,4 @@
<div class="prefpanel clearfix padded-strong edit-current-user"> <div class="prefpanel clearfix padded-strong edit-current-user">
<?php echo $this->successMessage ?> <?php echo $this->successMessage ?>
<?php echo $this->form?> <?php echo $this->form ?>
</div> </div>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->entries; echo $this->entries;
?>

View File

@ -1,3 +1,2 @@
<?php <?php
echo $this->entries; echo $this->entries;
?>

View File

@ -1,43 +1,44 @@
<?php if (isset($this->obj)) : ?> <?php if (isset($this->obj)) : ?>
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/> <input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>" />
<input class="obj_lastMod" type="hidden" value="<?php echo "1";//$this->obj->getLastModified('U'); ?>"/> <input class="obj_lastMod" type="hidden" value="<?php echo "1"; //$this->obj->getLastModified('U');
<input class="obj_type" type="hidden" value="webstream"/> ?>" />
<input class="obj_type" type="hidden" value="webstream" />
<div class="status" style="display:none;"></div> <div class="status" style="display:none;"></div>
<div class="inner_editor_title"> <div class="inner_editor_title">
<H2><?php echo(_("Editing "));?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName; <H2><?php echo (_("Editing ")); ?>"<span class="title_obj_name"><?php if (isset($this->unsavedName)) echo $this->unsavedName;
else echo $this->escape($this->obj->getName());?></span>"</H2> else echo $this->escape($this->obj->getName()); ?></span>"</H2>
</div> </div>
<div class="inner_editor_wrapper"> <div class="inner_editor_wrapper">
<dl class="zend_form side_playlist playlist_editor"> <dl class="zend_form side_playlist playlist_editor">
<dt> <dt>
<label><?php echo(_("Name:")); ?></label> <label><?php echo (_("Name:")); ?></label>
</dt> </dt>
<dd> <dd>
<div id="name-error" class="errors" style="display:none;"></div> <div id="name-error" class="errors" style="display:none;"></div>
<input class="playlist_name_display" type="text" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>"> <input class="playlist_name_display" type="text" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>">
</dd> </dd>
<dt id="description-label"><label for="description"><?php echo _("Description") ?></label></dt> <dt id="description-label"><label for="description"><?php echo _("Description") ?></label></dt>
<dd id="description-element"> <dd id="description-element">
<textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea> <textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea>
</dd> </dd>
<dt id="submit-label" style="display: none;">&nbsp;</dt> <dt id="submit-label" style="display: none;">&nbsp;</dt>
<div id="url-error" class="errors" style="display:none;"></div> <div id="url-error" class="errors" style="display:none;"></div>
<dt id="streamurl-label"><label for="streamurl"><?php echo _("Stream URL:"); ?></label></dt> <dt id="streamurl-label"><label for="streamurl"><?php echo _("Stream URL:"); ?></label></dt>
<dd id="streamurl-element"> <dd id="streamurl-element">
<input type="url" value="<?php echo $this->obj->getUrl(); ?>" size="40"/> <input type="url" value="<?php echo $this->obj->getUrl(); ?>" size="40" />
</dd> </dd>
<div id="length-error" class="errors" style="display:none;"></div> <div id="length-error" class="errors" style="display:none;"></div>
<dt id="streamlength-label"><label for="streamlength"><?php echo _("Default Length:"); ?></label></dt> <dt id="streamlength-label"><label for="streamlength"><?php echo _("Default Length:"); ?></label></dt>
<dd id="streamlength-element"> <dd id="streamlength-element">
<input type="text" value="<?php echo $this->obj->getDefaultLength() ?>"/> <input type="text" value="<?php echo $this->obj->getDefaultLength() ?>" />
</dd> </dd>
</dl> </dl>
</div> </div>
<div class="btn-toolbar clearfix"> <div class="btn-toolbar clearfix">

View File

@ -1,5 +1,5 @@
$(document).ready(function() { $(document).ready(function () {
$.ajaxSetup({ $.ajaxSetup({
cache: false cache: false,
}); });
}); });

View File

@ -3,246 +3,273 @@ var _idToPostionLookUp;
var URL_BAR_HEIGHT = 32; var URL_BAR_HEIGHT = 32;
/** /**
*When the page loads the ready function will get all the data it can from the hidden span elements *When the page loads the ready function will get all the data it can from the hidden span elements
*and call one of three functions depending on weather the window was open to play an audio file, *and call one of three functions depending on weather the window was open to play an audio file,
*or a playlist or a show. *or a playlist or a show.
*/ */
$(document).ready(function(){ $(document).ready(function () {
$.jPlayer.timeFormat.showHour = true;
$.jPlayer.timeFormat.showHour = true; var audioUri = $(".audioUri").text();
var audioMime = $(".audioMime").text();
var playlistID = $(".playlistID").text();
var playlistIndex = $(".playlistIndex").text();
var showID = $(".showID").text();
var showIndex = $(".showIndex").text();
var blockId = $(".blockId").text();
var blockIndex = $(".blockIndex").text();
var audioUri = $('.audioUri').text(); _playlist_jplayer = new jPlayerPlaylist(
var audioMime = $('.audioMime').text();
var playlistID = $('.playlistID').text();
var playlistIndex = $('.playlistIndex').text();
var showID = $('.showID').text();
var showIndex = $('.showIndex').text();
var blockId = $('.blockId').text();
var blockIndex = $('.blockIndex').text();
_playlist_jplayer = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
},[], //array of songs will be filled with below's json call
{ {
swfPath: baseUrl+"js/jplayer", jPlayer: "#jquery_jplayer_1",
supplied:"oga, mp3, m4v, m4a, wav", cssSelectorAncestor: "#jp_container_1",
size: { },
width: "0px", [], //array of songs will be filled with below's json call
height: "0px", {
cssClass: "jp-video-270p" swfPath: baseUrl + "js/jplayer",
}, supplied: "oga, mp3, m4v, m4a, wav",
playlistOptions: { size: {
autoPlay: false, width: "0px",
loopOnPrevious: false, height: "0px",
shuffleOnLoop: true, cssClass: "jp-video-270p",
enableRemoveControls: false, },
displayTime: 0, playlistOptions: {
addTime: 0, autoPlay: false,
removeTime: 0, loopOnPrevious: false,
shuffleTime: 0 shuffleOnLoop: true,
}, enableRemoveControls: false,
ready: function(){ displayTime: 0,
if (playlistID != "" && playlistID !== ""){ addTime: 0,
playAllPlaylist(playlistID, playlistIndex); removeTime: 0,
}else if (audioUri != "") { shuffleTime: 0,
playOne(audioUri, audioMime); },
}else if (showID != "") { ready: function () {
playAllShow(showID, showIndex); if (playlistID != "" && playlistID !== "") {
}else if(blockId != "" && blockIndex != ""){ playAllPlaylist(playlistID, playlistIndex);
playBlock(blockId, blockIndex); } else if (audioUri != "") {
} playOne(audioUri, audioMime);
} else if (showID != "") {
playAllShow(showID, showIndex);
} else if (blockId != "" && blockIndex != "") {
playBlock(blockId, blockIndex);
} }
}); },
}
);
$("#jp_container_1").on("mouseenter", "ul.jp-controls li", function(ev) { $("#jp_container_1").on("mouseenter", "ul.jp-controls li", function (ev) {
$(this).addClass("ui-state-hover"); $(this).addClass("ui-state-hover");
}); });
$("#jp_container_1").on("mouseleave", "ul.jp-controls li", function(ev) {
$(this).removeClass("ui-state-hover");
});
$("#jp_container_1").on("mouseleave", "ul.jp-controls li", function (ev) {
$(this).removeClass("ui-state-hover");
});
}); });
/** /**
* Sets up the jPlayerPlaylist to play. * Sets up the jPlayerPlaylist to play.
* - Get the playlist info based on the playlistID give. * - Get the playlist info based on the playlistID give.
* - Update the playlistIndex to the position in the pllist to start playing. * - Update the playlistIndex to the position in the pllist to start playing.
* - Select the element played from and start playing. If playlist is null then start at index 0. * - Select the element played from and start playing. If playlist is null then start at index 0.
**/ **/
function playAllPlaylist(p_playlistID, p_playlistIndex) { function playAllPlaylist(p_playlistID, p_playlistIndex) {
var viewsPlaylistID = $('.playlistID').text(); var viewsPlaylistID = $(".playlistID").text();
if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) { if (_idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID) {
play(p_playlistIndex); play(p_playlistIndex);
}else { } else {
buildplaylist(baseUrl+"audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex); buildplaylist(
} baseUrl + "audiopreview/get-playlist/playlistID/" + p_playlistID,
p_playlistIndex
);
}
} }
function playBlock(p_blockId, p_blockIndex) function playBlock(p_blockId, p_blockIndex) {
{ var viewsBlockId = $(".blockId").text();
var viewsBlockId = $('.blockId').text();
if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) { if (_idToPostionLookUp !== undefined && viewsBlockId == p_blockId) {
play(p_blockIndex); play(p_blockIndex);
} else { } else {
buildplaylist(baseUrl+"audiopreview/get-block/blockId/"+p_blockId, p_blockIndex); buildplaylist(
} baseUrl + "audiopreview/get-block/blockId/" + p_blockId,
p_blockIndex
);
}
} }
/** /**
* Sets up the show to play. * Sets up the show to play.
* checks with the show id given to the show id on the page/view * checks with the show id given to the show id on the page/view
* if the show id and the page or views show id are the same it means the user clicked another * if the show id and the page or views show id are the same it means the user clicked another
* file in the same show, so don't refresh the show content tust play the track from the preloaded show. * file in the same show, so don't refresh the show content tust play the track from the preloaded show.
* if the the ids are different they we'll need to get the show's context so create the uri * if the the ids are different they we'll need to get the show's context so create the uri
* and call the controller. * and call the controller.
**/ **/
function playAllShow(p_showID, p_index) { function playAllShow(p_showID, p_index) {
var viewsShowID = $(".showID").text();
var viewsShowID = $('.showID').text(); if (_idToPostionLookUp !== undefined && viewsShowID == p_showID) {
if ( _idToPostionLookUp !== undefined && viewsShowID == p_showID ) { play(p_index);
play(p_index); } else {
}else { buildplaylist(
buildplaylist(baseUrl+"audiopreview/get-show/showID/"+p_showID, p_index); baseUrl + "audiopreview/get-show/showID/" + p_showID,
} p_index
);
}
} }
/** /**
* This function will call the AudiopreviewController to get the contents of * This function will call the AudiopreviewController to get the contents of
* either a show or playlist Looping throught the returned contents and * either a show or playlist Looping throught the returned contents and
* creating media for each track. * creating media for each track.
* *
* Then trigger the jplayer to play the list. * Then trigger the jplayer to play the list.
*/ */
function buildplaylist(p_url, p_playIndex) { function buildplaylist(p_url, p_playIndex) {
_idToPostionLookUp = Array(); _idToPostionLookUp = Array();
$.getJSON(p_url, function(data){ // get the JSON array produced by my PHP $.getJSON(p_url, function (data) {
var myPlaylist = new Array(); // get the JSON array produced by my PHP
var media; var myPlaylist = new Array();
var index; var media;
var total = 0; var index;
var skipped = 0; var total = 0;
var skipped = 0;
for(index in data) { for (index in data) {
if (data[index]['type'] == 0) { if (data[index]["type"] == 0) {
if (data[index]['element_mp3'] != undefined){ if (data[index]["element_mp3"] != undefined) {
media = {title: data[index]['element_title'], media = {
artist: data[index]['element_artist'], title: data[index]["element_title"],
mp3:data[index]['uri'] artist: data[index]["element_artist"],
}; mp3: data[index]["uri"],
} else if (data[index]['element_oga'] != undefined) { };
media = {title: data[index]['element_title'], } else if (data[index]["element_oga"] != undefined) {
artist: data[index]['element_artist'], media = {
oga:data[index]['uri'] title: data[index]["element_title"],
}; artist: data[index]["element_artist"],
} else if (data[index]['element_m4a'] != undefined) { oga: data[index]["uri"],
media = {title: data[index]['element_title'], };
artist: data[index]['element_artist'], } else if (data[index]["element_m4a"] != undefined) {
m4a:data[index]['uri'] media = {
}; title: data[index]["element_title"],
} else if (data[index]['element_wav'] != undefined) { artist: data[index]["element_artist"],
media = {title: data[index]['element_title'], m4a: data[index]["uri"],
artist: data[index]['element_artist'], };
wav:data[index]['uri'] } else if (data[index]["element_wav"] != undefined) {
}; media = {
} else { title: data[index]["element_title"],
// skip this track since it's not supported artist: data[index]["element_artist"],
console.log("continue"); wav: data[index]["uri"],
skipped++; };
continue; } else {
} // skip this track since it's not supported
} else if (data[index]['type'] == 1) { console.log("continue");
var mime = data[index]['mime']; skipped++;
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) { continue;
key = "mp3"; }
} else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) { } else if (data[index]["type"] == 1) {
key = "oga"; var mime = data[index]["mime"];
} else if (mime.search(/mp4/i) > 0) { if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
key = "m4a"; key = "mp3";
} else if (mime.search(/wav/i) > 0) { } else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) {
key = "wav"; key = "oga";
} } else if (mime.search(/mp4/i) > 0) {
key = "m4a";
if (key) { } else if (mime.search(/wav/i) > 0) {
media = {title: data[index]['element_title'], key = "wav";
artist: data[index]['element_artist']
};
media[key] = data[index]['uri']
}
}
if (media && isAudioSupported(data[index]['mime'])) {
// javascript doesn't support associative array with numeric key
// so we need to remove the gap if we skip any of tracks due to
// browser incompatibility.
myPlaylist[index-skipped] = media;
}
// we should create a map according to the new position in the
// player itself total is the index on the player
_idToPostionLookUp[data[index]['element_id']] = total;
total++;
} }
_playlist_jplayer.setPlaylist(myPlaylist);
_playlist_jplayer.option("autoPlay", true);
play(p_playIndex);
window.scrollbars = false; if (key) {
media = {
var container = $("#jp_container_1"); title: data[index]["element_title"],
// Add 2px to account for borders artist: data[index]["element_artist"],
window.resizeTo(container.width() + 2, container.height() + URL_BAR_HEIGHT + 2); };
}); media[key] = data[index]["uri"];
} }
}
/** if (media && isAudioSupported(data[index]["mime"])) {
*Function simply plays the given index, for playlists index can be different so need to look up the // javascript doesn't support associative array with numeric key
*right index. // so we need to remove the gap if we skip any of tracks due to
*/ // browser incompatibility.
function play(p_playlistIndex){ myPlaylist[index - skipped] = media;
playlistIndex = _idToPostionLookUp[p_playlistIndex]; }
if(playlistIndex == undefined){ // we should create a map according to the new position in the
playlistIndex = 0 // player itself total is the index on the player
_idToPostionLookUp[data[index]["element_id"]] = total;
total++;
} }
//_playlist_jplayer.select(playlistIndex); _playlist_jplayer.setPlaylist(myPlaylist);
_playlist_jplayer.play(playlistIndex); _playlist_jplayer.option("autoPlay", true);
} play(p_playIndex);
/** window.scrollbars = false;
* Playing one audio track occurs from the library. This function will create the media, setup
* jplayer and play the track.
*/
function playOne(uri, mime) {
var playlist = new Array();
var media = null;
var key = null;
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
key = "mp3";
} else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) {
key = "oga";
} else if (mime.search(/mp4/i) > 0) {
key = "m4a";
} else if (mime.search(/wav/i) > 0) {
key = "wav";
}
if (key) {
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():""
};
media[key] = uri;
}
if (media) {
_playlist_jplayer.option("autoPlay", true);
playlist[0] = media;
_playlist_jplayer.setPlaylist(playlist);
_playlist_jplayer.play(0);
}
var container = $("#jp_container_1"); var container = $("#jp_container_1");
// Add 2px to account for borders // Add 2px to account for borders
window.resizeTo(container.width() + 2, container.height() + URL_BAR_HEIGHT + 2); window.resizeTo(
container.width() + 2,
container.height() + URL_BAR_HEIGHT + 2
);
});
}
/**
*Function simply plays the given index, for playlists index can be different so need to look up the
*right index.
*/
function play(p_playlistIndex) {
playlistIndex = _idToPostionLookUp[p_playlistIndex];
if (playlistIndex == undefined) {
playlistIndex = 0;
}
//_playlist_jplayer.select(playlistIndex);
_playlist_jplayer.play(playlistIndex);
}
/**
* Playing one audio track occurs from the library. This function will create the media, setup
* jplayer and play the track.
*/
function playOne(uri, mime) {
var playlist = new Array();
var media = null;
var key = null;
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
key = "mp3";
} else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) {
key = "oga";
} else if (mime.search(/mp4/i) > 0) {
key = "m4a";
} else if (mime.search(/wav/i) > 0) {
key = "wav";
}
if (key) {
media = {
title:
$(".audioFileTitle").text() != "null"
? $(".audioFileTitle").text()
: "",
artist:
$(".audioFileArtist").text() != "null"
? $(".audioFileArtist").text()
: "",
};
media[key] = uri;
}
if (media) {
_playlist_jplayer.option("autoPlay", true);
playlist[0] = media;
_playlist_jplayer.setPlaylist(playlist);
_playlist_jplayer.play(0);
}
var container = $("#jp_container_1");
// Add 2px to account for borders
window.resizeTo(
container.width() + 2,
container.height() + URL_BAR_HEIGHT + 2
);
} }

View File

@ -1,50 +1,51 @@
var AIRTIME = (function(AIRTIME) { var AIRTIME = (function (AIRTIME) {
var mod, DEFAULT_CLASS = 'ui-button ui-state-default', DISABLED_CLASS = 'ui-state-disabled'; var mod,
DEFAULT_CLASS = "ui-button ui-state-default",
DISABLED_CLASS = "ui-state-disabled";
if (AIRTIME.button === undefined) { if (AIRTIME.button === undefined) {
AIRTIME.button = {}; AIRTIME.button = {};
}
mod = AIRTIME.button;
mod.isDisabled = function (c, useParent) {
var button = $("." + c);
if (useParent) {
button = button.parent();
} }
mod = AIRTIME.button;
mod.isDisabled = function(c, useParent) { if (button.hasClass(DISABLED_CLASS)) {
var button = $("." + c); return true;
if (useParent) { }
button = button.parent();
}
if (button.hasClass(DISABLED_CLASS)) { return false;
return true; };
}
return false; mod.enableButton = function (c, useParent) {
}; if (useParent) {
var button = $("." + c).parent();
} else {
var button = $("." + c);
}
mod.enableButton = function(c, useParent) { if (button.hasClass(DISABLED_CLASS)) {
if (useParent) { button.removeClass(DISABLED_CLASS);
var button = $("." + c).parent(); button.removeAttr("disabled");
} else { }
var button = $("." + c); };
}
if (button.hasClass(DISABLED_CLASS)) { mod.disableButton = function (c, useParent) {
button.removeClass(DISABLED_CLASS); if (useParent) {
button.removeAttr('disabled'); var button = $("." + c).parent();
} } else {
}; var button = $("." + c);
}
mod.disableButton = function(c, useParent) { if (!button.hasClass(DISABLED_CLASS)) {
if (useParent) { button.addClass(DISABLED_CLASS);
var button = $("." + c).parent(); button.attr("disabled", "disabled");
} else { }
var button = $("." + c); };
}
if (!button.hasClass(DISABLED_CLASS)) { return AIRTIME;
button.addClass(DISABLED_CLASS); })(AIRTIME || {});
button.attr('disabled', 'disabled');
}
};
return AIRTIME;
}(AIRTIME || {}));

View File

@ -1,24 +1,28 @@
function isAudioSupported(mime) {
var audio = new Audio();
function isAudioSupported(mime){ if (typeof mime !== "string" || mime === null) {
var audio = new Audio(); return false;
}
if ((typeof mime) !== "string" || (mime === null)) { var bMime = null;
return false; if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) {
} bMime = 'audio/ogg; codecs="vorbis"';
} else {
bMime = mime;
}
var bMime = null; //return a true of the browser can play this file natively, or if the
if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) { //file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s).
bMime = 'audio/ogg; codecs="vorbis"'; //Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
} else { //is adding a javascript library to do the work for you, which seems like overkill....
bMime = mime; return (
} (!!audio.canPlayType && audio.canPlayType(bMime) != "") ||
(mime.indexOf("mp3") != -1 &&
//return a true of the browser can play this file natively, or if the navigator.mimeTypes["application/x-shockwave-flash"] != undefined) ||
//file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s). (mime.indexOf("mp4") != -1 &&
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative navigator.mimeTypes["application/x-shockwave-flash"] != undefined) ||
//is adding a javascript library to do the work for you, which seems like overkill.... (mime.indexOf("mpeg") != -1 &&
return (!!audio.canPlayType && audio.canPlayType(bMime) != "") || navigator.mimeTypes["application/x-shockwave-flash"] != undefined)
(mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) || );
(mime.indexOf("mp4") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) ||
(mime.indexOf("mpeg") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined);
} }

View File

@ -1,17 +1,18 @@
var previewWidth = 482, var previewWidth = 482,
previewHeight = 110; previewHeight = 110;
$(document).ready(function() { $(document).ready(function () {
/* Removed as this is now (hopefully) unnecessary */
//$("#Panel").stickyPanel({
// topPadding: 1,
// afterDetachCSSClass: "floated-panel",
// savePanelSpace: true
//});
/* Removed as this is now (hopefully) unnecessary */ //this statement tells the browser to fade out any success message after 5 seconds
//$("#Panel").stickyPanel({ setTimeout(function () {
// topPadding: 1, $(".success").fadeOut("slow");
// afterDetachCSSClass: "floated-panel", }, 5000);
// savePanelSpace: true
//});
//this statement tells the browser to fade out any success message after 5 seconds
setTimeout(function(){$(".success").fadeOut("slow")}, 5000);
}); });
/* /*
@ -19,105 +20,104 @@ $(document).ready(function() {
* which we use in multiple places * which we use in multiple places
*/ */
var i18n_months = [ var i18n_months = [
$.i18n._("January"), $.i18n._("January"),
$.i18n._("February"), $.i18n._("February"),
$.i18n._("March"), $.i18n._("March"),
$.i18n._("April"), $.i18n._("April"),
$.i18n._("May"), $.i18n._("May"),
$.i18n._("June"), $.i18n._("June"),
$.i18n._("July"), $.i18n._("July"),
$.i18n._("August"), $.i18n._("August"),
$.i18n._("September"), $.i18n._("September"),
$.i18n._("October"), $.i18n._("October"),
$.i18n._("November"), $.i18n._("November"),
$.i18n._("December") $.i18n._("December"),
]; ];
var i18n_months_short = [ var i18n_months_short = [
$.i18n._("Jan"), $.i18n._("Jan"),
$.i18n._("Feb"), $.i18n._("Feb"),
$.i18n._("Mar"), $.i18n._("Mar"),
$.i18n._("Apr"), $.i18n._("Apr"),
$.i18n._("May"), $.i18n._("May"),
$.i18n._("Jun"), $.i18n._("Jun"),
$.i18n._("Jul"), $.i18n._("Jul"),
$.i18n._("Aug"), $.i18n._("Aug"),
$.i18n._("Sep"), $.i18n._("Sep"),
$.i18n._("Oct"), $.i18n._("Oct"),
$.i18n._("Nov"), $.i18n._("Nov"),
$.i18n._("Dec") $.i18n._("Dec"),
]; ];
var i18n_days_short = [ var i18n_days_short = [
$.i18n._("Su"), $.i18n._("Su"),
$.i18n._("Mo"), $.i18n._("Mo"),
$.i18n._("Tu"), $.i18n._("Tu"),
$.i18n._("We"), $.i18n._("We"),
$.i18n._("Th"), $.i18n._("Th"),
$.i18n._("Fr"), $.i18n._("Fr"),
$.i18n._("Sa") $.i18n._("Sa"),
]; ];
var HTTPMethods = Object.freeze({ var HTTPMethods = Object.freeze({
GET: "GET", GET: "GET",
POST: "POST", POST: "POST",
PUT: "PUT", PUT: "PUT",
PATCH: "PATCH", PATCH: "PATCH",
DELETE: "DELETE", DELETE: "DELETE",
OPTIONS: "OPTIONS" OPTIONS: "OPTIONS",
}); });
var dateStartId = "#sb_date_start", var dateStartId = "#sb_date_start",
timeStartId = "#sb_time_start", timeStartId = "#sb_time_start",
dateEndId = "#sb_date_end", dateEndId = "#sb_date_end",
timeEndId = "#sb_time_end"; timeEndId = "#sb_time_end";
function getDatatablesStrings(overrideDict) { function getDatatablesStrings(overrideDict) {
var dict = {
sEmptyTable: $.i18n._("No data available in table"),
sInfo: $.i18n._("Showing _START_ to _END_ of _TOTAL_ entries"),
sInfoEmpty: $.i18n._("Showing 0 to 0 of 0 entries"),
sInfoFiltered: "", // $.i18n._("(filtered from _MAX_ total entries)"),
sInfoPostFix: $.i18n._(""),
sInfoThousands: $.i18n._(","),
sLengthMenu: $.i18n._("Show _MENU_"),
sLoadingRecords: $.i18n._("Loading..."),
//"sProcessing": $.i18n._("Processing..."),
sProcessing: $.i18n._(""),
sSearch: $.i18n._(""),
sZeroRecords: $.i18n._("No matching records found"),
oPaginate: {
sFirst: "&laquo;",
sLast: "&raquo;",
sNext: "&rsaquo;",
sPrevious: "&lsaquo;",
},
//"oPaginate": {
// "sFirst": $.i18n._("First"),
// "sLast": $.i18n._("Last"),
// "sNext": $.i18n._("Next"),
// "sPrevious": $.i18n._("Previous")
//},
oAria: {
sSortAscending: $.i18n._(": activate to sort column ascending"),
sSortDescending: $.i18n._(": activate to sort column descending"),
},
};
var dict = { return $.extend({}, dict, overrideDict);
"sEmptyTable": $.i18n._("No data available in table"),
"sInfo": $.i18n._("Showing _START_ to _END_ of _TOTAL_ entries"),
"sInfoEmpty": $.i18n._("Showing 0 to 0 of 0 entries"),
"sInfoFiltered": "", // $.i18n._("(filtered from _MAX_ total entries)"),
"sInfoPostFix": $.i18n._(""),
"sInfoThousands": $.i18n._(","),
"sLengthMenu": $.i18n._("Show _MENU_"),
"sLoadingRecords": $.i18n._("Loading..."),
//"sProcessing": $.i18n._("Processing..."),
"sProcessing": $.i18n._(""),
"sSearch": $.i18n._(""),
"sZeroRecords": $.i18n._("No matching records found"),
"oPaginate": {
"sFirst": "&laquo;",
"sLast": "&raquo;",
"sNext": "&rsaquo;",
"sPrevious": "&lsaquo;"
},
//"oPaginate": {
// "sFirst": $.i18n._("First"),
// "sLast": $.i18n._("Last"),
// "sNext": $.i18n._("Next"),
// "sPrevious": $.i18n._("Previous")
//},
"oAria": {
"sSortAscending": $.i18n._(": activate to sort column ascending"),
"sSortDescending": $.i18n._(": activate to sort column descending")
}
};
return $.extend({}, dict, overrideDict);
} }
function adjustDateToServerDate(date, serverTimezoneOffset){ function adjustDateToServerDate(date, serverTimezoneOffset) {
//date object stores time in the browser's localtime. We need to artificially shift //date object stores time in the browser's localtime. We need to artificially shift
//it to //it to
var timezoneOffset = date.getTimezoneOffset()*60*1000; var timezoneOffset = date.getTimezoneOffset() * 60 * 1000;
date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset*1000); date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset * 1000);
/* date object has been shifted to artificial UTC time. Now let's /* date object has been shifted to artificial UTC time. Now let's
* shift it to the server's timezone */ * shift it to the server's timezone */
return date; return date;
} }
/** /**
@ -129,27 +129,31 @@ var _preview_window = null;
*Gets the info from the view when menu action play choosen and opens the jplayer window. *Gets the info from the view when menu action play choosen and opens the jplayer window.
*/ */
function openAudioPreview(p_event) { function openAudioPreview(p_event) {
p_event.stopPropagation(); p_event.stopPropagation();
var audioFileID = $(this).attr('audioFile'); var audioFileID = $(this).attr("audioFile");
var objId = $('.obj_id:first').attr('value'); var objId = $(".obj_id:first").attr("value");
var objType = $('.obj_type:first').attr('value'); var objType = $(".obj_type:first").attr("value");
var playIndex = $(this).parent().parent().attr('id'); var playIndex = $(this).parent().parent().attr("id");
playIndex = playIndex.substring(4); //remove the spl_ playIndex = playIndex.substring(4); //remove the spl_
if (objType == "playlist") { if (objType == "playlist") {
open_playlist_preview(objId, playIndex); open_playlist_preview(objId, playIndex);
} else if (objType == "block") { } else if (objType == "block") {
open_block_preview(objId, playIndex); open_block_preview(objId, playIndex);
} }
} }
function open_audio_preview(type, id) { function open_audio_preview(type, id) {
// The reason that we need to encode artist and title string is that // The reason that we need to encode artist and title string is that
// sometime they contain '/' or '\' and apache reject %2f or %5f // sometime they contain '/' or '\' and apache reject %2f or %5f
// so the work around is to encode it twice. // so the work around is to encode it twice.
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/type/'+type, previewWidth, previewHeight); openPreviewWindow(
_preview_window.focus(); baseUrl + "audiopreview/audio-preview/audioFileID/" + id + "/type/" + type,
previewWidth,
previewHeight
);
_preview_window.focus();
} }
/** /**
@ -159,26 +163,43 @@ function open_audio_preview(type, id) {
*given index. *given index.
*/ */
function open_playlist_preview(p_playlistID, p_playlistIndex) { function open_playlist_preview(p_playlistID, p_playlistIndex) {
if (p_playlistIndex == undefined) //Use a resonable default. if (p_playlistIndex == undefined)
p_playlistIndex = 0; //Use a resonable default.
p_playlistIndex = 0;
if (_preview_window != null && !_preview_window.closed)
if (_preview_window != null && !_preview_window.closed) _preview_window.playAllPlaylist(p_playlistID, p_playlistIndex);
_preview_window.playAllPlaylist(p_playlistID, p_playlistIndex); else
else openPreviewWindow(
openPreviewWindow(baseUrl+'audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID, previewWidth, previewHeight); baseUrl +
_preview_window.focus(); "audiopreview/playlist-preview/playlistIndex/" +
p_playlistIndex +
"/playlistID/" +
p_playlistID,
previewWidth,
previewHeight
);
_preview_window.focus();
} }
function open_block_preview(p_blockId, p_blockIndex) { function open_block_preview(p_blockId, p_blockIndex) {
if (p_blockIndex == undefined) //Use a resonable default. if (p_blockIndex == undefined)
p_blockIndex = 0; //Use a resonable default.
p_blockIndex = 0;
if (_preview_window != null && !_preview_window.closed) if (_preview_window != null && !_preview_window.closed)
_preview_window.playBlock(p_blockId, p_blockIndex); _preview_window.playBlock(p_blockId, p_blockIndex);
else else
openPreviewWindow(baseUrl+'audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId, previewWidth, previewHeight); openPreviewWindow(
_preview_window.focus(); baseUrl +
"audiopreview/block-preview/blockIndex/" +
p_blockIndex +
"/blockId/" +
p_blockId,
previewWidth,
previewHeight
);
_preview_window.focus();
} }
/** /**
@ -188,134 +209,159 @@ function open_block_preview(p_blockId, p_blockIndex) {
*given index. *given index.
*/ */
function open_show_preview(p_showID, p_showIndex) { function open_show_preview(p_showID, p_showIndex) {
if (_preview_window != null && !_preview_window.closed) if (_preview_window != null && !_preview_window.closed)
_preview_window.playAllShow(p_showID, p_showIndex); _preview_window.playAllShow(p_showID, p_showIndex);
else else
openPreviewWindow(baseUrl+'audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex, previewWidth, previewHeight); openPreviewWindow(
_preview_window.focus(); baseUrl +
"audiopreview/show-preview/showID/" +
p_showID +
"/showIndex/" +
p_showIndex,
previewWidth,
previewHeight
);
_preview_window.focus();
} }
function openPreviewWindow(url, w, h) { function openPreviewWindow(url, w, h) {
var dim = (w && h) ? 'width=' + w + ',height=' + h + ',' : ''; var dim = w && h ? "width=" + w + ",height=" + h + "," : "";
// Hardcoding this here is kinda gross, but the alternatives aren't much better... // Hardcoding this here is kinda gross, but the alternatives aren't much better...
_preview_window = window.open(url, $.i18n._('Audio Player'), dim + 'scrollbars=yes'); _preview_window = window.open(
return false; url,
$.i18n._("Audio Player"),
dim + "scrollbars=yes"
);
return false;
} }
function validateTimeRange() { function validateTimeRange() {
var oRange, var oRange,
inputs = $('.sb-timerange > input'), inputs = $(".sb-timerange > input"),
start, end; start,
end;
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); oRange = AIRTIME.utilities.fnGetScheduleRange(
dateStartId,
timeStartId,
dateEndId,
timeEndId
);
start = oRange.start; start = oRange.start;
end = oRange.end; end = oRange.end;
if (end >= start) { if (end >= start) {
inputs.removeClass('error'); inputs.removeClass("error");
} else { } else {
if (!inputs.hasClass('error')) { if (!inputs.hasClass("error")) {
inputs.addClass('error'); inputs.addClass("error");
}
} }
}
return { return {
start: start, start: start,
end: end, end: end,
isValid: end >= start isValid: end >= start,
}; };
} }
// validate uploaded images // validate uploaded images
function validateImage(img, el) { function validateImage(img, el) {
// remove any existing error messages // remove any existing error messages
if ($("#img-err")) { $("#img-err").remove(); } if ($("#img-err")) {
$("#img-err").remove();
}
if (img.size > 2048000) { // 2MB - pull this from somewhere instead? if (img.size > 2048000) {
// hack way of inserting an error message // 2MB - pull this from somewhere instead?
var err = $.i18n._("Selected file is too large"); // hack way of inserting an error message
el.parent().after( var err = $.i18n._("Selected file is too large");
"<ul id='img-err' class='errors'>" + el.parent().after(
"<li>" + err + "</li>" + "<ul id='img-err' class='errors'>" + "<li>" + err + "</li>" + "</ul>"
"</ul>"); );
return false; return false;
} else if (validateMimeType(img.type) < 0) { } else if (validateMimeType(img.type) < 0) {
var err = $.i18n._("File format is not supported"); var err = $.i18n._("File format is not supported");
el.parent().after( el.parent().after(
"<ul id='img-err' class='errors'>" + "<ul id='img-err' class='errors'>" + "<li>" + err + "</li>" + "</ul>"
"<li>" + err + "</li>" + );
"</ul>"); return false;
return false; }
} return true;
return true;
} }
// validate image mime type // validate image mime type
function validateMimeType(mime) { function validateMimeType(mime) {
var extensions = [ var extensions = [
'image/jpeg', "image/jpeg",
'image/png', "image/png",
'image/gif' "image/gif",
// BMP? // BMP?
]; ];
return $.inArray(mime, extensions); return $.inArray(mime, extensions);
} }
function pad(number, length) { function pad(number, length) {
return sprintf("%'0"+length+"d", number); return sprintf("%'0" + length + "d", number);
} }
function removeSuccessMsg() { function removeSuccessMsg() {
var $status = $('.success'); var $status = $(".success");
$status.fadeOut("slow", function(){$status.empty()}); $status.fadeOut("slow", function () {
$status.empty();
});
} }
function hideHint(h) { function hideHint(h) {
h.hide("slow").addClass("hidden"); h.hide("slow").addClass("hidden");
} }
function showHint(h) { function showHint(h) {
h.show("slow").removeClass("hidden"); h.show("slow").removeClass("hidden");
} }
function getUsabilityHint() { function getUsabilityHint() {
var pathname = window.location.pathname; var pathname = window.location.pathname;
$.getJSON(baseUrl + "api/get-usability-hint", {"format": "json", "userPath": pathname}, function(json) { $.getJSON(
var $hint_div = $('.usability_hint'); baseUrl + "api/get-usability-hint",
var current_hint = $hint_div.html(); { format: "json", userPath: pathname },
if (json === "") { function (json) {
// there are no more hints to display to the user var $hint_div = $(".usability_hint");
hideHint($hint_div); var current_hint = $hint_div.html();
} else if (current_hint !== json) { if (json === "") {
// we only change the message if it is new // there are no more hints to display to the user
if ($hint_div.is(":visible")) { hideHint($hint_div);
hideHint($hint_div); } else if (current_hint !== json) {
} // we only change the message if it is new
$hint_div.html(json); if ($hint_div.is(":visible")) {
showHint($hint_div); hideHint($hint_div);
} else {
// hint is the same before we hid it so we just need to show it
if ($hint_div.is(":hidden")) {
showHint($hint_div);
}
} }
}); $hint_div.html(json);
showHint($hint_div);
} else {
// hint is the same before we hid it so we just need to show it
if ($hint_div.is(":hidden")) {
showHint($hint_div);
}
}
}
);
} }
// TODO: build this out so we can use it as a fallback in fail cases // TODO: build this out so we can use it as a fallback in fail cases
function buildErrorDialog(message) { function buildErrorDialog(message) {
var el = $("<div id='error_dialog'></div>"); var el = $("<div id='error_dialog'></div>");
el.text(message); el.text(message);
$(document.body).append(el); $(document.body).append(el);
$("#error_dialog").dialog({ $("#error_dialog").dialog({
title: $.i18n._("Something went wrong!"), title: $.i18n._("Something went wrong!"),
resizable: false, resizable: false,
modal: true, modal: true,
width: "auto", width: "auto",
height: "auto" height: "auto",
}); });
} }
/** /**
@ -324,35 +370,44 @@ function buildErrorDialog(message) {
* @param selector jQuery selector to search descendants * @param selector jQuery selector to search descendants
* @returns {jQuery} * @returns {jQuery}
*/ */
jQuery.fn.addTitles = function(selector) { jQuery.fn.addTitles = function (selector) {
this.each(function() { this.each(function () {
// Put this in a mouseenter event handler so it's dynamic // Put this in a mouseenter event handler so it's dynamic
// (newly created elements will have the title applied on hover) // (newly created elements will have the title applied on hover)
$(this).on("mouseenter", selector, function () { $(this).on("mouseenter", selector, function () {
$(this).attr("title", $(this).text()); $(this).attr("title", $(this).text());
});
}); });
});
return this; // jQuery chaining return this; // jQuery chaining
}; };
// XXX: Old code to pan selector text; keeping this around in case we want to use it later - Duncan // XXX: Old code to pan selector text; keeping this around in case we want to use it later - Duncan
jQuery.fn.scrollText = function(selector) { jQuery.fn.scrollText = function (selector) {
this.each(function () { this.each(function () {
$(this).on("mouseenter", selector, function () { $(this).on("mouseenter", selector, function () {
var sw = $(this)[0].scrollWidth - parseFloat($(this).css("textIndent")), iw = $(this).innerWidth(); var sw = $(this)[0].scrollWidth - parseFloat($(this).css("textIndent")),
if (sw > iw) { iw = $(this).innerWidth();
$(this).stop().animate({ if (sw > iw) {
textIndent: "-" + (sw + 1 - iw) + "px" $(this)
}, sw * 8); .stop()
} .animate(
}); {
$(this).on("mouseleave", selector, function () { textIndent: "-" + (sw + 1 - iw) + "px",
$(this).stop().animate({ },
textIndent: "0" sw * 8
}, 500); );
}); }
}); });
$(this).on("mouseleave", selector, function () {
$(this).stop().animate(
{
textIndent: "0",
},
500
);
});
});
return this; return this;
}; };

View File

@ -1,88 +1,100 @@
$(document).ready(function () {
$(document).ready(function() { $("#facebook-login").click(function () {
$("#facebook-login").click(function() { AIRTIME.facebook.promptForFacebookPage();
AIRTIME.facebook.promptForFacebookPage(); });
});
}); });
window.fbAsyncInit = function () {
window.fbAsyncInit = function() { FB.init({
FB.init({ appId: FACEBOOK_APP_ID,
appId : FACEBOOK_APP_ID, xfbml: true,
xfbml : true, version: "v2.4",
version : 'v2.4' });
});
}; };
var AIRTIME = (function(AIRTIME) { var AIRTIME = (function (AIRTIME) {
//Module initialization
if (AIRTIME.facebook === undefined) {
AIRTIME.facebook = {};
}
//Module initialization var mod = AIRTIME.facebook;
if (AIRTIME.facebook === undefined) {
AIRTIME.facebook = {}; (function (d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
} }
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "facebook-jssdk");
var mod = AIRTIME.facebook; mod.promptForFacebookPage = function () {
FB.login(
(function (d, s, id) { function (response) {
var js, fjs = d.getElementsByTagName(s)[0]; if (response.authResponse) {
if (d.getElementById(id)) { mod.getPagesOwnedByUser(
return; response.authResponse.userID,
response.authResponse.accessToken
);
mod.addPageTab();
} else {
console.log("Authorization failed.");
} }
js = d.createElement(s); },
js.id = id; { scope: "manage_pages" }
js.src = "//connect.facebook.net/en_US/sdk.js"; );
fjs.parentNode.insertBefore(js, fjs); };
}(document, 'script', 'facebook-jssdk'));
mod.promptForFacebookPage = function() { mod.getPagesOwnedByUser = function (userId, accessToken) {
FB.login(function (response) { FB.api(
if (response.authResponse) { "/" + userId + "/accounts",
mod.getPagesOwnedByUser(response.authResponse.userID, response.authResponse.accessToken); function (response) {
mod.addPageTab(); console.log(response);
},
{ access_token: accessToken }
);
};
} else { mod.addPageTab = function () {
console.log('Authorization failed.'); FB.ui(
{ method: "pagetab" },
function (resp) {
console.log("response:");
console.log(resp);
var pageIdList = [];
var tabs = resp["tabs_added"];
if (tabs != undefined && Object.keys(tabs).length > 0) {
for (var pageId in tabs) {
pageIdList.push(pageId);
}
//POST these back to Airtime, which will then proxy it over to our social app. (multiple requests from Airtime)
$.post(
"facebook-tab-success",
{ pages: JSON.stringify(pageIdList) },
function () {
alert("Successfully added to your Facebook page!");
} }
}, {scope: 'manage_pages'}); )
} .done(function () {})
.fail(function () {
alert(
"Sorry, an error occurred and we were unable to add the widget to your Facebook page."
);
});
}
},
{
app_id: FACEBOOK_APP_ID,
//redirect_uri: 'https://localhost'
}
);
};
mod.getPagesOwnedByUser = function(userId, accessToken) { return AIRTIME;
FB.api('/' + userId + '/accounts', function (response) { })(AIRTIME || {});
console.log(response);
}, {access_token: accessToken});
}
mod.addPageTab = function() {
FB.ui(
{ method: 'pagetab' },
function (resp) {
console.log("response:");
console.log(resp);
var pageIdList = [];
var tabs = resp["tabs_added"];
if ((tabs != undefined) && (Object.keys(tabs).length > 0)) {
for (var pageId in tabs) {
pageIdList.push(pageId);
}
//POST these back to Airtime, which will then proxy it over to our social app. (multiple requests from Airtime)
$.post('facebook-tab-success', { "pages" : JSON.stringify(pageIdList) }, function() {
alert("Successfully added to your Facebook page!");
}).done(function() {
}).fail(function() {
alert("Sorry, an error occurred and we were unable to add the widget to your Facebook page.");
});
}
},
{
app_id: FACEBOOK_APP_ID,
//redirect_uri: 'https://localhost'
}
);
}
return AIRTIME;
}(AIRTIME || {}));

View File

@ -22,7 +22,6 @@ var live_dj_on_air = false;
var scheduled_play_on_air = false; var scheduled_play_on_air = false;
var scheduled_play_source = false; var scheduled_play_source = false;
//a reference returned by setTimeout. Useful for when we want clearTimeout() //a reference returned by setTimeout. Useful for when we want clearTimeout()
var newSongTimeoutId = null; var newSongTimeoutId = null;
@ -40,449 +39,545 @@ var onAirOffIterations = 0;
var nextSongPrepare = true; var nextSongPrepare = true;
var nextShowPrepare = true; var nextShowPrepare = true;
function secondsTimer(){ function secondsTimer() {
/* This function constantly calls itself every 'uiUpdateInterval' /* This function constantly calls itself every 'uiUpdateInterval'
* micro-seconds and is responsible for updating the UI. */ * micro-seconds and is responsible for updating the UI. */
if (localRemoteTimeOffset !== null){ if (localRemoteTimeOffset !== null) {
var date = new Date(); var date = new Date();
approximateServerTime = date.getTime() - localRemoteTimeOffset; approximateServerTime = date.getTime() - localRemoteTimeOffset;
updateProgressBarValue(); updateProgressBarValue();
updatePlaybar(); updatePlaybar();
controlOnAirLight(); controlOnAirLight();
controlSwitchLight(); controlSwitchLight();
} }
setTimeout(secondsTimer, uiUpdateInterval); setTimeout(secondsTimer, uiUpdateInterval);
} }
function newSongStart(){ function newSongStart() {
nextSongPrepare = true; nextSongPrepare = true;
if (nextSong.type == 'track') { if (nextSong.type == "track") {
currentSong = nextSong; currentSong = nextSong;
nextSong = null; nextSong = null;
} }
} }
function nextShowStart(){ function nextShowStart() {
nextShowPrepare = true; nextShowPrepare = true;
currentShow[0] = nextShow.shift(); currentShow[0] = nextShow.shift();
} }
/* Called every "uiUpdateInterval" mseconds. */ /* Called every "uiUpdateInterval" mseconds. */
function updateProgressBarValue(){ function updateProgressBarValue() {
var showPercentDone = 0; var showPercentDone = 0;
if (currentShow.length > 0){ if (currentShow.length > 0) {
showPercentDone = (approximateServerTime - currentShow[0].showStartPosixTime)/currentShow[0].showLengthMs*100; showPercentDone =
if (showPercentDone < 0 || showPercentDone > 100){ ((approximateServerTime - currentShow[0].showStartPosixTime) /
showPercentDone = 0; currentShow[0].showLengthMs) *
currentShow = new Array(); 100;
currentSong = null; if (showPercentDone < 0 || showPercentDone > 100) {
} showPercentDone = 0;
currentShow = new Array();
currentSong = null;
} }
$('#progress-show').attr("style", "width:"+showPercentDone+"%"); }
$("#progress-show").attr("style", "width:" + showPercentDone + "%");
var songPercentDone = 0; var songPercentDone = 0;
var scheduled_play_div = $("#scheduled_play_div"); var scheduled_play_div = $("#scheduled_play_div");
var scheduled_play_line_to_switch = scheduled_play_div.parent().find(".line-to-switch"); var scheduled_play_line_to_switch = scheduled_play_div
.parent()
.find(".line-to-switch");
if (currentSong !== null){ if (currentSong !== null) {
var songElapsedTime = 0; var songElapsedTime = 0;
songPercentDone = (approximateServerTime - currentSong.songStartPosixTime)/currentSong.songLengthMs*100; songPercentDone =
songElapsedTime = approximateServerTime - currentSong.songStartPosixTime; ((approximateServerTime - currentSong.songStartPosixTime) /
if (songPercentDone < 0) { currentSong.songLengthMs) *
songPercentDone = 0; 100;
//currentSong = null; songElapsedTime = approximateServerTime - currentSong.songStartPosixTime;
} else if (songPercentDone > 100) { if (songPercentDone < 0) {
songPercentDone = 100; songPercentDone = 0;
} else { //currentSong = null;
if ((currentSong.media_item_played == true && currentShow.length > 0) || (songElapsedTime < 5000 && currentShow[0].record != 1)) { } else if (songPercentDone > 100) {
scheduled_play_line_to_switch.attr("class", "line-to-switch on"); songPercentDone = 100;
scheduled_play_div.addClass("ready");
scheduled_play_source = true;
}
else{
scheduled_play_source = false;
scheduled_play_line_to_switch.attr("class", "line-to-switch off");
scheduled_play_div.removeClass("ready");
}
$('#progress-show').attr("class", "progress-show");
}
} else { } else {
if (
(currentSong.media_item_played == true && currentShow.length > 0) ||
(songElapsedTime < 5000 && currentShow[0].record != 1)
) {
scheduled_play_line_to_switch.attr("class", "line-to-switch on");
scheduled_play_div.addClass("ready");
scheduled_play_source = true;
} else {
scheduled_play_source = false; scheduled_play_source = false;
scheduled_play_line_to_switch.attr("class", "line-to-switch off"); scheduled_play_line_to_switch.attr("class", "line-to-switch off");
scheduled_play_div.removeClass("ready"); scheduled_play_div.removeClass("ready");
$('#progress-show').attr("class", "progress-show-error"); }
$("#progress-show").attr("class", "progress-show");
} }
$('#progress-bar').attr("style", "width:"+songPercentDone+"%"); } else {
scheduled_play_source = false;
scheduled_play_line_to_switch.attr("class", "line-to-switch off");
scheduled_play_div.removeClass("ready");
$("#progress-show").attr("class", "progress-show-error");
}
$("#progress-bar").attr("style", "width:" + songPercentDone + "%");
} }
function updatePlaybar(){ function updatePlaybar() {
/* Column 0 update */ /* Column 0 update */
if (previousSong !== null){ if (previousSong !== null) {
$('#previous').text(previousSong.name+","); $("#previous").text(previousSong.name + ",");
$('#prev-length').text(convertToHHMMSSmm(previousSong.songLengthMs)); $("#prev-length").text(convertToHHMMSSmm(previousSong.songLengthMs));
}else{ } else {
$('#previous').empty(); $("#previous").empty();
$('#prev-length').empty(); $("#prev-length").empty();
} }
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){ if (currentSong !== null && !master_dj_on_air && !live_dj_on_air) {
if (currentSong.record == "1") { if (currentSong.record == "1") {
$('#current').html("<span style='color:red; font-weight:bold'>"+$.i18n._("Recording:")+"</span>"+currentSong.name+","); $("#current").html(
} else { "<span style='color:red; font-weight:bold'>" +
$('#current').text(currentSong.name+","); $.i18n._("Recording:") +
if (currentSong.metadata && currentSong.metadata.artwork_data) { "</span>" +
currentSong.name +
var check_current_song = Cookies.get('current_track'); ","
var loaded = Cookies.get('loaded'); );
if (check_current_song != currentSong.name) {
$('#now-playing-artwork_containter').html("<img height='75' width='75' class'artwork' src='"+ currentSong.metadata.artwork_data +"' />");
Cookies.remove('current_track');
Cookies.set('current_track', currentSong.name);
}
// makes sure it stays updated with current track if page loads
if (loaded != UNIQID) {
Cookies.remove('current_track');
Cookies.remove('loaded');
Cookies.set('loaded', UNIQID);
}
}
}
}else{
if (master_dj_on_air) {
if (showName) {
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Master Stream")+"</span>");
} else {
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Master Stream")+"</span>");
}
} else if (live_dj_on_air) {
if (showName) {
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Live Stream")+"</span>");
} else {
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Live Stream")+"</span>");
}
} else {
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Nothing Scheduled")+"</span>");
}
}
if (nextSong !== null){
$('#next').text(nextSong.name+",");
$('#next-length').text(convertToHHMMSSmm(nextSong.songLengthMs));
}else{
$('#next').empty();
$('#next-length').empty();
}
$('#start').empty();
$('#end').empty();
$('#time-elapsed').empty();
$('#time-remaining').empty();
$('#song-length').empty();
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
$('#start').text(currentSong.starts.split(' ')[1]);
$('#end').text(currentSong.ends.split(' ')[1]);
/* Get rid of the millisecond accuracy so that the second counters for both
* show and song change at the same time. */
var songStartRoughly = parseInt(Math.round(currentSong.songStartPosixTime/1000), 10)*1000;
var songEndRoughly = parseInt(Math.round(currentSong.songEndPosixTime/1000), 10)*1000;
$('#time-elapsed').text(convertToHHMMSS(approximateServerTime - songStartRoughly));
$('#time-remaining').text(convertToHHMMSS(songEndRoughly - approximateServerTime));
$('#song-length').text(convertToHHMMSS(currentSong.songLengthMs));
}
/* Column 1 update */
$('#playlist').text($.i18n._("Current Show:"));
var recElem = $('.recording-show');
if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name);
(currentShow[0].record == "1") ? recElem.show(): recElem.hide();
} else { } else {
recElem.hide(); $("#current").text(currentSong.name + ",");
} if (currentSong.metadata && currentSong.metadata.artwork_data) {
var check_current_song = Cookies.get("current_track");
var loaded = Cookies.get("loaded");
$('#show-length').empty(); if (check_current_song != currentSong.name) {
if (currentShow.length > 0){ $("#now-playing-artwork_containter").html(
$('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime)); "<img height='75' width='75' class'artwork' src='" +
currentSong.metadata.artwork_data +
"' />"
);
Cookies.remove("current_track");
Cookies.set("current_track", currentSong.name);
}
// makes sure it stays updated with current track if page loads
if (loaded != UNIQID) {
Cookies.remove("current_track");
Cookies.remove("loaded");
Cookies.set("loaded", UNIQID);
}
}
} }
} else {
if (master_dj_on_air) {
if (showName) {
$("#current").html(
$.i18n._("Current") +
": <span style='color:red; font-weight:bold'>" +
showName +
" - " +
$.i18n._("Master Stream") +
"</span>"
);
} else {
$("#current").html(
$.i18n._("Current") +
": <span style='color:red; font-weight:bold'>" +
$.i18n._("Master Stream") +
"</span>"
);
}
} else if (live_dj_on_air) {
if (showName) {
$("#current").html(
$.i18n._("Current") +
": <span style='color:red; font-weight:bold'>" +
showName +
" - " +
$.i18n._("Live Stream") +
"</span>"
);
} else {
$("#current").html(
$.i18n._("Current") +
": <span style='color:red; font-weight:bold'>" +
$.i18n._("Live Stream") +
"</span>"
);
}
} else {
$("#current").html(
$.i18n._("Current") +
": <span style='color:red; font-weight:bold'>" +
$.i18n._("Nothing Scheduled") +
"</span>"
);
}
}
/* Column 2 update */ if (nextSong !== null) {
$('#time').text(convertDateToHHMMSS(approximateServerTime)); $("#next").text(nextSong.name + ",");
$("#next-length").text(convertToHHMMSSmm(nextSong.songLengthMs));
} else {
$("#next").empty();
$("#next-length").empty();
}
$("#start").empty();
$("#end").empty();
$("#time-elapsed").empty();
$("#time-remaining").empty();
$("#song-length").empty();
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air) {
$("#start").text(currentSong.starts.split(" ")[1]);
$("#end").text(currentSong.ends.split(" ")[1]);
/* Get rid of the millisecond accuracy so that the second counters for both
* show and song change at the same time. */
var songStartRoughly =
parseInt(Math.round(currentSong.songStartPosixTime / 1000), 10) * 1000;
var songEndRoughly =
parseInt(Math.round(currentSong.songEndPosixTime / 1000), 10) * 1000;
$("#time-elapsed").text(
convertToHHMMSS(approximateServerTime - songStartRoughly)
);
$("#time-remaining").text(
convertToHHMMSS(songEndRoughly - approximateServerTime)
);
$("#song-length").text(convertToHHMMSS(currentSong.songLengthMs));
}
/* Column 1 update */
$("#playlist").text($.i18n._("Current Show:"));
var recElem = $(".recording-show");
if (currentShow.length > 0) {
$("#playlist").text(currentShow[0].name);
currentShow[0].record == "1" ? recElem.show() : recElem.hide();
} else {
recElem.hide();
}
$("#show-length").empty();
if (currentShow.length > 0) {
$("#show-length").text(
convertDateToHHMM(currentShow[0].showStartPosixTime) +
" - " +
convertDateToHHMM(currentShow[0].showEndPosixTime)
);
}
/* Column 2 update */
$("#time").text(convertDateToHHMMSS(approximateServerTime));
} }
function calcAdditionalData(currentItem){ function calcAdditionalData(currentItem) {
currentItem.songStartPosixTime = convertDateToPosixTime(currentItem.starts); currentItem.songStartPosixTime = convertDateToPosixTime(currentItem.starts);
currentItem.songEndPosixTime = convertDateToPosixTime(currentItem.ends); currentItem.songEndPosixTime = convertDateToPosixTime(currentItem.ends);
currentItem.songLengthMs = currentItem.songEndPosixTime - currentItem.songStartPosixTime; currentItem.songLengthMs =
currentItem.songEndPosixTime - currentItem.songStartPosixTime;
} }
function calcAdditionalShowData(show){ function calcAdditionalShowData(show) {
if (show.length > 0){ if (show.length > 0) {
show[0].showStartPosixTime = convertDateToPosixTime(show[0].start_timestamp); show[0].showStartPosixTime = convertDateToPosixTime(
show[0].showEndPosixTime = convertDateToPosixTime(show[0].end_timestamp); show[0].start_timestamp
show[0].showLengthMs = show[0].showEndPosixTime - show[0].showStartPosixTime; );
} show[0].showEndPosixTime = convertDateToPosixTime(show[0].end_timestamp);
show[0].showLengthMs =
show[0].showEndPosixTime - show[0].showStartPosixTime;
}
} }
function calculateTimeToNextSong() { function calculateTimeToNextSong() {
if (approximateServerTime === null) { if (approximateServerTime === null) {
return; return;
} }
if (newSongTimeoutId !== null) { if (newSongTimeoutId !== null) {
/* We have a previous timeout set, let's unset it */ /* We have a previous timeout set, let's unset it */
clearTimeout(newSongTimeoutId); clearTimeout(newSongTimeoutId);
newSongTimeoutId = null; newSongTimeoutId = null;
} }
var diff = nextSong.songStartPosixTime - approximateServerTime; var diff = nextSong.songStartPosixTime - approximateServerTime;
if (diff < 0) diff=0; if (diff < 0) diff = 0;
nextSongPrepare = false; nextSongPrepare = false;
newSongTimeoutId= setTimeout(newSongStart, diff); newSongTimeoutId = setTimeout(newSongStart, diff);
} }
function calculateTimeToNextShow() { function calculateTimeToNextShow() {
if (approximateServerTime === null) { if (approximateServerTime === null) {
return; return;
} }
if (newShowTimeoutId !== null) { if (newShowTimeoutId !== null) {
/* We have a previous timeout set, let's unset it */ /* We have a previous timeout set, let's unset it */
clearTimeout(newShowTimeoutId); clearTimeout(newShowTimeoutId);
newShowTimeoutId = null; newShowTimeoutId = null;
} }
var diff = nextShow[0].showStartPosixTime - approximateServerTime; var diff = nextShow[0].showStartPosixTime - approximateServerTime;
if (diff < 0) diff=0; if (diff < 0) diff = 0;
nextShowPrepare = false; nextShowPrepare = false;
newShowTimeoutId= setTimeout(nextShowStart, diff); newShowTimeoutId = setTimeout(nextShowStart, diff);
} }
function parseItems(obj){ function parseItems(obj) {
previousSong = obj.previous; previousSong = obj.previous;
currentSong = obj.current; currentSong = obj.current;
nextSong = obj.next; nextSong = obj.next;
if (previousSong !== null) { if (previousSong !== null) {
calcAdditionalData(previousSong); calcAdditionalData(previousSong);
} }
if (currentSong !== null) { if (currentSong !== null) {
calcAdditionalData(currentSong); calcAdditionalData(currentSong);
} }
if (nextSong !== null) { if (nextSong !== null) {
calcAdditionalData(nextSong); calcAdditionalData(nextSong);
calculateTimeToNextSong(); calculateTimeToNextSong();
} }
currentShow = new Array(); currentShow = new Array();
if (obj.currentShow.length > 0) { if (obj.currentShow.length > 0) {
calcAdditionalShowData(obj.currentShow); calcAdditionalShowData(obj.currentShow);
currentShow = obj.currentShow; currentShow = obj.currentShow;
} }
nextShow = new Array(); nextShow = new Array();
if (obj.nextShow.length > 0) { if (obj.nextShow.length > 0) {
calcAdditionalShowData(obj.nextShow); calcAdditionalShowData(obj.nextShow);
nextShow = obj.nextShow; nextShow = obj.nextShow;
calculateTimeToNextShow(); calculateTimeToNextShow();
} }
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime); var date = new Date();
var date = new Date(); localRemoteTimeOffset = date.getTime() - schedulePosixTime;
localRemoteTimeOffset = date.getTime() - schedulePosixTime;
} }
function parseSourceStatus(obj){ function parseSourceStatus(obj) {
var live_div = $("#live_dj_div"); var live_div = $("#live_dj_div");
var master_div = $("#master_dj_div"); var master_div = $("#master_dj_div");
var live_li = live_div.parent(); var live_li = live_div.parent();
var master_li = master_div.parent(); var master_li = master_div.parent();
if(obj.live_dj_source == false){ if (obj.live_dj_source == false) {
live_li.find(".line-to-switch").attr("class", "line-to-switch off"); live_li.find(".line-to-switch").attr("class", "line-to-switch off");
live_div.removeClass("ready"); live_div.removeClass("ready");
}else{ } else {
live_li.find(".line-to-switch").attr("class", "line-to-switch on"); live_li.find(".line-to-switch").attr("class", "line-to-switch on");
live_div.addClass("ready"); live_div.addClass("ready");
} }
if(obj.master_dj_source == false){ if (obj.master_dj_source == false) {
master_li.find(".line-to-switch").attr("class", "line-to-switch off"); master_li.find(".line-to-switch").attr("class", "line-to-switch off");
master_div.removeClass("ready"); master_div.removeClass("ready");
}else{ } else {
master_li.find(".line-to-switch").attr("class", "line-to-switch on"); master_li.find(".line-to-switch").attr("class", "line-to-switch on");
master_div.addClass("ready"); master_div.addClass("ready");
} }
} }
function parseSwitchStatus(obj){ function parseSwitchStatus(obj) {
if (obj.live_dj_source == "on") {
live_dj_on_air = true;
} else {
live_dj_on_air = false;
}
if(obj.live_dj_source == "on"){ if (obj.master_dj_source == "on") {
live_dj_on_air = true; master_dj_on_air = true;
}else{ } else {
live_dj_on_air = false; master_dj_on_air = false;
} }
if(obj.master_dj_source == "on"){ if (obj.scheduled_play == "on") {
master_dj_on_air = true; scheduled_play_on_air = true;
}else{ } else {
master_dj_on_air = false; scheduled_play_on_air = false;
} }
if(obj.scheduled_play == "on"){ var scheduled_play_switch = $("#scheduled_play.source-switch-button");
scheduled_play_on_air = true; var live_dj_switch = $("#live_dj.source-switch-button");
}else{ var master_dj_switch = $("#master_dj.source-switch-button");
scheduled_play_on_air = false;
}
var scheduled_play_switch = $("#scheduled_play.source-switch-button"); scheduled_play_switch.find("span").html(obj.scheduled_play);
var live_dj_switch = $("#live_dj.source-switch-button"); if (scheduled_play_on_air) {
var master_dj_switch = $("#master_dj.source-switch-button"); scheduled_play_switch.addClass("active");
} else {
scheduled_play_switch.removeClass("active");
}
scheduled_play_switch.find("span").html(obj.scheduled_play); live_dj_switch.find("span").html(obj.live_dj_source);
if(scheduled_play_on_air){ if (live_dj_on_air) {
scheduled_play_switch.addClass("active"); live_dj_switch.addClass("active");
}else{ } else {
scheduled_play_switch.removeClass("active"); live_dj_switch.removeClass("active");
} }
live_dj_switch.find("span").html(obj.live_dj_source); master_dj_switch.find("span").html(obj.master_dj_source);
if(live_dj_on_air){ if (master_dj_on_air) {
live_dj_switch.addClass("active"); master_dj_switch.addClass("active");
}else{ } else {
live_dj_switch.removeClass("active"); master_dj_switch.removeClass("active");
} }
master_dj_switch.find("span").html(obj.master_dj_source)
if(master_dj_on_air){
master_dj_switch.addClass("active");
}else{
master_dj_switch.removeClass("active");
}
} }
function controlOnAirLight(){ function controlOnAirLight() {
if ((scheduled_play_on_air && scheduled_play_source) || live_dj_on_air || master_dj_on_air) { if (
$('#on-air-info').attr("class", "on-air-info on"); (scheduled_play_on_air && scheduled_play_source) ||
onAirOffIterations = 0; live_dj_on_air ||
} else if (onAirOffIterations < 20) { master_dj_on_air
//if less than 4 seconds have gone by (< 20 executions of this function) ) {
//then keep the ON-AIR light on. Only after at least 3 seconds have gone by, $("#on-air-info").attr("class", "on-air-info on");
//should we be allowed to turn it off. This is to stop the light from temporarily turning onAirOffIterations = 0;
//off between tracks: CC-3725 } else if (onAirOffIterations < 20) {
onAirOffIterations++; //if less than 4 seconds have gone by (< 20 executions of this function)
} else { //then keep the ON-AIR light on. Only after at least 3 seconds have gone by,
$('#on-air-info').attr("class", "on-air-info off"); //should we be allowed to turn it off. This is to stop the light from temporarily turning
} //off between tracks: CC-3725
onAirOffIterations++;
} else {
$("#on-air-info").attr("class", "on-air-info off");
}
} }
function controlSwitchLight(){ function controlSwitchLight() {
var live_li= $("#live_dj_div").parent(); var live_li = $("#live_dj_div").parent();
var master_li = $("#master_dj_div").parent(); var master_li = $("#master_dj_div").parent();
var scheduled_play_li = $("#scheduled_play_div").parent(); var scheduled_play_li = $("#scheduled_play_div").parent();
if((scheduled_play_on_air && scheduled_play_source) && !live_dj_on_air && !master_dj_on_air){ if (
scheduled_play_li.find(".line-to-on-air").attr("class", "line-to-on-air on"); scheduled_play_on_air &&
live_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); scheduled_play_source &&
master_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); !live_dj_on_air &&
}else if(live_dj_on_air && !master_dj_on_air){ !master_dj_on_air
scheduled_play_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); ) {
live_li.find(".line-to-on-air").attr("class", "line-to-on-air on"); scheduled_play_li
master_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); .find(".line-to-on-air")
}else if(master_dj_on_air){ .attr("class", "line-to-on-air on");
scheduled_play_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); live_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
live_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); master_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
master_li.find(".line-to-on-air").attr("class", "line-to-on-air on"); } else if (live_dj_on_air && !master_dj_on_air) {
}else{ scheduled_play_li
scheduled_play_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); .find(".line-to-on-air")
live_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); .attr("class", "line-to-on-air off");
master_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); live_li.find(".line-to-on-air").attr("class", "line-to-on-air on");
} master_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
} else if (master_dj_on_air) {
scheduled_play_li
.find(".line-to-on-air")
.attr("class", "line-to-on-air off");
live_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
master_li.find(".line-to-on-air").attr("class", "line-to-on-air on");
} else {
scheduled_play_li
.find(".line-to-on-air")
.attr("class", "line-to-on-air off");
live_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
master_li.find(".line-to-on-air").attr("class", "line-to-on-air off");
}
} }
function getScheduleFromServer(){ function getScheduleFromServer() {
$.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", $.ajax({
dataType:"json", url: baseUrl + "Schedule/get-current-playlist/format/json",
success:function(data){ dataType: "json",
parseItems(data.entries); success: function (data) {
parseSourceStatus(data.source_status); parseItems(data.entries);
parseSwitchStatus(data.switch_status); parseSourceStatus(data.source_status);
showName = data.show_name; parseSwitchStatus(data.switch_status);
}, error:function(jqXHR, textStatus, errorThrown){}}); showName = data.show_name;
},
error: function (jqXHR, textStatus, errorThrown) {},
});
} }
function setupQtip(){ function setupQtip() {
var qtipElem = $('#about-link'); var qtipElem = $("#about-link");
if (qtipElem.length > 0){ if (qtipElem.length > 0) {
qtipElem.qtip({ qtipElem.qtip({
content: $('#about-txt').html(), content: $("#about-txt").html(),
show: 'mouseover', show: "mouseover",
hide: { when: 'mouseout', fixed: true }, hide: { when: "mouseout", fixed: true },
position: { position: {
corner: { corner: {
target: 'center', target: "center",
tooltip: 'topRight' tooltip: "topRight",
} },
}, },
style: { style: {
border: { border: {
width: 0, width: 0,
radius: 4 radius: 4,
}, },
name: 'light' // Use the default light style name: "light", // Use the default light style
} },
});
}
}
function setSwitchListener(ele){
var sourcename = $(ele).attr('id');
var status_span = $(ele).find("span");
var status = status_span.html();
$.get(baseUrl+"Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
if(data.error){
alert(data.error);
}else{
if(data.status == "ON"){
$(ele).addClass("active");
}else{
$(ele).removeClass("active");
}
status_span.html(data.status);
}
}); });
}
} }
function kickSource(ele){ function setSwitchListener(ele) {
var sourcename = $(ele).attr('id'); var sourcename = $(ele).attr("id");
var status_span = $(ele).find("span");
$.get(baseUrl+"Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){ var status = status_span.html();
if(data.error){ $.get(
alert(data.error); baseUrl +
"Dashboard/switch-source/format/json/sourcename/" +
sourcename +
"/status/" +
status,
function (data) {
if (data.error) {
alert(data.error);
} else {
if (data.status == "ON") {
$(ele).addClass("active");
} else {
$(ele).removeClass("active");
} }
}); status_span.html(data.status);
}
}
);
}
function kickSource(ele) {
var sourcename = $(ele).attr("id");
$.get(
baseUrl +
"Dashboard/disconnect-source/format/json/sourcename/" +
sourcename,
function (data) {
if (data.error) {
alert(data.error);
}
}
);
} }
var stream_window = null; var stream_window = null;
function init() { function init() {
//begin producer "thread" //begin producer "thread"
setInterval(getScheduleFromServer, serverUpdateInterval); setInterval(getScheduleFromServer, serverUpdateInterval);
//begin consumer "thread" //begin consumer "thread"
secondsTimer(); secondsTimer();
setupQtip(); setupQtip();
$('.listen-control-button').click(function() { $(".listen-control-button").click(function () {
if (stream_window == null || stream_window.closed) if (stream_window == null || stream_window.closed)
stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=158'); stream_window = window.open(
stream_window.focus(); baseUrl + "Dashboard/stream-player",
return false; "name",
}); "width=400,height=158"
);
stream_window.focus();
return false;
});
} }
/* We never retrieve the user's password from the db /* We never retrieve the user's password from the db
@ -491,40 +586,39 @@ function init() {
* field. Therefore, we fill the password field with 6 x's * field. Therefore, we fill the password field with 6 x's
*/ */
function setCurrentUserPseudoPassword() { function setCurrentUserPseudoPassword() {
$('#cu_password').val("xxxxxx"); $("#cu_password").val("xxxxxx");
$('#cu_passwordVerify').val("xxxxxx"); $("#cu_passwordVerify").val("xxxxxx");
} }
/*$(window).resize(function() { /*$(window).resize(function() {
*//* If we don't do this, the menu can stay hidden after resizing *//* */ /* If we don't do this, the menu can stay hidden after resizing */ /*
if ($(this).width() > 970) { if ($(this).width() > 970) {
$("#nav .responsive-menu").show(); $("#nav .responsive-menu").show();
} }
});*/ });*/
$(document).ready(function() { $(document).ready(function () {
if ($('#master-panel').length > 0) if ($("#master-panel").length > 0) init();
init(); if ($(".errors").length === 0) {
if ($('.errors').length === 0) { setCurrentUserPseudoPassword();
setCurrentUserPseudoPassword(); }
}
$('body').on('click','#current-user', function() { $("body").on("click", "#current-user", function () {
$.ajax({ $.ajax({
url: baseUrl+'user/edit-user/format/json' url: baseUrl + "user/edit-user/format/json",
});
}); });
});
$('body').on('click', '#cu_save_user', function() { $("body").on("click", "#cu_save_user", function () {
Cookies.set('airtime_locale', $('#cu_locale').val(), {path: '/'}); Cookies.set("airtime_locale", $("#cu_locale").val(), { path: "/" });
}); });
// When the 'Listen' button is clicked we set the width // When the 'Listen' button is clicked we set the width
// of the share button to the width of the 'Live Stream' // of the share button to the width of the 'Live Stream'
// text. This differs depending on the language setting // text. This differs depending on the language setting
$('#popup-link').css('width', $('.jp-container h1').css('width')); $("#popup-link").css("width", $(".jp-container h1").css("width"));
/*$('#menu-btn').click(function() { /*$('#menu-btn').click(function() {
$('#nav .responsive-menu').slideToggle(); $('#nav .responsive-menu').slideToggle();
});*/ });*/
}); });

View File

@ -1,232 +1,213 @@
/* function to create popup window */ /* function to create popup window */
function popup(mylink){ function popup(mylink) {
if (!window.focus) if (!window.focus) return true;
return true; var href;
var href; if (typeof mylink == "string") href = mylink;
if (typeof(mylink) == 'string') else href = mylink.href;
href=mylink; window.open(href, "player", "width=300,height=100,scrollbars=yes");
else return false;
href=mylink.href;
window.open(href, "player", 'width=300,height=100,scrollbars=yes');
return false;
} }
/* Take a string representing a date in the format 2012-04-25 and return /* Take a string representing a date in the format 2012-04-25 and return
* a javascript date object representing this date. */ * a javascript date object representing this date. */
function getDateFromString(time){ function getDateFromString(time) {
var date = time.split("-"); var date = time.split("-");
if (date.length != 3){ if (date.length != 3) {
return null; return null;
} }
var year = parseInt(date[0], 10); var year = parseInt(date[0], 10);
var month = parseInt(date[1], 10) -1; var month = parseInt(date[1], 10) - 1;
var day = parseInt(date[2], 10); var day = parseInt(date[2], 10);
if (isNaN(year) || isNaN(month) || isNaN(day)){ if (isNaN(year) || isNaN(month) || isNaN(day)) {
return null; return null;
} }
return new Date(year, month, day);
return new Date(year, month, day);
} }
function convertSecondsToDaysHoursMinutesSeconds(seconds){ function convertSecondsToDaysHoursMinutesSeconds(seconds) {
if (seconds < 0) if (seconds < 0) seconds = 0;
seconds = 0;
seconds = parseInt(seconds, 10); seconds = parseInt(seconds, 10);
var days = parseInt(seconds / 86400); var days = parseInt(seconds / 86400);
seconds -= days*86400; seconds -= days * 86400;
var hours = parseInt(seconds / 3600); var hours = parseInt(seconds / 3600);
seconds -= hours*3600; seconds -= hours * 3600;
var minutes = parseInt(seconds / 60); var minutes = parseInt(seconds / 60);
seconds -= minutes*60; seconds -= minutes * 60;
return {days:days, hours:hours, minutes:minutes, seconds:seconds}; return { days: days, hours: hours, minutes: minutes, seconds: seconds };
} }
/* Takes an input parameter of milliseconds and converts these into /* Takes an input parameter of milliseconds and converts these into
* the format HH:MM:SS */ * the format HH:MM:SS */
function convertToHHMMSS(timeInMS){ function convertToHHMMSS(timeInMS) {
var time = parseInt(timeInMS); var time = parseInt(timeInMS);
var hours = parseInt(time / 3600000); var hours = parseInt(time / 3600000);
time -= 3600000*hours; time -= 3600000 * hours;
var minutes = parseInt(time / 60000); var minutes = parseInt(time / 60000);
time -= 60000*minutes; time -= 60000 * minutes;
var seconds = parseInt(time / 1000); var seconds = parseInt(time / 1000);
hours = hours.toString(); hours = hours.toString();
minutes = minutes.toString(); minutes = minutes.toString();
seconds = seconds.toString(); seconds = seconds.toString();
if (hours.length == 1) if (hours.length == 1) hours = "0" + hours;
hours = "0" + hours; if (minutes.length == 1) minutes = "0" + minutes;
if (minutes.length == 1) if (seconds.length == 1) seconds = "0" + seconds;
minutes = "0" + minutes; return hours + ":" + minutes + ":" + seconds;
if (seconds.length == 1)
seconds = "0" + seconds;
return hours + ":" + minutes + ":" + seconds;
} }
function convertToHHMMSSmm(timeInMS){ function convertToHHMMSSmm(timeInMS) {
var time = parseInt(timeInMS); var time = parseInt(timeInMS);
var hours = parseInt(time / 3600000); var hours = parseInt(time / 3600000);
time -= 3600000*hours; time -= 3600000 * hours;
var minutes = parseInt(time / 60000); var minutes = parseInt(time / 60000);
time -= 60000*minutes; time -= 60000 * minutes;
var seconds = parseInt(time / 1000); var seconds = parseInt(time / 1000);
time -= 1000*seconds; time -= 1000 * seconds;
var ms = parseInt(time); var ms = parseInt(time);
hours = hours.toString(); hours = hours.toString();
minutes = minutes.toString(); minutes = minutes.toString();
seconds = seconds.toString(); seconds = seconds.toString();
ms = ms.toString(); ms = ms.toString();
if (hours.length == 1) if (hours.length == 1) hours = "0" + hours;
hours = "0" + hours; if (minutes.length == 1) minutes = "0" + minutes;
if (minutes.length == 1) if (seconds.length == 1) seconds = "0" + seconds;
minutes = "0" + minutes;
if (seconds.length == 1)
seconds = "0" + seconds;
if (ms.length == 3) if (ms.length == 3) ms = ms.substring(0, 2);
ms = ms.substring(0, 2); else if (ms.length == 2) ms = "0" + ms.substring(0, 1);
else if (ms.length == 2) else if (ms.length == 1) ms = "00";
ms = "0" + ms.substring(0,1);
else if (ms.length == 1)
ms = "00";
if (hours == "00") if (hours == "00") return minutes + ":" + seconds + "." + ms;
return minutes + ":" + seconds + "." + ms; else return hours + ":" + minutes + ":" + seconds + "." + ms;
else
return hours + ":" + minutes + ":" + seconds+ "." + ms;
} }
function convertDateToHHMM(epochTime){ function convertDateToHHMM(epochTime) {
var d = new Date(epochTime); var d = new Date(epochTime);
var hours = d.getUTCHours().toString(); var hours = d.getUTCHours().toString();
var minutes = d.getUTCMinutes().toString(); var minutes = d.getUTCMinutes().toString();
if (hours.length == 1) if (hours.length == 1) hours = "0" + hours;
hours = "0" + hours; if (minutes.length == 1) minutes = "0" + minutes;
if (minutes.length == 1)
minutes = "0" + minutes;
return hours + ":" + minutes; return hours + ":" + minutes;
} }
function convertDateToHHMMSS(epochTime){ function convertDateToHHMMSS(epochTime) {
var d = new Date(epochTime); var d = new Date(epochTime);
var hours = d.getUTCHours().toString(); var hours = d.getUTCHours().toString();
var minutes = d.getUTCMinutes().toString(); var minutes = d.getUTCMinutes().toString();
var seconds = d.getUTCSeconds().toString(); var seconds = d.getUTCSeconds().toString();
if (hours.length == 1) if (hours.length == 1) hours = "0" + hours;
hours = "0" + hours; if (minutes.length == 1) minutes = "0" + minutes;
if (minutes.length == 1) if (seconds.length == 1) seconds = "0" + seconds;
minutes = "0" + minutes; return hours + ":" + minutes + ":" + seconds;
if (seconds.length == 1)
seconds = "0" + seconds;
return hours + ":" + minutes + ":" + seconds;
} }
/* Takes in a string of format similar to 2011-02-07 02:59:57, /* Takes in a string of format similar to 2011-02-07 02:59:57,
* and converts this to epoch/posix time. */ * and converts this to epoch/posix time. */
function convertDateToPosixTime(s){ function convertDateToPosixTime(s) {
var datetime = s.split(" ");
var datetime = s.split(" "); var date = datetime[0].split("-");
var time = datetime[1].split(":");
var date = datetime[0].split("-"); var year = date[0];
var time = datetime[1].split(":"); var month = date[1];
var day = date[2];
var hour = time[0];
var minute = time[1];
var sec = 0;
var msec = 0;
var year = date[0]; if (time[2].indexOf(".") != -1) {
var month = date[1]; var temp = time[2].split(".");
var day = date[2]; sec = temp[0];
var hour = time[0]; msec = temp[1];
var minute = time[1]; } else sec = time[2];
var sec = 0;
var msec = 0;
if (time[2].indexOf(".") != -1){ return Date.UTC(year, month - 1, day, hour, minute, sec, msec);
var temp = time[2].split(".");
sec = temp[0];
msec = temp[1];
} else
sec = time[2];
return Date.UTC(year, month-1, day, hour, minute, sec, msec);
} }
function getFileExt(filename){ function getFileExt(filename) {
return filename.split('.').pop(); return filename.split(".").pop();
} }
function resizeImg(ele, targetWidth, targetHeight){ function resizeImg(ele, targetWidth, targetHeight) {
var img = $(ele); var img = $(ele);
var width = ele.width; var width = ele.width;
var height = ele.height; var height = ele.height;
// resize img proportionaly // resize img proportionaly
if( width > height && width > targetWidth){ if (width > height && width > targetWidth) {
var ratio = targetWidth/width; var ratio = targetWidth / width;
img.css("width", targetHeight+"px"); img.css("width", targetHeight + "px");
var newHeight = height * ratio; var newHeight = height * ratio;
img.css("height", newHeight+"px"); img.css("height", newHeight + "px");
}else if( width < height && height > targetHeight){ } else if (width < height && height > targetHeight) {
var ratio = targetHeight/height; var ratio = targetHeight / height;
img.css("height", targetHeight+"px"); img.css("height", targetHeight + "px");
var newWidth = width * ratio; var newWidth = width * ratio;
img.css("width", newWidth+"px"); img.css("width", newWidth + "px");
}else if( width == height && width > targetWidth){ } else if (width == height && width > targetWidth) {
img.css("height", targetHeight+"px"); img.css("height", targetHeight + "px");
img.css("width", targetWidth+"px" ); img.css("width", targetWidth + "px");
} }
} }
function resizeToMaxHeight(ele, targetHeight){ function resizeToMaxHeight(ele, targetHeight) {
var img = $(ele); var img = $(ele);
var width = ele.width; var width = ele.width;
var height = ele.height; var height = ele.height;
// resize img proportionaly // resize img proportionaly
if( height > targetHeight){ if (height > targetHeight) {
var ratio = targetHeight/height; var ratio = targetHeight / height;
img.css("height", targetHeight+"px"); img.css("height", targetHeight + "px");
var newWidth = width * ratio; var newWidth = width * ratio;
img.css("width", newWidth+"px"); img.css("width", newWidth + "px");
} }
} }
/* From http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/#7557433 */ /* From http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/#7557433 */
function isInView(el) { function isInView(el) {
//special bonus for those using jQuery //special bonus for those using jQuery
if (typeof jQuery === "function" && el instanceof jQuery) { if (typeof jQuery === "function" && el instanceof jQuery) {
el = el[0]; el = el[0];
} }
var rect = el.getBoundingClientRect(); var rect = el.getBoundingClientRect();
return ( return (
rect.top >= 0 && rect.top >= 0 &&
rect.left >= 0 && rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */ rect.bottom <=
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */ (window.innerHeight ||
); document.documentElement.clientHeight) /*or $(window).height() */ &&
rect.right <=
(window.innerWidth ||
document.documentElement.clientWidth) /*or $(window).width() */
);
} }

View File

@ -2,149 +2,165 @@
* Get the tooltip message to be displayed * Get the tooltip message to be displayed
*/ */
function getContent() { function getContent() {
var link = getLatestLink(); var link = getLatestLink();
var hasPatch = getHasPatch(); var hasPatch = getHasPatch();
var hasMinor = getHasMinor(); var hasMinor = getHasMinor();
var hasMajor = getHasMajor(); var hasMajor = getHasMajor();
var hasMultiMajor = getHasMultiMajor(); var hasMultiMajor = getHasMultiMajor();
var isPreRelease = getIsPreRelease(); var isPreRelease = getIsPreRelease();
var msg = ""; var msg = "";
// See file legacy/application/views/helpers/VersionNotify.php for more info // See file legacy/application/views/helpers/VersionNotify.php for more info
if(isUpToDate()) { if (isUpToDate()) {
msg = $.i18n._("You are running the latest version"); msg = $.i18n._("You are running the latest version");
} else { } else {
msg = $.i18n._("New version available: ") + link + '<ul>'; msg = $.i18n._("New version available: ") + link + "<ul>";
if (isPreRelease) { if (isPreRelease) {
msg += '<li>'+$.i18n._("You have a pre-release version of LibreTime intalled."); msg +=
} "<li>" +
if (hasPatch) { $.i18n._("You have a pre-release version of LibreTime intalled.");
msg += '<li>'+$.i18n._("A patch update for your LibreTime installation is available.");
}
if (hasMinor) {
msg += '<li>'+$.i18n._("A feature update for your LibreTime installation is available.");
}
if (hasMajor && !hasMultiMajor) {
msg += '<li>'+$.i18n._("A major update for your LibreTime installation is available.");
}
if (hasMultiMajor) {
msg += '<li>'+$.i18n._("Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible.");
}
msg += '</ul>';
} }
if (hasPatch) {
msg +=
"<li>" +
$.i18n._(
"A patch update for your LibreTime installation is available."
);
}
if (hasMinor) {
msg +=
"<li>" +
$.i18n._(
"A feature update for your LibreTime installation is available."
);
}
if (hasMajor && !hasMultiMajor) {
msg +=
"<li>" +
$.i18n._(
"A major update for your LibreTime installation is available."
);
}
if (hasMultiMajor) {
msg +=
"<li>" +
$.i18n._(
"Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible."
);
}
msg += "</ul>";
}
return msg; return msg;
} }
/** /**
* Get if patch is available * Get if patch is available
*/ */
function getHasPatch() { function getHasPatch() {
return versionNotifyInfo.hasPatch; return versionNotifyInfo.hasPatch;
} }
/** /**
* Get if minor update is available * Get if minor update is available
*/ */
function getHasMinor() { function getHasMinor() {
return versionNotifyInfo.hasMinor; return versionNotifyInfo.hasMinor;
} }
/** /**
* Get if major update is available * Get if major update is available
*/ */
function getHasMajor() { function getHasMajor() {
return versionNotifyInfo.hasMajor; return versionNotifyInfo.hasMajor;
} }
/** /**
* Get if multiple major updates are available * Get if multiple major updates are available
*/ */
function getHasMultiMajor() { function getHasMultiMajor() {
return versionNotifyInfo.hasMultiMajor; return versionNotifyInfo.hasMultiMajor;
} }
/** /**
* Get if pre-release was installed * Get if pre-release was installed
*/ */
function getIsPreRelease() { function getIsPreRelease() {
return versionNotifyInfo.isPreRelease; return versionNotifyInfo.isPreRelease;
} }
/** /**
* Get the current version * Get the current version
*/ */
function getCurrentVersion() { function getCurrentVersion() {
return versionNotifyInfo.current; return versionNotifyInfo.current;
} }
/** /**
* Get the latest version * Get the latest version
*/ */
function getLatestVersion() { function getLatestVersion() {
return versionNotifyInfo.latest; return versionNotifyInfo.latest;
} }
/** /**
* Returns the download link to latest release in HTML * Returns the download link to latest release in HTML
*/ */
function getLatestLink() { function getLatestLink() {
return "<a href='' onclick='openLatestLink();'>" + getLatestVersion() + "</a>"; return (
"<a href='' onclick='openLatestLink();'>" + getLatestVersion() + "</a>"
);
} }
/** /**
* Returns true if current version is up to date * Returns true if current version is up to date
*/ */
function isUpToDate() { function isUpToDate() {
return !getHasPatch() && !getHasMinor() && !getHasMajor(); return !getHasPatch() && !getHasMinor() && !getHasMajor();
} }
/** /**
* Opens the link in a new window * Opens the link in a new window
*/ */
function openLatestLink() { function openLatestLink() {
window.open(versionNotifyInfo.link); window.open(versionNotifyInfo.link);
} }
/** /**
* Sets up the tooltip for version notification * Sets up the tooltip for version notification
*/ */
function setupVersionQtip(){ function setupVersionQtip() {
var qtipElem = $('#version-icon'); var qtipElem = $("#version-icon");
if (qtipElem.length > 0){ if (qtipElem.length > 0) {
qtipElem.qtip({ qtipElem.qtip({
id: 'version', id: "version",
content: { content: {
text: getContent(), text: getContent(),
title: { title: {
text: getCurrentVersion(), text: getCurrentVersion(),
button: isUpToDate() ? false : true button: isUpToDate() ? false : true,
} },
}, },
hide: { hide: {
event: isUpToDate() ? 'mouseleave' : 'unfocus' event: isUpToDate() ? "mouseleave" : "unfocus",
}, },
position: { position: {
my: "top right", my: "top right",
at: "bottom left" at: "bottom left",
}, },
style: { style: {
border: { border: {
width: 0, width: 0,
radius: 4 radius: 4,
}, },
classes: "ui-tooltip-dark ui-tooltip-rounded" classes: "ui-tooltip-dark ui-tooltip-rounded",
} },
}); });
} }
} }
$(document).ready(function() { $(document).ready(function () {
if($('#version-icon').length > 0) { if ($("#version-icon").length > 0) {
setupVersionQtip(); setupVersionQtip();
} }
}); });

View File

@ -1,183 +1,204 @@
var AIRTIME = (function(AIRTIME) { var AIRTIME = (function (AIRTIME) {
var mod; var mod;
if (AIRTIME.library === undefined) { if (AIRTIME.library === undefined) {
AIRTIME.library = {}; AIRTIME.library = {};
}
mod = AIRTIME.library;
mod.checkAddButton = function () {
var selected = mod.getChosenItemsLength(),
sortable = $(".spl_sortable:visible"),
check = false,
blockType = $("input[name=sp_type]:checked", "#smart-block-form").val();
// make sure audioclips are selected and a playlist or static block is currently open.
// static blocks have value of 0
// dynamic blocks have value of 1
if (selected !== 0 && (sortable.length !== 0 || blockType === "0")) {
check = true;
} }
mod = AIRTIME.library; if (check === true) {
AIRTIME.button.enableButton("btn-group #library-plus", false);
} else {
AIRTIME.button.disableButton("btn-group #library-plus", false);
}
mod.checkAddButton = function() { var objType = $(".obj_type").val(),
btnText;
if (objType === "playlist") {
btnText = " " + $.i18n._("Add to current playlist");
} else if (objType === "block") {
btnText = " " + $.i18n._("Add to current smart block");
} else {
btnText = " " + $.i18n._("Add to current playlist");
}
AIRTIME.library.changeAddButtonText(
$(".btn-group #library-plus #lib-plus-text"),
btnText
);
};
var selected = mod.getChosenItemsLength(), mod.fnRowCallback = function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
sortable = $('.spl_sortable:visible'), var $nRow = $(nRow);
check = false, if (aData.ftype === "audioclip") {
blockType = $('input[name=sp_type]:checked', '#smart-block-form').val(); $nRow.addClass("lib-audio");
$image = $nRow.find("td.library_type");
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream");
} else if (aData.ftype === "block") {
$nRow.addClass("lib-block");
} else {
$nRow.addClass("lib-pl");
}
// make sure audioclips are selected and a playlist or static block is currently open. $nRow
// static blocks have value of 0 .attr("id", aData["tr_id"])
// dynamic blocks have value of 1 .data("aData", aData)
if (selected !== 0 && (sortable.length !== 0 || blockType === "0")) { .data("screen", "playlist");
check = true;
if (aData["bl_type"] !== undefined) {
$nRow.attr("bl_type", aData["bl_type"]);
}
};
mod.fnDrawCallback = function () {
mod.redrawChosen();
mod.checkToolBarIcons();
$(
"#library_display tr.lib-audio, tr.lib-stream, tr.lib-pl, tr.lib-block"
).draggable({
helper: function () {
var $el = $(this),
selected = mod.getChosenAudioFilesLength(),
container,
message,
li = $(".side_playlist ul[id='spl_sortable'] li:first"),
width = li.width(),
height = 55;
if (width > 798) width = 798;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
} }
if (check === true) { if (selected === 1) {
AIRTIME.button.enableButton("btn-group #library-plus", false); message = $.i18n._("Adding 1 Item");
} else { } else {
AIRTIME.button.disableButton("btn-group #library-plus", false); message = sprintf($.i18n._("Adding %s Items"), selected);
} }
var objType = $('.obj_type').val(), container = $('<div class="helper"/>')
btnText; .append("<li/>")
if (objType === 'playlist') { .find("li")
btnText = ' '+$.i18n._('Add to current playlist'); .addClass("ui-state-default")
} else if (objType === 'block') { .append("<div/>")
btnText = ' '+$.i18n._('Add to current smart block'); .find("div")
} else { .addClass("list-item-container")
btnText = ' '+$.i18n._('Add to current playlist'); .append(message)
} .end()
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText); .width(width)
}; .height(height)
.end();
mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { return container;
var $nRow = $(nRow); },
if (aData.ftype === "audioclip") { cursor: "pointer",
$nRow.addClass("lib-audio"); cursorAt: {
$image = $nRow.find('td.library_type'); top: 30,
if (!isAudioSupported(aData.mime)) { left: 100,
$image.html('<span class="ui-icon ui-icon-locked"></span>'); },
aData.image = '<span class="ui-icon ui-icon-locked"></span>'; connectToSortable: ".spl_sortable",
} });
} else if (aData.ftype === "stream") { };
$nRow.addClass("lib-stream");
} else if (aData.ftype === "block") { mod.dblClickAdd = function (data, type) {
$nRow.addClass("lib-block"); var i,
} else { aMediaIds = [];
$nRow.addClass("lib-pl");
// process selected files/playlists.
aMediaIds.push(new Array(data.id, data.ftype));
// check if a playlist/block is open before adding items
if (
$('input[id="obj_type"]').val() == "playlist" ||
$('input[id="obj_type"]').val() == "block"
) {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, "after");
}
};
mod.setupLibraryToolbar = function () {
var $toolbar = $(".lib-content .fg-toolbar:first");
mod.createToolbarButtons();
$toolbar.append($menu);
// add to playlist button
$toolbar
.find(".icon-plus")
.parent()
.click(function () {
if (AIRTIME.button.isDisabled("btn-group #library-plus") === true) {
return;
} }
$nRow.attr("id", aData["tr_id"]).data("aData", aData).data("screen", var aData = AIRTIME.library.getSelectedData(),
"playlist"); i,
temp,
if (aData["bl_type"] !== undefined) { length,
$nRow.attr("bl_type", aData["bl_type"]); aMediaIds = [];
}
};
mod.fnDrawCallback = function() {
mod.redrawChosen();
mod.checkToolBarIcons();
$('#library_display tr.lib-audio, tr.lib-stream, tr.lib-pl, tr.lib-block')
.draggable(
{
helper : function() {
var $el = $(this), selected = mod
.getChosenAudioFilesLength(), container, message, li = $(".side_playlist ul[id='spl_sortable'] li:first"),
width = li.width(), height = 55;
if (width > 798) width = 798;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
}
if (selected === 1) {
message = $.i18n._("Adding 1 Item");
} else {
message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('<div class="helper"/>').append(
"<li/>").find("li").addClass(
"ui-state-default").append("<div/>")
.find("div").addClass(
"list-item-container").append(
message).end().width(width)
.height(height).end();
return container;
},
cursor : 'pointer',
cursorAt: {
top: 30,
left: 100
},
connectToSortable : '.spl_sortable'
});
};
mod.dblClickAdd = function(data, type) {
var i, aMediaIds = [];
// process selected files/playlists. // process selected files/playlists.
aMediaIds.push(new Array(data.id, data.ftype)); for (i = 0, length = aData.length; i < length; i++) {
temp = aData[i];
// check if a playlist/block is open before adding items if (
if ($('input[id="obj_type"]').val() == 'playlist' temp.ftype === "audioclip" ||
|| $('input[id="obj_type"]').val() == 'block') { temp.ftype === "block" ||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after'); (temp.ftype === "stream" && $(".obj_type").val() === "playlist")
) {
aMediaIds.push(new Array(temp.id, temp.ftype));
}
} }
}; if (aMediaIds.length > 0) {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, "after");
} else {
if ($(".obj_type").val() == "block") {
alert($.i18n._("You can only add tracks to smart blocks."));
} else if ($(".obj_type").val() == "playlist") {
alert(
$.i18n._(
"You can only add tracks, smart blocks, and webstreams to playlists."
)
);
}
}
});
mod.setupLibraryToolbar = function() { // delete from library.
var $toolbar = $(".lib-content .fg-toolbar:first"); $toolbar
.find(".icon-trash")
.parent()
.click(function () {
if (AIRTIME.button.isDisabled("icon-trash") === true) {
return;
}
mod.createToolbarButtons(); AIRTIME.library.fnDeleteSelectedItems();
});
$toolbar.append($menu); mod.createToolbarDropDown();
};
return AIRTIME;
// add to playlist button })(AIRTIME || {});
$toolbar
.find('.icon-plus').parent()
.click(function() {
if (AIRTIME.button.isDisabled('btn-group #library-plus') === true) {
return;
}
var aData = AIRTIME.library.getSelectedData(), i, temp, length, aMediaIds = [];
// process selected files/playlists.
for (i = 0, length = aData.length; i < length; i++) {
temp = aData[i];
if (temp.ftype === "audioclip"
|| temp.ftype === "block"
|| (temp.ftype === "stream" && $(
".obj_type").val() === "playlist")) {
aMediaIds.push(new Array(temp.id,
temp.ftype));
}
}
if (aMediaIds.length > 0) {
AIRTIME.playlist.fnAddItems(aMediaIds,
undefined, 'after');
} else {
if ($('.obj_type').val() == 'block') {
alert($.i18n._('You can only add tracks to smart blocks.'));
} else if ($('.obj_type').val() == 'playlist') {
alert($.i18n._('You can only add tracks, smart blocks, and webstreams to playlists.'));
}
}
});
// delete from library.
$toolbar.find('.icon-trash').parent().click(function() {
if (AIRTIME.button.isDisabled('icon-trash') === true) {
return;
}
AIRTIME.library.fnDeleteSelectedItems();
});
mod.createToolbarDropDown();
};
return AIRTIME;
}(AIRTIME || {}));

View File

@ -1,391 +1,439 @@
var AIRTIME = (function(AIRTIME) { var AIRTIME = (function (AIRTIME) {
var mod; var mod;
if (AIRTIME.library === undefined) { if (AIRTIME.library === undefined) {
AIRTIME.library = {}; AIRTIME.library = {};
}
mod = AIRTIME.library;
mod.checkAddButton = function () {
var selected = mod.getChosenItemsLength(),
$cursor = $("tr.sb-selected"),
check = false,
shows = $("tr.sb-header"),
current = $("tr.sb-current-show"),
// TODO: this is an ugly way of doing this... we should find a more robust way of checking which view we're in.
btnText =
window.location.href.toLowerCase().indexOf("schedule") > -1
? $.i18n._("Add to show")
: $.i18n._("Add to next show");
// make sure library items are selected and a cursor is selected.
if (selected !== 0) {
check = true;
} }
mod = AIRTIME.library; var sortable = $(".spl_sortable");
if ($("#show_builder_table").is(":visible")) {
if (shows.length === 0) {
check = false;
}
mod.checkAddButton = function() { if ($cursor.length !== 0) {
var selected = mod.getChosenItemsLength(), $cursor = $('tr.sb-selected'), check = false, btnText = $.i18n._("Add after selected items");
shows = $('tr.sb-header'), current = $('tr.sb-current-show'), } else if (current.length !== 0) {
// TODO: this is an ugly way of doing this... we should find a more robust way of checking which view we're in. btnText = $.i18n._("Add to current show");
btnText = (window.location.href.toLowerCase().indexOf("schedule") > -1) ? $.i18n._('Add to show') : $.i18n._('Add to next show'); }
} else if (sortable.length > 0 && sortable.is(":visible")) {
// make sure library items are selected and a cursor is selected. var objType = $(".active-tab .obj_type").val();
if (selected !== 0) { if (objType === "block") {
check = true; btnText = $.i18n._("Add to current smart block");
} } else {
btnText = $.i18n._("Add to current playlist");
var sortable = $(".spl_sortable"); }
if ($("#show_builder_table").is(":visible")) { } else {
if (shows.length === 0) { check = false;
check = false;
}
if ($cursor.length !== 0) {
btnText = $.i18n._('Add after selected items');
} else if (current.length !== 0) {
btnText = $.i18n._('Add to current show');
}
} else if (sortable.length > 0 && sortable.is(":visible")) {
var objType = $('.active-tab .obj_type').val();
if (objType === 'block') {
btnText = $.i18n._('Add to current smart block');
} else {
btnText = $.i18n._('Add to current playlist');
}
} else {
check = false;
}
if (check) {
AIRTIME.button.enableButton("btn-group #library-plus", false);
} else {
AIRTIME.button.disableButton("btn-group #library-plus", false);
}
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
};
mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
var $nRow = $(nRow);
if (aData.ftype === "audioclip") {
$nRow.addClass("lib-audio");
$image = $nRow.find('td.library_type');
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream");
} else {
$nRow.addClass("lib-pl");
}
$nRow.attr("id", aData["tr_id"]).data("aData", aData).data("screen",
"timeline");
};
/**
* Draw a placeholder for the given table to show if it has no data.
*
* @param {Object} table jQuery object containing the table DOM node
*/
mod.drawEmptyPlaceholder = function (table) {
var opts;
if (table instanceof AIRTIME.widgets.Table) {
opts = table.getEmptyPlaceholder();
table = table.getDatatable();
if (!table) {
return;
}
}
var emptyRow = table.find('tr:has(td.dataTables_empty)'),
wrapper = table.closest(".dataTables_wrapper"),
libEmpty = wrapper.find('.empty_placeholder');
if (emptyRow.length > 0) {
emptyRow.hide();
var mediaType = parseInt($('.media_type_selector.selected').data('selection-id')),
img = wrapper.find('.empty_placeholder_image');
if (!opts && isNaN(mediaType)) {
return;
}
// Remove all classes for when we change between empty media types
img.removeClass(function() { return $(this).attr("class"); });
if (opts) {
img.addClass("empty_placeholder_image " + opts.iconClass);
wrapper.find('.empty_placeholder_text').html(opts.html);
} else {
opts = AIRTIME.library.placeholder(mediaType);
img.addClass("empty_placeholder_image icon-white " + opts.icon);
wrapper.find('.empty_placeholder_text').html(
$.i18n._("You haven't added any " + opts.media)
+ "<br/>" + $.i18n._(opts.subtext)
+ "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
);
}
libEmpty.show();
} else {
libEmpty.hide();
}
};
mod.fnDrawCallback = function fnLibDrawCallback() {
var table = $('#library_display'),
cb = table.find('th[class*="checkbox"]');
if (cb.find("input").length == 0) {
cb.append("<input id='super-checkbox' type='checkbox'>");
}
mod.redrawChosen();
mod.checkToolBarIcons();
mod.drawEmptyPlaceholder(table);
var sortable;
if ($("#show_builder_table").is(":visible")) {
sortable = "#show_builder_table";
} else {
sortable = ".active-tab .spl_sortable";
}
$('#library_display tr[class*="lib-"]')
.draggable(
{
helper: function () {
var $el = $(this), selected = mod
.getChosenItemsLength(), container, thead = $("#show_builder_table thead"), colspan = thead
.find("th").length, width = $el.width(), message;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
}
if (selected === 1) {
message = $.i18n._("Adding 1 Item");
} else {
message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('<div/>').attr('id',
'draggingContainer').append('<tr/>')
.find("tr").append('<td/>').find("td")
.attr("colspan", colspan).width(width)
.addClass("ui-state-highlight").append(
message).end().end();
return container;
},
create: function(event, ui) {
$(this).draggable("option", "cursorAt", {
top: 20,
left: Math.floor($(this).outerWidth() / 2)
});
},
tolerance: 'pointer',
cursor: 'move',
distance: 25, // min-distance for dragging
connectToSortable: sortable
});
};
mod.dblClickAdd = function(data, type) {
var i, length, temp, aMediaIds = [], aSchedIds = [], aData = [];
if ($("#show_builder_table").is(":visible")) {
// process selected files/playlists.
aMediaIds.push({
"id": data.id,
"type": type
});
$("#show_builder_table tr.sb-selected").each(function (i, el) {
aData.push($(el).data("aData"));
});
// process selected schedule rows to add media after.
for (i = 0, length = aData.length; i < length; i++) {
temp = aData[i];
aSchedIds.push({
"id": temp.id,
"instance": temp.instance,
"timestamp": temp.timestamp
});
}
if (aSchedIds.length == 0) {
if (!addToCurrentOrNext(aSchedIds)) {
return;
}
}
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
} else {
// process selected files/playlists.
aMediaIds.push(new Array(data.id, data.ftype));
// check if a playlist/block is open before adding items
if ($('.active-tab .obj_type').val() == 'playlist'
|| $('.active-tab .obj_type').val() == 'block') {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
}
}
};
function addToCurrentOrNext(arr) {
var el;
// Add to the end of the current or next show by getting the footer
el = $(".sb-footer.sb-future:first");
var data = el.prev().data("aData");
if (data === undefined) {
alert($.i18n._("Cannot schedule outside a show.\nTry creating a show first."));
return false;
}
arr.push({
"id" : data.id,
"instance" : data.instance,
"timestamp" : data.timestamp
});
if (!isInView(el)) {
$('.dataTables_scrolling.sb-padded').animate({
scrollTop: el.offset().top
}, 0);
}
return true;
} }
mod.addToSchedule = function (selected) { if (check) {
console.log(selected); AIRTIME.button.enableButton("btn-group #library-plus", false);
var aMediaIds = [], aSchedIds = [], aData = []; } else {
AIRTIME.button.disableButton("btn-group #library-plus", false);
}
$.each(selected, function () { AIRTIME.library.changeAddButtonText(
aMediaIds.push({ $(".btn-group #library-plus #lib-plus-text"),
"id": this.id, btnText
"type": this.ftype );
}); };
});
// process selected files/playlists. mod.fnRowCallback = function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$("#show_builder_table").find("tr.sb-selected").each(function (i, el) { var $nRow = $(nRow);
aData.push($(el).data("aData"));
});
// process selected schedule rows to add media after. if (aData.ftype === "audioclip") {
$.each(aData, function () { $nRow.addClass("lib-audio");
aSchedIds.push({ $image = $nRow.find("td.library_type");
"id": this.id, if (!isAudioSupported(aData.mime)) {
"instance": this.instance, $image.html('<span class="ui-icon ui-icon-locked"></span>');
"timestamp": this.timestamp aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}); }
}); } else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream");
} else {
$nRow.addClass("lib-pl");
}
if (aSchedIds.length == 0) { $nRow
if (!addToCurrentOrNext(aSchedIds)) { .attr("id", aData["tr_id"])
return; .data("aData", aData)
} .data("screen", "timeline");
};
/**
* Draw a placeholder for the given table to show if it has no data.
*
* @param {Object} table jQuery object containing the table DOM node
*/
mod.drawEmptyPlaceholder = function (table) {
var opts;
if (table instanceof AIRTIME.widgets.Table) {
opts = table.getEmptyPlaceholder();
table = table.getDatatable();
if (!table) {
return;
}
}
var emptyRow = table.find("tr:has(td.dataTables_empty)"),
wrapper = table.closest(".dataTables_wrapper"),
libEmpty = wrapper.find(".empty_placeholder");
if (emptyRow.length > 0) {
emptyRow.hide();
var mediaType = parseInt(
$(".media_type_selector.selected").data("selection-id")
),
img = wrapper.find(".empty_placeholder_image");
if (!opts && isNaN(mediaType)) {
return;
}
// Remove all classes for when we change between empty media types
img.removeClass(function () {
return $(this).attr("class");
});
if (opts) {
img.addClass("empty_placeholder_image " + opts.iconClass);
wrapper.find(".empty_placeholder_text").html(opts.html);
} else {
opts = AIRTIME.library.placeholder(mediaType);
img.addClass("empty_placeholder_image icon-white " + opts.icon);
wrapper
.find(".empty_placeholder_text")
.html(
$.i18n._("You haven't added any " + opts.media) +
"<br/>" +
$.i18n._(opts.subtext) +
"<br/><a target='_blank' href='" +
opts.href +
"'>" +
$.i18n._("Learn about " + opts.media) +
"</a>"
);
}
libEmpty.show();
} else {
libEmpty.hide();
}
};
mod.fnDrawCallback = function fnLibDrawCallback() {
var table = $("#library_display"),
cb = table.find('th[class*="checkbox"]');
if (cb.find("input").length == 0) {
cb.append("<input id='super-checkbox' type='checkbox'>");
}
mod.redrawChosen();
mod.checkToolBarIcons();
mod.drawEmptyPlaceholder(table);
var sortable;
if ($("#show_builder_table").is(":visible")) {
sortable = "#show_builder_table";
} else {
sortable = ".active-tab .spl_sortable";
}
$('#library_display tr[class*="lib-"]').draggable({
helper: function () {
var $el = $(this),
selected = mod.getChosenItemsLength(),
container,
thead = $("#show_builder_table thead"),
colspan = thead.find("th").length,
width = $el.width(),
message;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
} }
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds); if (selected === 1) {
}; message = $.i18n._("Adding 1 Item");
} else {
mod.setupLibraryToolbar = function() { message = sprintf($.i18n._("Adding %s Items"), selected);
var $toolbar = $(".lib-content .fg-toolbar:first");
mod.createToolbarButtons();
//mod.moveSearchBarToHeader();
$("#advanced_search").click(function(e) {
e.stopPropagation();
});
if (localStorage.getItem('user-type') != 'G') {
$toolbar.append($menu);
// add to timeline button
$toolbar
.find('#library-plus')
.click(
function () {
if (AIRTIME.button.isDisabled('btn-group #library-plus') === true) {
return;
}
var selected = AIRTIME.library.getSelectedData(), aMediaIds = [];
if ($("#show_builder_table").is(":visible")) {
mod.addToSchedule(selected);
} else {
$.each(selected, function () {
aMediaIds.push([this.id, this.ftype]);
});
// check if a playlist/block is open before adding items
if ($('.active-tab .obj_type').val() == 'playlist'
|| $('.active-tab .obj_type').val() == 'block') {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
}
}
});
$toolbar.find('#publish-btn').click(function () {
if (AIRTIME.button.isDisabled('btn-group #publish-btn') === true) {
return;
}
var selected = $(".lib-selected");
selected.each(function (i, el) {
var data = $(el).data("aData");
AIRTIME.publish.openPublishDialog(data.id);
});
});
// delete from library.
$toolbar.find('#sb-delete').click(function () {
if (AIRTIME.button.isDisabled('btn-group #sb-delete') === true) {
return;
}
AIRTIME.library.fnDeleteSelectedItems();
});
$toolbar.find('#sb-new').click(function () {
if (AIRTIME.button.isDisabled('btn-group #sb-new') === true) {
return;
}
var selection = $(".media_type_selector.selected").data("selection-id");
if (selection == AIRTIME.library.MediaTypeIntegerEnum.PLAYLIST) {
AIRTIME.playlist.fnNew();
} else if (selection == AIRTIME.library.MediaTypeIntegerEnum.BLOCK) {
AIRTIME.playlist.fnNewBlock();
} else if (selection == AIRTIME.library.MediaTypeIntegerEnum.WEBSTREAM) {
AIRTIME.playlist.fnWsNew();
}
});
$toolbar.find('#sb-edit').click(function () {
if (AIRTIME.button.isDisabled('btn-group #sb-edit') === true) {
return;
}
var selected = $(".lib-selected");
selected.each(function (i, el) {
var data = $(el).data("aData");
if (data.ftype === "audioclip") {
$.get(baseUrl + "library/edit-file-md/id/" + data.id, {format: "json"}, function (json) {
AIRTIME.playlist.fileMdEdit(json, data.tr_id);
//buildEditMetadataDialog(json);
});
} else if (data.ftype === "playlist" || data.ftype === "block") {
AIRTIME.playlist.fnEdit(data, baseUrl + 'playlist/edit');
AIRTIME.playlist.validatePlaylistElements();
} else if (data.ftype === "stream") {
AIRTIME.playlist.fnEdit(data, baseUrl + 'webstream/edit');
}
});
});
mod.createToolbarDropDown();
} }
};
return AIRTIME; container = $("<div/>")
.attr("id", "draggingContainer")
.append("<tr/>")
.find("tr")
.append("<td/>")
.find("td")
.attr("colspan", colspan)
.width(width)
.addClass("ui-state-highlight")
.append(message)
.end()
.end();
}(AIRTIME || {})); return container;
},
create: function (event, ui) {
$(this).draggable("option", "cursorAt", {
top: 20,
left: Math.floor($(this).outerWidth() / 2),
});
},
tolerance: "pointer",
cursor: "move",
distance: 25, // min-distance for dragging
connectToSortable: sortable,
});
};
mod.dblClickAdd = function (data, type) {
var i,
length,
temp,
aMediaIds = [],
aSchedIds = [],
aData = [];
if ($("#show_builder_table").is(":visible")) {
// process selected files/playlists.
aMediaIds.push({
id: data.id,
type: type,
});
$("#show_builder_table tr.sb-selected").each(function (i, el) {
aData.push($(el).data("aData"));
});
// process selected schedule rows to add media after.
for (i = 0, length = aData.length; i < length; i++) {
temp = aData[i];
aSchedIds.push({
id: temp.id,
instance: temp.instance,
timestamp: temp.timestamp,
});
}
if (aSchedIds.length == 0) {
if (!addToCurrentOrNext(aSchedIds)) {
return;
}
}
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
} else {
// process selected files/playlists.
aMediaIds.push(new Array(data.id, data.ftype));
// check if a playlist/block is open before adding items
if (
$(".active-tab .obj_type").val() == "playlist" ||
$(".active-tab .obj_type").val() == "block"
) {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, "after");
}
}
};
function addToCurrentOrNext(arr) {
var el;
// Add to the end of the current or next show by getting the footer
el = $(".sb-footer.sb-future:first");
var data = el.prev().data("aData");
if (data === undefined) {
alert(
$.i18n._("Cannot schedule outside a show.\nTry creating a show first.")
);
return false;
}
arr.push({
id: data.id,
instance: data.instance,
timestamp: data.timestamp,
});
if (!isInView(el)) {
$(".dataTables_scrolling.sb-padded").animate(
{
scrollTop: el.offset().top,
},
0
);
}
return true;
}
mod.addToSchedule = function (selected) {
console.log(selected);
var aMediaIds = [],
aSchedIds = [],
aData = [];
$.each(selected, function () {
aMediaIds.push({
id: this.id,
type: this.ftype,
});
});
// process selected files/playlists.
$("#show_builder_table")
.find("tr.sb-selected")
.each(function (i, el) {
aData.push($(el).data("aData"));
});
// process selected schedule rows to add media after.
$.each(aData, function () {
aSchedIds.push({
id: this.id,
instance: this.instance,
timestamp: this.timestamp,
});
});
if (aSchedIds.length == 0) {
if (!addToCurrentOrNext(aSchedIds)) {
return;
}
}
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
};
mod.setupLibraryToolbar = function () {
var $toolbar = $(".lib-content .fg-toolbar:first");
mod.createToolbarButtons();
//mod.moveSearchBarToHeader();
$("#advanced_search").click(function (e) {
e.stopPropagation();
});
if (localStorage.getItem("user-type") != "G") {
$toolbar.append($menu);
// add to timeline button
$toolbar.find("#library-plus").click(function () {
if (AIRTIME.button.isDisabled("btn-group #library-plus") === true) {
return;
}
var selected = AIRTIME.library.getSelectedData(),
aMediaIds = [];
if ($("#show_builder_table").is(":visible")) {
mod.addToSchedule(selected);
} else {
$.each(selected, function () {
aMediaIds.push([this.id, this.ftype]);
});
// check if a playlist/block is open before adding items
if (
$(".active-tab .obj_type").val() == "playlist" ||
$(".active-tab .obj_type").val() == "block"
) {
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, "after");
}
}
});
$toolbar.find("#publish-btn").click(function () {
if (AIRTIME.button.isDisabled("btn-group #publish-btn") === true) {
return;
}
var selected = $(".lib-selected");
selected.each(function (i, el) {
var data = $(el).data("aData");
AIRTIME.publish.openPublishDialog(data.id);
});
});
// delete from library.
$toolbar.find("#sb-delete").click(function () {
if (AIRTIME.button.isDisabled("btn-group #sb-delete") === true) {
return;
}
AIRTIME.library.fnDeleteSelectedItems();
});
$toolbar.find("#sb-new").click(function () {
if (AIRTIME.button.isDisabled("btn-group #sb-new") === true) {
return;
}
var selection = $(".media_type_selector.selected").data("selection-id");
if (selection == AIRTIME.library.MediaTypeIntegerEnum.PLAYLIST) {
AIRTIME.playlist.fnNew();
} else if (selection == AIRTIME.library.MediaTypeIntegerEnum.BLOCK) {
AIRTIME.playlist.fnNewBlock();
} else if (
selection == AIRTIME.library.MediaTypeIntegerEnum.WEBSTREAM
) {
AIRTIME.playlist.fnWsNew();
}
});
$toolbar.find("#sb-edit").click(function () {
if (AIRTIME.button.isDisabled("btn-group #sb-edit") === true) {
return;
}
var selected = $(".lib-selected");
selected.each(function (i, el) {
var data = $(el).data("aData");
if (data.ftype === "audioclip") {
$.get(
baseUrl + "library/edit-file-md/id/" + data.id,
{ format: "json" },
function (json) {
AIRTIME.playlist.fileMdEdit(json, data.tr_id);
//buildEditMetadataDialog(json);
}
);
} else if (data.ftype === "playlist" || data.ftype === "block") {
AIRTIME.playlist.fnEdit(data, baseUrl + "playlist/edit");
AIRTIME.playlist.validatePlaylistElements();
} else if (data.ftype === "stream") {
AIRTIME.playlist.fnEdit(data, baseUrl + "webstream/edit");
}
});
});
mod.createToolbarDropDown();
}
};
return AIRTIME;
})(AIRTIME || {});

File diff suppressed because it is too large Load Diff

View File

@ -1,219 +1,237 @@
$(document).ready(function () { $(document).ready(function () {
var uploadProgress;
var self = this;
self.uploadFilter = "all";
var uploadProgress; self.IMPORT_STATUS_CODES = {
var self = this; 0: { message: $.i18n._("Successfully imported") },
self.uploadFilter = "all"; 1: { message: $.i18n._("Pending import") },
2: { message: $.i18n._("Import failed.") },
UNKNOWN: { message: $.i18n._("Unknown") },
};
if (Object.freeze) {
Object.freeze(self.IMPORT_STATUS_CODES);
}
self.IMPORT_STATUS_CODES = { Dropzone.options.addMediaDropzone = {
0: {message: $.i18n._("Successfully imported")}, url: "/rest/media",
1: {message: $.i18n._("Pending import")}, //clickable: false,
2: {message: $.i18n._("Import failed.")}, acceptedFiles: acceptedMimeTypes.join(),
UNKNOWN: {message: $.i18n._("Unknown")} addRemoveLinks: true,
}; dictRemoveFile: $.i18n._("Remove"),
if (Object.freeze) { maxFilesize: LIBRETIME_PLUPLOAD_MAX_FILE_SIZE, //Megabytes
Object.freeze(self.IMPORT_STATUS_CODES); init: function () {
this.on("sending", function (file, xhr, data) {
data.append("csrf_token", $("#csrf").val());
});
this.on("addedfile", function (file, xhr, data) {
var el = $(file.previewElement);
uploadProgress = true;
el.find(".dz-remove").prependTo(el.find(".dz-details"));
el.find(".dz-error-message").appendTo(el.find(".dz-error-mark"));
});
this.on("success", function (file, xhr, data) {
//Refresh the upload table:
self.recentUploadsTable.fnDraw(); //Only works because we're using bServerSide
//In DataTables 1.10 and greater, we can use .fnAjaxReload()
});
this.on("queuecomplete", function () {
uploadProgress = false;
});
},
};
$(window).bind("beforeunload", function () {
if (uploadProgress) {
return sprintf(
$.i18n._(
"You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"
),
"\n",
"\n"
);
}
});
self.renderImportStatus = function (data, type, full) {
if (typeof data !== "number") {
console.log("Invalid data type for the import_status.");
return;
}
var statusStr = self.IMPORT_STATUS_CODES.UNKNOWN.message;
var importStatusCode = data;
if (self.IMPORT_STATUS_CODES[importStatusCode]) {
statusStr = self.IMPORT_STATUS_CODES[importStatusCode].message;
} }
Dropzone.options.addMediaDropzone = { return statusStr;
url: '/rest/media', };
//clickable: false,
acceptedFiles: acceptedMimeTypes.join(),
addRemoveLinks: true,
dictRemoveFile: $.i18n._("Remove"),
maxFilesize:LIBRETIME_PLUPLOAD_MAX_FILE_SIZE, //Megabytes
init: function () {
this.on("sending", function (file, xhr, data) {
data.append("csrf_token", $("#csrf").val());
});
this.on("addedfile", function (file, xhr, data) { self.renderFileActions = function (data, type, full) {
var el = $(file.previewElement); if (full.import_status == 0) {
uploadProgress = true; return (
el.find(".dz-remove").prependTo(el.find(".dz-details")); '<a class="deleteFileAction">' +
el.find(".dz-error-message").appendTo(el.find(".dz-error-mark")); $.i18n._("Delete from Library") +
}); "</a>"
);
} else if (full.import_status == 1) {
//No actions for pending files
return $.i18n._("N/A");
} else {
//Failed downloads
return '<a class="deleteFileAction">' + $.i18n._("Clear") + "</a>";
}
};
this.on("success", function (file, xhr, data) { $("#recent_uploads_table").on("click", "a.deleteFileAction", function () {
//Refresh the upload table: //Grab the file object for the row that was clicked.
self.recentUploadsTable.fnDraw(); //Only works because we're using bServerSide // Some tips from the DataTables forums:
//In DataTables 1.10 and greater, we can use .fnAjaxReload() // fnGetData is used to get the object behind the row - you can also use
}); // fnGetPosition if you need to get the index instead
file = $("#recent_uploads_table")
.dataTable()
.fnGetData($(this).closest("tr")[0]);
this.on("queuecomplete", function() { $.ajax({
uploadProgress = false; type: "DELETE",
}); url: "rest/media/" + file.id + "?csrf_token=" + $("#csrf").attr("value"),
} success: function (resp) {
}; self.recentUploadsTable.fnDraw();
},
$(window).bind('beforeunload', function () { error: function () {
if (uploadProgress) { alert(
return sprintf($.i18n._("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"), $.i18n._(
"\n", "\n"); "Error: The file could not be deleted. Please try again later."
} )
);
},
}); });
});
self.renderImportStatus = function (data, type, full) { self.setupRecentUploadsTable = function () {
if (typeof data !== "number") { return $("#recent_uploads_table").dataTable({
console.log("Invalid data type for the import_status."); bJQueryUI: true,
return; bProcessing: false,
} bServerSide: true,
var statusStr = self.IMPORT_STATUS_CODES.UNKNOWN.message; sAjaxSource: "/plupload/recent-uploads/format/json",
var importStatusCode = data; sAjaxDataProp: "files",
if (self.IMPORT_STATUS_CODES[importStatusCode]) { bSearchable: false,
statusStr = self.IMPORT_STATUS_CODES[importStatusCode].message; bInfo: true,
} //"sScrollY": "200px",
bFilter: false,
return statusStr; bSort: false,
}; //"sDom": '<"H">frtip<"F"l>',
sDom: '<"dataTables_scrolling"frt><"F"lip>',
self.renderFileActions = function (data, type, full) { bPaginate: true,
if (full.import_status == 0) { sPaginationType: "full_numbers",
return '<a class="deleteFileAction">' + $.i18n._('Delete from Library') + '</a>'; oLanguage: getDatatablesStrings({
} else if (full.import_status == 1) { sEmptyTable: $.i18n._("No files have been uploaded yet."),
//No actions for pending files sInfoEmpty: $.i18n._("Showing 0 to 0 of 0 uploads"),
return $.i18n._('N/A'); sInfo: $.i18n._("Showing _START_ to _END_ of _TOTAL_ uploads"),
} else { //Failed downloads sInfoFiltered: $.i18n._("(filtered from _MAX_ total uploads)"),
return '<a class="deleteFileAction">' + $.i18n._('Clear') + '</a>'; }),
} aoColumns: [
}; { mData: "artist_name", sTitle: $.i18n._("Creator") },
{ mData: "track_title", sTitle: $.i18n._("Title") },
$("#recent_uploads_table").on("click", "a.deleteFileAction", function () { {
//Grab the file object for the row that was clicked. mData: "import_status",
// Some tips from the DataTables forums: sTitle: $.i18n._("Import Status"),
// fnGetData is used to get the object behind the row - you can also use mRender: self.renderImportStatus,
// fnGetPosition if you need to get the index instead },
file = $("#recent_uploads_table").dataTable().fnGetData($(this).closest("tr")[0]); { mData: "utime", sTitle: $.i18n._("Uploaded") },
{
$.ajax({ mData: "id",
type: 'DELETE', sTitle: $.i18n._("Actions"),
url: 'rest/media/' + file.id + "?csrf_token=" + $("#csrf").attr('value'), mRender: self.renderFileActions,
success: function (resp) { },
self.recentUploadsTable.fnDraw(); ],
}, fnServerData: function (sSource, aoData, fnCallback) {
error: function () { /* Add some extra data to the sender */
alert($.i18n._("Error: The file could not be deleted. Please try again later.")); aoData.push({ name: "uploadFilter", value: self.uploadFilter });
$.getJSON(sSource, aoData, function (json) {
fnCallback(json);
if (json.files) {
var areAnyFileImportsPending = false;
for (var i = 0; i < json.files.length; i++) {
//console.log(file);
var file = json.files[i];
if (file.import_status == 1) {
areAnyFileImportsPending = true;
}
} }
if (areAnyFileImportsPending) {
//alert("pending uploads, starting refresh on timer");
self.startRefreshingRecentUploads();
} else if (self.isRecentUploadsRefreshTimerActive) {
self.stopRefreshingRecentUploads();
self.recentUploadsTable.fnDraw();
}
// Update usability hint - in common.js
getUsabilityHint();
}
}); });
},
}); });
};
self.setupRecentUploadsTable = function () { $("#recent_uploads").addTitles("td");
return $("#recent_uploads_table").dataTable({
"bJQueryUI": true,
"bProcessing": false,
"bServerSide": true,
"sAjaxSource": '/plupload/recent-uploads/format/json',
"sAjaxDataProp": 'files',
"bSearchable": false,
"bInfo": true,
//"sScrollY": "200px",
"bFilter": false,
"bSort": false,
//"sDom": '<"H">frtip<"F"l>',
"sDom": '<"dataTables_scrolling"frt><"F"lip>',
"bPaginate": true,
"sPaginationType": "full_numbers",
"oLanguage": getDatatablesStrings({
"sEmptyTable": $.i18n._("No files have been uploaded yet."),
"sInfoEmpty": $.i18n._("Showing 0 to 0 of 0 uploads"),
"sInfo": $.i18n._("Showing _START_ to _END_ of _TOTAL_ uploads"),
"sInfoFiltered": $.i18n._("(filtered from _MAX_ total uploads)"),
}),
"aoColumns": [
{"mData": "artist_name", "sTitle": $.i18n._("Creator")},
{"mData": "track_title", "sTitle": $.i18n._("Title")},
{
"mData": "import_status", "sTitle": $.i18n._("Import Status"),
"mRender": self.renderImportStatus
},
{"mData": "utime", "sTitle": $.i18n._("Uploaded")},
{
"mData": "id", "sTitle": $.i18n._("Actions"),
"mRender": self.renderFileActions
}
],
"fnServerData": function (sSource, aoData, fnCallback) {
/* Add some extra data to the sender */
aoData.push({"name": "uploadFilter", "value": self.uploadFilter});
$.getJSON(sSource, aoData, function (json) {
fnCallback(json);
if (json.files) {
var areAnyFileImportsPending = false;
for (var i = 0; i < json.files.length; i++) {
//console.log(file);
var file = json.files[i];
if (file.import_status == 1) {
areAnyFileImportsPending = true;
}
}
if (areAnyFileImportsPending) { self.isRecentUploadsRefreshTimerActive = false;
//alert("pending uploads, starting refresh on timer");
self.startRefreshingRecentUploads();
} else if (self.isRecentUploadsRefreshTimerActive) {
self.stopRefreshingRecentUploads();
self.recentUploadsTable.fnDraw();
}
// Update usability hint - in common.js self.startRefreshingRecentUploads = function () {
getUsabilityHint(); if (!self.isRecentUploadsRefreshTimerActive) {
} //Prevent multiple timers from running
}); self.recentUploadsRefreshTimer = setInterval(function () {
} self.recentUploadsTable.fnDraw();
}); }, 3000);
}; self.isRecentUploadsRefreshTimerActive = true;
}
$("#recent_uploads").addTitles("td"); };
self.stopRefreshingRecentUploads = function () {
clearInterval(self.recentUploadsRefreshTimer);
self.isRecentUploadsRefreshTimerActive = false; self.isRecentUploadsRefreshTimerActive = false;
};
self.startRefreshingRecentUploads = function () { $("#upload_status_all").click(function () {
if (!self.isRecentUploadsRefreshTimerActive) { //Prevent multiple timers from running if (self.uploadFilter !== "all") {
self.recentUploadsRefreshTimer = setInterval(function() { self.uploadFilter = "all";
self.recentUploadsTable.fnDraw(); self.recentUploadsTable.fnPageChange(0).fnDraw();
}, 3000); }
self.isRecentUploadsRefreshTimerActive = true; });
} $("#upload_status_pending").click(function () {
}; if (self.uploadFilter !== "pending") {
self.uploadFilter = "pending";
self.recentUploadsTable.fnPageChange(0).fnDraw();
}
});
$("#upload_status_failed").click(function () {
if (self.uploadFilter !== "failed") {
self.uploadFilter = "failed";
self.recentUploadsTable.fnPageChange(0).fnDraw();
}
});
self.stopRefreshingRecentUploads = function () { //Create the recent uploads table.
clearInterval(self.recentUploadsRefreshTimer); self.recentUploadsTable = self.setupRecentUploadsTable();
self.isRecentUploadsRefreshTimerActive = false;
};
$("#upload_status_all").click(function () { //$("#recent_uploads_table.div.fg-toolbar").prepend('<b>Custom tool bar! Text/images etc.</b>');
if (self.uploadFilter !== "all") {
self.uploadFilter = "all";
self.recentUploadsTable.fnPageChange(0).fnDraw();
}
});
$("#upload_status_pending").click(function () {
if (self.uploadFilter !== "pending") {
self.uploadFilter = "pending";
self.recentUploadsTable.fnPageChange(0).fnDraw();
}
});
$("#upload_status_failed").click(function () {
if (self.uploadFilter !== "failed") {
self.uploadFilter = "failed";
self.recentUploadsTable.fnPageChange(0).fnDraw();
}
});
//Create the recent uploads table. $("#select_type").on("change", function () {
self.recentUploadsTable = self.setupRecentUploadsTable(); var ttValue = $("#select_type").val();
var ttText = $('#select_type option[value="' + ttValue + '"]').text();
//$("#recent_uploads_table.div.fg-toolbar").prepend('<b>Custom tool bar! Text/images etc.</b>'); if (ttValue != "") {
$("#upload_type").text(" " + ttText);
$("#select_type").on("change",function(){ $("#upload_type").css("color", "#ff611f");
var ttValue = $("#select_type").val(); } else {
var ttText = $('#select_type option[value="'+ttValue+'"]').text(); $("#upload_type").text(" Tracks");
if (ttValue != ""){ $("#upload_type").css("color", "#ffffff");
$("#upload_type").text(" " + ttText); }
$("#upload_type").css("color", "#ff611f"); Cookies.set("tt_upload", ttValue);
} else { });
$("#upload_type").text(" Tracks");
$("#upload_type").css("color", "#ffffff");
}
Cookies.set('tt_upload', ttValue);
});
}); });

File diff suppressed because it is too large Load Diff

View File

@ -1,114 +1,128 @@
var AIRTIME = (function (AIRTIME) { var AIRTIME = (function (AIRTIME) {
var mod; var mod;
if (AIRTIME.publish === undefined) { if (AIRTIME.publish === undefined) {
AIRTIME.publish = {}; AIRTIME.publish = {};
} }
mod = AIRTIME.publish; mod = AIRTIME.publish;
var endpoint = 'rest/media/'; var endpoint = "rest/media/";
var dialogUrl = 'library/publish-dialog'; var dialogUrl = "library/publish-dialog";
var PUBLISH_APP_NAME = 'publish'; var PUBLISH_APP_NAME = "publish";
//AngularJS app //AngularJS app
var publishApp = angular.module(PUBLISH_APP_NAME, []) var publishApp = angular
.controller('Publish', function ($sce, $scope, $http, mediaId, tab) { .module(PUBLISH_APP_NAME, [])
$scope.publishData = {}; .controller("Publish", function ($sce, $scope, $http, mediaId, tab) {
var sourceInterval; $scope.publishData = {};
var sourceInterval;
tab.contents.on("click", "input[type='checkbox']", function () { tab.contents.on("click", "input[type='checkbox']", function () {
var noSourcesChecked = true; var noSourcesChecked = true;
$.each(tab.contents.find("input[type='checkbox']"), function () { $.each(tab.contents.find("input[type='checkbox']"), function () {
if ($(this).is(":checked")) { if ($(this).is(":checked")) {
noSourcesChecked = false; noSourcesChecked = false;
} }
}); });
tab.contents.find(".publish-btn").prop("disabled", noSourcesChecked); tab.contents.find(".publish-btn").prop("disabled", noSourcesChecked);
});
function fetchSourceData() {
var csrfToken = jQuery("#csrf").val();
$http
.get(endpoint + mediaId, { csrf_token: csrfToken })
.success(function (json) {
$scope.media = json;
tab.setName($scope.media.track_title);
});
// Get an object containing all sources, their translated labels,
// and their publication state for the file with the given ID
$http
.get(endpoint + mediaId + "/publish-sources", {
csrf_token: csrfToken,
})
.success(function (json) {
$scope.sources = { toPublish: [], published: [] };
$.each(json, function () {
if (Math.abs(this.status) == 1) {
$scope.sources.published.push(this);
} else {
$scope.sources.toPublish.push(this);
}
}); });
});
}
function fetchSourceData() { function init() {
var csrfToken = jQuery("#csrf").val(); fetchSourceData();
$http.get(endpoint + mediaId, {csrf_token: csrfToken}) sourceInterval = setInterval(function () {
.success(function (json) { fetchSourceData();
$scope.media = json; }, 5000);
tab.setName($scope.media.track_title);
});
// Get an object containing all sources, their translated labels, tab.assignOnCloseHandler(function () {
// and their publication state for the file with the given ID clearInterval(sourceInterval);
$http.get(endpoint + mediaId + '/publish-sources', {csrf_token: csrfToken}) $scope.$destroy();
.success(function (json) { });
$scope.sources = { toPublish: [], published: []}; }
$.each(json, function () {
if (Math.abs(this.status) == 1) {
$scope.sources.published.push(this);
} else {
$scope.sources.toPublish.push(this);
}
});
});
}
function init() { $scope.openEditDialog = function () {
fetchSourceData(); var uid = AIRTIME.library.MediaTypeStringEnum.FILE + "_" + mediaId;
sourceInterval = setInterval(function() { $.get(
fetchSourceData(); baseUrl + "library/edit-file-md/id/" + mediaId,
}, 5000); { format: "json" },
function (json) {
AIRTIME.playlist.fileMdEdit(json, uid);
}
);
};
tab.assignOnCloseHandler(function () { $scope.publish = function () {
clearInterval(sourceInterval); var data = {};
$scope.$destroy(); jQuery.each($scope.publishData, function (k, v) {
}); if (v) {
} data[k] = "publish"; // FIXME: should be more robust
}
$scope.openEditDialog = function() {
var uid = AIRTIME.library.MediaTypeStringEnum.FILE + "_" + mediaId;
$.get(baseUrl + "library/edit-file-md/id/" + mediaId, {format: "json"}, function (json) {
AIRTIME.playlist.fileMdEdit(json, uid);
});
};
$scope.publish = function () {
var data = {};
jQuery.each($scope.publishData, function (k, v) {
if (v) {
data[k] = 'publish'; // FIXME: should be more robust
}
});
if (data && Object.keys(data).length > 0) {
$http.put(endpoint + mediaId + '/publish', {csrf_token: jQuery("#csrf").val(), sources: data})
.success(function () {
tab.contents.find(".publish-btn").prop("disabled", true);
fetchSourceData();
$scope.publishData = {}; // Reset the publishData in case the user publishes
// and unpublishes without closing the tab
});
}
};
$scope.remove = function (source) {
var data = {};
data[source] = 'unpublish'; // FIXME: should be more robust
$http.put(endpoint + mediaId + '/publish', {csrf_token: jQuery("#csrf").val(), sources: data})
.success(function () {
fetchSourceData();
});
};
$scope.discard = function () {
tab.close();
$scope.media = {};
};
init();
}); });
if (data && Object.keys(data).length > 0) {
$http
.put(endpoint + mediaId + "/publish", {
csrf_token: jQuery("#csrf").val(),
sources: data,
})
.success(function () {
tab.contents.find(".publish-btn").prop("disabled", true);
fetchSourceData();
$scope.publishData = {}; // Reset the publishData in case the user publishes
// and unpublishes without closing the tab
});
}
};
/* $scope.remove = function (source) {
var data = {};
data[source] = "unpublish"; // FIXME: should be more robust
$http
.put(endpoint + mediaId + "/publish", {
csrf_token: jQuery("#csrf").val(),
sources: data,
})
.success(function () {
fetchSourceData();
});
};
$scope.discard = function () {
tab.close();
$scope.media = {};
};
init();
});
/*
var selected = $("#podcast_table").find(".selected"), var selected = $("#podcast_table").find(".selected"),
ids = []; ids = [];
var selectedData = AIRTIME.library.podcastTableWidget.getSelectedRows(); var selectedData = AIRTIME.library.podcastTableWidget.getSelectedRows();
@ -116,15 +130,15 @@ var AIRTIME = (function (AIRTIME) {
ids.push(el.id); ids.push(el.id);
});*/ });*/
function _bootstrapAngularApp(mediaId, tab) { function _bootstrapAngularApp(mediaId, tab) {
publishApp.value('mediaId', mediaId); publishApp.value("mediaId", mediaId);
publishApp.value('tab', tab); publishApp.value("tab", tab);
var wrapper = AIRTIME.tabs.getActiveTab().contents.find(".angular_wrapper"); var wrapper = AIRTIME.tabs.getActiveTab().contents.find(".angular_wrapper");
angular.bootstrap(wrapper.get(0), [PUBLISH_APP_NAME]); angular.bootstrap(wrapper.get(0), [PUBLISH_APP_NAME]);
} }
mod.publishSelectedTracks = function() { mod.publishSelectedTracks = function () {
/* /*
_bulkAction("GET", function(json) { _bulkAction("GET", function(json) {
json.forEach(function(el) { json.forEach(function(el) {
var uid = AIRTIME.library.MediaTypeStringEnum.FILE+"_"+el.id; var uid = AIRTIME.library.MediaTypeStringEnum.FILE+"_"+el.id;
@ -138,18 +152,21 @@ var AIRTIME = (function (AIRTIME) {
}); });
}); });
});*/ });*/
};
}; mod.openPublishDialog = function (mediaId) {
jQuery
.get(dialogUrl, { csrf_token: jQuery("#csrf").val() })
.success(function (html) {
var tab = AIRTIME.tabs.openTab(
html,
PUBLISH_APP_NAME + "_" + mediaId,
null
);
_bootstrapAngularApp(mediaId, tab);
});
mod.openPublishDialog = function(mediaId) { /*
jQuery.get(dialogUrl, { csrf_token: jQuery("#csrf").val() })
.success(function(html) {
var tab = AIRTIME.tabs.openTab(html, PUBLISH_APP_NAME+"_"+mediaId, null);
_bootstrapAngularApp(mediaId, tab);
});
/*
_bulkAction("GET", function(json) { _bulkAction("GET", function(json) {
json.forEach(function(el) { json.forEach(function(el) {
var uid = AIRTIME.library.MediaTypeStringEnum.FILE+"_"+el.id; var uid = AIRTIME.library.MediaTypeStringEnum.FILE+"_"+el.id;
@ -162,7 +179,7 @@ var AIRTIME = (function (AIRTIME) {
}); });
}); });
});*/ });*/
}; };
return AIRTIME; return AIRTIME;
}(AIRTIME || {})); })(AIRTIME || {});

File diff suppressed because it is too large Load Diff

View File

@ -1,194 +1,229 @@
$(document).ready(function() { $(document).ready(function () {
listenerstat_content = $("#listenerstat_content") listenerstat_content = $("#listenerstat_content");
dateStartId = "#his_date_start", (dateStartId = "#his_date_start"),
timeStartId = "#his_time_start", (timeStartId = "#his_time_start"),
dateEndId = "#his_date_end", (dateEndId = "#his_date_end"),
timeEndId = "#his_time_end"; (timeEndId = "#his_time_end");
// set width dynamically // set width dynamically
var width = $("#listenerstat_content").width(); var width = $("#listenerstat_content").width();
width = width * .91; width = width * 0.91;
$("#listenerstat_content").find("#flot_placeholder").width(width); $("#listenerstat_content").find("#flot_placeholder").width(width);
$("#listenerstat_content").find("#legend").width(width); $("#listenerstat_content").find("#legend").width(width);
getDataAndPlot(); getDataAndPlot();
listenerstat_content.find("#his_submit").click(function(){ listenerstat_content.find("#his_submit").click(function () {
var oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); var oRange = AIRTIME.utilities.fnGetScheduleRange(
var start = oRange.start; dateStartId,
var end = oRange.end; timeStartId,
getDataAndPlot(start, end); dateEndId,
}); timeEndId
);
var start = oRange.start;
var end = oRange.end;
getDataAndPlot(start, end);
});
}); });
/** /**
* Toggle a spinner overlay so the user knows the page is processing * Toggle a spinner overlay so the user knows the page is processing
*/ */
function toggleOverlay() { function toggleOverlay() {
$('#flot_placeholder').toggleClass('processing'); $("#flot_placeholder").toggleClass("processing");
} }
function getDataAndPlot(startTimestamp, endTimestamp) { function getDataAndPlot(startTimestamp, endTimestamp) {
// Turn on the processing overlay // Turn on the processing overlay
toggleOverlay(); toggleOverlay();
// get data // get data
$.get(baseUrl+'Listenerstat/get-data', {start: startTimestamp, end: endTimestamp}, function(data){ $.get(
out = new Object(); baseUrl + "Listenerstat/get-data",
$.each(data, function(mpName, v){ { start: startTimestamp, end: endTimestamp },
plotData = new Object(); function (data) {
plotData.data = new Array(); out = new Object();
$.each(v, function(i, ele){ $.each(data, function (mpName, v) {
plotData.label = mpName; plotData = new Object();
var d = new Date(0); plotData.data = new Array();
d.setUTCSeconds(ele.timestamp); $.each(v, function (i, ele) {
plotData.data.push([d, ele.listener_count]); plotData.label = mpName;
}) var d = new Date(0);
out[mpName] = plotData; d.setUTCSeconds(ele.timestamp);
plotData.data.push([d, ele.listener_count]);
}); });
plot(out); out[mpName] = plotData;
// Turn off the processing overlay });
toggleOverlay(); plot(out);
}) // Turn off the processing overlay
toggleOverlay();
}
);
} }
function plot(datasets){ function plot(datasets) {
var plot; var plot;
data = null; data = null;
function plotByChoice(doAll) function plotByChoice(doAll) {
{ // largest date object that you can set
// largest date object that you can set firstTimestamp = new Date(8640000000000000);
firstTimestamp = new Date(8640000000000000); // smallest
// smallest lastTimestamp = new Date(0);
lastTimestamp = new Date(0);
data = []; data = [];
if (doAll != null) if (doAll != null) {
{ $.each(datasets, function (key, val) {
$.each(datasets, function(key, val) { if (firstTimestamp.getTime() > val.data[0][0].getTime()) {
if (firstTimestamp.getTime() > val.data[0][0].getTime()) { firstTimestamp = val.data[0][0];
firstTimestamp = val.data[0][0];
}
if (lastTimestamp.getTime() < val.data[val.data.length-1][0].getTime()) {
lastTimestamp = val.data[val.data.length-1][0];
}
data.push(val);
});
} }
else if (
{ lastTimestamp.getTime() < val.data[val.data.length - 1][0].getTime()
$('#legend .legendCB').each( ) {
function(){ lastTimestamp = val.data[val.data.length - 1][0];
if (this.checked)
{
data.push(datasets[this.id]);
if (firstTimestamp.getTime() > datasets[this.id].data[0][0].getTime()) {
firstTimestamp = datasets[this.id].data[0][0];
}
if (lastTimestamp.getTime() < datasets[this.id].data[datasets[this.id].data.length-1][0].getTime()) {
lastTimestamp = datasets[this.id].data[datasets[this.id].data.length-1][0];
}
}
else
{
data.push({label: this.id, data: []})
}
}
);
} }
data.push(val);
numOfTicks = 10; });
tickSize = (lastTimestamp.getTime() - firstTimestamp.getTime())/1000/numOfTicks; } else {
$("#legend .legendCB").each(function () {
plot = $.plot($("#flot_placeholder"), data, { if (this.checked) {
yaxis: { min: 0, tickDecimals: 0, color: '#d6d6d6', tickColor: '#d6d6d6' }, data.push(datasets[this.id]);
xaxis: { mode: "time", timeformat:"%y/%m/%0d %H:%M", tickSize: [tickSize, "second"], if (
color: '#d6d6d6', tickColor: '#d6d6d6' }, firstTimestamp.getTime() > datasets[this.id].data[0][0].getTime()
grid: { ) {
hoverable: true, firstTimestamp = datasets[this.id].data[0][0];
backgroundColor: { colors: ["#333", "#555"] } }
}, if (
series: { lastTimestamp.getTime() <
lines: { datasets[this.id].data[
show: true, datasets[this.id].data.length - 1
fill: 0.3 ][0].getTime()
}, ) {
points: { show: true } lastTimestamp =
}, datasets[this.id].data[datasets[this.id].data.length - 1][0];
legend: { }
container: $('#legend'), } else {
noColumns: 5, data.push({ label: this.id, data: [] });
color: '#c0c0c0',
labelFormatter: function (label, series) {
var cb = '<input style="float:left;" class="legendCB" type="checkbox" ';
if (series.data.length > 0){
cb += 'checked="true" ';
}
cb += 'id="'+label+'" /> ';
cb += label;
return cb;
}
}
});
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 5,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
} }
});
var previousPoint = null;
$("#flot_placeholder").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY,
sprintf($.i18n._("Listener Count on %s: %s"), item.series.label, Math.floor(y)));
}
}
else {
$("#tooltip").remove();
previousPoint = null;
}
});
$('#legend').find("input").click(function(){setTimeout(plotByChoice,100);});
} }
plotByChoice(true); numOfTicks = 10;
oBaseDatePickerSettings = { tickSize =
dateFormat: 'yy-mm-dd', (lastTimestamp.getTime() - firstTimestamp.getTime()) / 1000 / numOfTicks;
//i18n_months, i18n_days_short are in common.js
monthNames: i18n_months, plot = $.plot($("#flot_placeholder"), data, {
dayNamesMin: i18n_days_short, yaxis: {
onSelect: function(sDate, oDatePicker) { min: 0,
$(this).datepicker( "setDate", sDate ); tickDecimals: 0,
color: "#d6d6d6",
tickColor: "#d6d6d6",
},
xaxis: {
mode: "time",
timeformat: "%y/%m/%0d %H:%M",
tickSize: [tickSize, "second"],
color: "#d6d6d6",
tickColor: "#d6d6d6",
},
grid: {
hoverable: true,
backgroundColor: { colors: ["#333", "#555"] },
},
series: {
lines: {
show: true,
fill: 0.3,
},
points: { show: true },
},
legend: {
container: $("#legend"),
noColumns: 5,
color: "#c0c0c0",
labelFormatter: function (label, series) {
var cb =
'<input style="float:left;" class="legendCB" type="checkbox" ';
if (series.data.length > 0) {
cb += 'checked="true" ';
}
cb += 'id="' + label + '" /> ';
cb += label;
return cb;
},
},
});
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + "</div>")
.css({
position: "absolute",
display: "none",
top: y + 5,
left: x + 5,
border: "1px solid #fdd",
padding: "2px",
"background-color": "#fee",
opacity: 0.8,
})
.appendTo("body")
.fadeIn(200);
}
var previousPoint = null;
$("#flot_placeholder").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var y = item.datapoint[1].toFixed(2);
showTooltip(
item.pageX,
item.pageY,
sprintf(
$.i18n._("Listener Count on %s: %s"),
item.series.label,
Math.floor(y)
)
);
} }
}; } else {
$("#tooltip").remove();
previousPoint = null;
}
});
oBaseTimePickerSettings = { $("#legend")
showPeriodLabels: false, .find("input")
showCloseButton: true, .click(function () {
closeButtonText: $.i18n._("Done"), setTimeout(plotByChoice, 100);
showLeadingZero: false, });
defaultTime: '0:00', }
hourText: $.i18n._("Hour"),
minuteText: $.i18n._("Minute")
};
listenerstat_content.find(dateStartId).datepicker(oBaseDatePickerSettings); plotByChoice(true);
listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings); oBaseDatePickerSettings = {
listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings); dateFormat: "yy-mm-dd",
listenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings); //i18n_months, i18n_days_short are in common.js
monthNames: i18n_months,
dayNamesMin: i18n_days_short,
onSelect: function (sDate, oDatePicker) {
$(this).datepicker("setDate", sDate);
},
};
oBaseTimePickerSettings = {
showPeriodLabels: false,
showCloseButton: true,
closeButtonText: $.i18n._("Done"),
showLeadingZero: false,
defaultTime: "0:00",
hourText: $.i18n._("Hour"),
minuteText: $.i18n._("Minute"),
};
listenerstat_content.find(dateStartId).datepicker(oBaseDatePickerSettings);
listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings);
listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings);
listenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings);
} }

View File

@ -1,127 +1,171 @@
$(document).ready(function() { $(document).ready(function () {
showlistenerstat_content = $("#showlistenerstat_content") showlistenerstat_content = $("#showlistenerstat_content");
dateStartId = "#his_date_start", (dateStartId = "#his_date_start"),
timeStartId = "#his_time_start", (timeStartId = "#his_time_start"),
dateEndId = "#his_date_end", (dateEndId = "#his_date_end"),
timeEndId = "#his_time_end", (timeEndId = "#his_time_end"),
show_id = "#his_show_filter"; (show_id = "#his_show_filter");
// set width dynamically // set width dynamically
var width = $("#showlistenerstat_content").width(); var width = $("#showlistenerstat_content").width();
width = width * .91; width = width * 0.91;
addDatePicker(); addDatePicker();
showlistenerstat_content.find("#his_submit").click(function(){ showlistenerstat_content.find("#his_submit").click(function () {
// var show_id = $("#sb_show_filter").val(); // var show_id = $("#sb_show_filter").val();
var oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); var oRange = AIRTIME.utilities.fnGetScheduleRange(
var start = oRange.start; dateStartId,
var end = oRange.end; timeStartId,
showListenerDataTable(); dateEndId,
}); timeEndId
);
var start = oRange.start;
var end = oRange.end;
showListenerDataTable();
});
}); });
function getShowData(startTimestamp, endTimestamp, show_id) { function getShowData(startTimestamp, endTimestamp, show_id) {
// get data // get data
$.get(baseUrl+'Listenerstat/get-all-show-data', {start: startTimestamp, end: endTimestamp }, function(data) { $.get(
return data; baseUrl + "Listenerstat/get-all-show-data",
}); { start: startTimestamp, end: endTimestamp },
function (data) {
return data;
}
);
} }
function addDatePicker() { function addDatePicker() {
oBaseDatePickerSettings = {
dateFormat: "yy-mm-dd",
//i18n_months, i18n_days_short are in common.js
monthNames: i18n_months,
dayNamesMin: i18n_days_short,
onSelect: function (sDate, oDatePicker) {
$(this).datepicker("setDate", sDate);
},
onClose: validateTimeRange,
};
oBaseTimePickerSettings = {
showPeriodLabels: false,
showCloseButton: true,
closeButtonText: $.i18n._("Done"),
showLeadingZero: false,
defaultTime: "0:00",
hourText: $.i18n._("Hour"),
minuteText: $.i18n._("Minute"),
onClose: validateTimeRange,
};
oBaseDatePickerSettings = { showlistenerstat_content
dateFormat: 'yy-mm-dd', .find(dateStartId)
//i18n_months, i18n_days_short are in common.js .datepicker(oBaseDatePickerSettings)
monthNames: i18n_months, .blur(validateTimeRange());
dayNamesMin: i18n_days_short, showlistenerstat_content
onSelect: function(sDate, oDatePicker) { .find(timeStartId)
$(this).datepicker( "setDate", sDate ); .timepicker(oBaseTimePickerSettings)
}, .blur(validateTimeRange());
onClose: validateTimeRange showlistenerstat_content
}; .find(dateEndId)
oBaseTimePickerSettings = { .datepicker(oBaseDatePickerSettings)
showPeriodLabels: false, .blur(validateTimeRange());
showCloseButton: true, showlistenerstat_content
closeButtonText: $.i18n._("Done"), .find(timeEndId)
showLeadingZero: false, .timepicker(oBaseTimePickerSettings)
defaultTime: '0:00', .blur(validateTimeRange());
hourText: $.i18n._("Hour"),
minuteText: $.i18n._("Minute"),
onClose: validateTimeRange
};
showlistenerstat_content.find(dateStartId).datepicker(oBaseDatePickerSettings).blur(validateTimeRange());
showlistenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings).blur(validateTimeRange());
showlistenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings).blur(validateTimeRange());
showlistenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings).blur(validateTimeRange());
} }
function getStartEnd() { function getStartEnd() {
return AIRTIME.utilities.fnGetScheduleRange(
return AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); dateStartId,
timeStartId,
dateEndId,
timeEndId
);
} }
function validateTimeRange() { function validateTimeRange() {
var oRange, var oRange,
inputs = $('.date_form > input'), inputs = $(".date_form > input"),
error_window = $('.error_window'), error_window = $(".error_window"),
start, end; start,
end;
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); oRange = AIRTIME.utilities.fnGetScheduleRange(
dateStartId,
timeStartId,
dateEndId,
timeEndId
);
start = oRange.start; start = oRange.start;
end = oRange.end; end = oRange.end;
if (end >= start) { if (end >= start) {
error_window.removeClass('error'); error_window.removeClass("error");
$('.error_window').html(''); $(".error_window").html("");
} } else {
else { error_window.addClass("error");
error_window.addClass('error'); console.log("bad");
console.log('bad') $(".error_window").html("Your start date time is after your end date time");
$('.error_window').html('Your start date time is after your end date time'); }
}
return { return {
start: start, start: start,
end: end, end: end,
isValid: end >= start isValid: end >= start,
}; };
} }
function showListenerDataTable() { function showListenerDataTable() {
var oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId); var oRange = AIRTIME.utilities.fnGetScheduleRange(
var start = oRange.start; dateStartId,
var lengthMenu = [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, $.i18n._("All")]]; timeStartId,
var end = oRange.end; dateEndId,
var sDom = 'l<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>'; timeEndId
var show_id = $("#sb_show_filter").val(); );
var dt = $('#show_stats_datatable'); var start = oRange.start;
info = getStartEnd(); var lengthMenu = [
dt.dataTable({ [10, 25, 50, 100, 500, -1],
"aoColumns": [ [10, 25, 50, 100, 500, $.i18n._("All")],
/* first name */ {"sName": "show", "mDataProp": "show"}, ];
/* air date */ {"sName": "time", "mDataProp": "time"}, var end = oRange.end;
/* last name */ {"sName": "average_number_of_listeners", "mDataProp": "average_number_of_listeners"}, var sDom = 'l<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>';
/* last name */ {"sName": "maximum_number_of_listeners", "mDataProp": "maximum_number_of_listeners"}], var show_id = $("#sb_show_filter").val();
"sAjaxSource": baseUrl+'Listenerstat/get-all-show-data', var dt = $("#show_stats_datatable");
"sAjaxDataProp": "", info = getStartEnd();
"bDestroy": true, dt.dataTable({
"aLengthMenu": lengthMenu, aoColumns: [
"iDisplayLength": 25, /* first name */ { sName: "show", mDataProp: "show" },
"sPaginationType": "full_numbers", /* air date */ { sName: "time", mDataProp: "time" },
"bJQueryUI": true, /* last name */ {
"bAutoWidth": true, sName: "average_number_of_listeners",
"sDom": sDom, mDataProp: "average_number_of_listeners",
"fnServerData": function ( sSource, aoData, fnCallback ) { },
aoData.push({"start": start, "end": end}); /* last name */ {
$.ajax( { sName: "maximum_number_of_listeners",
"dataType": 'json', mDataProp: "maximum_number_of_listeners",
"type": "POST", },
"url": sSource, ],
"data": {"start": start, "end": end}, sAjaxSource: baseUrl + "Listenerstat/get-all-show-data",
"success": fnCallback sAjaxDataProp: "",
} ); bDestroy: true,
}, aLengthMenu: lengthMenu,
}); iDisplayLength: 25,
sPaginationType: "full_numbers",
bJQueryUI: true,
bAutoWidth: true,
sDom: sDom,
fnServerData: function (sSource, aoData, fnCallback) {
aoData.push({ start: start, end: end });
$.ajax({
dataType: "json",
type: "POST",
url: sSource,
data: { start: start, end: end },
success: fnCallback,
});
},
});
} }

View File

@ -1,9 +1,9 @@
$(window).load(function() { $(window).load(function () {
$("#username").focus(); $("#username").focus();
}); });
$(document).ready(function() { $(document).ready(function () {
$("#submit").click(function() { $("#submit").click(function () {
Cookies.set('airtime_locale', $('#locale').val(), {path: '/'}); Cookies.set("airtime_locale", $("#locale").val(), { path: "/" });
}); });
}); });

View File

@ -1,17 +1,16 @@
$(document).ready(function() { $(document).ready(function () {
var dialog = $("#lang-timezone-popup");
var dialog = $("#lang-timezone-popup"); dialog.dialog({
autoOpen: false,
dialog.dialog({ width: 500,
autoOpen: false, resizable: false,
width: 500, modal: true,
resizable: false, closeOnEscape: false,
modal: true, position: ["center", "center"],
closeOnEscape: false, dialogClass: "no-close",
position:['center','center'], buttons: [
dialogClass: 'no-close', /* Testing removing the Not Now button for higher engagement
buttons: [
/* Testing removing the Not Now button for higher engagement
{ {
id: "setup-later", id: "setup-later",
text: $.i18n._("Not Now"), text: $.i18n._("Not Now"),
@ -20,32 +19,32 @@ $(document).ready(function() {
$(this).dialog("close"); $(this).dialog("close");
} }
},*/ },*/
{ {
id: "help_airtime", id: "help_airtime",
text: $.i18n._("OK"), text: $.i18n._("OK"),
"class": "btn", class: "btn",
click: function() { click: function () {
$("#lang-timezone-form").submit(); $("#lang-timezone-form").submit();
} },
} },
] ],
}); });
var language = window.navigator.userLanguage || window.navigator.language; var language = window.navigator.userLanguage || window.navigator.language;
if (language === undefined) { if (language === undefined) {
language = "en_CA"; language = "en_CA";
} }
language = language.replace("-", "_"); language = language.replace("-", "_");
$("#setup_language").val(language); $("#setup_language").val(language);
dayjs.extend(utc) dayjs.extend(utc);
dayjs.extend(timezone) dayjs.extend(timezone);
var timezone_name = dayjs.tz.guess(); var timezone_name = dayjs.tz.guess();
if (timezone_name === undefined) { if (timezone_name === undefined) {
timezone_name = "America/Toronto"; timezone_name = "America/Toronto";
} }
$("#setup_timezone").val(timezone_name); $("#setup_timezone").val(timezone_name);
dialog.dialog('open'); dialog.dialog("open");
}); });

Some files were not shown because too many files have changed in this diff Show More