2011-11-07 13:20:19 +00:00
|
|
|
$(document).ready(function(){
|
2011-09-28 08:44:27 +00:00
|
|
|
|
2011-12-16 15:00:06 +00:00
|
|
|
$(".tooltip").qtip();
|
2011-12-20 15:22:09 +00:00
|
|
|
$(".tooltip").each(function(){
|
2011-12-16 15:00:06 +00:00
|
|
|
var title = $(this).attr('title');
|
|
|
|
var width = $(this).attr('wdth');
|
|
|
|
$(this).attr('title', '');
|
|
|
|
$(this).qtip({
|
|
|
|
solo:true,
|
|
|
|
content: title,
|
|
|
|
style: {
|
|
|
|
width: width,
|
2011-12-20 15:22:09 +00:00
|
|
|
classes: "ui-tooltip-dark"
|
2011-12-16 15:00:06 +00:00
|
|
|
},
|
|
|
|
position: {
|
|
|
|
at: $('#at').val(),
|
|
|
|
my: $('#my').val(),
|
|
|
|
viewport: $(window),
|
|
|
|
adjust: {
|
|
|
|
method: $('#adjust_method').val(),
|
|
|
|
x: parseInt($('#adjust_x').val(), 10) || 0,
|
|
|
|
y: parseInt($('#adjust_y').val(), 10) || 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2011-12-16 16:42:58 +00:00
|
|
|
$(function() {
|
2011-12-16 16:50:07 +00:00
|
|
|
$( ".datepicker" ).datepicker({
|
|
|
|
showOn: "button",
|
|
|
|
buttonImage: "/themes/default/images/calendar.png",
|
|
|
|
buttonImageOnly: true
|
|
|
|
});
|
2011-12-16 16:42:58 +00:00
|
|
|
$( ".datepicker" ).datepicker( "option", "dateFormat", "yymmdd" );
|
|
|
|
});
|
|
|
|
|
2011-12-20 15:22:09 +00:00
|
|
|
$('.printCritere').click(function(){
|
|
|
|
var name = $(this).attr('name');
|
|
|
|
var block = $('#'+$(this).attr('name')).css('display');
|
|
|
|
if(block == 'block') {
|
|
|
|
$(this).css('background-image', 'url(/themes/default/images/ajouter.png)');
|
2011-12-20 15:31:31 +00:00
|
|
|
$('#'+name).hide('slide');
|
2011-12-20 15:22:09 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$(this).css('background-image', 'url(/themes/default/images/moins.png)');
|
2011-12-20 15:31:31 +00:00
|
|
|
$('#'+name).show('slide');
|
2011-12-20 15:22:09 +00:00
|
|
|
}
|
2011-12-19 16:48:03 +00:00
|
|
|
})
|
|
|
|
|
2011-12-20 15:22:09 +00:00
|
|
|
$(function() {
|
|
|
|
$( "#accordion" ).accordion({
|
|
|
|
autoHeight: false,
|
|
|
|
navigation: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
$( "#sortable" ).sortable({
|
|
|
|
placeholder: "ui-state-highlight"
|
|
|
|
});
|
|
|
|
$( "#sortable" ).disableSelection();
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
$( ".column" ).sortable({
|
|
|
|
connectWith: ".column"
|
|
|
|
});
|
|
|
|
|
|
|
|
$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
|
|
|
|
.find( ".portlet-header" )
|
|
|
|
.addClass( "ui-widget-header ui-corner-all" )
|
|
|
|
.prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
|
|
|
|
.end()
|
|
|
|
.find( ".portlet-content" );
|
|
|
|
|
|
|
|
$( ".portlet-header .ui-icon" ).click(function() {
|
|
|
|
$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
|
|
|
|
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
|
|
|
|
});
|
|
|
|
|
|
|
|
$( ".column" ).disableSelection();
|
|
|
|
});
|
2011-12-16 09:00:12 +00:00
|
|
|
|
2011-12-14 14:27:21 +00:00
|
|
|
$('#tabs').delegate('select.criteres', 'change', function(e){
|
2011-12-20 15:22:09 +00:00
|
|
|
var valeur = $(this, ':selected').val();
|
2011-12-14 14:27:21 +00:00
|
|
|
e.stopPropagation();
|
2011-12-20 15:22:09 +00:00
|
|
|
if(valeur == 'tous') {
|
|
|
|
$('#'+$(this).attr('name')).css('background-color', '');
|
|
|
|
} else {
|
|
|
|
$('#'+$(this).attr('name')).css('background-color', '#CCF8D2'); }
|
2011-12-14 14:27:21 +00:00
|
|
|
set($(this).attr('name'), $(this, ':selected').val());
|
2011-12-20 15:22:09 +00:00
|
|
|
|
2011-12-14 14:27:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#tabs').delegate('input[type=checkbox].criteres', 'click', function(e){
|
|
|
|
e.stopPropagation();
|
2011-12-14 15:14:50 +00:00
|
|
|
set($(this).attr('name'), $(this).val());
|
2011-12-14 14:27:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#tabs').delegate('input[type=radio].criteres', 'click', function(e){
|
|
|
|
e.stopPropagation();
|
2011-12-14 15:14:50 +00:00
|
|
|
set($(this).attr('name'), $(this).val());
|
2011-12-14 13:23:37 +00:00
|
|
|
});
|
2011-11-07 13:20:19 +00:00
|
|
|
|
2011-12-14 14:27:21 +00:00
|
|
|
$('#tabs').delegate('input[type=text].criteres', 'blur', function(e){
|
|
|
|
e.stopPropagation();
|
2011-12-14 15:14:50 +00:00
|
|
|
set($(this).attr('name'), $(this).val());
|
2011-12-14 14:27:21 +00:00
|
|
|
});
|
2011-11-07 13:20:19 +00:00
|
|
|
|
2011-12-14 15:48:35 +00:00
|
|
|
$('#tabs').delegate('a.interval', 'click', function(e){
|
2011-12-15 09:17:26 +00:00
|
|
|
e.preventDefault();
|
2011-12-14 15:48:35 +00:00
|
|
|
var key = $(this).attr('id');
|
2011-12-15 13:08:03 +00:00
|
|
|
var values = $('input[name='+key+'1]').val() + ',' + $('input[name='+key+'2]').val();
|
2011-12-14 15:48:35 +00:00
|
|
|
set(key, values);
|
2011-12-15 09:17:26 +00:00
|
|
|
return false;
|
2011-12-14 15:48:35 +00:00
|
|
|
});
|
2011-12-14 14:27:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function set(key, value)
|
|
|
|
{
|
2011-12-19 09:44:31 +00:00
|
|
|
$('.comptage').css('display', 'none');
|
|
|
|
$('.attente').css('display', 'block');
|
2011-12-14 14:27:21 +00:00
|
|
|
$.post('/comptage', { cle:key, valeur:value}, function(data, status) {
|
|
|
|
$('#count').html(data.count);
|
2011-12-14 15:10:16 +00:00
|
|
|
$('#insee').html(data.insee);
|
2011-12-19 09:44:31 +00:00
|
|
|
$('.attente').css('display', 'none');
|
|
|
|
$('.comptage').css('display', 'block');
|
2011-12-14 15:59:30 +00:00
|
|
|
}, 'json')
|
|
|
|
.error(function(){ alert('error'); });
|
2011-12-14 14:27:21 +00:00
|
|
|
}
|
|
|
|
|