Template:Team:Paris-Saclay/left-column

From 2012.igem.org

(Difference between revisions)
 
(55 intermediate revisions not shown)
Line 3: Line 3:
<link rel='stylesheet' type='text/css' href='/Team:Paris-Saclay/left-column.css?action=raw&ctype=text/css'/>
<link rel='stylesheet' type='text/css' href='/Team:Paris-Saclay/left-column.css?action=raw&ctype=text/css'/>
<link rel='stylesheet' type='text/css' href='/Team:Paris-Saclay/jtweetsanywhere.css?action=raw&ctype=text/css'/>
<link rel='stylesheet' type='text/css' href='/Team:Paris-Saclay/jtweetsanywhere.css?action=raw&ctype=text/css'/>
 +
<link rel='stylesheet' type='text/css' href='/Team:Paris-Saclay/MetroJs.css?action=raw&ctype=text/css'/>
<script type="text/javascript" src='/Team:Paris-Saclay/jquery.min.js?action=raw&ctype=text/javascript'></script>
<script type="text/javascript" src='/Team:Paris-Saclay/jquery.min.js?action=raw&ctype=text/javascript'></script>
-
<script type="text/javascript" src='/Team:Paris-Saclay/jtweetsanywhere.min.js?action=raw&ctype=text/javascript'></script>
+
<script type="text/javascript" src='/Team:Paris-Saclay/jtweetsanywhere.min.js?action=raw&ctype=text/javascript'>
 +
</script>
 +
<script type="text/javascript" src='/Team:Paris-Saclay/MetroJs.js?action=raw&ctype=text/javascript'></script>
</head>
</head>
<body>
<body>
Line 11: Line 14:
<div id="articles-widget" class="widget">
<div id="articles-widget" class="widget">
<div>
<div>
-
<h1 id="ctArticles">Related Items</h1>
 
  <ul id="ltArticles">
  <ul id="ltArticles">
  </ul>
  </ul>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
 +
$(document).ready(function() {
$(document).ready(function() {
     var url = document.location.href;
     var url = document.location.href;
     var idxPS = url.indexOf("Team:Paris-Saclay",0);
     var idxPS = url.indexOf("Team:Paris-Saclay",0);
-
     Title = url.substring(idxPS,url.length);
+
     var Title = url.substring(idxPS,url.length);
 +
    LinkTitle = url.replace("_"," ");
     Category = "";
     Category = "";
      
      
Line 37: Line 41:
                 var idxCategory = Category.lastIndexOf("/");
                 var idxCategory = Category.lastIndexOf("/");
                 var name = Category.substring(idxCategory+1);
                 var name = Category.substring(idxCategory+1);
-
                $("h1#ctArticles").append("<h1>"+name+"</h1>");
 
} )
} )
},
},
Line 55: 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 = 1;
+
         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("/");
                 var Article = $(this).attr("title").substring(idxArticle+1);
                 var Article = $(this).attr("title").substring(idxArticle+1);
                 var linkArticle = "https://2012.igem.org/"+$(this).attr("title");
                 var linkArticle = "https://2012.igem.org/"+$(this).attr("title");
-
$("ul#ltArticles").append('<li>' + '<a href="' + linkArticle + '">' + '<div id="circle">'+ '<h2>'+ count + '</h2>' + '</div>' + Article + '</a>'+ '</li>');
+
                if (linkArticle != LinkTitle){
-
                count += 1;
+
if(Article == "Notebook")
-
} )
+
{
 +
$("ul#ltArticles").append('<li>' + '<a href="https://2012.igem.org/Team:Paris-Saclay/Project/Notebook/Week 1">' + Article + '</a>'+ '</li>');
 +
count += 1;
 +
}
 +
else
 +
{
 +
$("ul#ltArticles").append('<li>' + '<a href="' + linkArticle + '">' + Article + '</a>'+ '</li>');
 +
count += 1;
 +
}
 +
}}
 +
 +
)
 +
if (count == 0) {
 +
$("div#articles-widget").hide();
 +
}
},
},
error : function(){
error : function(){

Latest revision as of 23:53, 26 September 2012

Follow us !