Team:UT-Tokyo/Templates/BeginContent

From 2011.igem.org

(Difference between revisions)
Line 324: Line 324:
<script type="text/javascript">
<script type="text/javascript">
 +
 +
String.prototype.startswith = function (str){
 +
    return this.indexOf(str) == 0;
 +
};
var UT_Tokyo = UT_Tokyo || {};
var UT_Tokyo = UT_Tokyo || {};
Line 449: Line 453:
       $('#pageContent').unblock();
       $('#pageContent').unblock();
 +
      // left menu
 +
      $('.left-menu ul li a').each(function() {
 +
        $this = $(this);
 +
        if ($this.html().startswith('Page')) {
 +
          $this.attr('href', '/'+fullPageName');
 +
        } else if ($this.html().startswith('Discussion')) {
 +
          $this.attr('href', '/Talk:'+fullPageName+'?action=edit&redlink=1');
 +
        } else if ($this.html().startswith('Edit')) {
 +
          $this.attr('href', '/'+fullPageName+'?action=edit');
 +
        } else if ($this.html().startswith('History')) {
 +
          $this.attr('href', '/'+fullPageName+'?action=history');
 +
        } else if ($this.html().startswith('Move')) {
 +
          $this.attr('href', '/Special:MovePage/'+fullPageName);
 +
        } else if ($this.html().startswith('Watch')) {
 +
          $this.attr('href', '/'+fullPageName+'?action=watch');
 +
        }
 +
      });
       UT_Tokyo.currentUrl = toUrl;
       UT_Tokyo.currentUrl = toUrl;
       UT_Tokyo.needHandling = true;
       UT_Tokyo.needHandling = true;
-
     
 
     },
     },
     'error': function(XMLHttpRequest, textStatus, errorThrown) {
     'error': function(XMLHttpRequest, textStatus, errorThrown) {

Revision as of 16:02, 31 August 2011