Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/10/2005, 06:03
Avatar de zacktagnan
zacktagnan
 
Fecha de Ingreso: abril-2005
Mensajes: 501
Antigüedad: 19 años, 1 mes
Puntos: 3
Orden de los días de la semana - 3ª parte

/*
Tabla de Vínculos: Año- | Mes- | Mes+ | Año+
#204368 => Color de los Bordes de la tabla (Azul Marino)
#e0eafc => Color de Fondo de las Casillas de Vínculos (Azul Claro)
*/
ggWinContent += ("<table width=\"100%\" border=\"1\" cellspacing=\"1\" bordercolor=\"#204368\" cellpadding=\"1\" bgcolor=\"#ffffff\" style=\"font-size:" + fontsize + "pt;\"><tr><td style=\"text-align:center; background-color:#e0eafc;\">");

/*
EL SIGUIENTE if...else CONTROLA EL PRIMER AÑO DESDE EL QUE SE NAVEGA
si elAñoNavegado es igual al añoActual entonces no se siguen restando años
(Se hace lo mismo para los Vínculos de Mes- , Mes+ ó Año+)
*/
if (this.gYear == vNowYear) {
ggWinContent += ("&lt;&lt;A&ntilde;o");
}
else {
ggWinContent += ("<a href=\"javascript:void(0);\" " +
"onmouseover=\"window.status='Un año menos'; return true;\" " +
"onmouseout=\"window.status=''; return true;\" " +
"onclick=\"Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
");" +
"\">&lt;&lt;A&ntilde;o<\/a>");
}
ggWinContent += ("</td><td style=\"text-align:center; background-color:#e0eafc;\">");

/*
si elMesNavegado es igual al mesActual Y elAñoNavegado es igual al añoActual
entonces no se siguen restando meses
*/
if (this.gMonth == vNowMonth && this.gYear == vNowYear) {
ggWinContent += ("&lt;&lt;Mes");
}
else {
ggWinContent += ("<a href=\"javascript:void(0);\" " +
"onmouseover=\"window.status='Un mes menos'; return true;\" " +
"onmouseout=\"window.status=''; return true;\" " +
"onclick=\"Build(" +
"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" +
");" +
"\">&lt;&lt;Mes<\/a>");
}
ggWinContent += ("</td><td style=\"text-align:center; background-color:#e0eafc;\">");

/*
si elMesNavegado es igual al referido a Diciembre Y elAñoNavegado es igual al añoActual+5
entonces no se siguen sumando meses
*/
if (this.gMonth == 11 && this.gYear == vNowYear+5) {
ggWinContent += ("Mes&gt;&gt;");
}
else {
ggWinContent += ("<a href=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Un mes más'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" +
");" +
"\">Mes&gt;&gt;<\/a>");
}
ggWinContent += ("</td><td style=\"text-align:center; background-color:#e0eafc;\">");

/*
si elAñoNavegado es igual al añoActual+5
entonces no se siguen sumando años
*/
if (this.gYear == vNowYear+5) {
ggWinContent += ("A&ntilde;o&gt;&gt;");
}
else {
ggWinContent += ("<a href=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Un año más'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" +
");" +
"\">A&ntilde;o&gt;&gt;<\/a>");
}
ggWinContent += ("</td></tr></table><br />");
// Fin de Tabla de Vínculos: Año- | Mes- | Mes+ | Año+

// Código completo de calendario para el mes y añadirlo a la variable

vCode = this.getMonthlyCalendarCode();
ggWinContent += vCode;
}/*
Fin de Función que Contiene la Tabla de Vínculos: Año- | Mes- | Mes+ | Año+
*/

/*
CABECERA CON LOS DÍAS DE LA SEMANA
*/

Calendar.prototype.cal_header = function() {
var vCode = "";

vCode = vCode + "<tr>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">DOM</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">LUN</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">MAR</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">MIE</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">JUE</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">VIE</td>";
vCode = vCode + "<td width=\"14%\" style=\"text-align:center; background-color:#204368; font-weight:bold; font-family:" + fontface + "; color:" + this.gHeaderColor + ";\">SAB</td>";
vCode = vCode + "</tr>";

return vCode;
}/*
FIN DE CABECERA CON LOS DÍAS DE LA SEMANA
*/


Calendar.prototype.cal_data = function() {
var vDate = new Date();
vDate.setDate(1);
vDate.setMonth(this.gMonth);
vDate.setFullYear(this.gYear);

var vFirstDay=vDate.getDay();
var vDay=1;
var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
var vOnLastDay=0;
var vCode = "";

/*
Día para el primer mes/año requerido
Poner el número necesario de blancos antes del primer día
El siguiente 'for' controla los espacios necesarios antes del 1º día del mes
*/
vCode = vCode + "<tr>";
for (i=0; i<vFirstDay; i++) {
vCode = vCode + "<td width=\"14%\" style=\"font-family:" + fontface + ";" + this.write_weekend_string(i) + "\"> </td>";
}

// Resto de la primera semana
for (j=vFirstDay; j<7; j++) {
mesecito=this.gMonth+1;
anyto=this.gYear;
p=p_item;
vCode = vCode + "<td width=\"14%\" style=\"font-family:" + fontface + ";" + this.write_weekend_string(j) + "\">" +
"<a href='javascript:oculCalen(" + vDay + "," + mesecito + "," + anyto + ",\"" + p + "\");' " +
"onmouseover=\"window.status='Cambiar la fecha a: " + this.format_data(vDay) + "'; return true;\" " +
"onmouseout=\"window.status=''; return true;\" " +
"onclick=\"ggPosX=50;ggPosY=50;nd();nd();\">" +
this.format_day(vDay) +
"</a>" +
"</td>";
vDay=vDay + 1;
}
vCode = vCode + "</tr>";

// Resto de las semanas
for (k=2; k<7; k++) {
vCode = vCode + "<tr>";

for (j=0; j<7; j++) {
mesecito=this.gMonth+1;
anyto=this.gYear;
p=p_item;
vCode = vCode + "<td width=\"14%\" style=\"font-family:" + fontface + ";" + this.write_weekend_string(j) + "\">" +
"<a href='javascript:oculCalen(" + vDay + "," + mesecito + "," + anyto + ",\"" + p + "\");' " +
"onmouseover=\"window.status='Cambiar la fecha a: " + this.format_data(vDay) + "'; return true;\" " +
"onmouseout=\"window.status=''; return true;\" " +
"onclick=\"window.scroll(0,ggPosY);ggPosX=50;ggPos Y=50;nd();nd();\">" +
this.format_day(vDay) +
"</a>" +
"</td>";
vDay=vDay + 1;

if (vDay > vLastDay) {
vOnLastDay = 1;
break;
}
}

if (j == 6)
vCode = vCode + "</tr>";
if (vOnLastDay == 1)
break;
}

// RELLENANDO ESPACIOS PARA EL RESTO DE LA ÚLTIMA SEMANA
for (m=1; m<(7-j); m++) {
if (this.gYearly)
vCode = vCode + "<td width=\"14%\" style=\"font-family:" + fontface + "; color:grey;" + this.write_weekend_string(j+m) + "\"> </td>";
else
vCode = vCode + "<td width=\"14%\" style=\"font-family:" + fontface + "; color:grey;" + this.write_weekend_string(j+m) + "\"></td>";
}// FIN DE RELLENANDO ESPACIOS PARA EL RESTO DE LA ÚLTIMA SEMANA

return vCode;
}

(Fin de la 3ª parte - Sigue en la 4ª)