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
[SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko [FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|