-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcc-display.js
More file actions
21 lines (21 loc) · 1.27 KB
/
cc-display.js
File metadata and controls
21 lines (21 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script src="/{context}/s/cc-license-data"></script>
<script type="text/javascript">
// placeholder HTML entities are in the above section.
$(document).ready(function($) {
var ccType = '${xml.get("/metadata/drm/type")}';
if(enableCcLicenseDisplay(ccType)) {
const acu = '${xml.get("/metadata/drm/cc/allow.commercial.uses")}';
const am = '${xml.get("/metadata/drm/cc/allow.modifications")}';
const v = '${xml.get("/metadata/drm/cc/version")}';
const defaultV = '${xml.get("/metadata/drm/cc/system.default.license.version")}';
const dType = 'S';
if(attributesReadyForCcLicenseDisplay(ccType, acu, am)) {
$( "#licenseHeaderDescription" ).html(getCcLicenseHeaderDescription(dType, ccType, acu, am, v, defaultV));
$( "#licenseLinkAndImage" ).html(getCcLicenseLinkAndImage(dType, ccType, acu, am, v, defaultV));
$( "#licenseFooterDescription" ).html(getCcLicenseFooterDescription(dType, ccType, acu, am, v, defaultV));
} else {
$( "#licenseHeaderDescription" ).html("Unable to generate the Creative Commons license until 'Allow Commercial Uses' and 'Allow Modifications' have been configured.");
}
}
});
</script>