Team:WITS-CSIR SA/common.js
From 2011.igem.org
(Difference between revisions)
(41 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
function RebuildHeader() { | function RebuildHeader() { | ||
- | $('#p-logo').empty(); | + | var html = '<table cellpadding="2" cellspacing="2" border="0" style="background-color: transparent;"><tr><td><img src="https://static.igem.org/mediawiki/2011/c/c9/Logo.png" style="height: 90px; margin-left:30px; margin-top:20px;" alt="This must be edited. Still, a cool idea" /></td><td><h1>CSIR Wits</h1></td></tr></table>'; |
+ | |||
+ | $('#p-logo').empty().append(html); | ||
+ | $('#p-logo h1').addClass('logo'); | ||
$('#top-section').css({ | $('#top-section').css({ | ||
backgroundImage: 'url(https://static.igem.org/mediawiki/2011/5/53/Body_bg.gif)', | backgroundImage: 'url(https://static.igem.org/mediawiki/2011/5/53/Body_bg.gif)', | ||
Line 13: | Line 10: | ||
height: '155px' | 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); | ||
} | } | ||
Line 21: | Line 28: | ||
function StyleBody(){ | function StyleBody(){ | ||
$('body').addClass('ui-widget-content'); | $('body').addClass('ui-widget-content'); | ||
- | $('#bodyContent').css('background-color': '# | + | $('#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"><table border="0" cellpadding="2" cellspacing="2" style="background-color: transparent; position: relative; top: 108px; left: -150px;"><tr><td><strong style="color:white;">Search:</strong></td><td><input id="searchInput" name="search" type="text" title="Search 2011.igem.org [alt-f]" accesskey="f" value="" autocomplete="off" /></td><td><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;" /></td><td><input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search the pages for this text" style="color:#99C92F;" /></td></tr></table></form>'; | ||
+ | |||
+ | $('#searchform').html(html); | ||
} | } | ||
$(function() { | $(function() { | ||
- | |||
RebuildHeader(); | RebuildHeader(); | ||
RemoveTitle(); | RemoveTitle(); | ||
StyleBody(); | StyleBody(); | ||
+ | SetEqualHeights('equalHeights'); | ||
+ | SetEqualHeights('infoBox'); | ||
+ | BuildSearch(); | ||
}); | }); |
Latest revision as of 13:23, 12 July 2011
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();
});