Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Rudi Grinberg 2012-09-19 15:44:21 -04:00
commit ece17dbf38
6 changed files with 58 additions and 41 deletions

View File

@ -186,6 +186,7 @@ SQL;
/* Check if the show being resized and any of its repeats * overlap /* Check if the show being resized and any of its repeats * overlap
with other scheduled shows */ with other scheduled shows */
$utc = new DateTimeZone("UTC");
foreach ($showInstances as $si) { foreach ($showInstances as $si) {
$startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC")); $startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC"));
@ -223,15 +224,10 @@ SQL;
$sql_gen = <<<SQL $sql_gen = <<<SQL
UPDATE cc_show_instances UPDATE cc_show_instances
SET ends = (ends + interval :deltaDay1 + interval :interval1) SET ends = (ends + :deltaDay1::INTERVAL + :interval1::INTERVAL)
WHERE (show_id = :show_id1 WHERE (show_id = :show_id1
AND ends > :current_timestamp1) AND ends > :current_timestamp1)
AND ((ends + interval :deltaDay2 + interval :interval2 - starts) <= interval '24:00') AND ((ends + :deltaDay2::INTERVAL + :interval2::INTERVAL - starts) <= interval '24:00')
UPDATE cc_show_days
SET duration = (CAST(duration AS interval) + interval :deltaDay3 + interval :interval3)
WHERE show_id = :show_id2
AND ((CAST(duration AS interval) + interval :deltaDay4 + interval :interval4) <= interval '24:00')
SQL; SQL;
Application_Common_Database::prepareAndExecute($sql_gen, Application_Common_Database::prepareAndExecute($sql_gen,
@ -241,7 +237,18 @@ SQL;
':show_id1' => $this->_showId, ':show_id1' => $this->_showId,
':current_timestamp1' => $current_timestamp, ':current_timestamp1' => $current_timestamp,
':deltaDay2' => "$deltaDay days", ':deltaDay2' => "$deltaDay days",
':interval2' => "$hours:$mins", ':interval2' => "$hours:$mins"
), "execute");
$sql_gen = <<<SQL
UPDATE cc_show_days
SET duration = (CAST(duration AS interval) + :deltaDay3::INTERVAL + :interval3::INTERVAL)
WHERE show_id = :show_id2
AND ((CAST(duration AS interval) + :deltaDay4::INTERVAL + :interval4::INTERVAL) <= interval '24:00')
SQL;
Application_Common_Database::prepareAndExecute($sql_gen,
array(
':deltaDay3' => "$deltaDay days", ':deltaDay3' => "$deltaDay days",
':interval3' => "$hours:$mins", ':interval3' => "$hours:$mins",
':show_id2' => $this->_showId, ':show_id2' => $this->_showId,

View File

@ -7,8 +7,8 @@
<span class='blockId'><?php echo "$this->blockId" ?></span> <span class='blockId'><?php echo "$this->blockId" ?></span>
<span class='blockIndex'><?php echo "$this->blockIndex" ?></span> <span class='blockIndex'><?php echo "$this->blockIndex" ?></span>
<?php elseif (isset($this->uri)): ?> <?php elseif (isset($this->uri)): ?>
<span class='audioUri'><?php echo "$this->uri" ?></span> <span class='audioUri' style="display: none;"><?php echo "$this->uri" ?></span>
<span class='audioMime'><?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)): ?>

View File

