work finished through 2b on exercise checklist

main
Jason 3 years ago
parent b18ee4e062
commit 8673a7fdad

@ -19,11 +19,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hack or Snooze</title>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" href="css/site.css">
<link rel="stylesheet" href="css/user.css">
<link rel="stylesheet" href="css/stories.css">
@ -32,8 +29,8 @@
<body>
<!-- top navigation bar -->
<nav>
<!-- top navigation bar -->
<nav>
<div class="navbar-brand">
<a class="nav-link" href="#" id="nav-all">Hack or Snooze</a>
</div>
@ -45,10 +42,10 @@
<a class="nav-link" href="#" id="nav-user-profile"></a>
<a class="hidden" id="nav-logout" href="#"><small>(logout)</small></a>
</div>
</nav>
</nav>
<!-- area for stories (all stories, user stories, favorites) -->
<section class="stories-container container">
<!-- area for stories (all stories, user stories, favorites) -->
<section class="stories-container container">
<!-- loading message (removed by JS after stories loaded) -->
<div id="stories-loading-msg">Loading&hellip;</div>
@ -56,11 +53,12 @@
<!-- List of all stories -->
<ol id="all-stories-list" class="stories-list"></ol>
</section>
</section>
<!-- Login and signup forms -->
<section class="account-forms-container container">
<!-- Login and signup and add story forms -->
<section class="account-forms-container container">
<!--add story form-->
<form id="add-story-form" class="add-story hidden">
<h4>Add a story</h4>
<label for="story-title">Title: </label>
@ -104,17 +102,18 @@
</div>
<button type="submit">create account</button>
</form>
</section>
</section>
<!-- Library JS & our JS -->
<script src="https://unpkg.com/jquery"></script>
<script src="https://unpkg.com/axios/dist/axios.js"></script>
<!-- Library JS & our JS -->
<script src="https://unpkg.com/jquery"></script>
<script src="https://unpkg.com/axios/dist/axios.js"></script>
<script src="js/models.js"></script>
<script src="js/main.js"></script>
<script src="js/nav.js"></script>
<script src="js/user.js"></script>
<script src="js/stories.js"></script>
<script src="js/models.js"></script>
<script src="js/main.js"></script>
<script src="js/nav.js"></script>
<script src="js/user.js"></script>
<script src="js/stories.js"></script>
</body>
</html>

@ -73,13 +73,17 @@ async function getNewStoryAndSubmit(evt) {
title: title,
author: author,
url: url
}
};
// instantiate a Story with obj and display on page
const resultOfAddStoryCall = await storyList.addStory(currentUser, newStory);
console.log("resultOfAddStoryCall: ", resultOfAddStoryCall);
hidePageComponents();
putStoriesOnPage();
await getAndShowStoriesOnStart();
//resets form with empty values
$addStoryForm.trigger("reset");
}
//event listener for add story form submit
$addStoryForm.on("submit", getNewStoryAndSubmit);
Loading…
Cancel
Save