Team:ETH Zurich/Templates/HeaderNew

From 2011.igem.org

(Difference between revisions)
Line 10: Line 10:
     $(function()
     $(function()
     {
     {
-
var docLink = document.URL;
+
var page = document.URL;
-
if (document.URL.indexOf("?") != -1)
+
var a = document.createElement('a');
 +
a.href = document.URL;
 +
var docPath = a.pathname + a.search;
 +
if (docPath.indexOf("?") != -1)
{
{
-
docLink += '&';
+
var docLink = '/' + docPath + '&';
}
}
else
else
{
{
-
docLink += '?';
+
var docLink = '/' + docPath + '?';
}
}
 +
if ($('#pt-logout').length)  
if ($('#pt-logout').length)  
Line 27: Line 31:
$('#editLink').attr('href', docLink + 'action=edit');
$('#editLink').attr('href', docLink + 'action=edit');
$('#historyLink').attr('href', docLink + 'action=history');
$('#historyLink').attr('href', docLink + 'action=history');
-
 
$('#logoutLink').attr('href', $('#pt-logout').children().get(0).href);
$('#logoutLink').attr('href', $('#pt-logout').children().get(0).href);
}
}
Line 37: Line 40:
a.href = document.URL;
a.href = document.URL;
var docPath = a.pathname + a.search;
var docPath = a.pathname + a.search;
-
$('#loginLink').get(0).href = 'https://2011.igem.org/wiki/index.php?title=Special:U serLogin&returnto=' + encodeURIComponent(docPath);
+
$('#loginLink').get(0).href = 'https://2011.igem.org/wiki/index.php?title=Special:UserLogin&returnto=' + encodeURIComponent(docPath);
}
}

Revision as of 11:51, 17 October 2011

Menu image preload Menu image preload Menu image preload Menu image preload Menu image preload Menu image preload