CC-3501 : Calendar->Show->Add media files from Library better usability may be proposed
This commit is contained in:
parent
9e9ae11725
commit
b39db57d0c
|
@ -455,12 +455,7 @@ class Application_Model_Scheduler {
|
|||
$cueinSec = Application_Model_Playlist::playlistTimeToSeconds($removedItem->getDbCueIn());
|
||||
$cueOutSec = bcadd($cueinSec , $length, 6);
|
||||
$cueout = Application_Model_Playlist::secondsToPlaylistTime($cueOutSec);
|
||||
|
||||
Logging::log('$nEpoch: '. $nEpoch);
|
||||
Logging::log('$sEpoch: '. $sEpoch);
|
||||
Logging::log('$length: '. $length);
|
||||
Logging::log('$cliplength: '. $cliplength);
|
||||
|
||||
|
||||
$removedItem->setDbCueOut($cueout)
|
||||
->setDbClipLength($cliplength)
|
||||
->setDbEnds($this->nowDT)
|
||||
|
|
|
@ -159,7 +159,7 @@ class Application_Model_ShowBuilder {
|
|||
|
||||
$row["header"] = true;
|
||||
$row["starts"] = $showStartDT->format("Y-m-d H:i");
|
||||
$row["timeUntil"] = floatval($showStartDT->format("U.u")) - $this->epoch_now;
|
||||
$row["refresh"] = floatval($showStartDT->format("U.u")) - $this->epoch_now;
|
||||
$row["ends"] = $showEndDT->format("Y-m-d H:i");
|
||||
$row["duration"] = floatval($showEndDT->format("U.u")) - floatval($showStartDT->format("U.u"));
|
||||
$row["title"] = $p_item["show_name"];
|
||||
|
@ -253,7 +253,9 @@ class Application_Model_ShowBuilder {
|
|||
$startsEpoch = floatval($showStartDT->format("U.u"));
|
||||
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
||||
$showEndDT->setTimezone(new DateTimeZone($this->timezone));
|
||||
$endsEpoch = floatval($showEndDT->format("U.u"));
|
||||
$endsEpoch = floatval($showEndDT->format("U.u"));
|
||||
|
||||
$row["refresh"] = floatval($showEndDT->format("U.u")) - $this->epoch_now;
|
||||
|
||||
$this->getScheduledStatus($startsEpoch, $endsEpoch, $row);
|
||||
$this->isAllowed($p_item, $row);
|
||||
|
|
|
@ -376,71 +376,80 @@ var AIRTIME = (function(AIRTIME){
|
|||
"fnDrawCallback": function(oSettings, json) {
|
||||
var wrapperDiv,
|
||||
markerDiv,
|
||||
td,
|
||||
$td,
|
||||
$tr,
|
||||
$lib = $("#library_content"),
|
||||
tr,
|
||||
oTable = $('#show_builder_table').dataTable(),
|
||||
aData;
|
||||
aData,
|
||||
elements,
|
||||
i, length, temp,
|
||||
$cursorRows;
|
||||
|
||||
clearTimeout(AIRTIME.showbuilder.timeout);
|
||||
|
||||
//only create the cursor arrows if the library is on the page.
|
||||
if ($lib.length > 0 && $lib.filter(":visible").length > 0) {
|
||||
|
||||
$cursorRows = $sbTable.find("tbody tr:not(.sb-header, .sb-empty, .sb-now-playing, .sb-past, .sb-not-allowed)");
|
||||
|
||||
//create cursor arrows.
|
||||
$sbTable.find("tr:not(:first, .sb-header, .sb-empty, .sb-now-playing, .sb-past, .sb-not-allowed)").each(function(i, el) {
|
||||
td = $(el).find("td:first");
|
||||
if (td.hasClass("dataTables_empty")) {
|
||||
$cursorRows.each(function(i, el) {
|
||||
$td = $(el).find("td:first");
|
||||
if ($td.hasClass("dataTables_empty")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wrapperDiv = $("<div />", {
|
||||
"class": "innerWrapper",
|
||||
"css": {
|
||||
"height": td.height()
|
||||
"height": $td.height()
|
||||
}
|
||||
});
|
||||
markerDiv = $("<div />", {
|
||||
"class": "marker"
|
||||
});
|
||||
|
||||
td.append(markerDiv).wrapInner(wrapperDiv);
|
||||
$td.append(markerDiv).wrapInner(wrapperDiv);
|
||||
});
|
||||
|
||||
//if there is only 1 cursor on the page highlight it by default.
|
||||
if ($cursorRows.length === 1) {
|
||||
$cursorRows.addClass("cursor-selected-row");
|
||||
}
|
||||
}
|
||||
|
||||
//if the now playing song is visible set a timeout to redraw the table at the start of the next song.
|
||||
tr = $sbTable.find("tr.sb-now-playing");
|
||||
//order of importance of elements for setting the next timeout.
|
||||
elements = [
|
||||
$sbTable.find("tr.sb-now-playing"),
|
||||
$sbTable.find("tbody tr.sb-future.sb-header:first"),
|
||||
$sbTable.find("tbody tr.sb-future.sb-footer:first")
|
||||
];
|
||||
|
||||
if (tr.length > 0) {
|
||||
//enable jump to current button.
|
||||
AIRTIME.button.enableButton("sb-button-current");
|
||||
//check which element we should set a timeout relative to.
|
||||
for (i = 0, length = elements.length; i < length; i++) {
|
||||
temp = elements[i];
|
||||
|
||||
aData = tr.data("aData");
|
||||
|
||||
setTimeout(function(){
|
||||
AIRTIME.showbuilder.resetTimestamp();
|
||||
oTable.fnDraw();
|
||||
}, aData.refresh * 1000); //need refresh in milliseconds
|
||||
|
||||
}
|
||||
//current song is not set, set a timeout to refresh when the first item on the timeline starts.
|
||||
else {
|
||||
tr = $sbTable.find("tbody tr.sb-future.sb-header:first");
|
||||
|
||||
if (tr.length > 0) {
|
||||
aData = tr.data("aData");
|
||||
if (temp.length > 0) {
|
||||
aData = temp.data("aData");
|
||||
|
||||
AIRTIME.showbuilder.timeout = setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
AIRTIME.showbuilder.resetTimestamp();
|
||||
oTable.fnDraw();
|
||||
}, aData.timeUntil * 1000); //need refresh in milliseconds
|
||||
}
|
||||
}, aData.refresh * 1000); //need refresh in milliseconds
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//now playing item exists.
|
||||
if (elements[0].length > 0) {
|
||||
//enable jump to current button.
|
||||
AIRTIME.button.enableButton("sb-button-current");
|
||||
}
|
||||
|
||||
//check if there are any overbooked tracks on screen to enable the trim button.
|
||||
tr = $sbTable.find("tr.sb-over.sb-future");
|
||||
|
||||
if (tr.length > 0) {
|
||||
$tr = $sbTable.find("tr.sb-over.sb-future");
|
||||
if ($tr.length > 0) {
|
||||
//enable deleting of overbooked tracks.
|
||||
AIRTIME.button.enableButton("sb-button-trim");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue