1- const axios = require ( 'axios' ) ;
2- const CACHE = window . CACHE_MODULE ;
1+ // const CACHE = window.CACHE_MODULE;
32
43function getWorkouts ( ) {
54 CACHE . getAuthenticatedUserFromCache ( )
65 $ . ajax ( {
76 type : 'GET' ,
8- url : '/api/workout ' ,
7+ url : '/api/home ' ,
98 contentType : 'application/json' ,
109 dataType : 'json' ,
1110 data : undefined ,
@@ -27,10 +26,6 @@ function clearInputs() {
2726 $ ( 'input' ) . val ( "" ) ;
2827}
2928
30- function onPageLoad ( ) {
31- getWorkouts ( )
32- clearInputs ( ) ;
33- } ;
3429
3530var substringMatcher = function ( strs ) {
3631 return function findMatches ( q , cb ) {
@@ -56,18 +51,18 @@ var substringMatcher = function(strs) {
5651
5752
5853
59- function typeAhead ( ) {
60- $ ( '.typeahead' ) . typeahead ( {
61- hint : true ,
62- highlight : true ,
63- minLength : 1
64- } , {
65- name : 'exercises' ,
66- source : substringMatcher ( exercises )
67- }
54+ // function typeAhead() {
55+ // $('.typeahead').typeahead({
56+ // hint: true,
57+ // highlight: true,
58+ // minLength: 1
59+ // }, {
60+ // name: 'exercises',
61+ // source: substringMatcher(exercises)
62+ // }
6863
69- )
70- }
64+ // )
65+ // }
7166count = 1
7267
7368function currentDate ( ) {
@@ -92,10 +87,54 @@ function changeDate(count) {
9287 } ) ;
9388}
9489
90+
91+
92+ function dateSelectTemplate ( ) {
93+
94+ }
95+
96+ function workoutHeader ( ) {
97+ $ ( '.js-container' ) . append ( '<p>hello there</p>' ) ;
98+ }
99+ let exHeadTemp = `<section class="ex-list">
100+ <div class="log-header">
101+ <h1 class="ex-head">Exercises</h1>
102+ <div class="stat-labels">
103+ <h3 class="log-stat-lbl">Sets</h3>
104+ <h3 class="log-stat-lbl">Reps</h3>
105+ <h3 class="log-stat-lbl">Weight</h3>
106+ </div><!--end stat-label-->
107+ <div class="delete"></div>
108+ </div><!--end log-header-->
109+ </section>`
110+
111+ let exListTemp = `<section class="ex-list">
112+ <div class="log-header">
113+ <h3 class="ex-name js-exName">Pushups</h3>
114+ <div class="stat-labels">
115+ <p class="log-stat js-setLbl">1</p>
116+ <p class="log-stat js-repsLbl">10</p>
117+ <p class="log-stat js-weightsLbl">0</p>
118+ </div><!--end stat-label-->
119+ <div class="delete js-delete">x</div>
120+ </div><!--end log-header-->
121+ <h4 class="add-ex js-addEx"><a href="#">Add Exercise</a></h4>
122+ </section>`
123+
124+
125+ let searchBar = `<p>This will be on a modal or different page</p>
126+ <div id="the-basics">
127+ <input class="search-ex typeahead" type="text" placeholder="Search Exercises"/>
128+ </div>`
129+
95130function onPageLoad ( ) {
96- typeAhead ( ) ;
131+ // typeAhead();
97132 currentDate ( ) ;
98133 changeDate ( ) ;
134+ workoutHeader ( )
135+ getWorkouts ( )
136+ clearInputs ( ) ;
99137}
100138
139+
101140$ ( onPageLoad ) ;
0 commit comments