Fix copyright not being display processes correctly

HFP-1079
pull/23/merge
Frode Petterson 2017-05-31 09:33:10 +02:00
parent 9adc92d3c4
commit aaa0861355
1 changed files with 4 additions and 7 deletions

View File

@ -1254,15 +1254,12 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
*/ */
var humanizeLicense = function (license, version) { var humanizeLicense = function (license, version) {
var copyrightLicense = H5P.copyrightLicenses[license]; var copyrightLicense = H5P.copyrightLicenses[license];
if (copyrightLicense.label === undefined) {
return copyrightLicense;
}
// Build license string // Build license string
var value = ''; var value = '';
if (!(license === 'PD' && version)) { if (!(license === 'PD' && version)) {
// Add license label // Add license label
value += (copyrightLicense.label ? copyrightLicense.label : copyrightLicense); value += (copyrightLicense.hasOwnProperty('label') ? copyrightLicense.label : copyrightLicense);
} }
// Check for version info // Check for version info
@ -1276,15 +1273,15 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
if (value) { if (value) {
value += ' '; value += ' ';
} }
value += (versionInfo.label ? versionInfo.label : versionInfo); value += (versionInfo.hasOwnProperty('label') ? versionInfo.label : versionInfo);
} }
// Add link if specified // Add link if specified
var link; var link;
if (copyrightLicense.link) { if (copyrightLicense.hasOwnProperty('link')) {
link = copyrightLicense.link.replace(':version', copyrightLicense.linkVersions ? copyrightLicense.linkVersions[version] : version); link = copyrightLicense.link.replace(':version', copyrightLicense.linkVersions ? copyrightLicense.linkVersions[version] : version);
} }
else if (versionInfo && versionInfo.link) { else if (versionInfo && copyrightLicense.hasOwnProperty('link')) {
link = versionInfo.link link = versionInfo.link
} }
if (link) { if (link) {