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:
drigato 2015-10-21 10:58:22 -04:00
parent 9d0beabd3f
commit 1cfa708717
5 changed files with 45 additions and 2 deletions

View File

@ -370,6 +370,9 @@ class LibraryController extends Zend_Controller_Action
if ($form->isValid($serialized)) {
$file->setDbColMetadata($serialized);
$this->view->status = true;
} else {
$this->view->status = false;
}
}

View File

@ -169,6 +169,26 @@ class Application_Form_EditAudioMD extends Zend_Form
));
$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
$this->addElement('button', 'editmdsave', array(
'ignore' => true,

View File

@ -415,6 +415,7 @@ textarea {
font-size: 14px;
margin: 0 0 10px;
max-width: 280px;
}
/* Playlist/Block/Webstream Editors */

View File

@ -8,6 +8,15 @@
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
{
clear: left;

View File

@ -513,15 +513,24 @@ var AIRTIME = (function(AIRTIME){
newTab.wrapper.find(".md-save").on("click", function() {
var file_id = newTab.wrapper.find('#file_id').val(),
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
// we would be on calendar if viewing recorded file metadata
if ($("#schedule_calendar").length === 0) {
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) {
@ -529,6 +538,7 @@ var AIRTIME = (function(AIRTIME){
newTab.wrapper.find('.md-save').click();
}
});
}
function openPlaylist(json) {