68 lines
2.1 KiB
JavaScript
Raw Normal View History

2011-05-03 12:49:43 +00:00
$(document).ready(function(){
$('a#password').on('click', function(){
2011-05-03 12:49:43 +00:00
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(); }
2011-05-03 12:49:43 +00:00
};
$("#dialog-password").dialog(dialogOpts);
$("#dialog-password").dialog('open');
2011-05-03 12:49:43 +00:00
return false;
});
2011-11-22 17:00:53 +00:00
$('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);
}
});
2012-06-05 13:52:12 +00:00
$('#msgModeEdition').text('Mode Edition modifié en session.');
2011-11-22 17:00:53 +00:00
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(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
}
});
2011-05-03 12:49:43 +00:00
});