131 lines
2.9 KiB
JavaScript
Raw Normal View History

2011-04-26 13:39:19 +00:00
$(document).ready( function()
{
$('select[name=typeBilan]').on('change', function(e){
2011-07-06 15:31:24 +00:00
e.preventDefault();
$(this).parent('form').submit();
});
$('select[name=mil]').on('change', function(e){
2011-07-06 15:31:24 +00:00
e.preventDefault();
$(this).parent('form').submit();
});
$('a.tooltip').each(function(){
var title = $(this).attr('title');
$(this).attr('title', '');
$(this).qtip( {
content: title,
2011-08-30 07:11:39 +00:00
style: {
width: 500,
classes: "ui-tooltip-dark"
},
position: {
my: "top left",
at: "bottom left"
2011-08-30 07:11:39 +00:00
}
});
});
$('area.detailsgraphique').qtip({
content: $('area.detailsgraphique').title,
style: { name: 'cream', width: 170 },
position: {
corner: { target: 'bottomMiddle',
tooltip: 'topMiddle' } }
});
$('.rTip').each(function(){
2011-08-30 07:11:39 +00:00
$(this).qtip({
content: {
text: "Chargement...",
title: { text: $(this).attr('name') },
ajax: { url: $(this).attr('rel') }
2011-08-30 07:11:39 +00:00
},
position: {
at: "right center",
my: "right center",
adjust: { x: -20 }
2011-08-30 07:11:39 +00:00
},
show: { solo: true },
2011-08-30 07:11:39 +00:00
style: {
tip: true,
width: 400,
classes: "ui-tooltip-light"
}
});
});
$('img.sTip').each(function(){
$(this).qtip({
content: {
2011-08-30 07:11:39 +00:00
text: "Chargement...",
title: { text: "Evolution - " + $(this).attr('title') },
ajax: { url: $(this).attr('rel') }
},
position: {
2011-08-30 07:11:39 +00:00
at: "right center",
my: "right center",
adjust: { x: -20 }
},
2011-08-30 07:11:39 +00:00
show: {
solo: true
},
style: {
2011-08-30 07:11:39 +00:00
width: 420,
classes: "ui-tooltip-light"
}
});
});
$('#bilanClient').on('click', function(e){
2011-07-12 15:13:03 +00:00
e.preventDefault();
var url = $(this).attr('href');
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 550,
height: 450,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(url);
},
buttons: {
Valider: function() { formEnvoiBilanSubmit(); },
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogbilanclient').remove(); }
};
$('<div id="dialogbilanclient"></div>').dialog(dialogOpts);
return false;
});
$('a#xls').on('click', function(e){
e.preventDefault();
var objet = $(this).parent();
objet.html('Construction du fichier...');
var url = $(this).attr('href');
$.post( url, function (data, textStatus) {
if( data=='' || data=='FALSE' || textStatus=='timeout' ) {
data = 'La construction du fichier a échoué.<br/>';
}
objet.html(data);
});
});
2011-07-12 15:13:03 +00:00
});
function formEnvoiBilanSubmit(){
var url = $('#formEnvoiBilan').attr('action');
$.post(url, $('#formEnvoiBilan').serialize(),
function (data, textStatus) {
if (textStatus!='success'){
$('#dialogbilanclient').html('Erreur');
} else {
$('#dialogbilanclient').html(data);
}
}
);
}