Skip to content
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

[Website]: Code examples and samples require JavaScript #37

Closed
joshbruce opened this issue Aug 3, 2016 · 5 comments
Closed

[Website]: Code examples and samples require JavaScript #37

joshbruce opened this issue Aug 3, 2016 · 5 comments

Comments

@joshbruce
Copy link
Contributor

joshbruce commented Aug 3, 2016

Issue type

This is a duplication of the one from the UWDS: uswds/uswds#1305

What happened

The code samples are generated after page load. There is a JS function that checks for a div with class preview. It copies the contents, inserts them into a string. Then adds the element to the page.

Therefore, if JS fails or is disabled the code sample boxes don't show up. See the 18f ticket.

What I expected

Code samples would always be displayed. We can make this part of the Jekyll build - see the solution for the USWDS. It would change the file structure a bit, and make defining a component a little more interesting.

Steps to reproduce the issue [optional]

  1. Go to: https://gsa.github.io/sam-web-design-standards/elements/actions-icons/
  2. Notice the code accordion.
  3. Disable JavaScript in your browser.
  4. Refresh the page
  5. Notice the code accordion is missing.

ps. I wasn't sure if this would be a level 1 or 2 defect as they both apply; however, the dependency on JavaScript means it match our definition of done.

@joshbruce
Copy link
Contributor Author

#66

@joshbruce
Copy link
Contributor Author

joshbruce commented Aug 18, 2016

Created a /code/main.html include to make the building of content more generic.

Created a /code/template-code.html to be used a baseline when converting elements and components (copy/paste into new file).

  • Accordions
  • Alerts
  • Footers
  • Header
  • Side navigation
  • Pagination
  • Name form
  • Address form
  • Sign-in form
  • Registration form
  • Inline feedback form (quick)
  • Support form
  • Search bar
  • Search result
  • Actions & icons
  • Buttons
  • Text inputs and area
  • Select
  • Date input
  • Links
  • Lists
  • Labels
  • Tables
  • Remove _site-assets/js/components/generate-code-snippets.js and all references

@anuragmundada-asurion
Copy link

@joshbruce I have covered till inlinefeedbackform_quick! Will commit shortly!

@joshbruce
Copy link
Contributor Author

@anuragmundada-reisys - Sweet! That is so awesome. Thank you so much. I'm going to remove the JS file on my next one.

I love when meetings get cancelled. 👍

anuragmundada-asurion referenced this issue in anuragmundada-asurion/sam-web-design-standards Aug 18, 2016
joshbruce pushed a commit that referenced this issue Aug 18, 2016
[Website]: [Pagination, nameform, addressform, signinform, registration, feedback form] new pattern #37
@joshbruce
Copy link
Contributor Author

@diego-ruiz-rei & @anuragmundada-reisys - Merged and site updated for end of Sprint demo. Think this could totally be something you demo. Thanks again!

diego-ruiz pushed a commit that referenced this issue May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants