Team:Uppsala/notebook

From 2013.igem.org

(Difference between revisions)
Line 116: Line 116:
<script type="text/javascript">
<script type="text/javascript">
-
 
var month = new Date().getMonth();   
var month = new Date().getMonth();   
var year = new Date().getFullYear();   
var year = new Date().getFullYear();   
-
var cal_table = '';    
+
var cal_table = '';  
-
var eventString;
+
var eventString;  
-
var days_with_dirys = new Array('t2013630','t201371','t201372','t201381','t2013919');
+
-
var inputs = 5;
+
var days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
-
+
var days_with_dirys = new Array('t201381');
-
/*getWeek() will calculate current week nr*/
+
var inputs = 1;
 +
 
Date.prototype.getWeek = function()  
Date.prototype.getWeek = function()  
{
{
Line 132: Line 130:
}
}
-
/*writes/rewrites the calculator string */
+
function calendar()
-
function calendar_normal()
+
{
{
   var m = month+1;
   var m = month+1;
Line 139: Line 136:
   var today = date.getDate();     
   var today = date.getDate();     
   cal_table = '';   
   cal_table = '';   
 +
  var eventString;
   if(year<=200)
   if(year<=200)
Line 148: Line 146:
   days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
   days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    
    
-
  if(year%4 == 0 && year!=1900)
+
  if(year%4 == 0)
   {
   {
 +
  if( year!=1900 )
 +
  {
   days_in_month[1]=29;
   days_in_month[1]=29;
-
}
+
  }
-
 
+
  }
    
    
     total = days_in_month[month];
     total = days_in_month[month];
     var date_today = months[month]+' '+year;
     var date_today = months[month]+' '+year;
   
   
-
     cal_table = cal_table + '<table class="cal_calendar" ><tbody id="cal_body"><tr class="head"><th class="arrow"><input id="left" type="image" onclick="left_arrow()" src="https://static.igem.org/mediawiki/2013/a/a1/Arrowleft.png"></th><th colspan="6" >'+date_today+'</th><th class="arrow"><input id="right" type="image" onclick="right_arrow()" src="https://static.igem.org/mediawiki/2013/0/0b/Arrowright.png"></th></tr>';
+
     cal_table = cal_table + '<table class="cal_calendar" ><tbody id="cal_body"><tr class="head"><th class="arrow"> <input id="left" type="image" onclick="left_arrow()" src="https://static.igem.org/mediawiki/2013/a/a1/Arrowleft.png"></th><th colspan="6" >'+date_today+'</th><th class="arrow"><input id="right" type="image" onclick="right_arrow()" src="https://static.igem.org/mediawiki/2013/0/0b/Arrowright.png"></th></tr>';
     cal_table = cal_table + '<tr class="cal_d_weeks"><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th><th>Week</th></tr><tr>';
     cal_table = cal_table + '<tr class="cal_d_weeks"><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th><th>Week</th></tr><tr>';
     week = 0;
     week = 0;
Line 176: Line 176:
         }
         }
      
      
-
        if(year == date.getFullYear())
+
                if(year == date.getFullYear())
         {
         {
           if(month == date.getMonth()){
           if(month == date.getMonth()){
Line 195: Line 195:
             cal_table = cal_table +'<td id="'+'t'+year+m+i+'" class="not_today"><input type="submit" onclick="showNotes(year, month, value)" value="'+i+'"></td>';
             cal_table = cal_table +'<td id="'+'t'+year+m+i+'" class="not_today"><input type="submit" onclick="showNotes(year, month, value)" value="'+i+'"></td>';
         }
         }
-
   
+
     
-
        week++;
+
              week++;
   markerNotes(year, m, i);
   markerNotes(year, m, i);
         if(week==7)
         if(week==7)
Line 231: Line 231:
  }
  }
-
function left_arrow()
+
 
 +
function left_arrow()
  {
  {
  month = month-1;
  month = month-1;
   if(month == -1)
   if(month == -1)
   {
   {
-
   year = year - 1;
+
   year = year-1;
   month = 11;
   month = 11;
   }
   }
-
  calendar_normal();
+
  calendar();
  document.getElementById('calendar').innerHTML = cal_table;
  document.getElementById('calendar').innerHTML = cal_table;
  }
  }
Line 248: Line 249:
   if(month == 12)
   if(month == 12)
   {
   {
-
   year = year +1;
+
   year = year+1;
   month = 0;
   month = 0;
   }   
   }   
-
  calendar_normal();
+
  calendar();
  document.getElementById('calendar').innerHTML = cal_table;
  document.getElementById('calendar').innerHTML = cal_table;
  }
  }
Line 262: Line 263:
   document.getElementById('file_holder').innerHTML = eventString;
   document.getElementById('file_holder').innerHTML = eventString;
  }
  }
-
+
 
-
function showNotesOfweek(y, wnr)
+
 
 +
function showNotesOfweek(y, wnr)
  {
  {
-
   var d = new Date(y,0,0);
+
   var d = new Date(y, 0, 0);
   if(y == 2012 ){
   if(y == 2012 ){
-
  wnr++;
+
wnr++;
-
}
+
}
-
   var w = d.getTime() + 604800000 * (wnr-1);  
+
   var w = d.getTime() + 604800000 * (wnr-1);
   var m = new Date(w).getMonth()+1;
   var m = new Date(w).getMonth()+1;
   var y = new Date(w).getFullYear();
   var y = new Date(w).getFullYear();
Line 300: Line 302:
   eventString = '';
   eventString = '';
  }
  }
-
 
  function markerNotes(y, m, d)
  function markerNotes(y, m, d)
  {
  {
Line 318: Line 319:
  var ds = '';  //diryString  
  var ds = '';  //diryString  
  var id = 'd'+y+m+d;
  var id = 'd'+y+m+d;
-
 
+
  //var ds = y+'-'+m+'-'+d;  
-
  if(id=='d2013630')
+
  if(id == 'd201381')
-
{
+
-
  ds = 'dscds';
+
-
}
+
-
else if(id=='d201371')
+
-
{
+
-
  ds = 'cdscds';  
+
-
  }
+
-
else if(id=='d201372')
+
-
{
+
-
  ds = 'csdcds';
+
-
}
+
-
else if(id=='d201381')
+
  {
  {
   ds = '<h2>Thursday 2013-08-01</h2><p>Name of participants: Marcus H, Karl H, Lovisa P, Emil M, Victor S, Hampus.E<br><br><h3>Ongoing constructs:</h3><br>' +
   ds = '<h2>Thursday 2013-08-01</h2><p>Name of participants: Marcus H, Karl H, Lovisa P, Emil M, Victor S, Hampus.E<br><br><h3>Ongoing constructs:</h3><br>' +
Line 349: Line 338:
   '<h3>Other experiments</h3><br>-<br></p>';  
   '<h3>Other experiments</h3><br>-<br></p>';  
-
}
 
-
else if(id=='d2013919')
 
-
{
 
-
  ds = '<h1>Uppsala IGEM team´s awesome synbioday at 12.15 to 17.00</h1>';
 
  }
  }
  else  
  else  
Line 370: Line 355:
  document.getElementById(id).innerHTML = ds;
  document.getElementById(id).innerHTML = ds;
}
}
-
 
</script>
</script>
Line 466: Line 450:
</div>
</div>
-
<div id="main_content">
+
<div id="main_content">  
<div id="calendar" onclick="calendar();">
<div id="calendar" onclick="calendar();">

Revision as of 15:18, 9 September 2013