mirror of
https://github.com/neocities/neocities.git
synced 2025-05-30 01:10:07 +02:00
more work on comments for events
This commit is contained in:
parent
eba4a6e3f5
commit
b96730b83f
17 changed files with 2298 additions and 43 deletions
16
public/assets/scripts/news/comment.js
Normal file
16
public/assets/scripts/news/comment.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
var Comment = function(eventId, csrfToken) {
|
||||
this.eventId = eventId
|
||||
this.csrfToken = csrfToken
|
||||
}
|
||||
|
||||
Comment.prototype.create = function(form) {
|
||||
var self = this
|
||||
var form = $(form)
|
||||
var comment = form.find('[name="comment"]').val()
|
||||
form.remove()
|
||||
|
||||
$.post('/event/'+this.eventId+'/comment', {csrf_token: this.csrfToken, comment: comment}, function(res) {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue