SpeakEasy project - Confusion


#1

i'm not sure where to put add() or addCommands(). the example is unclear about how annyang works.
jquery:

var main = function() {
  $('form').submit(function() {
     var text = $('#todo').val();
     var html = template(text);
     $('div.list').appendTo(html);
  
    var add = function(item) {
      $(this).template.appendTo(html);
      
    return false;
    };
  $('i.glyphicon-star active').click(function() {
    $(this).toggleClass();
  });
     $('i.glyphicon-remove').click(function() {
    $(this).toggleClass();
  });
 
}
  
$(document).ready(main);

html:

<!doctype html>
<html>
  <head>
    <link rel="stylesheet" href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css' />
    <link rel='stylesheet' href='style.css'/>
  </head>
  <body>
    <div class="header">
      <h1>ListEasy</h1>
    </div>
    <div class="main">
      <div class="list">
        <p>
          <input type="checkbox">
          <i class="glyphicon glyphicon-star"></i>
          <span>Brie</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
        <p>
          <input type="checkbox">
          <i class="glyphicon glyphicon-star"></i>
          <span>Bread</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
        <p>
          <input type="checkbox">
          <i class="glyphicon glyphicon-star"></i>
          <span>Sparkling Cider</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
        <p>
          <input type="checkbox" checked>
          <i class="glyphicon glyphicon-star"></i>
          <span>Strawberries</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
        <p>
          <input type="checkbox">
          <i class="glyphicon glyphicon-star"></i>
          <span>Chocolate Mousse</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
        <p>
          <input type="checkbox">
          <i class="glyphicon glyphicon-star active"></i>
          <span>Figs</span>
          <i class="glyphicon glyphicon-remove"></i>
        </p>
      </div>
      
      <form class="form">
        <div class="form-container">
          <input id="todo" type="text" class="form-input" placeholder="Add item">
        </div>
        <button type="submit" class="btn"></button>
      </form>
    </div>
    <script src="https://s3.amazonaws.com/codecademy-content/projects/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/annyang/1.4.0/annyang.min.js"></script>
    <script src='script.js'></script>
</body>
</html>

#2

Hi :slight_smile: just reformatted your post. Try to make sure you use the </> button when you post any code in the future :smile:

and describe the problem you are having rather than just posting code.

Thanks,
Alex


#3

ok, sure. thanks, alexcraig! i haven't posted in a while, i forgot how.


#4

Do you have a Pro advisor? Perhaps they could help :slight_smile: if not I'll try to look back later :slight_smile:


#9