Team:TU Delft/test

From 2010.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 118: Line 118:
function include_js(file, cb) {
function include_js(file, cb) {
-
    var html_doc = document.getElementsByTagName('head')[0];
+
var html_doc = document.getElementsByTagName('head')[0];
-
    var js = document.createElement('script');
+
var js = document.createElement('script');
-
    js.setAttribute('type', 'text/javascript');
+
js.setAttribute('type', 'text/javascript');
-
    js.setAttribute('src', file);
+
js.setAttribute('src', file);
-
    html_doc.appendChild(js);
+
html_doc.appendChild(js);
-
    js.onreadystatechange = function () {
+
js.onreadystatechange = function () {
-
        if (js.readyState == 'complete') {
+
if (js.readyState == 'complete')
-
cb();
+
cb();
-
        }
+
}
-
    }
+
-
    js.onload = cb;
+
js.onload = cb;
}
}
Line 140: Line 139:
function moveToAnchor(anchor) {
function moveToAnchor(anchor) {
-
var pos = $('#load > a[name='+anchor+']').offset();
+
try {
-
dbgout('anchor: '+anchor+';  pos=' + pos.left + ','+pos.top );
+
var pos = $('#iGEM_TU_Delft_container > a[name='+anchor+']').offset();
-
window.scroll(pos.left, pos.top);
+
dbgout('anchor: '+anchor+';  pos=' + pos.left + ','+pos.top );
 +
window.scroll(pos.left, pos.top);
 +
} catch (err) {
 +
dbgout('moveToAnchor error: ' + err);
 +
}
}
}
Line 151: Line 154:
currentPage = page;
currentPage = page;
var url = wgServer + "/Team:TU_Delft/" + page + "?action=render";
var url = wgServer + "/Team:TU_Delft/" + page + "?action=render";
 +
if(page.substring(0, 5) == "User:") {
 +
url = wgServer + "/" + page + "?action=render";
 +
}
$(window).trigger('page_close');
$(window).trigger('page_close');
Line 206: Line 212:
}
}
}
}
-
 
-
 
function rewriteLinks(elem) {
function rewriteLinks(elem) {
Line 215: Line 219:
if(this.hash) {
if(this.hash) {
-
//this.href = this.hash;
+
var anchor = this.hash.substring(1);
-
this.href = '#page=' + currentPage + '&anchor=' + this.hash.substring(1);
+
 
 +
if (anchor.substring(0,5)!='page=')
 +
this.href = '#page=' + currentPage + ampersandStr + 'anchor=' + anchor;
} else if(txt != "edit")
} else if(txt != "edit")
this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page=");
this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page=");
-
dbgout('rewriting ' + url + ' to ' + this.href);
+
// dbgout('rewriting ' + url + ' to ' + this.href);
});
});
}
}
Line 287: Line 293:
for (count=0;count<(constituentFolders.length);count++)
for (count=0;count<(constituentFolders.length);count++)
{
{
 +
if(constituentFolders[count].substring(0, 5) == "User:") {
 +
outputStr = outputStr + " <span class='doubleright'>&raquo;</span> <a href='https://2010.igem.org/Team:TU_Delft#page=Team/'>Team</a> <span class='doubleright'>&raquo;</span> <a href='https://2010.igem.org/Team:TU_Delft#page=Team/members'>Members</a> <span class='doubleright'>&raquo;</span> <a href='https://2010.igem.org/Team:TU_Delft#page=" + buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ").substring(5) + "</a>";
 +
}
 +
if(constituentFolders[count].substring(0, 5) !== "User:") {
outputStr=outputStr + " <span class='doubleright'>&raquo;</span> <a href='https://2010.igem.org/Team:TU_Delft#page=" + buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + "</a>";
outputStr=outputStr + " <span class='doubleright'>&raquo;</span> <a href='https://2010.igem.org/Team:TU_Delft#page=" + buildDepth(constituentFolders,count) + constituentFolders[count] + "'>" + capitaliseFirstLetter(constituentFolders[count]).replace(/-/gi," ") + "</a>";
 +
}
}
}
}
}
Line 643: Line 654:
<ul id="navlist">
<ul id="navlist">
-
<li><a class="menubutton" id="home" href="https://2010.igem.org/Team:TU_Delft#page=Home" title="Home"><span>Home</span></a></li>
+
<li><a class="menubutton" id="home" href="https://2010.igem.org/Team:TU_Delft/Home" title="Home"><span>Home</span></a></li>
-
<li><a class="menubutton" id="team" href="https://2010.igem.org/Team:TU_Delft#page=Team" title="Team"><span>Team</span></a>
+
<li><a class="menubutton" id="team" href="https://2010.igem.org/Team:TU_Delft/Team" title="Team"><span>Team</span></a>
<ul>
<ul>

Latest revision as of 20:56, 26 October 2010