mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-19 05:46:04 +01:00
fixed sweetalert for use with Turbolinks, changed wording
This commit is contained in:
parent
f5a469bafa
commit
d183a79493
9 changed files with 31 additions and 27 deletions
|
@ -1,15 +1,14 @@
|
|||
$(document).on "click", "a[data-action=ab-comment-destroy]", (ev) ->
|
||||
ev.preventDefault()
|
||||
swal
|
||||
title: "Are you sure?"
|
||||
text: "You will not be able to recover this!"
|
||||
title: "Really delete?"
|
||||
text: "You will not be able to recover this comment."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
if confirm 'Are you sure?'
|
||||
btn = $(this)
|
||||
cid = btn[0].dataset.cId
|
||||
$.ajax
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$(document).on "click", "a[data-action=ab-comment-report]", (ev) ->
|
||||
ev.preventDefault()
|
||||
swal
|
||||
title: "Report?"
|
||||
text: "A moderator will check this and decide what happens!"
|
||||
title: "Really report?"
|
||||
text: "A moderator will review this comment and decide what happens."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Report!"
|
||||
confirmButtonText: "Report"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$(document).on "click", "a[data-action=ab-destroy]", (ev) ->
|
||||
ev.preventDefault()
|
||||
swal
|
||||
title: "Are you sure?"
|
||||
text: "If you delete this answer it will be moved back to your inbox!"
|
||||
title: "Really delete?"
|
||||
text: "The question will be moved back to your inbox."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$(document).on "click", "a[data-action=ab-report]", (ev) ->
|
||||
ev.preventDefault()
|
||||
swal
|
||||
title: "Report?"
|
||||
text: "A moderator will check this and decide what happens!"
|
||||
title: "Really report?"
|
||||
text: "A moderator will review this comment and decide what happens."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Report!"
|
||||
confirmButtonText: "Report"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -25,3 +25,9 @@ window.showNotification = (text, success=true) ->
|
|||
|
||||
$(document).on "click", "button#create-account", ->
|
||||
Turbolinks.visit "/sign_up"
|
||||
|
||||
_ready = ->
|
||||
sweetAlertInitialize()
|
||||
|
||||
$(document).ready _ready
|
||||
$(document).on 'page:load', _ready
|
|
@ -23,12 +23,12 @@
|
|||
btn = ($ this)
|
||||
count = btn[0].dataset.ibCount
|
||||
swal
|
||||
title: "Really delete #{count} questions??"
|
||||
text: "You will not be able to recover them!"
|
||||
title: "Really delete #{count} questions?"
|
||||
text: "They will be gone forever."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete all!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn.button "loading"
|
||||
|
@ -93,12 +93,12 @@ $(document).on "click", "button[name=ib-answer]", ->
|
|||
|
||||
$(document).on "click", "button[name=ib-destroy]", ->
|
||||
swal
|
||||
title: "Are you sure?"
|
||||
text: "You will not be able to recover this question!"
|
||||
title: "Really delete?"
|
||||
text: "This question will be gone forever."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -69,12 +69,12 @@ $(document).on "input", "input[name=mod-comment-new]", (evt) ->
|
|||
$(document).on "click", "a[data-action=mod-comment-destroy]", (ev) ->
|
||||
ev.preventDefault()
|
||||
swal
|
||||
title: "Are you sure?"
|
||||
text: "You will not be able to recover this comment!"
|
||||
title: "Really delete?"
|
||||
text: "You will not be able to recover this comment."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$(document).on "click", "button[name=mod-delete-report]", ->
|
||||
swal
|
||||
title: "Are you sure?"
|
||||
text: "You will not be able to recover this!"
|
||||
title: "Really delete?"
|
||||
text: "You will not be able to recover this report."
|
||||
type: "warning"
|
||||
showCancelButton: true
|
||||
confirmButtonColor: "#DD6B55"
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Delete"
|
||||
closeOnConfirm: false
|
||||
, ->
|
||||
btn = $(this)
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
*= require rails_bootstrap_forms
|
||||
*= require growl
|
||||
*= require jquery.guillotine
|
||||
*= require_self
|
||||
*= require sweet-alert
|
||||
*= require_tree .
|
||||
*= require_self
|
||||
*/
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Exo+2:400,700);
|
||||
|
|
Loading…
Reference in a new issue