Merge pull request #249 from ZeusWPI/cammie-messages

Send messages to the kelder from cammie page
This commit is contained in:
lorin 2018-04-28 12:17:25 +02:00 committed by GitHub
commit a028ad71c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,11 @@
$ '.send'
.click ->
$context = $ this
$.ajax
# url: "http://localhost:8080/"
url: "https://kelder.zeus.ugent.be/messages/",
contentType: "text/plain",
type: "POST"
data: $('.chatbox').val()
success: $('#chat-response').text('Success! :)')
error: $('#chat-response').text('Error !1!')

View file

@ -4,6 +4,7 @@ title: Cammie
---
<% content_for :scripts do %>
<%= asset :js, :cammie %>
<%= asset :js, :message %>
<% end %>
<section id="cammie-section">
@ -66,4 +67,15 @@ title: Cammie
</button>
</div>
</nav>
<div class="columns">
<p id="chat-response"></p>
<div class="field has-addons ">
<div class="field control">
<input class="input chatbox" type="text" placeholder="Zeus is de max!">
</div>
<a class="button send control">
Send to kelder
</a>
</div>
<div>
</section>