Team:Cambridge/static/hack.js
From 2012.igem.org
(Difference between revisions)
(8 intermediate revisions not shown) | |||
Line 36: | Line 36: | ||
{ | { | ||
var w = screen.width; | var w = screen.width; | ||
- | var _c = ' | + | var _c = 'CAM12_bg_'; |
if(w <= 1024) | if(w <= 1024) | ||
_c=_c+'1024'; | _c=_c+'1024'; | ||
+ | else if(w <= 1280) | ||
+ | _c=_c+'1280'; | ||
+ | else if(w <= 1366) | ||
+ | _c=_c+'1366'; | ||
+ | else if(w <= 1440) | ||
+ | _c=_c+'1440'; | ||
else if(w <= 1680) | else if(w <= 1680) | ||
_c=_c+'1680'; | _c=_c+'1680'; | ||
- | else | + | else _c = _c+'1920'; |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
$('body').addClass(_c); | $('body').addClass(_c); | ||
Line 56: | Line 53: | ||
var head = "<title>Cambridge iGEM</title>" + | var head = "<title>Cambridge iGEM</title>" + | ||
- | "<link rel='stylesheet' type='text/css' href='/Team:Cambridge/static/wiki. | + | "<link rel='stylesheet' type='text/css' href='/Team:Cambridge/static/wiki.css' />"; |
var script = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'; | var script = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'; | ||
- | |||
- | |||
- | |||
$('head').html(head); | $('head').html(head); | ||
Line 68: | Line 62: | ||
var login = get_login(); | var login = get_login(); | ||
$('body').html($('#cam_page')); | $('body').html($('#cam_page')); | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
set_bk(); | set_bk(); | ||
set_login(login); | set_login(login); | ||
}); | }); |
Latest revision as of 09:33, 23 July 2012
/*
This file is part of the cambridge 2011 igem team's wiki. nothing is guaranteed.
Version 2, December 2004
Copyright (C) 2011 Haydn King hjking734@gmail.com
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- /
/*
- Removes iGEM style content, then pulls in the Cambridge Team's styling & javascript
- /
var get_login = function() { var page = $('#menubar.right-menu').find('#pt-userpage'); 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 Page'); $('#edit-intro-link').text('Edit Introduction'); $('#logged_out').hide(); $('#logged_in').show(); } }
var set_bk = function() { var w = screen.width; var _c = 'CAM12_bg_'; if(w <= 1024) _c=_c+'1024'; else if(w <= 1280) _c=_c+'1280'; else if(w <= 1366) _c=_c+'1366'; else if(w <= 1440) _c=_c+'1440'; else if(w <= 1680) _c=_c+'1680'; else _c = _c+'1920'; $('body').addClass(_c); }
var head = "<title>Cambridge iGEM</title>" + "<link rel='stylesheet' type='text/css' href='/Team:Cambridge/static/wiki.css' />"; var script = '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js';
$('head').html(head);
$(window).ready(function() {
var login = get_login(); $('body').html($('#cam_page'));
set_bk(); set_login(login);
});