Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
Making sure no commas entered in move. Cleaned up code a bit
  • Loading branch information
Fertogo committed Dec 22, 2014
1 parent 39f1db5 commit a2495a9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h3> <a href="#main" data-transition="flip"><button data-inline="true" data-mini
<li> Who are you?
<p> Hi, I am <a href="http://www.fernandotrujano.com"> Fernando Trujano </a>, a happy Pebble owner and college sophomore. If you like this app please give it a "heart" on the Pebble appstore.I smile everytime I see the count go up :) </p> </li>
<li> Can I buy you a beer?
<p> Not legally, at least until next year. In the meantime if you would like to support my work you can donate using Paypal. </p>
<p> Not legally, at least not until next year. In the meantime if you would like to support my work you can donate using Paypal. </p>
<form style="text-align:center" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCDJwiCPmsYsFVuuxZQ6Lrv/Z+1+VUT+J4xqxCNLeAljyBJbGp4a/vGiyxGssctbIYWraFule6Qxzds+EXhIfYlIFLTsc18Eg4YnD1IkEBL4+oxhqH3q67NoKHsSZ5kBN+N90S0jkpRiP/WWGQfqhZDh/PQb1DVfIyqMm5098BsojELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIZLvfb81M0kiAgZhedlj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1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE0MTEyNTA2MjYzM1owIwYJKoZIhvcNAQkEMRYEFPAaZoQPtuGHvUpHDjbm+D/t5DLVMA0GCSqGSIb3DQEBAQUABIGAhfyrkkH2k0HFNivrH4ddEyTmP6StjXz1xGpBDZJ8hxPsMhzdjzECc6aoO/lyaAy330gWiqzgf4xuTYoXCA4vzT4twP1CWlG8bSzRzxkT71/gjSGPzwkXxsqRqFR6JwngTGfmFTqTMVw/wLwGK/CV+GsnIFJp6LFLnCQmJBcez9o=-----END PKCS7-----
Expand All @@ -124,8 +124,8 @@ <h2> Known Issues </h2>
<ul data-role="listview">
<li> Workout name changes to a number
<p><strong> Temporary Fix: </strong> Go to the workout manager and save your workouts back to Pebble. </p> </li>
<li> Workout does not start
<p><strong> Temporary Fix: </strong> Wait a couple of seconds and try again. </p> </li>
<li> I'm stuck on the loading screen
<p><strong> Temporary Fix: </strong> Wait a couple of seconds and check that your Pebble is connected to the phone. </p> </li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -229,7 +229,17 @@ <h3> <span id="popup-text"> </span> <button id = "edit-delete-btn" data-icon="de
var mins = $("#minute-slider").val();
var secs = $("#second-slider").val();
console.log(move)
if (move != "" && (mins > 0 || secs >0)) {
if (move.indexOf(',') > 0){
$("#error1").html("Please don't user commas in move names").fadeIn();
}
else if (move == ""){
$("#error1").html("Please enter a move title").fadeIn()
}
else if (!(mins > 0 || secs >0)){
$("#error1").html("Please select a time for your move").fadeIn()
}
//else if (move != "" && (mins > 0 || secs >0)) {
else{
var time = (parseInt(mins)*60)+parseInt(secs)
console.log(time);

Expand All @@ -251,11 +261,7 @@ <h3> <span id="popup-text"> </span> <button id = "edit-delete-btn" data-icon="de
$("#second-slider").slider("refresh");
$('#move-list').listview('refresh');
$("#error1").fadeOut()
}

else {
$("#error1").fadeIn()
}
}
})

$("#add-workout-save-btn").click(function() {
Expand Down Expand Up @@ -333,9 +339,7 @@ <h3> <span id="popup-text"> </span> <button id = "edit-delete-btn" data-icon="de
var maintotaltime = 0;
var workout_title = workout.title.replace(/\s/g, '-')
var jQuerySelectorsRe = new RegExp('[\\[!"#$%&\'()*+,.:;<=>?@^`{|}~\\]]',"g")
//var workout_title = workout.title.replace(/[!"#$%&'()*+,.:;<=>?@^`{|}~]/g, "\\\\$&")
var workout_selector = workout_title.replace(jQuerySelectorsRe, "\\$&")
//missing [ ] \ Need to escape them somehow
var workout_selector = workout_title.replace(jQuerySelectorsRe, "\\$&")

$.each(workout.moves, function(j, move){ maintotaltime += parseInt(move[1]) }) //Please optimize
$("#workout-list").append('<div data-role="collapsible" id="workoutcollapsible" > <h4>'+ workout.title + ' <span class="totaltime" style="float:right" id="total-time">'+ timeText(maintotaltime)+' </span> </h4> <ul class="move-list" id="' + workout_title+'" data-role="listview">');
Expand Down Expand Up @@ -482,7 +486,7 @@ <h3> <span id="popup-text"> </span> <button id = "edit-delete-btn" data-icon="de
console.log(title);
var mins = $("#edit-minute-slider").val();
var secs = $("#edit-second-slider").val();
if (title != "" && (mins > 0 || secs >0)) {
if (title != "" && (mins > 0 || secs >0) && !(title.indexOf(',') > 0)) {
var time = (parseInt(mins)*60)+parseInt(secs)
json.workouts[id[0]].moves[id[1]] = [title , time];
console.log("Edited");
Expand Down

0 comments on commit a2495a9

Please sign in to comment.