Skip to content

Commit

Permalink
Merge branch 'adrians2'
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansoghoian committed Apr 12, 2015
2 parents 1cfa060 + a85c0f0 commit cefb09d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
19 changes: 13 additions & 6 deletions app/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ $(document).ready(function() {
var phoneNumber = $("#input-phone").val();

var values = {"name": name, "searchingForName": searchingForName, "message": message, "phoneNumber": phoneNumber};
$("#main-form").hide();

$.ajax({
type: "POST",
url: "http://7b3eabbd.ngrok.com",
url: "http://www.connectmeback.org/sms",
data: values,
success: function(data){
if (JSON.stringify(data) == "{}") {
console.log("Nothing came back from the server.");
var newElement = "<div class='bounceIn panel' style='height:226px; text-shadow: none; padding-left: 15px; padding-right: 15px; width: 75%; margin: 0 auto; margin-bottom:23px; margin-top:20px; padding-top: 20px; color:black; font-size: 18px'>You'll be notified via SMS as soon as your loved one submits a message. Please submit another <a href='http://127.0.0.1:5000/'>here.</a></div>"
$("#main-form").hide();
var newElement = "<div class='bounceIn panel' style='height:226px; text-shadow: none; padding-left: 15px; padding-right: 15px; width: 75%; margin: 0 auto; margin-bottom:23px; margin-top:20px; padding-top: 20px; color:#5C5C5C; font-size: 18px'>You'll be notified via SMS as soon as your loved one submits a message. Please submit another <a href='http://www.connectmeback.org/'>here.</a></div>"
$("#slogan").append(newElement);
} else {
}
if ('name' in data) {
$("#main-form").hide();
console.log("Got a response from the server, going to present it to the user now.");
var newElement = "<div class='bounceIn panel' style='height:226px; text-shadow: none; padding-left: 15px; padding-right: 15px; width: 75%; margin: 0 auto; margin-bottom:23px; margin-top:20px; padding-top: 20px; color:black; font-size: 18px'>You'll be notified via SMS as soon as your loved one submits a message. Please submit another <a href='http://127.0.0.1:5000/'>here.</a></div>"
console.log(data);

var searchingForName = data['name'];
var myName = data['searchingForName'];
var message = data['message'];
var phoneNumber = data['phone'];
var newElement = "<div class='bounceIn panel' style='height:226px; text-shadow: none; padding-left: 15px; padding-right: 15px; width: 75%; margin: 0 auto; margin-bottom:23px; margin-top:20px; padding-top: 20px; color:#5C5C5C; font-size: 18px'>Wow! We found a match. " + searchingForName + " was also looking for you, too. They say: '" + message + "', and you can contact them at: " + phoneNumber + ".</div>";
$("#slogan").append(newElement);
}
}
Expand Down
24 changes: 20 additions & 4 deletions app/static/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions app/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<!-- Carousel
================================================== -->
<img src="{{ url_for('static', filename='logo.png') }}" id="logo">
<img src="{{ url_for('static', filename='logo.png') }}" style="width:15%; height:auto;" id="logo">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<div class="carousel-inner" role="listbox">
Expand All @@ -85,7 +85,8 @@ <h1>هل إفترقت عن عائلتك ؟</h1>
<input type="text" class="form-control main-form" id="input-destination" placeholder="اسمهم">
<input type="text" class="form-control main-form" id="input-message" placeholder="اكتب الرسالة">
<input type="text" class="form-control main-form" id="input-phone" placeholder="رقم هاتفك">
<br>
<div class="checkbox"><label style="width: 100%; text-align: right; text-shadow: none; color: #B0B0B0; font-size: 21px; vertical-align: middle;"><input type="checkbox" name="legal" value="" style="float: right; padding-left: 10%; padding-top: 1%; border: #DC912C" required>لقد قرأت ووافقت على <a href="#">شروط الخدمة</a></label>
</div>
<button type="submit" class="btn btn-default" id="submit-form-button">صلني</button>
</form>
</div>
Expand Down

0 comments on commit cefb09d

Please sign in to comment.