mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 12:47:48 +01:00
replaced alerts with sweetAlert
This commit is contained in:
parent
ac9738d058
commit
9d3b8cced4
8 changed files with 75 additions and 7 deletions
|
@ -298,6 +298,8 @@ GEM
|
||||||
colorize (>= 0.7.0)
|
colorize (>= 0.7.0)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
|
sweetalert-rails (0.3.3)
|
||||||
|
railties (>= 3.1.0)
|
||||||
thin (1.6.3)
|
thin (1.6.3)
|
||||||
daemons (~> 1.0, >= 1.0.9)
|
daemons (~> 1.0, >= 1.0.9)
|
||||||
eventmachine (~> 1.0)
|
eventmachine (~> 1.0)
|
||||||
|
@ -387,6 +389,7 @@ DEPENDENCIES
|
||||||
simplecov
|
simplecov
|
||||||
sinatra
|
sinatra
|
||||||
spring
|
spring
|
||||||
|
sweetalert-rails
|
||||||
thin
|
thin
|
||||||
turbolinks
|
turbolinks
|
||||||
twitter
|
twitter
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
$(document).on "click", "a[data-action=ab-comment-destroy]", (ev) ->
|
$(document).on "click", "a[data-action=ab-comment-destroy]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
|
swal
|
||||||
|
title: "Are you sure?"
|
||||||
|
text: "You will not be able to recover this!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete it!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
if confirm 'Are you sure?'
|
if confirm 'Are you sure?'
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
cid = btn[0].dataset.cId
|
cid = btn[0].dataset.cId
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
$(document).on "click", "a[data-action=ab-comment-report]", (ev) ->
|
$(document).on "click", "a[data-action=ab-comment-report]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
if confirm 'Are you sure you want to report this comment?'
|
swal
|
||||||
|
title: "Report?"
|
||||||
|
text: "A moderator will check this and decide what happens!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Report!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
cid = btn[0].dataset.cId
|
cid = btn[0].dataset.cId
|
||||||
$.ajax
|
$.ajax
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
$(document).on "click", "a[data-action=ab-destroy]", (ev) ->
|
$(document).on "click", "a[data-action=ab-destroy]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
if confirm 'Are you sure?'
|
swal
|
||||||
|
title: "Are you sure?"
|
||||||
|
text: "You will not be able to recover this!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete it!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
aid = btn[0].dataset.aId
|
aid = btn[0].dataset.aId
|
||||||
$.ajax
|
$.ajax
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
$(document).on "click", "a[data-action=ab-report]", (ev) ->
|
$(document).on "click", "a[data-action=ab-report]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
if confirm 'Are you sure you want to report this answer?'
|
swal
|
||||||
|
title: "Report?"
|
||||||
|
text: "A moderator will check this and decide what happens!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Report!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
aid = btn[0].dataset.aId
|
aid = btn[0].dataset.aId
|
||||||
$.ajax
|
$.ajax
|
||||||
|
|
|
@ -22,7 +22,15 @@
|
||||||
($ document).on "click", "button#ib-delete-all", ->
|
($ document).on "click", "button#ib-delete-all", ->
|
||||||
btn = ($ this)
|
btn = ($ this)
|
||||||
count = btn[0].dataset.ibCount
|
count = btn[0].dataset.ibCount
|
||||||
if confirm "Really delete #{count} questions?"
|
swal
|
||||||
|
title: "Really delete #{count} questions??"
|
||||||
|
text: "You will not be able to recover them!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete all!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn.button "loading"
|
btn.button "loading"
|
||||||
succ = no
|
succ = no
|
||||||
$.ajax
|
$.ajax
|
||||||
|
@ -84,7 +92,15 @@ $(document).on "click", "button[name=ib-answer]", ->
|
||||||
|
|
||||||
|
|
||||||
$(document).on "click", "button[name=ib-destroy]", ->
|
$(document).on "click", "button[name=ib-destroy]", ->
|
||||||
if confirm 'Are you sure?'
|
swal
|
||||||
|
title: "Are you sure?"
|
||||||
|
text: "You will not be able to recover this question!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete it!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
btn.button "loading"
|
btn.button "loading"
|
||||||
iid = btn[0].dataset.ibId
|
iid = btn[0].dataset.ibId
|
||||||
|
|
|
@ -68,7 +68,15 @@ $(document).on "input", "input[name=mod-comment-new]", (evt) ->
|
||||||
# destroy
|
# destroy
|
||||||
$(document).on "click", "a[data-action=mod-comment-destroy]", (ev) ->
|
$(document).on "click", "a[data-action=mod-comment-destroy]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
if confirm 'Are you sure?'
|
swal
|
||||||
|
title: "Are you sure?"
|
||||||
|
text: "You will not be able to recover this comment!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete it!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
cid = btn[0].dataset.id
|
cid = btn[0].dataset.id
|
||||||
$.ajax
|
$.ajax
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
$(document).on "click", "button[name=mod-delete-report]", ->
|
$(document).on "click", "button[name=mod-delete-report]", ->
|
||||||
if confirm 'Are you sure?'
|
swal
|
||||||
|
title: "Are you sure?"
|
||||||
|
text: "You will not be able to recover this!"
|
||||||
|
type: "warning"
|
||||||
|
showCancelButton: true
|
||||||
|
confirmButtonColor: "#DD6B55"
|
||||||
|
confirmButtonText: "Yes, delete it!"
|
||||||
|
closeOnConfirm: false
|
||||||
|
, ->
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
id = btn[0].dataset.id
|
id = btn[0].dataset.id
|
||||||
$.ajax
|
$.ajax
|
||||||
|
|
Loading…
Reference in a new issue