Skip to content

refactor chooser to be more exacting, simplified, and maintainable #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 136 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
7845b21
setup baseline refactor configuration
possumbilities Aug 20, 2024
fb02f9f
setup baseline vocabulary to work from
possumbilities Aug 20, 2024
f54373a
setup rough pathway mangement testing
possumbilities Sep 5, 2024
1231476
add rough sketch of behavior to build from
possumbilities Sep 6, 2024
71ee3eb
add year of work creation
possumbilities Sep 6, 2024
cf97698
setup mini chooser experiment to port elsewhere later
possumbilities Sep 13, 2024
03231ed
add full guided-chooser link to flow of mini-chooser
possumbilities Sep 13, 2024
19540ea
adjust sizing
possumbilities Sep 13, 2024
d9685a3
adjust sizing of inputs
possumbilities Sep 13, 2024
d727daf
cleanup initial styling of mini chooser, to build other options from
possumbilities Sep 13, 2024
7ee5f7c
store baseline brand explorations to revisit later
possumbilities Sep 16, 2024
6454dde
reset colors to base
possumbilities Sep 16, 2024
93746cd
clean up the logic paths to prep for better pathstate flow
possumbilities Nov 18, 2024
daf4684
add pathstate finding skeleton base
possumbilities Nov 19, 2024
4506bd4
add ability to define state possibilities in addition to state paths,…
possumbilities Nov 19, 2024
0773c71
add rough logic paths
possumbilities Nov 20, 2024
dcceefa
check possibilities, setup baseline for checkbox val storage logic
possumbilities Nov 21, 2024
9a0891f
add first round checks for statepaths
possumbilities Nov 21, 2024
97d0357
refine logic pathways to resolve pathstates with possibilities and cu…
possumbilities Nov 21, 2024
ee880de
remove manifest error, add baseline support for state path part optio…
possumbilities Nov 22, 2024
f4f2442
account for missing checkbox on waive-your-copyright step
possumbilities Nov 22, 2024
7347d3d
resolve changing choice at attribution step
possumbilities Nov 22, 2024
3a461d7
add baseline license rec output into body
possumbilities Nov 22, 2024
6e0bbde
attach ND choice, to SA choice
possumbilities Nov 22, 2024
e3bb138
add visual separation from questions and attribution
possumbilities Nov 22, 2024
dc87e48
remove unrelated files
possumbilities Jan 9, 2025
2b98f48
update footer to vocab v1.7
possumbilities Jan 9, 2025
0f25bcf
update header to vocab v1.7
possumbilities Jan 9, 2025
5ee8d55
remove legacy files
possumbilities Jan 9, 2025
16199e7
Merge remote-tracking branch 'origin/stepper-html-baseline' into voca…
possumbilities Jan 9, 2025
c8f40bb
clear testing styles
possumbilities Jan 9, 2025
acda3f6
update vocabulary core to v1.8
possumbilities Jan 9, 2025
1faa370
Merge pull request #556 from creativecommons/vocab-setup
possumbilities Jan 9, 2025
a268546
correct h1 to chooser
possumbilities Jan 9, 2025
958bfde
add rough results template to modify and build into semantic markup
possumbilities Jan 9, 2025
2df5fe7
establish baseline markup for license rec
possumbilities Jan 10, 2025
b52265a
update links to footer icons to load correctly
possumbilities Jan 10, 2025
31cf55a
localize cc-by sprite icon helper class to style.css
possumbilities Jan 10, 2025
42d3746
localize remaining license icons
possumbilities Jan 10, 2025
872d2ae
adjust styling on dt/dd, add correct headings to license rec area
possumbilities Jan 10, 2025
bea8911
clean up placeholder template for now, reset to empty
possumbilities Jan 10, 2025
ec6cde2
Merge pull request #557 from creativecommons/semantic-results
possumbilities Jan 10, 2025
69d4245
change id of section to better reflect its marking for others to attr…
possumbilities Jan 10, 2025
6b81301
add baseline semantic html, with placholders
possumbilities Jan 10, 2025
7b67b65
add help section markup, with placholders
possumbilities Jan 10, 2025
7237f15
add license icons to markup for title
possumbilities Jan 10, 2025
ee1aaa5
add basic positioning styles to help for functionality later
possumbilities Jan 10, 2025
1ee5e8e
Merge pull request #559 from creativecommons/semantic-marking
possumbilities Jan 10, 2025
b0b690d
setup baseline file for stepper logic
possumbilities Jan 10, 2025
a622af6
add baseline state path routes as array
possumbilities Jan 10, 2025
7aca886
add comments for rough logic flow sections
possumbilities Jan 10, 2025
efa3096
amend comments for clarify
possumbilities Jan 10, 2025
91ab663
clean up comments, add setStateParts and setStatePossibilities rough …
possumbilities Jan 10, 2025
19a6704
update comments for better console readability
possumbilities Jan 10, 2025
8bc76e8
add rough logic for direct checking of logical state path with possib…
possumbilities Jan 10, 2025
5c06255
add rough render for h3 alone when license path currenty set is valid…
possumbilities Jan 10, 2025
c6a8d74
adjust empty lines
possumbilities Jan 10, 2025
2ff11c7
add styling and functionality to hide steps in relation to state to e…
possumbilities Jan 13, 2025
7b2ea44
Merge pull request #560 from creativecommons/stepper-flow
possumbilities Jan 13, 2025
41bd9bb
add rudimentary templates to load into rec for each license/tool
possumbilities Jan 14, 2025
b34ff49
add template replacement logic function to load when valid rec assemb…
possumbilities Jan 14, 2025
176f4e6
add debug styles to hide areas no currently being worked on in markup
possumbilities Jan 14, 2025
d953f96
add all relevant content data to license templates
possumbilities Jan 14, 2025
b5b1c74
add appropriate defaults for rec area
possumbilities Jan 14, 2025
d6ac3f7
adjust layout to better test rec rendering/output
possumbilities Jan 14, 2025
f925c0a
add rough sketch of setting cursor, clearing greater than input values
possumbilities Jan 15, 2025
1fb9171
add better input defaults, clear after state.props.cursor onChange, c…
possumbilities Jan 15, 2025
df4aa0c
add note
possumbilities Jan 15, 2025
22a79b4
cleanup lines
possumbilities Jan 15, 2025
d5e21bf
add notes for later refactor of clearStepsAfter
possumbilities Jan 15, 2025
2b78964
rename function to be more descriptive
possumbilities Jan 15, 2025
d7ed6ca
remove trailing space
possumbilities Jan 15, 2025
0228eea
remove extra line
possumbilities Jan 15, 2025
3d280de
Merge pull request #562 from creativecommons/render-recs
possumbilities Jan 15, 2025
7a8d2a7
unhide mark-your-work
possumbilities Jan 15, 2025
e010c3d
setup baseline rendering of attribution details, with rough functions…
possumbilities Jan 15, 2025
9bc594f
add functions for mark handling, add new watcher for keyup on attribu…
possumbilities Jan 16, 2025
312fcba
clean up and apply appropriate mark phrase concat string, after apply…
possumbilities Jan 16, 2025
76670bb
set baseline space for licenseShort props setting
possumbilities Jan 16, 2025
f2f926e
amend names to be accurate, were switched prior
possumbilities Jan 17, 2025
a7f41b8
Merge pull request #563 from creativecommons/render-marking
possumbilities Jan 17, 2025
ad05c02
alter markup namespaces to better handle tool vs license vs mark
possumbilities Jan 21, 2025
f346d47
change stored, and non user-facing terminology to tool instead of lic…
possumbilities Jan 21, 2025
093101c
continue change to tool terminology where possible
possumbilities Jan 21, 2025
7b3ebd9
change markup and JS from license to tool in rec area
possumbilities Jan 21, 2025
f16c749
change classes on tool-rec
possumbilities Jan 21, 2025
d99a921
alter naming of tool select
possumbilities Jan 21, 2025
42af261
wrap conversion of license to tool teterminology in non user-facing copy
possumbilities Jan 21, 2025
1ff399a
adjust heading, setup plain text template
possumbilities Jan 23, 2025
44f03bd
add test function for handlebar adjacent token placeholders for later…
possumbilities Feb 4, 2025
1a13916
add baseline plain text template swapping with token placeholder repl…
possumbilities Feb 4, 2025
7951478
adjust output of mark template slightly
possumbilities Feb 7, 2025
b434890
Merge pull request #564 from creativecommons/structure-namespaces
possumbilities Feb 10, 2025
fa78623
uncomment formatting sections to build tabs
possumbilities Feb 10, 2025
9d9241d
expand markup of marking formats to build from
possumbilities Feb 10, 2025
e29e557
setup baseline format output for rich text and html
possumbilities Feb 10, 2025
2660f08
add better filtering of input values, add logic for rich text iconSet…
possumbilities Feb 11, 2025
e416364
adjust spacing on iconSet visually, adjust js to be more orderly
possumbilities Feb 11, 2025
3975abe
correct id name
possumbilities Feb 11, 2025
4fa2216
add panels around sub-areas of larger web vs print
possumbilities Feb 18, 2025
70dd378
setup baseline expand/collapse styling and scripts, with semantic mar…
possumbilities Feb 18, 2025
68f28d6
add first rough bits to allow read only attribution details for url/t…
possumbilities Mar 4, 2025
270dae1
convert tabs/panels to details for better UX
possumbilities Mar 24, 2025
9d8ceae
Merge pull request #565 from creativecommons/add-tabs
possumbilities Mar 25, 2025
5ac569d
improve rec typography
possumbilities Mar 25, 2025
1ad809d
Merge branch 'refactor' into ux-boost
possumbilities Mar 25, 2025
4d3bb80
combine dt and dd in dl to be single line items
possumbilities Mar 25, 2025
00a04a5
add custom counter, start styling the form
possumbilities Mar 25, 2025
f57f94f
add long name toggles, events, watchers, markProps
possumbilities Mar 26, 2025
60d5ca1
watch markCopiers to grab content to clipboard
possumbilities Mar 26, 2025
a067a55
add baseline copy behavior to mark formats
possumbilities Mar 26, 2025
aadeeb8
Merge pull request #567 from creativecommons/ux-boost
possumbilities Mar 26, 2025
2fe1329
improve input styles, add missing info, add empty placeholder, enable…
possumbilities Mar 27, 2025
33e405e
remove referrer param from license urls
possumbilities Mar 27, 2025
1d5678e
remove referrers
possumbilities Mar 27, 2025
03d12cf
correct help section, adjust empty height
possumbilities Mar 27, 2025
64c69ce
remove console.logs and extraneous code
possumbilities Mar 27, 2025
aba84ef
cleanup markup
possumbilities Mar 27, 2025
2d558a0
cleanup css file
possumbilities Mar 27, 2025
35d3b8a
reset README.md to baseline
possumbilities Mar 27, 2025
580b6b6
fix typos rephrase
possumbilities Mar 27, 2025
19bbcf0
add html mark format correctly, output copyright only if not cc-0
possumbilities Mar 27, 2025
4d08cf4
improve placeholders
possumbilities Mar 27, 2025
63d793a
fix name of sharealike radios to correct behavior
possumbilities Mar 27, 2025
e60860c
Merge pull request #568 from creativecommons/ux-boost
possumbilities Mar 27, 2025
03c347e
correct specificity
possumbilities Mar 31, 2025
43da11b
Merge remote-tracking branch 'origin/refactor' into ux-boost
possumbilities Mar 31, 2025
27e4205
update README.md with better structure docs, and dev info
possumbilities Mar 31, 2025
e972c89
Merge pull request #569 from creativecommons/ux-boost
possumbilities Apr 1, 2025
f8d1131
remove docs directory until we write docs that spill over README.md
possumbilities Apr 1, 2025
dd982f3
add versioning to README.me to better track in release/commits
possumbilities Apr 1, 2025
ff339dd
update repo metadata
possumbilities Apr 1, 2025
926e404
update .gitignore to current
possumbilities Apr 1, 2025
e59b709
remove beta info
possumbilities Apr 1, 2025
b619eac
fix typos in README.md
possumbilities Apr 1, 2025
e8bed13
correct typo
possumbilities Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add better input defaults, clear after state.props.cursor onChange, c…
…lone instead of append templates (for better reuse)
  • Loading branch information
