Team:Cambridge/new

From 2011.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
-
<script type="text/javascript">
+
<script type="text/javascript" src='/Team:Cambridge/static/hack.js?action=raw&ctype=text/javascript'></script>
-
  var get_login = function()
+
<noscript>
-
  {
+
<h1>JAVASCRIPT DISABLED</h1>
-
    var page = $('#menubar.right-menu').find('#pt-userpage');
+
</nosript>
-
    if(page.length == 0) return undefined;
+
-
    return page.children('a').text();
+
-
  } 
+
-
 
+
-
  var set_login = function(username)
+
-
  {
+
-
    if(username != undefined)
+
-
    {
+
-
      $('#user-link').text(username).attr('href', '/User:' + username);
+
-
      $('#edit-link').text('Edit');
+
-
      $('#logged_out').hide();
+
-
      $('#logged_in').show();
+
-
    }
+
-
  }
+
-
 
+
-
  var set_bk = function()
+
-
  {
+
-
    var w = screen.width;
+
-
    var _c = 'cam-bk-';
+
-
    if(w <= 1024)
+
-
      _c=_c+'1024';
+
-
    else if(w <= 1680)
+
-
      _c=_c+'1680';
+
-
    else if(w <= 1920)
+
-
      _c=_c+'1920';
+
-
    else _c = _c+'2650';
+
-
   
+
-
    _c = _c + '-';
+
-
 
+
-
    var aspx = w / screen.height;
+
-
    if(aspx <= 1.6) //16:10
+
-
      _c = _c+'narrow';
+
-
    else _c = _c+'wide';
+
-
   
+
-
    console.log('screen: ' + screen.width + 'x' + screen.height);
+
-
    console.log('  -> ' + _c);
+
-
   
+
-
    $('body').addClass(_c);
+
-
  }
+
-
 
+
-
  var head = "<title>Cambridge iGEM</title>" +
+
-
            "<link rel='stylesheet' type='text/css' href='/Team:Cambridge/static/wiki.css?action=raw&ctype=text/css' />";
+
-
+
-
  var script = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js';
+
-
 
+
-
  var wiki_js = '/Team:Cambridge/static/wiki.js?action=raw&ctype=text/javascript';
+
-
  var intro_js ='/Team:Cambridge/static/introduction.js?action=raw&ctype=text/javascript';
+
-
   
+
-
 
+
-
$(window).ready(function() {
+
-
  var login = get_login();
+
-
  $('body').html($('#cam_page'));
+
-
  $('head').html(head);
+
-
 
+
-
  //this is ugly, but it makes sure that the JS is loaded in the correct order
+
-
  $.getScript(script, function() {
+
-
    $.getScript(wiki_js, function() {
+
-
      $.getScript(intro_js, function() {
+
-
        wiki_main();
+
-
      });
+
-
    });
+
-
  });
+
-
 
+
-
  set_bk();
+
-
  set_login(login);
+
-
});
+
-
</script>
+
<div id='cam_page'>
<div id='cam_page'>

Revision as of 15:30, 13 September 2011

JAVASCRIPT DISABLED