|
|
(83 intermediate revisions not shown) |
Line 27: |
Line 27: |
| <!-- Internet Explorer PNG fix - END /--> | | <!-- Internet Explorer PNG fix - END /--> |
| | | |
- | <!-- Scripting - START /-->
| |
- | <script type="text/javascript" src="http://nix.lv/history/jquery.history.js"></script>
| |
| | | |
- | <script type="text/javascript">
| |
- | //Global Vars
| |
- | var activePage = "</html>{{{contentpage|home}}}<html>";
| |
- |
| |
- | //On page load this function is called
| |
- | $(function() {
| |
- |
| |
- | // Initialize history plugin.
| |
- | $.history.init(pageload);
| |
- |
| |
- | // set onlick event for menu buttons
| |
- | $("a.menu_button").click(function(){
| |
- | //
| |
- | var hash = this.href;
| |
- | hash = hash.replace(/^.*#/, '');
| |
- | // moves to a new page.
| |
- | // pageload is called at once.
| |
- | $.history.load(hash);
| |
- | return false;
| |
- | });
| |
- |
| |
- | // setup hovering
| |
- | var pages = [ "home", "blog", "competition", "background", "project", "press", "education", "sponsors" ];
| |
- | for(var i=0; i<pages.length;i++) {
| |
- | var page=pages[i];
| |
- | var btnCssClassSelected = "menu_button_" + page + "_sel";
| |
- | btn.hover(function() {
| |
- | if (page != activePage)
| |
- | btn.addClass(btnCssClassSelected);
| |
- | }, function() {
| |
- | if (page != activePage)
| |
- | btn.removeClass(btnCssClassSelected);
| |
- | });
| |
- |
| |
- | btn.addClass("button_pointer");
| |
- | if (page == activePage)
| |
- | btn.addClass("menu_button_"+activePage+"_sel");
| |
- | }
| |
- |
| |
- | });
| |
- |
| |
- |
| |
- | function pageload(hash) {
| |
- |
| |
- | // hash doesn't contain the first # character.
| |
- | if(hash) {
| |
- | var url = wgServer + "/Team:TU_Delft/" +hash+ "?action=render";
| |
- | $.get(url, function(data) {
| |
- | $("#load").html(data).fadeIn(200);
| |
- | rewriteLinks($("#load"));
| |
- | });
| |
- | } else {
| |
- | // start page
| |
- | $("#load").empty();
| |
- | }
| |
- | }
| |
- |
| |
- |
| |
- | function rewriteLinks(elem) {
| |
- |
| |
- | $("a", elem).each(function(){
| |
- |
| |
- | var isFound = $( this ).attr( 'href' ).toString().search( new RegExp( /Team:TU_Delft/i ) );
| |
- |
| |
- | if(isFound > 0) {
| |
- | this.href = this.href.replace("Team:TU_Delft/", wgPageName+ "#");
| |
- | }
| |
- |
| |
- | });
| |
- |
| |
- | }
| |
- |
| |
- | </script>
| |
- |
| |
- | <!-- Scripting - END /-->
| |
| | | |
| <!-- Main CSS - START /--> | | <!-- Main CSS - START /--> |
Line 291: |
Line 214: |
| | | |
| #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; |