On a previous entrance I talked about Smoke.js, an independent Javascript library for creating dialogs, alarms, confirms, … A few months ago, the library was updated to version 0.1.3, where a few bugs where solved and new features were added, such as multi select.
If you are a developer, this versión 0.1.3 will force you to modify calling to options, for example, modify the duration of a message … but the change worth it!
$(‘#confirmar’).on(‘click’, function () {
smoke.confirm(‘texto’,function(e){
if (e){
smoke.signal(‘Pulsa Salir y me voy en 3 segundos’, function (e) {null;}, { duration: 3000 });
}else{
smoke.alert(‘Pulsa Cancelar’);
}
},
{ok:"Salir", cancel:"Cancelar"} // Nombre de los botones
); // Muestra mensaje de confirmacion
});
$(‘#multiple’).on(‘click’, function () {
smoke.quiz("Color favorito?", function(e){
if (e == "Azul – Blue"){
$mens.html(‘<strong>’+e+'</strong>’);
}
else { $mens.html(‘Ha seleccionado .. <i>’+e+'</i>’);}
}, {
button_1: "Azul – Blue",
button_2: "Amarillo – Yellow",
button_3: "Verde – Green",
button_cancel: "Ninguno"
});
});
On this page you can see the new version of Smoke in action. On the first sentence, you are asked to Exit or Cancel. If you click on Exit, you’ll get a message for 3 seconds (time in miliseconds).
The new Smoke.js library
Although the functionality of the previous and the current version is more or less the same, the previous version code seems to be shorter. The new version allows developers to increase functionality with callbacks, a feature that I like it (and you’ll like it too).
As you can read, this is one of my favorite libraries when working with HTML5 and Javascript. are you using it yet?