Team:TU Delft/test2

From 2010.igem.org

(Difference between revisions)
 
(19 intermediate revisions not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
-
{{:Team:TU_Delft/header}}
+
{{:Team:TU_Delft/header2}}
-
<script type="text/javascript">
+
-
delete $;
+
-
delete jQuery;
+
-
</script>
+
-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" type="text/javascript"></script>
+
<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>
-
         #content_panel {   
+
         #panel_mask {   
             width: 925px;
             width: 925px;
 +
            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;
         }
         }
-
      #preload { display: none; }
 
         </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>
+
<div id="loading">LOADING, please wait...</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>
-
 
+
-
 
+
-
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+ "#/");
+
-
  });
+
-
}
+
-
 
+
</div>
-
// 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); });
+
-
 
+
-
  $("#navlist a").each(function() {
+
-
      this.href = this.href.replace("Team:TU_Delft/", wgPageName+ "#/");
+
-
  });
+
-
 
+
-
    var first = true;
+
-
 
+
-
    // 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(first) {
+
-
        first = false;
+
-
        return;
+
-
      }
+
-
 
+
-
      if (page == "")
+
-
        page = "home";
+
-
 
+
-
      $(".menu_button_" + activePage).removeClass("menu_button_" + activePage + "_sel");
+
-
      activePage = page;
+
-
 
+
-
      if($.inArray(page, pages) >= 0)
+
-
        page = "pages/" + page;
+
-
 
+
-
      var url = wgServer+"/Team:TU_Delft/"+page+"?action=render";
+
-
 
+
-
      $("#content_panel").fadeOut(200);
+
-
  alert("address: " + url);
+
-
      $.get(url, function(data) {
+
-
        $("#content_panel").html(data).fadeIn(200).queue(function() {
+
-
//          rewriteLinks($("#content_panel"));
+
-
        });
+
-
      });
+
-
  });
+
-
 
+
-
});
+
-
 
+
-
</script>
+
</html>
</html>

Latest revision as of 10:08, 4 August 2010

 

 
LOADING, please wait...