Code Monkey home page Code Monkey logo

jsdom-task-lister-lite's Introduction

TaskLister Lite™️

Today you'll be creating a simple to do list application that will focus on DOM manipulation. Take a look at index.html and identify the DOM elements you'll need to manipulate before you write any code.

Check out the working demo!

Learning Goals:

  • Squelch a default action with event.preventDefault

Instructions:

Instead of relying on unit tests, this lab is deliverable driven. What this means is that, rather than running learn test to guide you to the solution, you will verify your solution works as intended by testing the behavior visually in the browser.

  1. Fork and clone this repository
  2. Open index.html in Chrome (Tip: you can use open index.html in bash and, as long as Chrome is your default application for opening .html files, it will automatically open the file)
  3. Put your JavaScript knowledge to the test and work your way through the deliverables

Structuring Your Code:

You've been provided with a basic HTML file, as well as a src/index.js file where you can implement your solution. Focus on getting the feature working while using your knowledge to write readable, maintainable code.

Deliverables:

  • As a user, I should be able to type a task into the input field.
  • As a user, I should be able to click some form of a submit button.
  • As a user, the task string that I provided should appear on the DOM after the submit button has been activated.

Note: While the example shows one working application of TaskLister Lite™️, yours can (and is encouraged to!) look however you like.

Squelch a Default Action with Event.preventDefault

The deliverables require you to handle an event in a form based on clicking a submit button. You're going to need to listen for a submit event on the <form> element.

By default, Form elements automatically submit the form, which redirects the browser to a new url. This is not the experience we want to build in this lab. We want to prevent that event from performing its default behavior (submitting the form), because we want to update the DOM using JavaScript. In order to prevent the default behavior of the submit event, when our handler "sees" the event, it needs to invoke the preventDefault() method on it.

Take a look at the MDN Documentation on Event.preventDefault. You'll see how JavaScript is used to prevent a form element (checkbox) from doing its default behavior (appearing checked upon click). You'll want to prevent submit from doing its default behavior in a similar fashion.

Stretch Deliverables:

If you finish early, try to implement one or more of the following:

  • A delete function that will remove tasks from your list
  • A priority value selected from a dropdown that is used to determine the color of the text in the list (e.g. red for high priority, yellow for medium, green for low)
    • As an additional challenge, implement a sorting functionality that displays the tasks in ascending or descending order based on priority
  • An additional input field (e.g. user, duration, date due)
  • Ability to edit tasks
  • Something of your choice! The main objective is to add a feature that allows the user's input to affect the DOM

jsdom-task-lister-lite's People

Contributors

aspenjames avatar danielseehausen avatar dependabot[bot] avatar ihollander avatar ipc103 avatar lizbur10 avatar maxwellbenton avatar realandrewcohn avatar rrcobb avatar sbal13 avatar sgharms avatar thuyanduong-flatiron avatar vibraniumforge avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsdom-task-lister-lite's Issues

Too many errors, I don't know where to start...

Canvas Link

https://github.com/learn-co-curriculum/jsdom-task-lister-lite/blob/bfc5bbdb8afa7f8565b1ca83c1aaa033cbd6adf3/CONTRIBUTING.md

Concern

This is the first time here so I'm not really sure what to do. However, this lesson seems to be opening up a server under localhost:8000. However, you run learn and basically have no idea that's what is happening. After learn runs, I am looking at something like this:
browser-sync <=2.26.13
Depends on vulnerable versions of browser-sync-client
Depends on vulnerable versions of browser-sync-ui
Depends on vulnerable versions of chokidar
Depends on vulnerable versions of connect
Depends on vulnerable versions of easy-extender
Depends on vulnerable versions of eazy-logger
Depends on vulnerable versions of http-proxy
Depends on vulnerable versions of localtunnel
Depends on vulnerable versions of micromatch
Depends on vulnerable versions of qs
Depends on vulnerable versions of serve-index
Depends on vulnerable versions of serve-static
Depends on vulnerable versions of socket.io
Depends on vulnerable versions of socket.io-client
Depends on vulnerable versions of ua-parser-js
Depends on vulnerable versions of yargs
node_modules/browser-sync
learn-browser *
Depends on vulnerable versions of browser-sync
Depends on vulnerable versions of mocha
node_modules/learn-browser

62 vulnerabilities (6 low, 9 moderate, 39 high, 8 critical)

To address all issues, run:
npm audit fix

miles and miles of this stuff. I run "npm audit fix" and it produces the same type of code. This may all be normal but how would we, as students, know that? We come all this way using our terminal to run learn and yes, read a few errors but nothing in the Readme says this will happen.

I guess a warning would be in order. This lab isn't set up like the labs we've encountered before. Probably a ton of behind the scenes stuff going on. That's fine but I think a warning would be good.

I suppose the next issue would be the actual coding. I received a warning in the beginning of the module about being on a "learn just enough to get by" but just read through some of the "deliverables" and "optional deliverables" in this lab. I figured somethings out on my own but I don't think I'm too far off when I say "you want me to do what with my 'learn just enough to get by' skills?" Sure, I can stumble for hours or days coding some of this stuff but is that really the right approach? I'm looking at the solution page like there's answers in there. There's not. I see new folders, code, syntax that hasn't been taught yet.

Not really sure what to say. Just look through the lessons up to this point, then compare it with the answer/solution available in this lab. I suppose, afterwards, I would ask myself the question: is there a clear pathway that I can expect students to understand and recreate the same code as the solution provided (with minor differences)?

Additional Context

na

Suggested Changes

I guess a warning would be in order. This lab isn't set up like the labs we've encountered before. Probably a ton of behind the scenes stuff going on. That's fine but I think a warning would be good.

Not really sure what to say. Just look through the lessons up to this point, then compare it with the answer/solution available in this lab. I suppose, afterwards, I would ask myself the question: is there a clear pathway that I can expect students to understand and recreate the same code as the solution provided (with minor differences)?

ASC/DESC ....?????

What does this mean ? The user has limited time to read and grasp concepts, please make the language as clear as possible as for your new users/ learners.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.