Commit 089d4fa0 authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez Committed by Alessandro Rubini

www: Creation of javascript file and folder. Removed scripts from head.php

Javascript folder created (/js) with scripts.js file.
This file contains all javascript functions.

head.php now includes this file instead of include the JS functions
directly.
parent 9f3400ba
......@@ -9,40 +9,7 @@
<link href="css/style.css" rel="stylesheet" type="text/css">
<!-- Javascript goes in the document HEAD -->
<script type="text/javascript">
function altRows(id){
if(document.getElementsByTagName){
var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className += " evenrowcolor";
}else{
rows[i].className += " oddrowcolor";
}
}
var table = document.getElementById(id+1);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className += " evenrowcolor";
}else{
rows[i].className += " oddrowcolor";
}
}
}
}
window.onload=function(){
altRows('alternatecolor');
}
</script>
<script type="text/javascript">
function showPopup(url) {
newwindow=window.open(url,'name','height=250,width=520,top=200,left=300,resizable');
if (window.focus) {newwindow.focus()}
}
</script>
<!-- Javascript are located in /js/scripts.js -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
</head>
/*
* Displays HTML tables in two colors
*
* @author José Luis Gutiérrez <jlgutierrez@ugr.es>
*
* Displays two different colors (gray and blue) for tables and forms.
* It allows two tables per page.
*
*/
function altRows(id){
if(document.getElementsByTagName){
var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className += " evenrowcolor";
}else{
rows[i].className += " oddrowcolor";
}
}
var table = document.getElementById(id+1);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className += " evenrowcolor";
}else{
rows[i].className += " oddrowcolor";
}
}
}
}
window.onload=function(){
altRows('alternatecolor');
}
/*
* Opens the help message
*
* @author José Luis Gutiérrez <jlgutierrez@ugr.es>
*
* Opens the help message for each page.
*
*/
function showPopup(url) {
newwindow=window.open(url,'name','height=250,width=520,top=200,left=300,resizable');
if (window.focus) {
newwindow.focus()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment