even more fixes

This commit is contained in:
nilsding 2015-01-03 19:49:47 +01:00
parent 0485be8eb9
commit 7d9a0b720d
8 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,7 @@
$(document).on "click", "a[data-action=ab-comment-destroy]", (ev) ->
ev.preventDefault()
btn = $(this)
cid = btn[0].dataset.cId
swal
title: "Really delete?"
text: "You will not be able to recover this comment."
@ -7,10 +9,8 @@ $(document).on "click", "a[data-action=ab-comment-destroy]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
cid = btn[0].dataset.cId
$.ajax
url: '/ajax/destroy_comment'
type: 'POST'

View File

@ -1,5 +1,7 @@
$(document).on "click", "a[data-action=ab-comment-report]", (ev) ->
ev.preventDefault()
btn = $(this)
cid = btn[0].dataset.cId
swal
title: "Really report?"
text: "A moderator will review this comment and decide what happens."
@ -7,10 +9,8 @@ $(document).on "click", "a[data-action=ab-comment-report]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Report"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
cid = btn[0].dataset.cId
$.ajax
url: '/ajax/report'
type: 'POST'

View File

@ -1,5 +1,7 @@
$(document).on "click", "a[data-action=ab-destroy]", (ev) ->
ev.preventDefault()
btn = $(this)
aid = btn[0].dataset.aId
swal
title: "Really delete?"
text: "The question will be moved back to your inbox."
@ -7,10 +9,8 @@ $(document).on "click", "a[data-action=ab-destroy]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
aid = btn[0].dataset.aId
$.ajax
url: '/ajax/destroy_answer' # TODO: find a way to use rake routes instead of hardcoding them here
type: 'POST'

View File

@ -1,5 +1,7 @@
$(document).on "click", "a[data-action=ab-report]", (ev) ->
ev.preventDefault()
btn = $(this)
aid = btn[0].dataset.aId
swal
title: "Really report?"
text: "A moderator will review this answer and decide what happens."
@ -7,10 +9,8 @@ $(document).on "click", "a[data-action=ab-report]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Report"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
aid = btn[0].dataset.aId
$.ajax
url: '/ajax/report' # TODO: find a way to use rake routes instead of hardcoding them here
type: 'POST'

View File

@ -29,7 +29,7 @@
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn.button "loading"
succ = no
@ -92,6 +92,7 @@ $(document).on "click", "button[name=ib-answer]", ->
$(document).on "click", "button[name=ib-destroy]", ->
btn = $(this)
swal
title: "Really delete?"
text: "This question will be gone forever."
@ -99,9 +100,8 @@ $(document).on "click", "button[name=ib-destroy]", ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
btn.button "loading"
iid = btn[0].dataset.ibId
$("textarea[name=ib-answer][data-id=#{iid}]").attr "readonly", "readonly"

View File

@ -68,6 +68,8 @@ $(document).on "input", "input[name=mod-comment-new]", (evt) ->
# destroy
$(document).on "click", "a[data-action=mod-comment-destroy]", (ev) ->
ev.preventDefault()
btn = $(this)
cid = btn[0].dataset.id
swal
title: "Really delete?"
text: "You will not be able to recover this comment."
@ -75,10 +77,8 @@ $(document).on "click", "a[data-action=mod-comment-destroy]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
cid = btn[0].dataset.id
$.ajax
url: '/ajax/mod/destroy_comment'
type: 'POST'

View File

@ -1,4 +1,6 @@
$(document).on "click", "button[name=mod-delete-report]", ->
btn = $(this)
id = btn[0].dataset.id
swal
title: "Really delete?"
text: "You will not be able to recover this report."
@ -6,10 +8,8 @@ $(document).on "click", "button[name=mod-delete-report]", ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Delete"
closeOnConfirm: false
closeOnConfirm: true
, ->
btn = $(this)
id = btn[0].dataset.id
$.ajax
url: '/ajax/mod/destroy_report'
type: 'POST'

View File

@ -58,7 +58,7 @@ $(document).on "click", "a[data-action=report-user]", (ev) ->
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Report"
closeOnConfirm: false
closeOnConfirm: true
, ->
$.ajax
url: '/ajax/report'