netsach / bootstrap.alert Goto Github PK
View Code? Open in Web Editor NEWCustomizable bootstrap alert : Replace old javascript alert('msg');
License: GNU General Public License v3.0
Customizable bootstrap alert : Replace old javascript alert('msg');
License: GNU General Public License v3.0
When I use the pugin with the following options, the modal immediatly disappear when it should be displayed.
In HTML :
<div class="spot></div>
In Javascript file
$(document).ready(function(){
$('.spot').click(function(event){
var button = $(event.currentTarget);
var stand_number = button.data("number");
$.alert({
title: '',
body: "Vous avez choisi le numéro " + stand_number,
is_delayed: false,
close_after_calback_confirm: true,
close_after_calback_decline: true,
text_confirm: 'OK',
text_decline: 'Close',
click_outside_for_close: false,
timer_modal: 50,
});
});
});
It would be nice to have a listener to a certain class to create confirmable link:
for example:
<script type="text/javascript">
$('.bootstrap-alert-confirmable').click(function(event){
var message = $(this).data('message');
var dest = event.target.href;
event.preventDefault();
$.alert({
text_confirm: 'oui',
text_decline: "annuler",
click_outside_for_close: false,
title: 'Êtes-vous sûr(e) ?',
body: message + '<br>Êtes-vous sûr(e) ?',
callback_confirm: function(){
window.location = dest;
},
is_delayed: false,
});
});
</script>
and in the page (DOM)
<a class="btn btn-danger bootstrap-alert-confirmable" data-message="This will cancel things." href=scheme://path/to/final/link">Cancel</a>
Currently, to chain alerts I use the following code :
callback_confirm: function(){
// display other modal
setTimeout(function(){
$.alert({
title: "",
body:"Vous réserver l'emplacement... Vous voulez réserver autre emplacements?",
is_delayed: false,
text_confirm: 'Finaliser et payer',
text_decline: 'Réserver autre emplacement',
callback_confirm: function(){
window.location.href = "http://127.0.0.1:5000/payment/";
},
});
},1000);
},
Could it be more simple to use ?
The gruntifle has no minify target, we should add it. The dist folder contains unnecessary files.
When the delayed functionnality is enabled, the 'timer' is shown on 'validation' button but when it expires it trigger the cancel one...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.