Team:Cornell/notebook
From 2013.igem.org
(Difference between revisions)
(Created page with "<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> {{:Team:Cornell/templates/header}} <html class="no-js" lang="en"> <body onload="load()"> <script...") |
|||
Line 2: | Line 2: | ||
{{:Team:Cornell/templates/header}} | {{:Team:Cornell/templates/header}} | ||
<html class="no-js" lang="en"> | <html class="no-js" lang="en"> | ||
- | < | + | <script type="text/javascript"> |
- | <script type="text/javascript"> | + | $(window).load(function() { |
- | + | $('li.pg-notebook').addClass('active'); | |
- | + | }); | |
- | + | </script> | |
- | + | <script type="text/javascript"> | |
- | + | function load() { | |
- | + | if(document.location != "https://2013.igem.org/Team:Cornell/notebook") { | |
- | + | var i = document.location.href.charAt(51); | |
- | + | document.getElementById('week' + i + 'entry').style.display = 'block'; | |
- | + | if(i!=1) { | |
- | + | document.getElementById('week1entry').style.display = 'none'; | |
- | + | document.getElementById('week1').className = ''; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
+ | document.getElementById('week' + i ).className = 'active'; | ||
} | } | ||
- | function onlyFilter(that) { | + | } |
- | + | function filter(that) { | |
- | + | var ele = that.children[0]; | |
+ | var show = ele.style.display == 'none'; | ||
+ | ele.style.display= (show ? 'block' : 'none'); | ||
+ | that.parentNode.children[1].className = (show ? 'nb-only' : 'nb-only-i'); | ||
+ | all(); | ||
+ | var list = document.getElementsByClassName('nb-' + ele.id); | ||
+ | for (var i = 0; i < list.length; i++) { | ||
+ | list[i].style.display = (show ? 'block' : 'none'); | ||
+ | } | ||
+ | } | ||
+ | function onlyFilter(that) { | ||
+ | var filt = that.parentNode; | ||
+ | var row = filt.parentNode; | ||
+ | |||
+ | for(var i=0; i<row.children.length; i++) | ||
+ | { | ||
+ | var hide = true; | ||
+ | if(row.children[i] == filt) hide = false; | ||
+ | row.children[i].children[0].children[0].style.display = (hide ? 'none' : 'block'); | ||
+ | row.children[i].children[1].className = (hide ? 'nb-only-i' : 'nb-only'); | ||
- | + | var list = document.getElementsByClassName('nb-' + row.children[i].children[0].children[0].id); | |
- | + | for (var j = 0; j < list.length; j++) { | |
- | + | list[j].style.display = (hide ? 'none' : 'block'); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | |||
} | } | ||
- | function all() { | + | all(); |
- | + | } | |
- | + | function all() { | |
- | + | var all = true; | |
- | + | var allbut = document.getElementById('nb-all'); | |
- | + | var row = document.getElementById('wet-only').parentNode.parentNode; | |
- | + | for(var i=0; i<row.children.length; i++) | |
+ | { if(row.children[i].children[1].className == 'nb-only-i') all = false; } | ||
+ | allbut.className = (all ? 'nb-all' : 'nb-all-i'); | ||
+ | } | ||
+ | function showAll() { | ||
+ | var all = true; | ||
+ | var allbut = document.getElementById('nb-all'); | ||
+ | var row = document.getElementById('wet-only').parentNode.parentNode; | ||
+ | for(var i=0; i<row.children.length; i++) | ||
+ | { | ||
+ | row.children[i].children[0].children[0].style.display = 'block'; | ||
+ | row.children[i].children[1].className = 'nb-only'; | ||
} | } | ||
- | + | allbut.className = (all ? 'nb-all' : 'nb-all-i'); | |
- | + | var list = document.getElementsByClassName("entry"); | |
- | + | for (var i = 0; i < list.length; i++) { | |
- | + | list[i].style.display = 'block'; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | + | } | |
- | + | function weekFilter(that) { | |
- | + | for(var i = 1; i<9; i++) { | |
- | + | document.getElementById('week' + i).className = (that.id.substr(4) == i ? 'active' : ''); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | </script> | + | var filt = that.id + "entry"; |
+ | var all = document.getElementsByClassName('nb-week'); | ||
+ | for(var i = 0; i<all.length; i++) { | ||
+ | if(all[i].tagName == 'DIV') all[i].style.display = 'none'; | ||
+ | } | ||
+ | document.getElementById(filt).style.display = 'block'; | ||
+ | } | ||
+ | </script> | ||
+ | <body onload="load()"> | ||
<div class="row"> | <div class="row"> | ||
<div class="two columns"> | <div class="two columns"> | ||
Line 245: | Line 248: | ||
</div> | </div> | ||
</div> | </div> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
</body> | </body> | ||
</html> | </html> |
Revision as of 02:22, 20 June 2013
Notebook
Filter by subteam: show all
Wet Lab
Dry Lab
Modeling
Human Practices
Wiki
Animation
only
only
only
only
only
only
Week 1
(05/01 - 05/07)
This is a Title
show technical details
{{{tech}}}
My name is Inigo Montoya
-{{{author}}}
TemplateTest2
show technical details
{{{tech}}}
Hello
-{{{author}}}
TemplateTest1
show technical details
{{{tech}}}
Hello
-{{{author}}}