@@ -67,30 +67,6 @@ export default {
6767 }
6868 },
6969 methods: {
70- authorElement () {
71- return workAuthor ({
72- creatorName: this .$props .value .attributionDetails .creatorName ,
73- creatorProfileUrl: this .$props .value .attributionDetails .creatorProfileUrl
74- })
75- },
76- titleElement () {
77- const workUrl = this .$props .value .attributionDetails .workUrl
78- const workTitle = this .$props .value .attributionDetails .workTitle
79- if (! workTitle && ! workUrl) {
80- return this .$t (' this-work' )
81- } else {
82- const titleSpan = workTitle ? ` <span rel="dc:title">${ workTitle} </span>` : this .$t (' this-work' )
83- if (workUrl) {
84- return ` <a rel="cc:attributionURL" href="${ workUrl} ">${ titleSpan} </a>`
85- } else {
86- return titleSpan
87- }
88- }
89- },
90- workLicenseElement () {
91- return workLicense (this .licenseURL ,
92- this .$props .value .shortName )
93- },
9470 onCopySuccess (e ) {
9571 this .success = true
9672 this .$emit (' copied' , { content: e .text })
@@ -111,13 +87,38 @@ export default {
11187 licenseURL () {
11288 return this .$licenseUrl (this .$props .value .shortName )
11389 },
90+ workLicenseElement () {
91+ return workLicense (this .licenseURL ,
92+ this .$props .value .shortName )
93+ },
94+ authorElement () {
95+ return workAuthor ({
96+ creatorName: this .$props .value .attributionDetails .creatorName ,
97+ creatorProfileUrl: this .$props .value .attributionDetails .creatorProfileUrl
98+ })
99+ },
100+ titleElement () {
101+ const workUrl = this .$props .value .attributionDetails .workUrl
102+ const workTitle = this .$props .value .attributionDetails .workTitle
103+ if (! workTitle && ! workUrl) {
104+ return this .$t (' this-work' )
105+ } else {
106+ const titleSpan = workTitle ? ` <span rel="dc:title">${ workTitle} </span>` : this .$t (' this-work' )
107+ if (workUrl) {
108+ return ` <a rel="cc:attributionURL" href="${ workUrl} ">${ titleSpan} </a>`
109+ } else {
110+ return titleSpan
111+ }
112+ }
113+ },
114114 htmlElement () {
115115 const licenseText = this .$t (' license-text' , {
116- workTitle: this .titleElement () ,
117- byLine: this .authorElement ()
116+ workTitle: this .titleElement ,
117+ byLine: this .authorElement
118118 })
119- const licenseIcons = ` <span class="license-icons">${ this .workLicenseElement ()} </span>`
120- return ` <p xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#">${ licenseText}${ licenseIcons} </p>`
119+ const paragraphBeginning = ' <p id="license-code" xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#">'
120+ const fullLicenseCode = ` ${ paragraphBeginning}${ licenseText}${ this .workLicenseElement } </p>`
121+ return fullLicenseCode
121122 },
122123 activeTab: {
123124 get () { return this .currentTab },
0 commit comments