Team:WITS-CSIR SA/common.js
From 2011.igem.org
function RebuildHeader() {
var html = '<img src="" style="height: 90px; margin-left:30px; margin-top:20px;" alt="This must be edited. Still, a cool idea" /> | CSIR Wits |
$('#p-logo').empty().append(html); $('#p-logo h1').addClass('logo'); $('#top-section').css({ backgroundImage: 'url(https://static.igem.org/mediawiki/2011/5/53/Body_bg.gif)', backgroundColor: '#666666', backgroundRepeat: 'repeat-x', height: '155px' });
}
function SetEqualHeights(c){
var maxHeight = 0; $('div.' + c).each(function(){ maxHeight = Math.max($(this).height(), maxHeight); });
var offset = (c == 'equalHeights' ? 50 : 0); $('div.' + c).height(maxHeight + offset);
}
function RemoveTitle(){
$('.firstHeading').eq(0).remove();
}
function StyleBody(){
$('body').addClass('ui-widget-content'); $('#bodyContent, #content').css({ backgroundColor: '#2e2e2e', backgroundImage: 'url(https://static.igem.org/mediawiki/2011/0/09/BackgroundBody.jpg)' }); $('table').css('background-color', 'transparent'); $('#catlinks').css({'background-color': 'transparent', border:'none', color: '#99C92F'}).addClass('ui-widget-content ui-corner-all'); var html = $('#footer-box').html(); $('#footer-box').remove(); $('#catlinks').html(html); $('#catlinks a').css('color', '#99C92F'); $('body').css({ 'overflow-x': 'hidden', 'overflow-y': 'visible' });
}
function BuildSearch() {
var html = '<form action="/Special:Search" id="searchform">Search: | <input id="searchInput" name="search" type="text" title="Search 2011.igem.org [alt-f]" accesskey="f" value="" autocomplete="off" /> | <input type="submit" name="go" class="searchButton" id="searchGoButton" value="Go" title="Go to a page with this exact name if exists" style="color:#99C92F;" /> | <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search the pages for this text" style="color:#99C92F;" /> |
$('#searchform').html(html);
}
$(function() {
RebuildHeader(); RemoveTitle(); StyleBody(); SetEqualHeights('equalHeights'); SetEqualHeights('infoBox'); BuildSearch();
});