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());
|
$cueinSec = Application_Model_Playlist::playlistTimeToSeconds($removedItem->getDbCueIn());
|
||||||
$cueOutSec = bcadd($cueinSec , $length, 6);
|
$cueOutSec = bcadd($cueinSec , $length, 6);
|
||||||
$cueout = Application_Model_Playlist::secondsToPlaylistTime($cueOutSec);
|
$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)
|
$removedItem->setDbCueOut($cueout)
|
||||||
->setDbClipLength($cliplength)
|
->setDbClipLength($cliplength)
|
||||||
->setDbEnds($this->nowDT)
|
->setDbEnds($this->nowDT)
|
||||||
|
|
|
@ -159,7 +159,7 @@ class Application_Model_ShowBuilder {
|
||||||
|
|
||||||
$row["header"] = true;
|
$row["header"] = true;
|
||||||
$row["starts"] = $showStartDT->format("Y-m-d H:i");
|
$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["ends"] = $showEndDT->format("Y-m-d H:i");
|
||||||
$row["duration"] = floatval($showEndDT->format("U.u")) - floatval($showStartDT->format("U.u"));
|
$row["duration"] = floatval($showEndDT->format("U.u")) - floatval($showStartDT->format("U.u"));
|
||||||
$row["title"] = $p_item["show_name"];
|
$row["title"] = $p_item["show_name"];
|
||||||
|
@ -253,7 +253,9 @@ class Application_Model_ShowBuilder {
|
||||||
$startsEpoch = floatval($showStartDT->format("U.u"));
|
$startsEpoch = floatval($showStartDT->format("U.u"));
|
||||||
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
||||||
$showEndDT->setTimezone(new DateTimeZone($this->timezone));
|
$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->getScheduledStatus($startsEpoch, $endsEpoch, $row);
|
||||||
$this->isAllowed($p_item, $row);
|
$this->isAllowed($p_item, $row);
|
||||||
|
|
|
@ -376,71 +376,80 @@ var AIRTIME = (function(AIRTIME){
|
||||||
"fnDrawCallback": function(oSettings, json) {
|
"fnDrawCallback": function(oSettings, json) {
|
||||||
var wrapperDiv,
|
var wrapperDiv,
|
||||||
markerDiv,
|
markerDiv,
|
||||||
td,
|
$td,
|
||||||
|
$tr,
|
||||||
$lib = $("#library_content"),
|
$lib = $("#library_content"),
|
||||||
tr,
|
|
||||||
oTable = $('#show_builder_table').dataTable(),
|
oTable = $('#show_builder_table').dataTable(),
|
||||||
aData;
|
aData,
|
||||||
|
elements,
|
||||||
|
i, length, temp,
|
||||||
|
$cursorRows;
|
||||||
|
|
||||||
clearTimeout(AIRTIME.showbuilder.timeout);
|
clearTimeout(AIRTIME.showbuilder.timeout);
|
||||||
|
|
||||||
//only create the cursor arrows if the library is on the page.
|
//only create the cursor arrows if the library is on the page.
|
||||||
if ($lib.length > 0 && $lib.filter(":visible").length > 0) {
|
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.
|
//create cursor arrows.
|
||||||
$sbTable.find("tr:not(:first, .sb-header, .sb-empty, .sb-now-playing, .sb-past, .sb-not-allowed)").each(function(i, el) {
|
$cursorRows.each(function(i, el) {
|
||||||
td = $(el).find("td:first");
|
$td = $(el).find("td:first");
|
||||||
if (td.hasClass("dataTables_empty")) {
|
if ($td.hasClass("dataTables_empty")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapperDiv = $("<div />", {
|
wrapperDiv = $("<div />", {
|
||||||
"class": "innerWrapper",
|
"class": "innerWrapper",
|
||||||
"css": {
|
"css": {
|
||||||
"height": td.height()
|
"height": $td.height()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
markerDiv = $("<div />", {
|
markerDiv = $("<div />", {
|
||||||
"class": "marker"
|
"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.
|
//order of importance of elements for setting the next timeout.
|
||||||
tr = $sbTable.find("tr.sb-now-playing");
|
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) {
|
//check which element we should set a timeout relative to.
|
||||||
//enable jump to current button.
|
for (i = 0, length = elements.length; i < length; i++) {
|
||||||
AIRTIME.button.enableButton("sb-button-current");
|
temp = elements[i];
|
||||||
|
|
||||||
aData = tr.data("aData");
|
if (temp.length > 0) {
|
||||||
|
aData = temp.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");
|
|
||||||
|
|
||||||
AIRTIME.showbuilder.timeout = setTimeout(function(){
|
setTimeout(function(){
|
||||||
AIRTIME.showbuilder.resetTimestamp();
|
AIRTIME.showbuilder.resetTimestamp();
|
||||||
oTable.fnDraw();
|
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.
|
//check if there are any overbooked tracks on screen to enable the trim button.
|
||||||
tr = $sbTable.find("tr.sb-over.sb-future");
|
$tr = $sbTable.find("tr.sb-over.sb-future");
|
||||||
|
if ($tr.length > 0) {
|
||||||
if (tr.length > 0) {
|
|
||||||
//enable deleting of overbooked tracks.
|
//enable deleting of overbooked tracks.
|
||||||
AIRTIME.button.enableButton("sb-button-trim");
|
AIRTIME.button.enableButton("sb-button-trim");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue