@@ -19,7 +19,6 @@ function workTitle(form) {
1919}
2020
2121function workAuthor ( form ) {
22- console . log ( 'Getting work author: ' , form . creatorName )
2322 if ( form . creatorName ) {
2423 const creatorNameNoLink = `<span rel="cc:attributionName">${ form . creatorName } </span>`
2524 return form . creatorProfileUrl ? `by <a rel="cc:attributionURL" href="${ form . creatorProfileUrl } ">${ creatorNameNoLink } </a>` : `by ${ creatorNameNoLink } `
@@ -28,46 +27,17 @@ function workAuthor(form) {
2827
2928function workLicense ( ccLicenseURL , shortLicenseName ) {
3029 const baseAssetsPath = 'https://search.creativecommons.org/static/img'
31- const licenseLink = `<a rel="license" href="${ ccLicenseURL } " style="margin-right: 5px;">${ shortLicenseName . toUpperCase ( ) } </a>`
32- let licenseIcons = `<img style="height: inherit;margin-right: 3px;display: inline-block;" src="${ baseAssetsPath } /cc_icon.svg" />`
33- console . log ( 'Icons: ' , licenseIcons )
30+ const licenseLink = `<a rel="license" href="${ ccLicenseURL } " target="_blank" rel="noopener noreferrer" style="display: inline-block;">${ shortLicenseName . toUpperCase ( ) } `
31+ let licenseIcons = `<img style="height: 22px!important;margin-left: 3px;vertical-align:text-bottom;" src="${ baseAssetsPath } /cc_icon.svg" />`
3432 if ( shortLicenseName ) {
3533 if ( shortLicenseName . includes ( 'CC0' ) ) {
3634 shortLicenseName = 'CC CC0 1.0'
3735 }
3836 licenseIcons += shortLicenseName . slice ( 3 , shortLicenseName . length - 4 ) . split ( '-' ) . map ( license =>
39- `<img style="height: inherit ;margin-right : 3px;display: inline-block ;" src="${ baseAssetsPath } /cc-${ license . toLowerCase ( ) } _icon.svg" />`
37+ `<img style="margin-top: 2px; height: 22px!important ;margin-left : 3px;vertical-align:text-bottom ;" src="${ baseAssetsPath } /cc-${ license . toLowerCase ( ) } _icon.svg" />`
4038 ) . join ( '' )
41- const licenseImgLink = `<a href=" ${ ccLicenseURL } " target="_blank" rel="noopener noreferrer" style="display: inline-block; opacity: .7;margin-top: 2px;margin-left: 3px;height: 22px !important;vertical-align:text-bottom ">${ licenseIcons } </a>`
39+ const licenseImgLink = `<span class="license-icons" style="opacity:.7 ">${ licenseIcons } </span> </a>`
4240 return `${ licenseLink } ${ licenseImgLink } `
4341 }
4442}
45-
46- // function attributionHtml(form, ccLicenseURL, shortLicenseName) {
47- // The default string in English is:
48- // This work is licensed under CC BY 4.0
49- // String if each form field is filled in
50- // 'My work" by Author is licensed under CC BY 4.0
51- // const baseAssetsPath = 'https://search.creativecommons.org/static/img'
52- // const workTitle = form.workTitle ? `${form.workTitle}` : 'This work'
53- // const workLink = form.workUrl ? `<a href="${form.workUrl}">${workTitle}</a>` : workTitle
54- // const creatorNameNoLink = `<span>${form.authorName}</span>`
55- // const creatorNameLink = form.creatorProfileUrl ? `<a href="${form.creatorProfileUrl}">${creatorNameNoLink}</a>` : creatorNameNoLink
56- // const creator = `<span> by ${creatorNameLink}</span>`
57- // const licenseLink = ` is licensed under <a rel="license" href="${ccLicenseURL}" style="margin-right: 5px;">${shortLicenseName.toUpperCase()}</a>`
58-
59- // let licenseIcons = `<img style="height: inherit;margin-right: 3px;display: inline-block;" src="${baseAssetsPath}/cc_icon.svg" />` // eslint-disable-line global-require, import/no-dynamic-require
60- // if (shortLicenseName) {
61- // licenseIcons += shortLicenseName.slice(3, shortLicenseName.length - 4).split('-').map(license =>
62- // `<img style="height: inherit;margin-right: 3px;display: inline-block;"
63- // src="${baseAssetsPath}/cc-${license.toLowerCase()}_icon.svg" />` // eslint-disable-line global-require, import/no-dynamic-require
64- // ).join('')
65- // }
66-
67- // const licenseImgLink = `<a href="${ccLicenseURL}" target="_blank" rel="noopener noreferrer" style="display: inline-block;opacity: .7;margin-top: 2px;margin-left: 3px;height: 22px !important;">${licenseIcons}</a>`
68- // return `<p style="font-size: 0.9rem;">${workLink}${creator}${licenseLink}${licenseImgLink}</p>`
69- // return { title: workTitle(form), author: workAuthor(form) }
70- // }
71-
72- // export default attributionHtml
7343export { workAuthor , workTitle , workLicense }
0 commit comments