Team:TU Delft/test2

From 2010.igem.org

(Difference between revisions)
 
(49 intermediate revisions not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
-
{{:Team:TU_Delft/header}}
+
{{:Team:TU_Delft/header2}}
<html>
<html>
 +
 +
<!-- 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" src="https://2010.igem.org/Team:TU_Delft/files/main_test.js?action=raw&ctype=text/javascript"></script>
 +
 +
<!-- Scripting - END /-->
 +
<div id="menu_wrap">
<div id="menu_wrap">
 +
</html>
</html>
{{:Team:TU_Delft/menu2|contentpage={{{contentpage|home}}} }}
{{:Team:TU_Delft/menu2|contentpage={{{contentpage|home}}} }}
<html>
<html>
 +
</div>
</div>
 +
<div id="content_wrap">
<div id="content_wrap">
 +
<div id="content_table">
<div id="content_table">
 +
     <div id="top_row">&nbsp;</div>
     <div id="top_row">&nbsp;</div>
 +
     <div class="main_row">
     <div class="main_row">
 +
         <div id="main_td">
         <div id="main_td">
         <style>
         <style>
         #panel_mask {   
         #panel_mask {   
-
             width: 650px;
+
             width: 925px;
             overflow:hidden;   
             overflow:hidden;   
             margin:0 auto;   
             margin:0 auto;   
 +
            min-height: 500px;
         }
         }
         .page_panel {
         .page_panel {
             float:left;
             float:left;
 +
            width: 925px;
             padding-right:10px;
             padding-right:10px;
         }
         }
         </style>
         </style>
-
         <div id="content_panel">
+
         <div id="panel_mask">
-
        <!-- CONTENT STARTS HERE /-->
+
-
            </html>{{:Team:TU_Delft/pages/home}}<html>
+
-
        <!-- CONTENT ENDS HERE /-->
+
-
        </div>
+
-
        </div>
+
<div id="load">
-
        <div id="left_td">
+
<div id="loading">LOADING, please wait...</div>
-
</html>
+
-
{{:Team:TU_Delft/left}}
+
-
<html>
+
-
        </div>
+
-
    </div>
+
-
    <div id="bottom_row">&nbsp;</div>
+
</div>
</div>
 +
</div>
</div>
-
<div id="footer_wrap"></html>
 
-
{{:Team:TU_Delft/footer}}
 
-
<html></div>
 
</div>
</div>
 +
    </div>
-
<!-- CODE SECTION -->
+
    <div id="bottom_row">&nbsp;</div>
-
<script type="text/javascript">
+
</div>
-
function isUndefined(x) { var u; return x === u; }
+
<div id="footer_wrap">
-
var activePage = "</html>{{{contentpage|home}}}<html>";
+
</html>
 +
{{:Team:TU_Delft/footer}}
 +
<html>
-
var pages = [ "home", "blog", "project", "team", "gallery", "education", "sponsors", "contact" ];
+
</div>
-
 
+
</div>
-
function setupTabButton(page) {
+
-
  var btn= $(".menu_button_" + page);
+
-
  btn.click(function(event) {
+
-
    $.address.value(page);
+
-
    return false;
+
-
  });
+
-
 
+
-
  // setup hovering
+
-
  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");
+
-
}
+
-
 
+
-
// rewrite links to load with AJAX within the frame
+
-
function rewriteLinks(elem) {
+
-
// TODO: replace full links too (with "http://..")?
+
-
  $("a[href^=/Team:TU_Delft/]", elem).each(function()
+
-
  {
+
-
//alert(this.href);
+
-
      this.href = this.href.replace("Team:TU_Delft/", wgPageName+ "#/");
+
-
  });
+
-
}
+
-
 
+
-
 
+
-
// this runs when page is loaded
+
-
$(function() {
+
-
 
+
-
 
+
-
    for(var i=0; i<pages.length;i++) {
+
-
      var page=pages[i];
+
-
      setupTabButton(page);
+
-
    }
+
-
 
+
-
/*      if(wgUserName != null) {
+
-
        var editurl = wgServer+"/Team:TU_Delft/pages/"+page+"?action=edit";
+
-
        $("#page_" + page + ">*:first").before($("<a href=\""+editurl+ "\">Edit " + page + "</a>"));
+
-
      }*/
+
-
    $("#content_panel").each(function() { rewriteLinks(this); });
+
-
 
+
-
// REWRITE SUBMENU ITEM LINKS
+
-
$("#navlist li ul li a").each(function() {
+
-
this.href = this.href.replace("Team:TU_Delft/", wgPageName+ "#/");
+
-
});
+
-
 
+
-
  // instead of button click handler, all actions pass through the address bar so history works too
+
-
  $.address.change(function(event) {
+
-
      var page = event.path.substring(1);
+
-
      if(page=='') page = activePage;
+
-
 
+
-
      $(".menu_button_" + activePage).removeClass("menu_button_" + activePage + "_sel");
+
-
      activePage = page;
+
-
 
+
-
    var url = wgServer+"/Team:TU_Delft/"+page+"?action=render";
+
-
 
+
-
      $.get(url, function(data) {
+
-
        $("#content_panel").html(data).show(200);
+
-
        rewriteLinks($("#content_panel"));
+
-
      });
+
-
  });
+
-
 
+
-
});
+
-
 
+
-
</script>
+
</html>
</html>

Latest revision as of 10:08, 4 August 2010

 

 
LOADING, please wait...