Skip to content

Commit

Permalink
Add js 3PlayMedia credentials validation draft
Browse files Browse the repository at this point in the history
  • Loading branch information
wowkalucky committed Jul 5, 2017
1 parent dcad13b commit d7dbcea
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions video_xblock/static/js/studio-edit/studio-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,28 @@ function StudioEditableXBlock(runtime, element) {
});
}

// Raccoongang changes
/**
* Validate if 3PlayMedia combination: fileId + apiKey is actual.
* @returns {boolean}
*/
function validateThreePlayMediaCreds() {
// TBD
return true;
}

/**
* Validation handlers' results combiner.
* @returns {boolean}
*/
function validationSucceeded(event) {
return [
validateTranscripts(event, $langChoiceItem),
validateThreePlayMediaCreds()
].every(Boolean);
}

$('.save-button', element).bind('click', function(event) {
if (validateTranscripts(event, $langChoiceItem)) {
if (validationSucceeded(event)) {
studioSubmit(fillValues(fields));
}
});
Expand All @@ -394,7 +413,6 @@ function StudioEditableXBlock(runtime, element) {
event.preventDefault();
runtime.notify('cancel', {});
});
// End of Raccoongang changes

if (gotTranscriptsValue) {
transcriptsValue = JSON.parse(gotTranscriptsValue);
Expand Down

0 comments on commit d7dbcea

Please sign in to comment.