possumbilities authored Jan 15, 2025
commit 1fb917194ef6af37de66694e105df62ee1ab424a
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ <h1>Choose a License for Your Work</h1>

<label for="license">License</label>
<select name="license" id="license">
<option value="noselect" selected>&mdash;choose a license&mdash;</option>
<option value="cc-0">CC0 1.0</option>
<option value="cc-by" selected>CC-BY 4.0</option>
<option value="cc-by">CC-BY 4.0</option>
<option value="cc-by-sa">CC-BY-SA 4.0</option>
<option value="cc-by-nd">CC-BY-ND 4.0</option>
<option value="cc-by-nc">CC-BY-NC 4.0</option>
Expand Down
36 changes: 23 additions & 13 deletions src/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,30 @@ function setStateProps(index, state) {

// function to reset values beyond current fieldset
function clearStepsAfter(fieldsets, state) {
// get current fieldset.element index onchange,
// then use loop through all fieldset.elements > index
// use querySelector to set all child inputs to
// empty default values

// might need a prop of "cursor" which marks where
// in the steps we are, do this in state.props

fieldsets.forEach((element, index) => {
if (index > state.props.cursor) {
console.log('clear at:');
console.log(index);

// change to querySelectorAll and then loop through to reset where appropriate
element.querySelector('input').checked = false;
if (index == 1) {
element.querySelector("#license").value = "noselect";
}

// if (index = 8) {

// }

if (index != 1 | index != 8) {
console.log('clear at:');
console.log(index);

// change to querySelectorAll and then loop through to reset where appropriate
let inputs = element.querySelectorAll('input');
inputs.forEach((input, i) => {
input.checked = false;
console.log('uncheck!');

});

}
}

});
Expand All @@ -179,9 +188,10 @@ function renderLicenseRec(state) {

let license = state.props.license;
let template = document.getElementById(license);
let templateContent = template.content;
let templateContent = template.content.cloneNode(true);
document.querySelector('#license-recommendation .license').textContent = '';
document.querySelector('#license-recommendation .license').appendChild(templateContent);
console.log('license set to: ' + license);
}
else if (state.props.license == 'unknown') {
document.querySelector('#license-recommendation').classList.add('disable');
Expand Down