SAAS-1125: Cue in and out points should be editable in the track metadata editor
Also made improvement by showing errors when the form has invalid data
This commit is contained in:
parent
9d0beabd3f
commit
1cfa708717
|
@ -370,6 +370,9 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
if ($form->isValid($serialized)) {
|
if ($form->isValid($serialized)) {
|
||||||
$file->setDbColMetadata($serialized);
|
$file->setDbColMetadata($serialized);
|
||||||
|
$this->view->status = true;
|
||||||
|
} else {
|
||||||
|
$this->view->status = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,26 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
));
|
));
|
||||||
$this->addElement($language);
|
$this->addElement($language);
|
||||||
|
|
||||||
|
$validCuePattern = '/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}(\.\d{1,6})?$/';
|
||||||
|
|
||||||
|
$cueIn = new Zend_Form_Element_Text('cuein');
|
||||||
|
$cueIn->class = 'input_text';
|
||||||
|
$cueIn->setLabel("Cue In:");
|
||||||
|
$cueInValidator = Application_Form_Helper_ValidationTypes::overrideRegexValidator(
|
||||||
|
$validCuePattern, _(sprintf("Specify cue in time in the format %s", "hh:mm:ss(.dddddd)"))
|
||||||
|
);
|
||||||
|
$cueIn->setValidators(array($cueInValidator));
|
||||||
|
$this->addElement($cueIn);
|
||||||
|
|
||||||
|
$cueOut = new Zend_Form_Element_Text('cueout');
|
||||||
|
$cueOut->class = 'input_text';
|
||||||
|
$cueOut->setLabel('Cue Out:');
|
||||||
|
$cueOutValidator = Application_Form_Helper_ValidationTypes::overrideRegexValidator(
|
||||||
|
$validCuePattern, _(sprintf("Specify cue out time in the format %s", "hh:mm:ss(.dddddd)"))
|
||||||
|
);
|
||||||
|
$cueOut->setValidators(array($cueOutValidator));
|
||||||
|
$this->addElement($cueOut);
|
||||||
|
|
||||||
// Add the submit button
|
// Add the submit button
|
||||||
$this->addElement('button', 'editmdsave', array(
|
$this->addElement('button', 'editmdsave', array(
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
|
|
|
@ -415,6 +415,7 @@ textarea {
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
|
max-width: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Playlist/Block/Webstream Editors */
|
/* Playlist/Block/Webstream Editors */
|
||||||
|
|
|
@ -8,6 +8,15 @@
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#edit-md-dialog ul.errors {
|
||||||
|
clear: both;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#edit-md-dialog dd input.input_text {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.spl_sortable,.spl_sortable>li,.side_playlist>div,#spl_editor,.spl_artist,.spl_cue_in,.spl_fade_in,.spl_cue_out,.spl_fade_out
|
.spl_sortable,.spl_sortable>li,.side_playlist>div,#spl_editor,.spl_artist,.spl_cue_in,.spl_fade_in,.spl_cue_out,.spl_fade_out
|
||||||
{
|
{
|
||||||
clear: left;
|
clear: left;
|
||||||
|
|
|
@ -513,15 +513,24 @@ var AIRTIME = (function(AIRTIME){
|
||||||
newTab.wrapper.find(".md-save").on("click", function() {
|
newTab.wrapper.find(".md-save").on("click", function() {
|
||||||
var file_id = newTab.wrapper.find('#file_id').val(),
|
var file_id = newTab.wrapper.find('#file_id').val(),
|
||||||
data = newTab.wrapper.find("#edit-md-dialog form").serializeArray();
|
data = newTab.wrapper.find("#edit-md-dialog form").serializeArray();
|
||||||
$.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function() {
|
$.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function(resp) {
|
||||||
|
|
||||||
|
newTab.wrapper.find("#edit-md-dialog").parent().html(resp.html);
|
||||||
|
|
||||||
// don't redraw the library table if we are on calendar page
|
// don't redraw the library table if we are on calendar page
|
||||||
// we would be on calendar if viewing recorded file metadata
|
// we would be on calendar if viewing recorded file metadata
|
||||||
if ($("#schedule_calendar").length === 0) {
|
if ($("#schedule_calendar").length === 0) {
|
||||||
oTable.fnStandingRedraw();
|
oTable.fnStandingRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resp.status === true) {
|
||||||
|
AIRTIME.playlist.closeTab();
|
||||||
|
}
|
||||||
|
|
||||||
|
//re-initialize events since we changed the html
|
||||||
|
initFileMdEvents(newTab);
|
||||||
});
|
});
|
||||||
|
|
||||||
AIRTIME.playlist.closeTab();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
newTab.wrapper.find('#edit-md-dialog').on("keyup", function(event) {
|
newTab.wrapper.find('#edit-md-dialog').on("keyup", function(event) {
|
||||||
|
@ -529,6 +538,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
newTab.wrapper.find('.md-save').click();
|
newTab.wrapper.find('.md-save').click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPlaylist(json) {
|
function openPlaylist(json) {
|
||||||
|
|
Loading…
Reference in New Issue