lipis/bootstrap-sweetalert

Add html boolean option

sylouuu opened this issue · 9 comments

Agreed. 5 months for a large feature missing such as HTML, or showConfirmButton... I've used this on a project and really appreciate it, but maybe this should be simplified to relying on SWAL and only tweaks for style.

I tried to merge the two.. but it's been a while and it's kind very outdated :/

It happens :)
I'd updated the readme to state that though, specifically the stable features in SA that aren't present here. It's by no means a bad code base you made, it's good. But maybe just let people know there are definitely some differences at this point.

:)

When are you guys going to merge? I'd like to use html: true soon.

Not to speak out of turn but your best option might be to use the standard
SWAL and overwrite what you need via CSS.

Or write your own JS to coat tail SWAL.

The danger of this library is that it mimics, not overlays, the original
SWAL code. So it's possible for it to fall behind easily.

Or you can update it and put in a merge request, offer the author a
donation, etc so there's incentive to get it up to date.

On Friday, April 10, 2015, Richard Lai notifications@github.com wrote:

When are you guys going to merge? I'd like to use html: true soon.


Reply to this email directly or view it on GitHub
#25 (comment)
.

-- Mike Minor
pixelbacon.com

Okay no problem.

yes.. I tried to update it.. but failed miserably... I don't have much time at the moment..so anyone who is willing to update would be nice :)

For now, this hack works:

swal({                                                 // as usual
  //etc.
  html: allowHtml,
  //etc.
});
if (allowHtml) {
  var txt = $(".sweet-alert p.lead").text();           // get text, which is escaped
  txt = $("<textarea/>").html(txt).text();             // unescape the text
  $(".sweet-alert p.lead").html(txt);                  // put it back in
}

And then you get HTML text. Can do the same for HTML title.

The merge with the main project has been completed. html and showConfirmButton options are now available