Team:WITS-CSIR SA/common.js

From 2011.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 1: Line 1:
function RebuildHeader() {
function RebuildHeader() {
-
   var html = '<table cellpadding="2" cellspacing="2" border="0"><tr><td><img src="https://static.igem.org/mediawiki/2011/c/c9/Logo.png" style="height: 90px; margin-left:20px; margin-top:15px;" alt="This must be edited. Still, a cool idea" /></td><td><h1 class="logo">CSIR Wits</h1></td></tr></table>';
+
   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').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 17: Line 18:
   });
   });
-
   $('div.' + c).height(maxHeight + 50);
+
  var offset = (c == 'equalHeights' ? 50 : 0);
 +
   $('div.' + c).height(maxHeight + offset);
}
}
Line 31: Line 33:
   });
   });
   $('table').css('background-color', 'transparent');
   $('table').css('background-color', 'transparent');
-
   $('#catlinks').css({'background-color': 'transparent', border:'none'}).addClass('ui-widget-header ui-corner-all');
+
   $('#catlinks').css({'background-color': 'transparent', border:'none', color: '#99C92F'}).addClass('ui-widget-content ui-corner-all');
   var html = $('#footer-box').html();
   var html = $('#footer-box').html();
   $('#footer-box').remove();
   $('#footer-box').remove();
   $('#catlinks').html(html);
   $('#catlinks').html(html);
 +
  $('#catlinks a').css('color', '#99C92F');
   $('body').css({ 'overflow-x': 'hidden', 'overflow-y': 'visible' });
   $('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);
}
}
Line 44: Line 53:
   SetEqualHeights('equalHeights');
   SetEqualHeights('equalHeights');
   SetEqualHeights('infoBox');
   SetEqualHeights('infoBox');
 +
  BuildSearch();
});
});

Latest revision as of 13:23, 12 July 2011

function RebuildHeader() {

var html = '
<img src="Logo.png" 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;" />
</form>';
 $('#searchform').html(html);

}

$(function() {

 RebuildHeader();
 RemoveTitle();
 StyleBody();
 SetEqualHeights('equalHeights');
 SetEqualHeights('infoBox');
 BuildSearch();

});