@ -8,6 +8,17 @@ var _idToPostionLookUp;
*/ */
$(document).ready(function(){ $(document).ready(function(){
$.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();
_playlist_jplayer = new jPlayerPlaylist({ _playlist_jplayer = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1", jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1" cssSelectorAncestor: "#jp_container_1"
@ -29,33 +40,20 @@ $(document).ready(function(){
addTime: 0, addTime: 0,
removeTime: 0, removeTime: 0,
shuffleTime: 0 shuffleTime: 0
},
ready: function(){
if (playlistID != "" && playlistID !== ""){
playAllPlaylist(playlistID, playlistIndex);
}else if (audioUri != "") {
playOne(audioUri, audioMime);
}else if (showID != "") {
playAllShow(showID, showIndex);
}else if(blockId != "" && blockIndex != ""){
playBlock(blockId, blockIndex);
}
} }
}); });
$.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 numOfItems = 0;
if (playlistID != "" && playlistID !== ""){
playAllPlaylist(playlistID, playlistIndex);
}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");
}); });
@ -63,6 +61,7 @@ $(document).ready(function(){
$("#jp_container_1").on("mouseleave", "ul.jp-controls li", function(ev) { $("#jp_container_1").on("mouseleave", "ul.jp-controls li", function(ev) {
$(this).removeClass("ui-state-hover"); $(this).removeClass("ui-state-hover");
}); });
}); });
/** /**
@ -223,7 +222,7 @@ function playOne(uri, mime) {
if (media) { if (media) {
_playlist_jplayer.option("autoPlay", true); _playlist_jplayer.option("autoPlay", true);
playlist[0] = media; playlist[0] = media;
_playlist_jplayer._initPlaylist(playlist); _playlist_jplayer.setPlaylist(playlist);
_playlist_jplayer.play(0); _playlist_jplayer.play(0);
} }

View File

@ -1089,7 +1089,7 @@ function validateAdvancedSearch(divs) {
if (!valid) allValid = false; if (!valid) allValid = false;
} }
addRemoveValidationIcons(valid, $(field)); addRemoveValidationIcons(valid, $(field), searchTermType);
/* Empty fields should not have valid/invalid indicator /* Empty fields should not have valid/invalid indicator
* Range values are considered valid even if only the * Range values are considered valid even if only the
@ -1114,9 +1114,20 @@ function validateAdvancedSearch(divs) {
return allValid; return allValid;
} }
function addRemoveValidationIcons(valid, field) { function addRemoveValidationIcons(valid, field, searchTermType) {
var validIndicator = "<span class='checked-icon sp-checked-icon'></span>", var title = '';
invalidIndicator = "<span class='not-available-icon sp-checked-icon'></span>"; if (searchTermType === 'i') {
title = 'Input must be a positive number';
} else if (searchTermType === 'n') {
title = 'Input must be a number';
} else if (searchTermType === 't') {
title = 'Input must be in the format: yyyy-mm-dd';
} else if (searchTermType === 'l') {
title = 'Input must be in the format: hh:mm:ss.t';
}
var validIndicator = " <span class='checked-icon sp-checked-icon'></span>",
invalidIndicator = " <span title='"+title+"' class='not-available-icon sp-checked-icon'></span>";
if (valid) { if (valid) {
if (!field.closest('div').children(':last-child').hasClass('checked-icon')) { if (!field.closest('div').children(':last-child').hasClass('checked-icon')) {

View File

@ -1247,7 +1247,6 @@ function QTip(target, options, id, attr)
position.top -= offset; position.top -= offset;
} }
else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) { else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) {
console.log('test');
position.top -= isCenter ? -offset : offset; position.top -= isCenter ? -offset : offset;
} }
if(position.top !== posTop && isCenter) { position.top -= adjust.y; } if(position.top !== posTop && isCenter) { position.top -= adjust.y; }
@ -3241,4 +3240,4 @@ PLUGINS.bgiframe = function(api)
PLUGINS.bgiframe.initialize = 'render'; PLUGINS.bgiframe.initialize = 'render';
}(jQuery, window)); }(jQuery, window));

View File

@ -206,6 +206,7 @@ libcamomile-ocaml-dev libcamlimages-ocaml-dev libtool libpulse-dev libjack-dev c
sed('%s/savonet/PACKAGES' % root, '#ocaml-alsa', 'ocaml-alsa') sed('%s/savonet/PACKAGES' % root, '#ocaml-alsa', 'ocaml-alsa')
sed('%s/savonet/PACKAGES' % root, '#ocaml-pulseaudio', 'ocaml-pulseaudio') sed('%s/savonet/PACKAGES' % root, '#ocaml-pulseaudio', 'ocaml-pulseaudio')
sed('%s/savonet/PACKAGES' % root, '#ocaml-faad', 'ocaml-faad') sed('%s/savonet/PACKAGES' % root, '#ocaml-faad', 'ocaml-faad')
do_run('cd %s/savonet && make clean' % root)
do_run('cd %s/savonet && ./bootstrap' % root) do_run('cd %s/savonet && ./bootstrap' % root)
do_run('cd %s/savonet && ./configure' % root) do_run('cd %s/savonet && ./configure' % root)
do_run('cd %s/savonet && make' % root) do_run('cd %s/savonet && make' % root)