Git Product home page Git Product logo

meteor-sweetalert's Introduction

Meteor-sweetalert

SweetAlert - a responsive, themable, cross-browser replacement for JavaScript's alert() with beautiful dialog prompts.

A success modal

Usage

meteor add kevohagan:sweetalert

Then, run

sweetAlert("Hello world!");

For more detailed usage, see the SweetAlert README.

License

MIT

meteor-sweetalert's People

Contributors

dandv avatar ecwyne avatar jmillerdesign avatar kevohagan avatar smoral avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

meteor-sweetalert's Issues

Template for sweet alert?

Being that we can insert html into the Sweet Alert, I was wondering if there was a template that the Sweet Alert is being used in so that I can make some custom event handlers for clickable text in the modal.

Looking to do something like:

Template.Example.events({
    'click #do-something': function() {
        htmlText = "I want to do something when I click <span id='click-me'>here</span>.";

        swal({
            title: "Example",   
            text: customText,
            confirmButtonColor: "#2e9bda",
            confirmButtonText: "Ok",
            closeOnConfirm: true,
            html:true
        });
    }
});


Template.SweetAlert.events({
    'click #click-me': function() {
        swal.close();
        // do other cool stuff here...
    }
})

How to change Theme

Hello,

I have add sweet alert with meteor.
But how can I change the theme (css) ?

inputPlaceholder not working

I have this piece of code:

swal({
      imageUrl: "/image.png",
      imageSize: "279x60",
      inputPlaceholder: "Enter your email to get invited",
      title: "<h3>Title text here?</h3>",
      text: "Text here.",
      type: "input",
      html: true,
      showCancelButton: true,
      closeOnConfirm: false,
      animation: "slide-from-top"
    }

But the input placeholder is not showing.
Any help here?

Remove "OK" button from alert box

I want to remove the OK button from the alert box but i did not find any property for not to display this button.

I am using the timer property timer:1000 for closing the alert in one second.
So, I don't think there is a use of ok button in this matter.

screen shot 2017-02-23 at 10 41 53 am

ImgURL not working?

I can't seem to get the custom icon to work. I've adjusted the size, tried CDN, tried local. The sweet alert gets rendered with custom-icon style set to "display: none"

Pass in variables to text attribute?

I tried adding the variable inline and by creating a variable before adding it to the swal object. Any way to do this?

var sponsor = tmpl.find('#sponsorName').value;
var dynamicText = "Are you sure you want to delete" + sponsor + "?";

swal({
  title: "Remove sponsor",
  text: dynamicText,
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false,
  html: true
}, function() {
  swal("Deleted!",
    "Deleted.",
    "success");
});

Doing this just leaves a blank space where the variable should display.

Confirm/Cancel SweetAlert is getting swallowed

I'm trying out the examples on the SweetAlert site (http://tristanedwards.me/sweetalert), but the example where you show another alert after clicking "Cancel" or "Confirm" is not working in the Meteor package. Basically, the modal isn't staying open - it's closing and swallowing the SweetAlert triggered in the confirmation function.

swal({
    title: "Are you sure?",
    text: "You will not be able to recover this imaginary file!",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, delete it!",
    cancelButtonText: "No, cancel plx!",
    closeOnConfirm: false,
    closeOnCancel: false
}, function(isConfirm) {
    if (isConfirm) {
        swal("Deleted!", "Your imaginary file has been deleted.", "success");
    } else {
        swal("Cancelled", "Your imaginary file is safe :)", "error");
    }
});

Is this using a older version of sweet alert

the sweet alert demo if you click outside the alert,
it closes the alert and with this it does not.

Is it becuase you are using a older version of the script or it is a option in sweet alert?

Function not calling when timer ends

Hi, I don't know if it's the version of sweet alert or something else, but unfortunately the function that should be called when the timer ends right now is not working. :s

swal({   
                    title: "¡Listo!",   
                    text: "Ya está la dirección de envío.",   
                    type: "success",
                    timer: 1000,   
                    showConfirmButton: false},   
                    function(){  
                       console.log('done');
                    }
                    );

Unable to use "input" and "prompt" alert types

Anyone else unable to use "input" or "prompt" alert types with SweetAlert? All the other types seem to work for me - I've been using this plugin for a while - just not input/prompt. I've just updated to the latest 0.5.0.

I get this error:

SweetAlert: Unknown alert type: input

Which is bizarre, since I checked the source SweetAlert js file and it has alertTypes = [... 'input', 'prompt'], so they should be working... any ideas?

Meteor.call() not working in swal

Meteor.call is working without swal but when I put it inside sweetalert its not.

'click .fa-trash': function() {
        swal({
            title: "Are you sure?",
            text: "You will not be able to recover this imaginary file!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: false,
            html: false
        }, function() {
            Meteor.call('deleteItem', this._id); 
            swal("Deleted!",
                "Your imaginary file has been deleted.",
                "success");
        });           
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.