Accueil > > > POPUP TRES SPECIAL ->DATE ET HEURE EN FRANCAIS AVEC ZEROS SIGNIFICATIS ET PLURIELS
POPUP TRES SPECIAL ->DATE ET HEURE EN FRANCAIS AVEC ZEROS SIGNIFICATIS ET PLURIELS
Information sur la source
Description
Ce script donne la date et l'heure (zeros significatifs + pluriels necessaires) sous forme de popup tres speciale
Source
- <SCRIPT language=JavaScript>
- versionum = navigator.appVersion.substring(0,1);
- if (versionum < 3)
- type = false;
- else
- type = true;
- today = new Date;
- numero = today.getDate();
- if (numero<10)
- numero = "0"+numero;
- if (type )
- annee = today.getFullYear();
- else
- annee = today.getYear();
- listjour = new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
- listmois = new Array("janvier","février","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","décembre");
- jour = listjour [ today.getDay()] + " " + numero + " " + listmois [today.getMonth()] + " " + annee;
- heure = today.getHours();
- minute = today.getMinutes();
- seconde = today.getSeconds();
- milli = today.getMilliseconds();
- if(heure > 1)
- pluriel1="s";
- else
- pluriel1="";
- if(minute > 1)
- pluriel2="s";
- else
- pluriel2="";
- if(seconde > 1)
- pluriel3="s";
- else
- pluriel3="";
- if(heure < 10)
- zero1="0";
- else
- zero1="";
- if(minute < 10)
- zero2="0";
- else
- zero2="";
- if(seconde < 10)
- zero3="0";
- else
- zero3="";
- quelleheure = zero1 + heure + " heure" + pluriel1 + " " + zero2 + minute + " minute" + pluriel2 + " " + zero3 + seconde + " seconde" + pluriel3;
-
- // PARAMETRES
- var fonc_mess = 'Nous sommes le' ;
- var fonc_mezz = 'et il est'
- var fonc_background = '#000000'
- var fonc_bordure = '#0000FF'
- var fonc_police = 'Arial Rounded MT Bold'
- var fonc_police_taille = '20'
- var fonc_police_color = '#FFFFFF'
- var fonc_hauteur = 137
- var fonc_largeur = 430
- var fonc_box2 = 0;
-
- // CADRES
- fonc_classe = 'border-color:'+fonc_bordure+';border-style:solid;border-width:1px;background:'+fonc_background+';font-family:'+fonc_police+';font-size:'+fonc_police_taille+'px;color:'+fonc_police_color;
- if(document.getElementById)
- {
- document.write('<DIV ID=fonc_box1 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
- document.write('<DIV ID=fonc_box2 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:'+fonc_box2+';height:'+fonc_hauteur+';z-index:5');
- if(document.all)
- document.write(';padding:10');
- document.write('"></DIV>');
- document.write('<DIV ID=fonc_box3 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
- // TAILLE DE L'ECRAN
- fonc_Y = document.body.clientHeight;
- fonc_X = document.body.clientWidth;
- fonc_posX = Math.round(fonc_X/2);
- fonc_posY = Math.round(fonc_Y/2)-Math.round(fonc_hauteur/2);
- }
-
- function fonc_deplace()
- {
- // PLACEMENT
- document.getElementById("fonc_box1").style.left = fonc_posX-20-(fonc_box2/2);
- document.getElementById("fonc_box3").style.left = fonc_posX+(fonc_box2/2);
- document.getElementById("fonc_box2").style.left = fonc_posX-(fonc_box2/2)-5;
- document.getElementById("fonc_box2").style.width = fonc_box2+10;
- fonc_box2 += 5;
- if(fonc_box2<fonc_largeur)
- setTimeout("fonc_deplace()",10);
- else
- {
- document.getElementById("fonc_box2").innerHTML = '<CENTER>'+fonc_mess+'<BR>'+jour+'<BR>'+fonc_mezz+'<BR>'+quelleheure+'<BR><B><A HREF=javascript:fonc_close()><FONT COLOR='+fonc_police_color+'>OK</FONT></A></B></CENTER>'
-
- }
- }
-
- function fonc_start()
- {
- if(document.getElementById)
- {
- document.getElementById("fonc_box1").style.visibility = 'visible'
- document.getElementById("fonc_box2").style.visibility = 'visible'
- document.getElementById("fonc_box3").style.visibility = 'visible'
- document.getElementById("fonc_box1").style.top = fonc_posY-10
- document.getElementById("fonc_box2").style.top = fonc_posY
- document.getElementById("fonc_box3").style.top = fonc_posY-10
- fonc_deplace();
- }
- }
-
- function fonc_close()
- {
- if(document.getElementById)
- {
- document.getElementById("fonc_box1").style.visibility = 'hidden'
- document.getElementById("fonc_box2").style.visibility = 'hidden'
- document.getElementById("fonc_box3").style.visibility = 'hidden'
- document.getElementById("fonc_box1").style.top = -600
- document.getElementById("fonc_box2").style.top = -600
- document.getElementById("fonc_box3").style.top = -600
- fonc_deplace();
- }
- }
-
- window.onload = fonc_start;
- </SCRIPT>
<SCRIPT language=JavaScript>
versionum = navigator.appVersion.substring(0,1);
if (versionum < 3)
type = false;
else
type = true;
today = new Date;
numero = today.getDate();
if (numero<10)
numero = "0"+numero;
if (type )
annee = today.getFullYear();
else
annee = today.getYear();
listjour = new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
listmois = new Array("janvier","février","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","décembre");
jour = listjour [ today.getDay()] + " " + numero + " " + listmois [today.getMonth()] + " " + annee;
heure = today.getHours();
minute = today.getMinutes();
seconde = today.getSeconds();
milli = today.getMilliseconds();
if(heure > 1)
pluriel1="s";
else
pluriel1="";
if(minute > 1)
pluriel2="s";
else
pluriel2="";
if(seconde > 1)
pluriel3="s";
else
pluriel3="";
if(heure < 10)
zero1="0";
else
zero1="";
if(minute < 10)
zero2="0";
else
zero2="";
if(seconde < 10)
zero3="0";
else
zero3="";
quelleheure = zero1 + heure + " heure" + pluriel1 + " " + zero2 + minute + " minute" + pluriel2 + " " + zero3 + seconde + " seconde" + pluriel3;
// PARAMETRES
var fonc_mess = 'Nous sommes le' ;
var fonc_mezz = 'et il est'
var fonc_background = '#000000'
var fonc_bordure = '#0000FF'
var fonc_police = 'Arial Rounded MT Bold'
var fonc_police_taille = '20'
var fonc_police_color = '#FFFFFF'
var fonc_hauteur = 137
var fonc_largeur = 430
var fonc_box2 = 0;
// CADRES
fonc_classe = 'border-color:'+fonc_bordure+';border-style:solid;border-width:1px;background:'+fonc_background+';font-family:'+fonc_police+';font-size:'+fonc_police_taille+'px;color:'+fonc_police_color;
if(document.getElementById)
{
document.write('<DIV ID=fonc_box1 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
document.write('<DIV ID=fonc_box2 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:'+fonc_box2+';height:'+fonc_hauteur+';z-index:5');
if(document.all)
document.write(';padding:10');
document.write('"></DIV>');
document.write('<DIV ID=fonc_box3 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
// TAILLE DE L'ECRAN
fonc_Y = document.body.clientHeight;
fonc_X = document.body.clientWidth;
fonc_posX = Math.round(fonc_X/2);
fonc_posY = Math.round(fonc_Y/2)-Math.round(fonc_hauteur/2);
}
function fonc_deplace()
{
// PLACEMENT
document.getElementById("fonc_box1").style.left = fonc_posX-20-(fonc_box2/2);
document.getElementById("fonc_box3").style.left = fonc_posX+(fonc_box2/2);
document.getElementById("fonc_box2").style.left = fonc_posX-(fonc_box2/2)-5;
document.getElementById("fonc_box2").style.width = fonc_box2+10;
fonc_box2 += 5;
if(fonc_box2<fonc_largeur)
setTimeout("fonc_deplace()",10);
else
{
document.getElementById("fonc_box2").innerHTML = '<CENTER>'+fonc_mess+'<BR>'+jour+'<BR>'+fonc_mezz+'<BR>'+quelleheure+'<BR><B><A HREF=javascript:fonc_close()><FONT COLOR='+fonc_police_color+'>OK</FONT></A></B></CENTER>'
}
}
function fonc_start()
{
if(document.getElementById)
{
document.getElementById("fonc_box1").style.visibility = 'visible'
document.getElementById("fonc_box2").style.visibility = 'visible'
document.getElementById("fonc_box3").style.visibility = 'visible'
document.getElementById("fonc_box1").style.top = fonc_posY-10
document.getElementById("fonc_box2").style.top = fonc_posY
document.getElementById("fonc_box3").style.top = fonc_posY-10
fonc_deplace();
}
}
function fonc_close()
{
if(document.getElementById)
{
document.getElementById("fonc_box1").style.visibility = 'hidden'
document.getElementById("fonc_box2").style.visibility = 'hidden'
document.getElementById("fonc_box3").style.visibility = 'hidden'
document.getElementById("fonc_box1").style.top = -600
document.getElementById("fonc_box2").style.top = -600
document.getElementById("fonc_box3").style.top = -600
fonc_deplace();
}
}
window.onload = fonc_start;
</SCRIPT>
Conclusion
Le script de la popup n'est pas de moi, mais la premiere version de ceette popup est vahement ameliorable. J'y ai juste ajouté la date et l'heure intelligente
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE?COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE? par Matthieu MEZIL
Avec EF, les vues doivent être mappées sur des entity types. Le problème c'est que les entity types doivent avoir une clé. Avec EF, nous avons les complex type qui n'ont pas de clé mais les vues ne peuvent pas être mappées dessus. Avec EF4, il est possibl...
Cliquez pour lire la suite de l'article par Matthieu MEZIL [WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL?[WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL? par JeremyJeanson
Certain d'entre vous on peut être vécu cette situation embarrassante après quelques temps passer avec WF4 : Au début avec mon " ActivityDesigner" , tout allait bien. Et puis un jour j'ai au des problèmes de " Binding" . Alors nous sommes allé sur le site ...
Cliquez pour lire la suite de l'article par JeremyJeanson MYTIC - SHAREPOINT 2010 : DéJà UN MYTHE MICROSOFT ?MYTIC - SHAREPOINT 2010 : DéJà UN MYTHE MICROSOFT ? par junarnoalg
La prochaine session de MyTIC aura lieu à Namur, le 23 mars prochain. Pendant presque une heure, nous parlerons de SharePoint 2010. Voici un aperçu du programme.
Accueil : 17h30 Début de la session : 18h00 - Les nouvelles int...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
Academy System (10.9.4.0)ACADEMY SYSTEM (10.9.4.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods
|