//===== operations syntax start //E:\myproducts_sites\strangers\education\build\jslib\start0.js.php //c dependance(start0.js.php) function uPointerId(id){ //c dependance(start0.js.php/uPointerId(id)) return(document.getElementById(id)); } //===== operations syntax end //===== operations date start function getidentifiantdatenow(newdate){ var d=(newdate?newdate:new Date()); ////var datestring=d.getDate()+'/'+(d.getMonth()+1)+'/'+d.getFullYear()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds(); // 16-5-2015 9:50 ///var sep='-'; 'id_'+ ///alert(d.getFullYear()); var item_number='id_'+d.getFullYear()+("0"+(d.getMonth()+1)).slice(-2)+("0"+d.getDate()).slice(-2)+("0"+d.getHours()).slice(-2)+("0"+d.getMinutes()).slice(-2)+("0"+d.getSeconds()).slice(-2); ///alert(item_number); // 16-05-2015 09:50 20160725003220 return(item_number); /////return({striso:item_number,strdate:datestring}); } //c usage /* var clock=new Date().subTime(0, 0,0); var hours24=clock.getHours(); var minutes=clock.getMinutes(); var seconds=clock.getSeconds(); */ Date.prototype.subTime= function(h,m,s){ if(h)this.setHours(this.getHours()-h); if(m)this.setMinutes(this.getMinutes()-m); if(s)this.setSeconds(this.getSeconds()-s); return(this); } Date.prototype.addTime= function(h,m,s){ if(h)this.setHours(this.getHours()+h); if(m)this.setMinutes(this.getMinutes()+m); if(s)this.setSeconds(this.getSeconds()+s); return(this); } function jsget_formatTimeNow(thisdate){ var year=thisdate.getFullYear(); var month=thisdate.getMonth()+1;month=(month.toString().length==1?'0':'')+ month; var day=thisdate.getDate();day=(day.toString().length==1?'0':'') + day; var hours=thisdate.getHours();hours=(hours.toString().length==1?'0':'') + hours; var mins=thisdate.getMinutes();mins=(mins.toString().length==1?'0':'') + mins; var secs=thisdate.getSeconds();secs=(secs.toString().length==1?'0':'') + secs; var iso=year+month+day+hours+mins+secs; var now=day+'/'+month+'/'+year+' '+hours+':'+mins+':'+secs; return({iso:iso,now:now}); } function jsget_timeNow(t){ var thisdate=new Date(); ///document.write("Nous sommes le : "); ///document.write(thisdate.getDate()+"/"+(thisdate.getMonth()+1)+"/"+thisdate.getFullYear()) var x=jsget_formatTimeNow(thisdate); var later=new Date().addTime(0,(t?t.m:30),0); var y=jsget_formatTimeNow(later); return({iso:x.iso,now:x.now,iso30:y.iso,now30:y.now}); } //===== operations date end //===== operations Cookie start function createCookieebook(name,value,days){ //c createCookie('ppkcookie','testcookie',7)days 0 effacé quand navigateur fermé négatif effacé immédiatement positif attend n jours if(days){ var date=new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires="; expires="+date.toGMTString(); } else var expires=""; document.cookie=name+"="+value+expires+"; path=/"; } function readCookieebook(name){ var nameEQ=name+"="; var ca=document.cookie.split(';'); for(var i=0;i()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return(re.test(mail)); }//c function test_mail(mail) //c \\\\\\\\\\\\\\\\\\\\\\\\\\\ //c //===== operations cursor start function getMousePosition(event){ //==== dependance(player0) return({ x: event.pageX, y: event.pageY }); } function getPosition(element){ //==== dependance(player0) var top=0, left=0; do { top += element.offsetTop; left += element.offsetLeft; } while (element=element.offsetParent); //!\interesting for syntax return ({ x: left, y: top }); } function jsgetMouseXY0(e){//c base ok var coord,tempX,tempY,ie=false; if(!e){e=window.event;ie=true;} if(ie){ // grab the x-y pos.s if browser is IE myApp.mybrowser tempX=e.clientX + document.body.scrollLeft; tempY=e.clientY + document.body.scrollTop; // tempX=event.clientX + document.body.scrollLeft;//!\test 07/08/2016 16:17:06 // tempY=event.clientY + document.body.scrollTop;//!\test 07/08/2016 16:17:06 }else{ // grab the x-y pos.s if browser is NS tempX=e.pageX; tempY=e.pageY; } // catch possible negative values in NS4 if(tempX<0){tempX=0;} if(tempY<0){tempY=0;} // show the position values in the form named Show // in the text fields named MouseX and MouseY ////alert(tempX+' - '+tempY); ///coord[1]=String(tempX); ///coord[2]=String(tempY); return({x:String(tempX),y:String(tempY)});//coord); }//c function jsgetMouseXY0(e) //c \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ function jsgetPosition0(element){ var left=0,top=0; //On récupère l'élément var e=uPointerId(element); // Tant que l'on a un élément parent while(e.offsetParent!='undefined'&&e.offsetParent!=null) { // On ajoute la position de l'élément parent left+=e.offsetLeft+(e.clientLeft!=null?e.clientLeft:0); top+=e.offsetTop+(e.clientTop!=null?e.clientTop:0); e=e.offsetParent; } return({left:left,top:top}); }//c function getPosition(element) //c \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ function jsXYmouse0(e,id){ // captures the mouse position // usage : onclick="var result=myApp.jsXYmouse(event, this).split('!|');" var posx=0,posy=0,posxr=0,posyr=0;//c coordonnées relatives à l'objet //===== if(!e){e=window.event;} if(e.pageX||e.pageY) { posx=e.pageX;posy=e.pageY;} else if(e.clientX||e.clientY) { posx=e.clientX;posy=e.clientY;} //===== var coord=jsgetPosition0(id); //c donne NaN si le style n'est pas créé var width=parseInt(uPointerId(id).style.width); var height=parseInt(uPointerId(id).style.height); var posxr=posx-coord.left,posyr=posy-coord.top; //===== return({px:posx,py:posy,pxr:posxr,pyr:posyr,width:width,height:height}); } //myApp.jsXYmouse=function(e, obj){ /////////////////////////////////////////////// function jsget_segment_position0(number,width,position){ var step=parseInt(width/number); for(var i=1;i<=number;i++)if(position