Skip to content

Commit be72dce

Browse files
authored
Merge pull request #173 from creativecommons/icons
Update cc icons and location they are served from
2 parents 53a0b8d + 3ed5e43 commit be72dce

File tree

10 files changed

+16527
-16290
lines changed

10 files changed

+16527
-16290
lines changed

package-lock.json

+16,391-16,278
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/license-icons/by.svg

+17
Loading

src/assets/license-icons/cc.svg

+26
Loading

src/assets/license-icons/nc.svg

+20
Loading

src/assets/license-icons/nd.svg

+17
Loading

src/assets/license-icons/sa.svg

+19
Loading

src/assets/license-icons/zero.svg

+23
Loading

src/components/LicenseDetailsCard.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,19 @@ export default {
108108
background-size: 35px 35px;
109109
}
110110
.license-list-item.zero::before {
111-
background-image: url("../assets/license-icons/cc-cc0_icon.svg");
111+
background-image: url("../assets/license-icons/zero.svg");
112112
}
113113
.license-list-item.by::before {
114-
background-image: url("../assets/license-icons/cc-by_icon.svg");
114+
background-image: url("../assets/license-icons/by.svg");
115115
}
116116
.license-list-item.nc::before {
117-
background-image: url("../assets/license-icons/cc-nc_icon.svg");
117+
background-image: url("../assets/license-icons/nc.svg");
118118
}
119119
.license-list-item.nd::before {
120-
background-image: url("../assets/license-icons/cc-nd_icon.svg");
120+
background-image: url("../assets/license-icons/nd.svg");
121121
}
122122
.license-list-item.sa::before {
123-
background-image: url("../assets/license-icons/cc-sa_icon.svg");
123+
background-image: url("../assets/license-icons/sa.svg");
124124
}
125125
.readable-string {
126126
padding-left:51px;

src/components/LicenseIcons.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
class="photo-license-icon"
1111
alt="CC icon"
1212
title="CC icon"
13-
src="../assets/license-icons/cc_icon.svg"
13+
src="../assets/license-icons/cc.svg"
1414
>
1515
<img
1616
v-for="(license, index) in iconsArr"
1717
:key="index"
1818
class="photo-license-icon"
1919
:alt="license + ' icon'"
2020
:title="license + ' icon'"
21-
:src="require(`../assets/license-icons/cc-${license.toLowerCase()}_icon.svg`)"
21+
:src="require(`../assets/license-icons/${license.toLowerCase()}.svg`)"
2222
>
2323
</a>
2424
</template>

src/utils/license-utilities.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ function attrToFull(attr) {
4343

4444
function licenseUrl(attr, mode) {
4545
// Returns url to license from short license name with version number (eg. 'CC BY 4.0')
46-
// mode: web/ print (?ref=ccchooser is added to the end of the link if mode is web)
47-
const linkRef = mode === 'web' ? '/?ref=ccchooser' : ''
46+
// mode: web/ print (?ref=chooser-v1 is added to the end of the link if mode is web)
47+
const linkRef = mode === 'web' ? '/?ref=chooser-v1' : ''
4848
if (attr.BY === false) {
4949
return `https://creativecommons.org/publicdomain/zero/1.0${linkRef}`
5050
}
@@ -125,13 +125,14 @@ function generateHTML(attributionDetails, shortLicenseName) {
125125
' xmlns:cc="http://creativecommons.org/ns#"' +
126126
' class="license-text">'
127127
const iconStyle = 'style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;"'
128-
const baseAssetsPath = 'https://search.creativecommons.org/static/img'
129-
let licenseIcons = `<img ${iconStyle} src="${baseAssetsPath}/cc_icon.svg" />`
128+
const baseAssetsPath = 'https://mirrors.creativecommons.org/presskit/icons'
129+
const linkRef = '?ref=chooser-v1'
130+
let licenseIcons = `<img ${iconStyle} src="${baseAssetsPath}/cc.svg/${linkRef}" />`
130131
if (shortLicenseName.includes('CC0')) {
131132
shortLicenseName = 'CC CC0 1.0'
132133
}
133134
licenseIcons += shortLicenseName.slice(3, shortLicenseName.length - 4).split('-').map(license =>
134-
`<img ${iconStyle} src="${baseAssetsPath}/cc-${license.toLowerCase()}_icon.svg" />`
135+
`<img ${iconStyle} src="${baseAssetsPath}/${license.toLowerCase()}.svg/${linkRef}" />`
135136
).join('')
136137
dataForHtmlGeneration.licenseIconsLink = `<a href="${licenseUrl(shortToAttr(shortLicenseName))}">${licenseIcons}</a>`
137138

@@ -153,6 +154,7 @@ function generateHTML(attributionDetails, shortLicenseName) {
153154
}
154155
return dataForHtmlGeneration
155156
}
157+
156158
export {
157159
defaultAttributes, CC0Attributes, CCBYAttributes, shortToAttr, attrToShort,
158160
attrToFull, licenseUrl, licenseSlug, licenseIconsArr, generateHTML, updateVisibleEnabledStatus

0 commit comments

Comments
 (0)