var handle_exception = function(ex) { location.reload(); } var show_dialog = function(type, content, on_yes, title, yes_label, no_label, yes_color, no_color) { //title = (title === undefined? "Information" : title); yes_label = (yes_label === undefined? "Oui" : yes_label); no_label = (no_label === undefined? "Non" : no_label); yes_color = (yes_color === undefined? 'green' : yes_color); no_color = (no_color === undefined? 'red' : no_color); switch(type) { case 'warning_ok_no': title = title === undefined? "Avertissement" : title; yes_label = "Ok"; no_label = "Non"; break; case 'warning_close': title = title === undefined? "Avertissement" : title; no_label = "Fermer"; no_color = 'blue'; yes_label = undefined; break; case 'error_close': title = title === undefined? "Erreur" : title; no_label = "Fermer"; no_color = 'blue'; yes_label = undefined; break; case 'info_send_cancel': title = title === undefined? "Information" : title; yes_label = "Envoyer"; no_label = "Annuler"; break; case 'info_close': title = title === undefined? "Information" : title; no_label = "Fermer"; no_color = 'blue'; yes_label = undefined; break; case 'custom_title_send_cancel': title = title === undefined? "Information" : title; yes_label = "Envoyer"; no_label = "Annuler"; break; } var dialog_out = $('#global_dialog'); var dialog_in = '' + '' + ''; dialog_out.html(dialog_in); dialog_out.modal('show'); $('#yes_button').on('click', function(){ if(on_yes !== undefined) { on_yes(); } }); } var init_controls = function() { $('.bs-select').selectpicker({ iconBase: 'fa', tickIcon: 'fa-check' }); } var PublicGlobal = function () { return { //main function to initiate the module init: function (){ init_controls(); } } }();