Team:TU Delft
From 2010.igem.org
(Difference between revisions)
Line 48: | Line 48: | ||
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; | var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; | ||
if(is_chrome) console.log(msg); | if(is_chrome) console.log(msg); | ||
+ | } | ||
+ | |||
+ | function updateContentEditLink() { | ||
+ | var page = currentPage ? currentPage : 'Home'; | ||
+ | var url = location.host + location.pathname + '/' + page + '?action=edit'; | ||
+ | $("#edit_content_link").attr('href', url); | ||
} | } | ||
// Set document ready callback | // Set document ready callback | ||
$(function() { | $(function() { | ||
+ | // Create content edit link | ||
+ | $(".left-menu ul > *:last").after('<li><a id="edit_content_link">edit content</a></li>'); | ||
+ | updateContentEditLink(); | ||
+ | |||
// Initialize history plugin. | // Initialize history plugin. | ||
$(window).hashchange(historyCallback); | $(window).hashchange(historyCallback); | ||
Line 121: | Line 131: | ||
function loadPage(page) | function loadPage(page) | ||
{ | { | ||
+ | var showLoadAnim = !!currentPage; | ||
currentPage = page; | currentPage = page; | ||
var url = wgServer + "/Team:TU_Delft/" + page + "?action=render"; | var url = wgServer + "/Team:TU_Delft/" + page + "?action=render"; | ||
$(window).trigger('page_close'); | $(window).trigger('page_close'); | ||
- | if( | + | if(showLoadAnim) { |
$("#TUD-loading-panel").show(); | $("#TUD-loading-panel").show(); | ||
//$("#loading-overlay").show(); | //$("#loading-overlay").show(); | ||
Line 136: | Line 147: | ||
$(window).trigger('page_init'); | $(window).trigger('page_init'); | ||
rewriteLinks($("#iGEM_TU_Delft_container")); | rewriteLinks($("#iGEM_TU_Delft_container")); | ||
+ | updateContentEditLink(); | ||
$("#iGEM_TU_Delft_container").fadeTo(200,1); | $("#iGEM_TU_Delft_container").fadeTo(200,1); | ||
next(); | next(); | ||
Line 170: | Line 182: | ||
} | } | ||
} else { | } else { | ||
- | |||
setHash('Home'); | setHash('Home'); | ||
} | } |