Skip to content

Commit d8d97e5

Browse files
authored
Merge pull request creativecommons#540 from creativecommons/dev-vocab-theme-v1-14
App: update dev copy of vocabulary-theme to 1.14 (d42593e)
2 parents 631c696 + ff80882 commit d8d97e5

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

cc_legal_tools/static/wp-content/themes/vocabulary-theme/chooser/css/chooser.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@
174174
line-height: 1.3;
175175
}
176176

177+
.chooser-page form#chooser #attribution-details label {
178+
display: block;
179+
}
180+
177181
.chooser-page form#chooser #attribution-details div {
178182
margin-bottom: .5em;
179183
}

cc_legal_tools/static/wp-content/themes/vocabulary-theme/chooser/js/chooser.js

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,19 @@ function renderMarkingFormats(state) {
275275
// set contents of plain text mark
276276
// [T]: reverse use of <template> since it has limits on tokenization capacity, even if
277277
// it allows more dev readability.
278-
let template = document.getElementById('plain-text');
279-
let templateContent = template.content.cloneNode(true);
278+
279+
// determine if generic mark is toggled.
280+
plainTextGenericMark = document.querySelector('#plain-text-generic-mark').checked;
281+
282+
if (plainTextGenericMark == true) {
283+
template = document.getElementById('plain-text-generic');
284+
console.log('plain text generic mark true');
285+
} else {
286+
template = document.getElementById('plain-text');
287+
console.log('plain text generic mark false');
288+
}
289+
290+
templateContent = template.content.cloneNode(true);
280291
document.querySelector('#mark-your-work .plain-text.mark').textContent = '';
281292

282293
function parseTokens(name, value, str){
@@ -299,7 +310,6 @@ function renderMarkingFormats(state) {
299310

300311
if (plainTextFullName == true) {
301312
markProps.toolName = state.props.toolLong;
302-
303313
} else {
304314
markProps.toolName = state.props.toolShort;
305315
}
@@ -355,7 +365,17 @@ function renderMarkingFormats(state) {
355365
markProps.toolName = state.props.toolShort;
356366
}
357367

358-
let richTextMark = '<a href="' + attribution.workLink + '">' + attribution.title + '</a>' + copyright + ' by ' + '<a href="' + attribution.creatorLink + '">' + attribution.creator + '</a>' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
368+
// determine if generic mark is toggled.
369+
richTextGenericMark = document.querySelector('#rich-text-generic-mark').checked;
370+
371+
if (richTextGenericMark == true) {
372+
richTextMark = 'This work' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
373+
console.log('plain text generic mark true');
374+
} else {
375+
richTextMark = '<a href="' + attribution.workLink + '">' + attribution.title + '</a>' + copyright + ' by ' + '<a href="' + attribution.creatorLink + '">' + attribution.creator + '</a>' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
376+
console.log('plain text generic mark false');
377+
}
378+
359379
document.querySelector('#mark-your-work .rich-text.mark').innerHTML = richTextMark;
360380

361381

@@ -368,8 +388,19 @@ function renderMarkingFormats(state) {
368388
} else {
369389
markProps.toolName = state.props.toolShort;
370390
}
391+
392+
// determine if generic mark is toggled.
393+
htmlGenericMark = document.querySelector('#html-generic-mark').checked;
394+
395+
if (htmlGenericMark == true) {
396+
htmlMark = 'This work' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
397+
console.log('plain text generic mark true');
398+
} else {
399+
htmlMark = '<a href="' + attribution.workLink + '">' + attribution.title + '</a>' + copyright + ' by ' + '<a href="' + attribution.creatorLink + '">' + attribution.creator + '</a>' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
400+
console.log('plain text generic mark false');
401+
}
402+
371403
//defaultHTML = '<p xmlns:cc="http://creativecommons.org/ns#">This work is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" alt=""><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg" alt=""><img src="https://mirrors.creativecommons.org/presskit/icons/sa.svg" alt=""></a></p>';
372-
let htmlMark = '<a href="' + attribution.workLink + '">' + attribution.title + '</a>' + copyright + ' by ' + '<a href="' + attribution.creatorLink + '">' + attribution.creator + '</a>' + ' is ' + typeAsVerb + ' ' + '<a href="' + state.props.toolURL + '">' + markProps.toolName + '</a>' + ccIconSet;
373404
document.querySelector('#mark-your-work .html.mark').innerHTML = htmlMark;
374405
}
375406

cc_legal_tools/static/wp-content/themes/vocabulary-theme/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Theme Name: CC Vocabulary Theme
33
Author: the Creative Commons team; possumbilities, Timid Robot
44
Author URI: https://opensource.creativecommons.org/
55
Description: Theme based on the Vocabulary Design System
6-
Version: 1.13
6+
Version: 1.14
77
Requires at least: 5.0
88
Tested up to: 6.2.2
99
Requires PHP: 7.0

0 commit comments

Comments
 (0)