Team:TU Delft/header
From 2010.igem.org
(Difference between revisions)
Line 17: | Line 17: | ||
/--> | /--> | ||
+ | <!-- Reset CSS - START /--> | ||
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/base/base-min.css"> | <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/base/base-min.css"> | ||
+ | <!-- Reset CSS - END /--> | ||
+ | |||
+ | <!-- Internet Explorer PNG fix - START /--> | ||
<!--[if lt IE 8]> | <!--[if lt IE 8]> | ||
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js">IE7_PNG_SUFFIX=".png";</script> | <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js">IE7_PNG_SUFFIX=".png";</script> | ||
<![endif]--> | <![endif]--> | ||
- | < | + | <!-- Internet Explorer PNG fix - END /--> |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <!-- Scripting - START /--> | |
- | + | <script type="text/javascript" src="http://github.com/cowboy/jquery-hashchange/raw/v1.3/jquery.ba-hashchange.js"></script> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | / | + | <script type="text/javascript"> |
- | + | //Global Vars | |
- | / | + | |
- | + | // Set document ready callback | |
- | + | $(function() { | |
- | + | // Initialize history plugin. | |
- | + | $(window).hashchange(historyCallback); | |
- | + | rewriteLinks($("#navlist")); | |
- | + | ||
- | + | historyCallback(); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | // setup hovering | |
- | + | $(".menu_button").hover( | |
- | + | function () { $(this).addClass("hover"); }, | |
- | + | function () { $(this).removeClass("hover"); } | |
- | + | ); | |
- | + | ||
- | + | if (console === undefined) { | |
- | + | console = {log:function(a){}}; | |
- | + | } | |
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | + | function splitHash(hash) { | |
- | + | var kvpairs = hash.split('&'); | |
- | + | var i; | |
- | + | var kvmap = {}; | |
- | + | for(i=0;i<kvpairs.length;i++) { | |
- | + | var s = kvpairs[i].split('='); | |
+ | kvmap[s[0]] = s[1]; | ||
+ | } | ||
+ | return kvmap; | ||
} | } | ||
- | + | function loadPage(page) | |
- | + | { | |
+ | var url = wgServer + "/Team:TU_Delft/" + page + "?action=render"; | ||
+ | $("#load").fadeOut(200); | ||
+ | $.get(url, function(data) { | ||
+ | $("#load").html(data).fadeIn(200); | ||
+ | rewriteLinks($("#load")); | ||
+ | }); | ||
} | } | ||
- | + | function historyCallback() { | |
- | + | var hash = location.hash; | |
- | + | //console.log('historyCallback: ' + hash); | |
- | + | if(hash) { | |
- | + | hash = hash.substring(1); | |
- | + | if(hash.split('=').length == 1) { | |
+ | //console.log('load hash as page: ' + hash); | ||
+ | // loadPage(hash); | ||
+ | } else { | ||
+ | var kvmap = splitHash(hash); | ||
+ | if (kvmap.page) { | ||
+ | //console.log('load hashmap.page: ' + kvmap.page); | ||
+ | loadPage(kvmap.page); | ||
+ | } | ||
+ | } | ||
+ | } else { | ||
+ | loadPage('pages/home'); | ||
+ | } | ||
} | } | ||
- | |||
- | |||
- | |||
- | + | function rewriteLinks(elem) { | |
- | + | $("a",elem).each(function() { | |
- | + | var txt = $(this).text(); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | if(this.hash) | |
- | + | this.href = this.hash; | |
- | + | else if(txt != "edit") | |
- | + | this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page="); | |
- | + | }); | |
} | } | ||
- | + | </script> | |
- | + | ||
- | + | ||
- | + | <!-- Scripting - END /--> | |
- | + | ||
- | + | ||
- | + | ||
- | + | <!-- Main CSS - START /--> | |
- | + | <style type="text/css"> | |
- | + | html, body { | |
- | + | ||
- | + | ||
margin: 0; | margin: 0; | ||
padding: 0; | padding: 0; | ||
} | } | ||
- | + | body { | |
- | + | background-color: #001e25; | |
- | + | background-image: url(http://www.igemtudelft.nl/wp-content/themes/minicard/images/bg/burst.jpg); | |
- | + | background-repeat: no-repeat; | |
- | + | background-position: top center; | |
- | + | ||
} | } | ||
+ | /* Wiki Hacks - START */ | ||
+ | /* Author: Pieter van Boheemen */ | ||
+ | /* Team: TU Delft */ | ||
+ | #globalWrapper { background-color: transparent; border: none; margin: 0; padding: 0;} | ||
+ | #content { background-color: transparent; border: none; padding: 0; margin: 0; width: 100%;} | ||
+ | #bodyContent { border: none; padding:0; margin:0; width:100%;} | ||
+ | #top-section { height: 20px; margin-top: -5px; margin-left: auto; margin-right: auto; margin-bottom: 0 !important; margin-bottom: 10px; padding:0; border: none;} | ||
+ | #p-logo { height:1px; overflow:hidden; display: none;} | ||
+ | #search-controls { overflow:hidden; display:block; background: none; position: absolute; top: 100px; right: 40px;} | ||
+ | .left-menu { width: 400px; display:block; float:left; margin-top:-80px; border: none;} | ||
+ | .left-menu ul { border: none; } | ||
+ | #menubar.right-menu { width:300px; display:block; float:left; margin-top:-80px; border: none;} | ||
+ | .right-menu ul { border: none;} | ||
+ | #footer-box { background-color: transparent; border: none; width: 965px; margin: 0 auto; padding: 0;} | ||
+ | #footer { border: none; width: 965px; margin: 0; padding: 0;} | ||
+ | .firstHeading { display: none;} | ||
+ | #f-list a { color: #333; font-size: 10px;} | ||
+ | #f-list a:hover { color: #666;} | ||
+ | #footer ul { margin: 0; padding: 0;} | ||
+ | #footer ul li { margin-top: 0; margin-bottom: 0; margin-left: 10px; margin-right: 10px; padding: 0;} | ||
/* Wiki Hacks - END */ | /* Wiki Hacks - END */ | ||
Line 304: | Line 296: | ||
#search-controls { | #search-controls { | ||
+ | |||
+ | display:none; | ||
+ | |||
background-image: url(https://static.igem.org/mediawiki/2010/9/95/Search.png); | background-image: url(https://static.igem.org/mediawiki/2010/9/95/Search.png); | ||
background-repeat: no-repeat; | background-repeat: no-repeat; |
Revision as of 18:13, 22 July 2010