Team:Lyon-INSA/notebook
From 2012.igem.org
(Difference between revisions)
Line 11: | Line 11: | ||
}); | }); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | function selectMonth(month_name,type) | ||
+ | { | ||
+ | $(".diapoContent").show(); | ||
+ | $(".diapoContent").html(""); | ||
+ | $(".textContent").html(""); | ||
+ | if (window.XMLHttpRequest) | ||
+ | {// code for IE7+, Firefox, Chrome, Opera, Safari | ||
+ | xmlhttp=new XMLHttpRequest(); | ||
+ | } | ||
+ | else | ||
+ | {// code for IE6, IE5 | ||
+ | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); | ||
+ | } | ||
+ | xmlhttp.open("GET","journal.xml",false); | ||
+ | xmlhttp.send(); | ||
+ | xmlDoc=xmlhttp.responseXML; | ||
+ | var day=0; | ||
+ | var x=xmlDoc.getElementsByTagName("month"); | ||
+ | for (i=0;i<x.length;i++) | ||
+ | { | ||
+ | if (x[i].getAttribute("name")==month_name) | ||
+ | { | ||
+ | if (type=="desc") | ||
+ | { | ||
+ | day=x[i].getElementsByTagName("jour").length-1; | ||
+ | } | ||
+ | var jour=x[i].getElementsByTagName("jour"); | ||
+ | $(".textContent").append("<div class='titreExp'></div>"); | ||
+ | $(".titreExp").append(jour[day].getElementsByTagName("titre")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='dateExp'></div>"); | ||
+ | $(".dateExp").append(" - " + jour[day].getElementsByTagName("date")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='descExp'></div>"); | ||
+ | $(".descExp").append(jour[day].getElementsByTagName("description")[0].childNodes[0].nodeValue); | ||
+ | $(".diapoContent").append(" <object width='320' height='240'><param name='allowFullScreen' value='true'></param><param name='allowScriptAccess' value='always'></param> <embed class='diapoExp' src='no' type='application/x-shockwave-flash' width='320' height='240' allowscriptaccess='always' allowfullscreen='true'></embed></object>"); | ||
+ | $(".diapoExp").attr("src","http://pf.kizoa.com/sflite.swf?did="+jour[day].getElementsByTagName('diaporama')[0].getAttribute('did')+"&k="+jour[day].getElementsByTagName('diaporama')[0].getAttribute('pk')+""); | ||
+ | } | ||
+ | } | ||
+ | globalDay=day; | ||
+ | globalMonth=month_name; | ||
+ | } | ||
+ | |||
+ | function nextDay(month_name,day) | ||
+ | { | ||
+ | $(".diapoContent").html(""); | ||
+ | $(".textContent").html(""); | ||
+ | if (window.XMLHttpRequest) | ||
+ | {// code for IE7+, Firefox, Chrome, Opera, Safari | ||
+ | xmlhttp=new XMLHttpRequest(); | ||
+ | } | ||
+ | else | ||
+ | {// code for IE6, IE5 | ||
+ | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); | ||
+ | } | ||
+ | xmlhttp.open("GET","journal.xml",false); | ||
+ | xmlhttp.send(); | ||
+ | xmlDoc=xmlhttp.responseXML; | ||
+ | var newDay=day+1; | ||
+ | var x=xmlDoc.getElementsByTagName("month"); | ||
+ | for (i=0;i<x.length;i++) | ||
+ | { | ||
+ | if (x[i].getAttribute("name")==month_name) | ||
+ | { | ||
+ | var jour=x[i].getElementsByTagName("jour"); | ||
+ | if (jour.length>newDay) | ||
+ | { | ||
+ | $(".textContent").append("<div class='titreExp'></div>"); | ||
+ | $(".titreExp").append(jour[newDay].getElementsByTagName("titre")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='dateExp'></div>"); | ||
+ | $(".dateExp").append(" - " + jour[newDay].getElementsByTagName("date")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='descExp'></div>"); | ||
+ | $(".descExp").append(jour[newDay].getElementsByTagName("description")[0].childNodes[0].nodeValue); | ||
+ | $(".diapoContent").append(" <object width='320' height='240'><param name='allowFullScreen' value='true'></param><param name='allowScriptAccess' value='always'></param> <embed class='diapoExp' src='no' type='application/x-shockwave-flash' width='320' height='240' allowscriptaccess='always' allowfullscreen='true'></embed></object>"); | ||
+ | $(".diapoExp").attr("src","http://pf.kizoa.com/sflite.swf?did="+jour[newDay].getElementsByTagName('diaporama')[0].getAttribute('did')+"&k="+jour[newDay].getElementsByTagName('diaporama')[0].getAttribute('pk')+""); | ||
+ | globalDay=newDay; | ||
+ | |||
+ | } | ||
+ | else if (i+1<x.length) | ||
+ | { | ||
+ | if (x[i+1].getElementsByTagName("jour").length>0) | ||
+ | {selectMonth(x[i+1].getAttribute("name"),"asc");} | ||
+ | else | ||
+ | { | ||
+ | globalDay=x[i].getElementsByTagName("jour").length; | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | globalDay=x[i].getElementsByTagName("jour").length; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | function previousDay(month_name,day) | ||
+ | { | ||
+ | |||
+ | $(".diapoContent").html(""); | ||
+ | $(".textContent").html(""); | ||
+ | if (window.XMLHttpRequest) | ||
+ | {// code for IE7+, Firefox, Chrome, Opera, Safari | ||
+ | xmlhttp=new XMLHttpRequest(); | ||
+ | } | ||
+ | else | ||
+ | {// code for IE6, IE5 | ||
+ | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); | ||
+ | } | ||
+ | xmlhttp.open("GET","journal.xml",false); | ||
+ | xmlhttp.send(); | ||
+ | xmlDoc=xmlhttp.responseXML; | ||
+ | var newDay=day-1; | ||
+ | var x=xmlDoc.getElementsByTagName("month"); | ||
+ | for (i=0;i<x.length;i++) | ||
+ | { | ||
+ | if (x[i].getAttribute("name")==month_name) | ||
+ | { | ||
+ | if (day>0) | ||
+ | { | ||
+ | var jour=x[i].getElementsByTagName("jour"); | ||
+ | $(".textContent").append("<div class='titreExp'></div>"); | ||
+ | $(".titreExp").append(jour[newDay].getElementsByTagName("titre")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='dateExp'></div>"); | ||
+ | $(".dateExp").append(" - " + jour[newDay].getElementsByTagName("date")[0].childNodes[0].nodeValue); | ||
+ | $(".textContent").append("<div class='descExp'></div>"); | ||
+ | $(".descExp").append(jour[newDay].getElementsByTagName("description")[0].childNodes[0].nodeValue); | ||
+ | $(".diapoContent").append(" <object width='320' height='240'><param name='allowFullScreen' value='true'></param><param name='allowScriptAccess' value='always'></param> <embed class='diapoExp' src='no' type='application/x-shockwave-flash' width='320' height='240' allowscriptaccess='always' allowfullscreen='true'></embed></object>"); | ||
+ | $(".diapoExp").attr("src","http://pf.kizoa.com/sflite.swf?did="+jour[newDay].getElementsByTagName('diaporama')[0].getAttribute('did')+"&k="+jour[newDay].getElementsByTagName('diaporama')[0].getAttribute('pk')+""); | ||
+ | globalDay=newDay; | ||
+ | } | ||
+ | else if (i>0) | ||
+ | { | ||
+ | if (x[i-1].getElementsByTagName("jour").length>0) | ||
+ | {selectMonth(x[i-1].getAttribute("name"),"desc");} | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | globalDay=-1; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | |||
</script> | </script> | ||
Line 17: | Line 167: | ||
<body> | <body> | ||
+ | |||
<div id="projectBar" class="menuBar"> | <div id="projectBar" class="menuBar"> | ||
Line 30: | Line 181: | ||
<div id="bandeau"></div> | <div id="bandeau"></div> | ||
- | <div id=" | + | <div id="xml" style="display:none;"> |
+ | <xml id='xmldata' style='display:none;'> | ||
+ | <?xml version="1.0" encoding="ISO-8859-1"?> | ||
+ | <!-- Edited by XMLSpy --> | ||
+ | <project> | ||
+ | <month name="June"> | ||
+ | <jour nb="1"> | ||
+ | <titre>Experience n1</titre> | ||
+ | <date>1st June 2012</date> | ||
+ | <description>Une experience trop cool</description> | ||
+ | <diaporama did="1657514" pk="1099023"></diaporama> | ||
+ | </jour> | ||
+ | <jour nb="2"> | ||
+ | <titre>titre</titre> | ||
+ | <date> 2nd June 2012</date> | ||
+ | |||
+ | <description>blabla</description> | ||
+ | <diaporama></diaporama> | ||
+ | </jour> | ||
+ | </month> | ||
+ | <month name="July"> | ||
+ | <jour nb="1"> | ||
+ | <titre>Experience n2</titre> | ||
+ | <date>1st July 2012</date> | ||
+ | <description>Une experience pas cool</description> | ||
+ | <diaporama></diaporama> | ||
+ | </jour> | ||
+ | <jour nb="2"> | ||
+ | <titre>titre</titre> | ||
+ | <date> 2nd July 2012</date> | ||
+ | |||
+ | <description>blibli</description> | ||
+ | <diaporama></diaporama> | ||
+ | </jour> | ||
+ | </month> | ||
+ | </project> | ||
+ | </xml> | ||
+ | </div> | ||
+ | <div id="contentPage"> | ||
+ | <div id="monthSelection"> | ||
+ | <div class="month">June</div> | ||
+ | <div class="month">July</div> | ||
+ | <div class="month">August</div> | ||
+ | <div class="month">September</div> | ||
+ | <div class="month">October</div> | ||
+ | </div> | ||
+ | <div id="descJour"> | ||
+ | <div id="jourPrecedent"><img src="images/precedent.png" width="50px" height="50px"/></div> | ||
+ | <div class="textContent"></div> | ||
+ | <div class="diapoContent" style="display:none;width:348px;height:268px;padding-top:14px;background:url('images/kizoafond.png') no-repeat"></div> | ||
+ | <div id="jourSuivant"><img src="images/precedent.png" width="50px" height="50px"/></div> | ||
+ | </div> | ||
</div> | </div> | ||
</body> | </body> |
Revision as of 17:20, 18 August 2012
June
July
August
September
October