$(document).ready(function(){ $('a#password').on('click', function(){ var dialogOpts = { bgiframe: true, autoOpen: false, height: 180, modal: true, buttons: { 'Modifier': function() { var pass = $('input[name=npass1]').val(); if (pass != $('input[name=npass2]').val()) { $('#form-message').html('Mots de passe différents.'); } else { $('input[name="frmOptions[changepwd]"]').val('1'); $('input[name="frmOptions[password]"]').val(pass); $('#password').html('Sauver pour enregistrer la modification du mot de passe'); $(this).dialog('close'); } }, 'Annuler': function() { $(this).dialog('close'); } }, close: function() { $('#dialog-password').remove(); } }; $("#dialog-password").dialog(dialogOpts); $("#dialog-password").dialog('open'); return false; }); $('input[name=modeEdition]').click(function(e){ var mode = $(this).is(':checked'); var bouton = $('input[type=submit]'); bouton.attr('disabled', true); $('#msgModeEdition').text('Mise à jour en cours.'); $.post('/user/editionsession', { mode: mode}, function(data, status){ if (data=='0'){ $('input[name=modeEdition]').attr('checked',false); } else if (data=='1'){ $('input[name=modeEdition]').attr('checked',true); } }); $('#msgModeEdition').text('Mode Edition modifié en session.'); bouton.removeAttr('disabled'); }); $('a#email-surveillance').on('click', function(){ var href = $(this).attr('href'); if (href!='#') { var title = $(this).attr('title'); var dialogOpts = { bgiframe: true, title: title, width: 550, height: 300, modal: true, open: function(event, ui) { $(this).html('Chargement...'); $(this).load(href); }, buttons: { Annuler: function() { $(this).dialog('close'); } }, close: function() { $('#dialog').remove(); } }; $('
').dialog(dialogOpts); return false; } }); });