Add default license when no version is selected

pull/42/head moodle-1.4
Frode Petterson 2017-06-06 13:51:51 +02:00
parent 46d772cb51
commit 3192f0fe19
1 changed files with 9 additions and 2 deletions

View File

@ -1264,8 +1264,13 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
// Check for version info
var versionInfo;
if (version && copyrightLicense.versions[version]) {
versionInfo = copyrightLicense.versions[version];
if (copyrightLicense.versions) {
if (copyrightLicense.versions.default && (!version || copyrightLicense.versions[version])) {
version = copyrightLicense.versions.default;
}
if (version && copyrightLicense.versions[version]) {
versionInfo = copyrightLicense.versions[version];
}
}
if (versionInfo) {
@ -2023,6 +2028,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
$(document).ready(function () {
var ccVersions = {
'default': '4.0',
'4.0': H5P.t('licenseCC40'),
'3.0': H5P.t('licenseCC30'),
'2.5': H5P.t('licenseCC25'),
@ -2076,6 +2082,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
'v1': '1.0'
},
versions: {
'default': 'v3',
'v3': H5P.t('licenseV3'),
'v2': H5P.t('licenseV2'),
'v1': H5P.t('licenseV1')