Team:Warsaw/Calendar-Main/NoAtribution

From 2008.igem.org

(Difference between revisions)
Line 53: Line 53:
<td>Antoni</td>
<td>Antoni</td>
<td>Paweł</td>
<td>Paweł</td>
-
<td>No author specified</td>
+
<td>Errors</td>
</tr>
</tr>
Line 159: Line 159:
                 if(ans.search(eday)<0)  
                 if(ans.search(eday)<0)  
                 {
                 {
-
                 for (i in authors)
+
                 //No proper author or title specified
 +
                if(and(ans.search("<h3>")<0,ans.search("<h4>")<0)) document.getElementById("no_author").innerHTML=document.getElementById("no_author").innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+": no authors, no titles</a>";
 +
 
 +
                //No proper titles
 +
                else if(ans.search("<h3>")<0) document.getElementById("no_author").innerHTML=document.getElementById("no_author").innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+": "+get_author(ans)+" no titles</a>";
 +
                //no proper authors
 +
                else if(ans.search("<h4>")<0) document.getElementById("no_author").innerHTML=document.getElementById("no_author").innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+": "+get_title(ans)+" no authors</a>";
 +
 
 +
                  else for (i in authors)
                   {
                   {
-
                   if(ans.search(authors[i])>0) {
+
                   if(ans.search("<h4>"+authors[i])>0) {
document.getElementById(authors[i]).innerHTML=document.getElementById(authors[i]).innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+"</a>";
document.getElementById(authors[i]).innerHTML=document.getElementById(authors[i]).innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+"</a>";
-
                  has_author=true;
+
               
                   }
                   }
                   }
                   }
-
                if (has_author==false) {
 
-
document.getElementById("no_author").innerHTML=document.getElementById("no_author").innerHTML+"<br/><a href="+'"'+adresbase+nday+'"'+">"+nday+"</a>";
 
-
                //alert("No author "+nday);
 
-
                }
 
                 }
                 }
                 if (day==end_day) {   
                 if (day==end_day) {   
Line 186: Line 190:
}  
}  
-
 
+
function and(cond1,cond2)
 +
{
 +
if (cond1==true) if (cond2==true) return true;
 +
//if (cond1==false) if (cond2==false) return true;
 +
return false;
 +
}
function analyze()
function analyze()
Line 220: Line 229:
}
}
 +
function get_author(string) {
 +
return string.substr(string.indexOf("<h4>")+4,string.indexOf("</h4>")-4-string.indexOf("<h4>"));
 +
}
 +
 +
function get_title(string) {
 +
return string.substr(string.indexOf("<h3>")+4,string.indexOf("</h3>")-4-string.indexOf("<h3>"));
 +
}
 +
 +
function count_titles(string) {
 +
 +
 +
}
/* ]]> */</script>
/* ]]> */</script>

Revision as of 20:03, 10 October 2008

Gallery Bricks Notebook Team Project Home

Attribution analyzer

Start dateEnd date

Michał K. Michał L. Piotr Antoni Paweł Errors