Template:Team:Paris-Saclay/left-column
From 2012.igem.org
(Difference between revisions)
YohannPetiot (Talk | contribs) |
YohannPetiot (Talk | contribs) |
||
(7 intermediate revisions not shown) | |||
Line 14: | Line 14: | ||
<div id="articles-widget" class="widget"> | <div id="articles-widget" class="widget"> | ||
<div> | <div> | ||
- | |||
<ul id="ltArticles"> | <ul id="ltArticles"> | ||
</ul> | </ul> | ||
Line 59: | Line 58: | ||
action: 'query', | action: 'query', | ||
list: 'categorymembers', | list: 'categorymembers', | ||
+ | cmlimit: 'max', | ||
cmtitle: Category}, | cmtitle: Category}, | ||
dataType: "xml", // type of file you are trying to read | dataType: "xml", // type of file you are trying to read | ||
success : function(xmlData){ | success : function(xmlData){ | ||
- | var count = | + | var count = 0; |
$(xmlData).find('cm').each(function() { | $(xmlData).find('cm').each(function() { | ||
var idxArticle = $(this).attr("title").lastIndexOf("/"); | var idxArticle = $(this).attr("title").lastIndexOf("/"); | ||
Line 68: | Line 68: | ||
var linkArticle = "https://2012.igem.org/"+$(this).attr("title"); | var linkArticle = "https://2012.igem.org/"+$(this).attr("title"); | ||
if (linkArticle != LinkTitle){ | if (linkArticle != LinkTitle){ | ||
- | + | if(Article == "Notebook") | |
- | if(Article = "Notebook") | + | |
{ | { | ||
$("ul#ltArticles").append('<li>' + '<a href="https://2012.igem.org/Team:Paris-Saclay/Project/Notebook/Week 1">' + Article + '</a>'+ '</li>'); | $("ul#ltArticles").append('<li>' + '<a href="https://2012.igem.org/Team:Paris-Saclay/Project/Notebook/Week 1">' + Article + '</a>'+ '</li>'); | ||
Line 79: | Line 78: | ||
count += 1; | count += 1; | ||
} | } | ||
- | }}) | + | }} |
+ | |||
+ | ) | ||
+ | if (count == 0) { | ||
+ | $("div#articles-widget").hide(); | ||
+ | } | ||
}, | }, | ||
error : function(){ | error : function(){ |
Latest revision as of 23:53, 26 September 2012
Follow us !