// 1.5 branche creation

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@5881 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2011-04-12 18:24:40 +00:00
commit 10445ad61d
5317 changed files with 432110 additions and 0 deletions
+104
View File
@@ -0,0 +1,104 @@
/* Cache les heures non dispo pour le jour dayIndex */
function hideUnusedHours(dayIndex){
var i = 0;
var t_obj = document.getElementById('divhr0');
while (t_obj)
{
var cal = djl_calendar[dayIndex];
var calStart = 0;
var calStop = 0;
if (cal) {
if (cal[2])
calStart = djl_calendar[dayIndex][2];
if (cal[3])
calStop = djl_calendar[dayIndex][3];
}
if ( (i >= calStart) && (i <= calStop) ) {
t_obj.style.display = '';
} else {
t_obj.style.display = 'none';
}
i++;
t_obj = document.getElementById('divhr' + i);
}
}
/* Sélectionne un des jours par son index */
function selectDay(dayIndex)
{
var i = 0;
var t_obj = document.getElementById('shipd0');
var currentShipd = document.getElementById('shipd'+deliveryDateSelected);
if (currentShipd) {
currentShipd.parentNode.style.fontWeight='';
currentShipd.parentNode.style.color = '';
}
while (t_obj)
{
t_obj.checked = false;
if (i == dayIndex)
t_obj.checked = true;
i++;
t_obj = document.getElementById('shipd' + i);
}
deliveryDateSelected = dayIndex;
currentShipd = document.getElementById('shipd'+deliveryDateSelected);
if (currentShipd) {
currentShipd.parentNode.style.fontWeight='bold';
currentShipd.parentNode.style.color = '#993300';
}
hideUnusedHours(dayIndex);
var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected);
if (!currentShipHr || currentShipHr.parentNode.parentNode.style.display == 'none') {
var cal = djl_calendar[dayIndex];
var calStart = 9;
if (cal) {
if (cal[2])
calStart = djl_calendar[dayIndex][2];
selectHour(calStart);
}
}
}
function selectHour(hourIndex)
{
var i = 0;
var t_obj = document.getElementById('shiphr0');
var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected);
if (currentShipHr) {
currentShipHr.parentNode.style.fontWeight='';
currentShipHr.parentNode.style.color = '';
}
while (t_obj)
{
t_obj.checked = false;
if (i == hourIndex)
t_obj.checked = true;
i++;
t_obj = document.getElementById('shiphr' + i);
}
deliveryHourSelected = hourIndex;
currentShipHr = document.getElementById('shiphr' + deliveryHourSelected);
if (currentShipHr) {
currentShipHr.parentNode.style.fontWeight='bold';
currentShipHr.parentNode.style.color = '#993300';
}
}
/**
toggle element visibility : make it visible if to_which is 1 and element is not visible, otherwise make it invisible
**/
function toggle_visibility(eltId, to_which)
{
var elt = $('div#' + eltId) ;
if (to_which == 1 && elt.get(0).style.display == 'none') {
elt.slideDown();
}
else if (to_which == 0 && elt.get(0).style.display != 'none') {
elt.slideUp();
}
}