Moved javascript to an external file
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Mon, 2 Aug 2010 08:14:02 +0000 (08:14 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Mon, 2 Aug 2010 08:14:02 +0000 (08:14 +0000)
html_templates/base.html
www/global.js [new file with mode: 0644]

index d89c54e78ea909e960c9083f6c0ba6c970d84b32..3aa6ba031571394294d0e2ef6874548a10f2bad0 100644 (file)
@@ -1,21 +1,10 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<link rel=stylesheet href='/global.css'>
 <link rel=icon href='/aiga_water_transportation.png' sizes='16x16' type='image/png'>
+<link rel=stylesheet href='/global.css'>
 <title>{% block title %}AIS{% endblock %}</title>
 {% block style_extra %}
 {% endblock %}
-
-<script language=javascript>
-function set_min_heigth() {
-    header = document.getElementById('header');
-    main = document.getElementById('main');
-    footer = document.getElementById('footer');
-    min_heigth = document.body.clientHeight - header.clientHeight - footer.clientHeight - 2;
-    if (min_heigth > 0) {
-        main.style.minHeight = min_heigth+'px';
-    }
-}
-</script>
+<script src="/global.js" type="text/javascript"></script>
 
 <body onload="set_min_heigth()">
 <div id=header>
diff --git a/www/global.js b/www/global.js
new file mode 100644 (file)
index 0000000..ec2dd62
--- /dev/null
@@ -0,0 +1,10 @@
+function set_min_heigth() {
+    header = document.getElementById('header');
+    main = document.getElementById('main');
+    footer = document.getElementById('footer');
+    min_heigth = document.body.clientHeight - header.clientHeight - footer.clientHeight - 2;
+    if (min_heigth > 0) {
+        main.style.minHeight = min_heigth+'px';
+    }
+}
+