[SPIP] ~spip v3.2.0-->v3.2.1
[lhc/web/www.git] / www / prive / formulaires / dateur / inc-dateur.html
index e608987..f1730b3 100644 (file)
@@ -26,7 +26,6 @@ function date_picker_options(){
                        '<:date_jour_5_initiale|texte_script:>','<:date_jour_6_initiale|texte_script:>','<:date_jour_7_initiale|texte_script:>'],
                dateFormat: 'dd/mm/yy',
                firstDay: 1,
-               isRTL: [(#ENV{lang}|lang_dir|=={rtl}|?{true,false})],
                changeMonth: true,
                changeYear: true,
                showOtherMonths: true,
@@ -34,28 +33,55 @@ function date_picker_options(){
                yearRange: "c-60:c+40"
        };
 }
+function time_picker_options() {
+       return {
+               step: #ENV{heure_pas,30},
+       };
+}
 function date_picker_init(){
+       // Initialisation du sélecteur sur les champs de date
        jQuery('input.date').not('.datePicker')
-               .addClass('datePicker').each(function(){
+               .addClass('datePicker').each(function() {
+                       // Pour chaque champ, on regarde s'il y a des options propres
                        var options = {showOn: 'button'};
-                       if (jQuery(this).attr('data-startDate'))
-                               options.minDate = jQuery(this).attr('data-startDate');
-                       if (jQuery(this).attr('data-endDate'))
-                               options.maxDate = jQuery(this).attr('data-endDate');
-                       if (jQuery(this).attr('data-yearRange'))
-                               options.yearRange = jQuery(this).attr('data-yearRange');
+                       if (jQuery(this).data('startdate')) {
+                               options.minDate = jQuery(this).data('startdate');
+                       }
+                       if (jQuery(this).data('enddate')) {
+                               options.maxDate = jQuery(this).data('enddate');
+                       }
+                       if (jQuery(this).data('yearrange')) {
+                               options.yearRange = jQuery(this).data('yearrange');
+                       }
                        jQuery(this)
                                .datepicker(jQuery.extend(date_picker_options(),options))
                                .trigger('datePickerLoaded');
                });
-       jQuery("input.heure").not('.timePicker').addClass('timePicker').timePicker({step:#ENV{heure_pas,30}});
+       
+       // Initialisation du sélecteur sur les champs d'heure
+       jQuery("input.heure").not('.timePicker')
+               .addClass('timePicker').each(function() {
+                       // Pour chaque champ, on regarde s'il y a des options propres
+                       var options = {};
+                       if (jQuery(this).data('starttime')) {
+                               options.startTime = jQuery(this).data('starttime');
+                       }
+                       if (jQuery(this).data('endtime')) {
+                               options.endTime = jQuery(this).data('endtime');
+                       }
+                       if (jQuery(this).data('step')) {
+                               options.step = jQuery(this).data('step');
+                       }
+                       jQuery(this)
+                               .timePicker(jQuery.extend(time_picker_options(), options));
+               });
 }
 var date_picker_loading;
 if (window.jQuery){
        jQuery(function(){
                if (jQuery('input.date,input.heure').length
                        && typeof date_picker_loading=="undefined"){
-                       date_picker_loading = jQuery.getScript('#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}');
+                       date_picker_loading = jQuery.getScript('[(#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}|timestamp)]');
                        date_picker_loading.done(function(){
                                date_picker_init();
                                onAjaxLoad(date_picker_init);
@@ -66,8 +92,8 @@ if (window.jQuery){
 /*]]>*/</script>
 <style type="text/css">
 [(#INCLURE{formulaires/dateur/time_picker.css}|compacte{css})]
-img.ui-datepicker-trigger { display: inline-block; padding: 0; margin: 0px 0 0 -19px; vertical-align: middle; }
+img.ui-datepicker-trigger { display: inline-block; padding: 0; margin: 0; margin-[(#ENV{lang}|lang_dir|choixsiegal{ltr,left,right})]: -19px; vertical-align: middle; z-index:2 }
 div.time-picker {font-size:11px;  width:5em; /* needed for IE */}
-.formulaire_spip input.date {width:9em;padding-right:25px;}
+.formulaire_spip input.date {width:9em;padding-[(#ENV{lang}|lang_dir|choixsiegal{ltr,right,left})]:25px;}
 .formulaire_spip input.heure {width:7em;}
 </style>