Graduate Admissions
+ + +-
+
- About us +
- Prospective Students
+
-
+
- Step 1 - Why Cambridge + + +
- Step 2 - Studying at Cambridge + + +
- Step 3 - How to apply
+
-
+
- Supporting Documentation +
- Continuation and Readmission +
- Your Self-Service Account +
- Application and Funding Deadlines +
- Application Fees +
- College Choice +
- Disabled Applicants +
- Entrance Requirements +
- Part-Time Study and Research +
- Privacy - Your Personal Data +
- Research Topic and Resources +
- Staff Applicants +
- Starting Dates +
- Applying Paper +
+ - Step 4 - I've applied - What Next? + + +
- Frequently asked questions + + +
- Site map +
+
-
- {% block content_header_more %}
-
- Demo Home - {% endblock %} + +
- + University A-Z + +
- + Contact the University + +
- + Accessibility + +
- + Freedom of information + +
- + Terms and conditions + +
- + Undergraduate + +
- + Graduate + +
- + International students + +
- + Continuing education + +
- + Executive and professional education + +
- + Courses in education + +
- + How the University and Colleges work + +
- + Visiting the University + +
- + Map + +
- + News + +
- + Events + +
- + Jobs + +
- + Giving to Cambridge + +
- + News + +
- + Features + +
- + Discussion + +
- + Spotlight on... + +
- + About research at Cambridge + +
- '+$(this).children("a").text()+' '); + if($(this).hasClass('campl-top')){ + $childUl.prepend('
- Back to section home '); + }else{ + + $childUl.prepend('
- '+ $(this).parent().children(".campl-title").children("a").html() +' '); + } + + }) + + + //reset menu structure after title links have been appended to ensure they are always created for full mobile structure + //desktop menu only needs to go one level deep + $allListItems.removeClass("campl-sub"); + if(projectlight.mobileLayout){ + $allListItems.has('ul').addClass("campl-sub"); + }else{ + $allListItems.not($allListItems.find("li")).has('ul').addClass("campl-sub"); + } + + //declare array of links after title link has been created + $links = $topListItems.find("a"); + + //set current class to first level navigation so mobile menu can always open at least + //one level of menu. This style makes the UL visible + $topUL.addClass("campl-current"); + + + //hover classes not required for mobile and tablet layouts + //hover event should only trigger from top level items not children of top level + $topListItems.hover( + function(){ + if(!projectlight.mobileLayout){ + $(this).addClass("campl-hover") + } + },function(){ + if(!projectlight.mobileLayout){ + $(this).removeClass("campl-hover") + } + }); + + + //Bound click event for all links inside the local navigation. + //handles moving forwards and backwards through pages or opening dropdown menu + $links.click(function(e){ + var $linkClicked = $(this), + $listItemClicked = $linkClicked.parent(); + + if($listItemClicked.hasClass("campl-title") && Modernizr.mq('only screen and (max-width: 767px)')){ + e.preventDefault(); + }else{ + if($listItemClicked.hasClass("campl-sub")){ + //slide mobile or tablet menu forward + if(projectlight.mobileLayout){ + slideMenu("forward"); + $listItemClicked.addClass("campl-current") + }else{ + if($listItemClicked.hasClass("campl-top") && $linkClicked.hasClass("campl-clicked")){ + //toggle open navigation if top level without sub level link clicked + closeSubNavigation(); + }else{ + //display sub menu for the desktop view for the item clicked + showSubNavigation($linkClicked, e) + } + } + e.preventDefault(); + }else{ + if($listItemClicked.hasClass("campl-back-link")){ + slideMenu("back"); + $linkClicked.parent().parent().parent().addClass("campl-previous"); + $linkClicked.parent().parent().addClass("campl-previous"); + return false + } + } + } + + }); + + //ensure dropdown or sliding panels are set to the correct width if the page changes and also on first load + $(window).resize(function(){ + setMenuWidth(); + }); + if(projectlight.mobileLayout){ + setMenuWidth(); + } + } + + //sets the width of the sub menus, for either the desktop dropdown, + //or to ensure the mobile sliding panels stretch to fill the whole screen + function setMenuWidth(){ + + var widthOfMenu = 480; + + if(Modernizr.mq('only screen and (max-width: 767px)')){ + widthOfMenu = $(window).width() + + $topUL.width(widthOfMenu); + $allMenuLists.width(widthOfMenu).css("left",widthOfMenu); + if($openMenu.parent().hasClass("campl-open")){ + $navContainer.css("left",-(menuPosition*widthOfMenu)) + } + //should be adding mobile state to dom elem + $navContainer.addClass("campl-mobile"); + }else{ + + //this resets the mobile structure by removing all the unwanted classes + //so the show/hide will work for the desktop dropdown menu + if($navContainer.hasClass("campl-mobile")){ + $openMenu.parent().removeClass("campl-open").addClass("campl-closed"); + $navContainer.find(".campl-current").removeClass("campl-current"); + $navContainer.attr("style","").removeAttr("style"); + $topUL.attr("style","").removeAttr("style"); + $allMenuLists.attr("style","").removeAttr("style") + } + } + } + //shows the desktop dropdown menus by positioning them on or off screen + function displayMenu(actionSent){ + if(actionSent == "show"){ + + //Walk up through DOM to determine nested level + var $currentUL = $currentPageListitem.parent(); + currentSectionNo = 0; + if($currentPageListitem.length > 0){ + if($currentPageListitem.parent().length > 0){ + //do while this is UL + while ($currentUL[0].tagName === "UL") + { + $currentUL.addClass("campl-current")// this displays hidden nav sections + if($currentUL.parent()[0].tagName === "LI" ){ + $currentUL.parent().addClass("campl-current") //need to add current to full path, UL and LI + } + $currentUL = $currentUL.parent().parent(); + currentSectionNo ++; + } + //set current menu position depending on which nested level the active page is on + menuPosition = currentSectionNo-1; + $navContainer.children("ul").removeClass("campl-current") + } + }else{ + menuPosition = 0 + } + + //get current menu width + if(Modernizr.mq('only screen and (min-width: 768px)')){ + widthOfMenu=480; + }else{ + widthOfMenu=$(window).width(); + } + + //set left position depending which level to open menu at + $navContainer.css({left:-(menuPosition*widthOfMenu)}); + + $openMenu.parent().removeClass("campl-closed").addClass("campl-open"); + }else{ + if(actionSent == "hide"){ + $openMenu.parent().removeClass("campl-open").addClass("campl-closed"); + $navContainer.css({left:-9999}); + + //need to force top container to go away. Ghost block seemed to be staying on screen even + //though CSS should have removed it, this hack forces it to be hidden then removes the display + //style to allow it to be controlled by the CSS again + $navContainer.find(".campl-current").removeClass("campl-current").hide(); + $navContainer.find(':hidden').css("display", "") + + //reset menu back to opening position + menuPosition = currentSectionNo-1; + } + } + } + //shows the sliding menus for the mobile navigation + function slideMenu(directionToSlide){ + var widthOfMenu, + currentLeftPos=$navContainer.css("left"); + currentLeftPos=parseInt(currentLeftPos.replace("px","")); + + if(Modernizr.mq('only screen and (min-width: 768px)')){ + widthOfMenu=480; + }else{ + widthOfMenu=$(window).width() + } + + if(directionToSlide === "forward"){ + menuPosition++; + $navContainer.stop().animate({left:currentLeftPos-widthOfMenu},300,function(){}) + }else{ + if(directionToSlide === "back"){ + menuPosition--; + $navContainer.stop().animate({left:currentLeftPos+widthOfMenu},300,function(){ + $navContainer.find(".campl-previous").removeClass("campl-previous").removeClass("campl-current"); + }) + } + } + } + //controls mulitple levels of dropdown navigation depending on hover and clicked classes being set + //nb: we have altered from the original sony code by only allowing users to open one level or + //dropdown menu in the desktop view + function showSubNavigation(linkClicked, event){ + var $linkClicked = $(linkClicked), + $listItemClicked = $linkClicked.parent(), + $ListItemSiblings = $listItemClicked.siblings(), + y; + + if($linkClicked.hasClass("campl-clicked")){ + $listItemClicked.removeClass("campl-hover"); + $linkClicked.removeClass("campl-clicked"); + + //list items beneath current with hover set + y = $listItemClicked.find(".campl-hover"); + $clickedChildren = x.find(".clicked"); + y.removeClass("campl-hover"); + $clickedChildren.removeClass("campl-clicked") + }else{ + $listItemClicked.addClass("campl-hover"); + $linkClicked.addClass("campl-clicked"); + + //for each of the list items siblings remove hover and clicked classes + $ListItemSiblings.each(function(){ + var $sibling = $(this); + if($sibling.children("a").hasClass("campl-clicked")){ + y = $sibling.find(".campl-hover"); + $clickedChildren = $sibling.find(".campl-clicked"); + $sibling.removeClass("campl-hover"); + y.removeClass("campl-hover"); + $clickedChildren.removeClass("campl-clicked") + } + }) + } + event.preventDefault(); + } + + //close button resets all open classes and returns the navigation back to a full closed state + function closeSubNavigation(){ + var $hoveredListItems =$topUL.find(".campl-hover"), + $linksClicked = $topUL.find(".campl-clicked"); + + $hoveredListItems.removeClass("campl-hover"); + $linksClicked.removeClass("campl-clicked"); + $secondLevelListitems.css("left",-9999) + } + +})(); //end of nav - self calling function + + +//carousel instantiation +projectlight.createCarousel = function(){ + var carousel = {}; + + // set up initial carousel values and autoplay, hide other slides + carousel.init = function(){ + this.carouselContainer = $("#carousel"); + this.slides = this.carouselContainer.find("ul"); + this.currentSlide = 1; + this.maxSlides = this.slides.children().length; + this.animating = false; + this.endPos = 0; + + // need to determine width of carousel, container and slide item depending on screen size + this.carouselWidth = this.carouselContainer.width(); + + // need to dynamically set width of slides Ul (length of all slides plus the cloned item) and left position (length off each side * currentSlide) + if (this.maxSlides > 1) { + this.slides.css({'width': (this.carouselWidth*(this.maxSlides+2))+this.carouselWidth+'px', 'left': '-' + (this.carouselWidth * this.currentSlide)+'px'}); + } + + + // calculate lookup position table + this.lookupPos = []; + + for(var cc = 0; cc < this.maxSlides; cc++){ + this.lookupPos.push(-cc * parseInt(this.carouselContainer.innerWidth(), 10)); + } + + if (this.maxSlides > 1) { + this.carouselContainer.removeClass('campl-banner') + //create next and back buttons for carousel + this.createCarouselControls(); + + //append pagination indicator + this.createPaginationIndicator(); + + // Clone first and last slides and append it to the slideshow to mimic infinite carousel functionality + var clonedFirstSlide = this.slides.find('li:first-child').clone(); + this.slides.append(clonedFirstSlide); + var clonedLastSlide = this.slides.find('li:nth-child('+this.maxSlides+')').clone(); + this.slides.prepend(clonedLastSlide); + + this.slide = this.slides.find("li") + + // click event on carousel direction controls + this.carouselControls.bind('click', this.activateDirectionButtons) + + //set width of each slide to ensure image is scaling to match fluid grid + this.slides.children().css({width:this.carouselWidth}) + + projectlight.resetCarousel(); + + this.autoPlaying = true; + this.startAutoPlay(); + + + + }else{ + this.carouselContainer.addClass('campl-banner') + } + + this.carouselContainer.find("li").show(); + + //instantiate caption and content text variables for handling truncation across all slides and cloned slides + //has to happen after cloning so all slides are properly controlled by the truncation during resize event + projectlight.$slideCaption = $(".campl-slide-caption-txt"); + projectlight.$carouselContent = $(".campl-carousel-content p"); + + projectlight.carouselContentItems = []; + projectlight.slideCaptionItems = []; + + //store array of original strings to replace when at full size + projectlight.$slideCaption.each(function(){ + projectlight.slideCaptionItems.push($(this).text()) + }) + + projectlight.$carouselContent.each(function(){ + projectlight.carouselContentItems.push($(this).text()) + }) + + //truncate homepage carousel content if page is thinner than tablet view but not on mobile view + if(Modernizr.mq('only screen and (min-width: 768px) and (max-width: 1000px)')){ + projectlight.$slideCaption.each(function(){ + $(this).text($.trim($(this).text()).substring(0, 50).split(" ").slice(0, -1).join(" ") + "...") + }) + + projectlight.$carouselContent.each(function(){ + $(this).text($.trim($(this).text()).substring(0, 35).split(" ").slice(0, -1).join(" ") + "...") + }) + + } + } + + carousel.createPaginationIndicator = function(){ + carousel.slides.children().each(function(i){ + var slideNo = i+1 + $(this).find(".campl-slide-caption").append(""+ slideNo + " of " + carousel.maxSlides + "") + }) + } + + //append control buttons unobtrusively if there is more than one slide in carousel + carousel.createCarouselControls = function(){ + + var carouselControls = document.createElement('ul'); + carouselControls.className = 'campl-unstyled-list clearfix campl-carousel-controls'; + carouselControls.id = 'carousel-controls'; + + var previouslistItem = document.createElement('li'); + previouslistItem.className = "campl-previous-li"; + var previouslink = document.createElement('a'); + var previousArrowSpan = document.createElement('span'); + previousArrowSpan.className = "campl-arrow-span"; + previouslink.className = "ir campl-carousel-control-btn campl-previous"; + var previouslinkText = document.createTextNode('previous slide'); + previouslink.setAttribute('href', '#'); + previouslink.appendChild(previousArrowSpan); + previouslink.appendChild(previouslinkText); + previouslistItem.appendChild(previouslink); + carouselControls.appendChild(previouslistItem); + + var nextlistItem = document.createElement('li'); + nextlistItem.className = "campl-next-li"; + var nextlink = document.createElement('a'); + var nextArrowSpan = document.createElement('span'); + nextArrowSpan.className = "campl-arrow-span"; + nextlink.className = "ir campl-carousel-control-btn campl-next"; + var nextlinkText = document.createTextNode('next slide'); + nextlink.setAttribute('href', '#'); + nextlink.appendChild(nextArrowSpan); + nextlink.appendChild(nextlinkText); + nextlistItem.appendChild(nextlink); + carouselControls.appendChild(nextlistItem); + + this.carouselContainer.append(carouselControls); + this.carouselControls = $('#carousel-controls a'); + this.prev = this.carouselControls.eq(0); + this.next = this.carouselControls.eq(1); + + }; + + //bound click event for carousel navigation controls + carousel.activateDirectionButtons = function(e){ + carousel.stopAutoPlay(); + var buttonClicked; + if(e.target.tagName === "SPAN"){ + buttonClicked = $(e.target.parentNode); + }else{ + buttonClicked = $(e.target.parentNode).find("a"); + } + + // detect which button has been clicked from event delegation + call animate slides and pass direction val + if(buttonClicked.hasClass('campl-previous')){ + carousel.animateSlides('left'); + } + if(buttonClicked.hasClass('campl-next')){ + carousel.animateSlides('right'); + } + e.preventDefault(); + }; + + + //autplay function sets time out which is called repeatedly from the animation completed call back + carousel.startAutoPlay = function(){ + this.slides.queue(function() { + carousel.timer = window.setTimeout(function() { + carousel.animateSlides('right'); + }, 6000); + }) + carousel.slides.dequeue(); + }; + + // stops play for reset purposes + carousel.stopAutoPlay = function(){ + this.autoPlaying = false; + window.clearTimeout(this.timer); + this.slides.queue("fx", []); + }; + + //controls the slide number of the current slide, distance to scroll and animation function with callback + carousel.animateSlides = function(directionToScroll){ + // check to see if gallery is not currently being animated + if(this.slides.filter(':animated').length === 0){ + var endPos = 0; + // get current left position of slides and remove measurement notation + var startPos = parseInt(this.slides.css('left')); + + + if(directionToScroll !== undefined){ + if(directionToScroll === 'left'){ + if(carousel.currentSlide <= 1){ + carousel.currentSlide = carousel.maxSlides; + }else{ + carousel.currentSlide = carousel.currentSlide - 1; + } + endPos = startPos + carousel.carouselContainer.innerWidth(); + }else{ + if(carousel.currentSlide >= carousel.maxSlides){ + carousel.currentSlide = 1; + endPos = 0; + }else{ + carousel.currentSlide = carousel.currentSlide + 1; + } + endPos = startPos - carousel.carouselContainer.innerWidth(); + } + } + + this.slides.animate({left: endPos}, 2500, function(){ + //after carousel has finished moving + if(carousel.currentSlide === carousel.maxSlides){ + carousel.slides.css({left:(-carousel.maxSlides * carousel.carouselContainer.innerWidth())+'px'}); + }else if(carousel.currentSlide === 1){ + //set the position of the slides to be back to the beginning + carousel.slides.css({left: -carousel.carouselContainer.innerWidth()+'px'}); + + } + if(carousel.autoPlaying === true){ + carousel.startAutoPlay(); + } + }); + + } + + } + + + + // Reset carousel + projectlight.resetCarousel = function(){ + + carousel.stopAutoPlay(); + + // need to determine width of carousel, container and slide item depending on screen size + carousel.carouselWidth = carousel.carouselContainer.width(); + + // reset width and position of slides when page is changed + // need to dynamically set width of slides Ul (length of all slides plus the cloned item) and left position (length off each side * currentSlide) + if (carousel.maxSlides > 1) { + carousel.slides.css({'width': (carousel.carouselWidth*(carousel.maxSlides+2))+carousel.carouselWidth+'px', 'left': '-' + (carousel.carouselWidth * carousel.currentSlide)+'px'}); + } + + // reset width and position of slides when page is changed + carousel.slides.children().css({width:carousel.carouselWidth}) + + // calculate lookup position table + carousel.lookupPos = []; + + for(var cc = 0; cc < carousel.maxSlides; cc++){ + carousel.lookupPos.push(-cc * parseInt(carousel.carouselContainer.innerWidth(), 10)); + } + + //carousel.updateControlActivation(); + // carousel.startAutoPlay(); + + } + + projectlight.stopCarousel = function(){ + carousel.stopAutoPlay(); + }; + + projectlight.startCarousel = function(){ + carousel.stopAutoPlay(); + carousel.startAutoPlay(); + }; + + + carousel.init(); + +} + +//only mark external links inside of the main content area as denoted by the campl-skipTo ID +projectlight.markExternalLinks = function(){ + if (jQuery.browser.msie) { + $("#content a[href*='cam.ac.uk']").not(".campl-carousel a[href*='http://']").addClass("campl-external").attr({ + "title": $(this).attr("title")+" (Link to an external website)" + }) + }else{ + $('#content a').not(".campl-carousel a").filter(function(){ + return this.hostname && !this.hostname.match(/cam.ac.uk/gi); + }).addClass("campl-external").attr({ + "title": $(this).attr("title")+" (Link to an external website)" + }) + } +} + + +//DOM ready +$(function() { + + //instantiate all the DOM elements which require javascript rendering + projectlight.init(); + projectlight.initTables(); + projectlight.localNav.init(); + projectlight.markExternalLinks(); + + //remove click event from local nav children selected items + + $(".campl-vertical-breadcrumb-children .campl-selected a").bind("click", function(e){ + e.preventDefault() + }) + + //instantiate calendar + if(document.getElementById('calendar')){ + $("#calendar").Zebra_DatePicker({ + always_visible: $('.calendar-container'), + format: 'dd mm yyyy', + direction: true, + always_show_clear:false, + disabled_dates: ['15 09 2012'] + }); + } + + //Change event for mobile navigation list selector + if(document.getElementById('navigation-select')){ + $("#navigation-select").bind("change", function(e){ + window.location = $(this).val() + }) + } + + + $(".campl-notifications-panel").each(function(){ + var $thisElem = $(this); + $thisElem.append("Close panel"); + $thisElem.find('.campl-close-panel').bind("click", function(e){ + $(e.target).parent().remove(); + e.preventDefault(); + }) + }) + + + //bound click events for twitter bootstrap pills and tab elements + $('#navTabs a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + }) + + $('#navPills a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + }) + + $('#searchTabs a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + }) + + + + //instantiate height of buttons for mobile users, on carousel object + if(document.getElementById('carousel')){ + projectlight.createCarousel(); + //wait for DOM ready to resize buttons for mobile + if(Modernizr.mq('only screen and (max-width: 767px)')){ + $(".campl-carousel-controls a").height($(".image-container").height()) + }else{ + $(".campl-carousel-controls a").attr("style", "") + } + } + + + //resize event handles changing flag layout to determine if user mode is mobile or not + //If the mode has changed the re-rendering or reset functions will be called to change the page layout + projectlight.$window.resize(function() { + + if(document.getElementById('carousel')){ + projectlight.resetCarousel(); + + //truncate homepage carousel content if page is thinner + if(Modernizr.mq('only screen and (min-width: 768px) and (max-width: 1000px)')){ + + //carousel height is remaining as if text isn't being truncated + + projectlight.$slideCaption.each(function(i){ + $(this).text($.trim(projectlight.slideCaptionItems[i]).substring(0, 50).split(" ").slice(0, -1).join(" ") + "...") + }) + + projectlight.$carouselContent.each(function(i){ + $(this).text($.trim(projectlight.carouselContentItems[i]).substring(0, 35).split(" ").slice(0, -1).join(" ") + "...") + }) + }else{ + + projectlight.$slideCaption.each(function(i){ + $(this).text(projectlight.slideCaptionItems[i]); + }) + + projectlight.$carouselContent.each(function(i){ + $(this).text(projectlight.carouselContentItems[i]); + }) + } + + } + + //commented out debugging to help developers see page width during development + //$("#pagewidth").html($(window).width()); + + + //check size of columns on resize event and remove incase of mobile layout + if(Modernizr.mq('only all')){ + //if mobile layout is triggered in media queries + if(Modernizr.mq('only screen and (max-width: 767px)')){ + //if layout moves from desktop to mobile layout + if(!projectlight.mobileLayout){ + //set current state flag + projectlight.mobileLayout = true; + //reset main nav to un-open state + projectlight.$navigationDrawer.removeClass("campl-navigation-open"); + projectlight.$globalNavOuter.removeClass("campl-drawer-open"); + projectlight.$searchDrawer.removeClass("campl-search-open"); + //deselect any previously clicked links + projectlight.$globalNavLI.removeClass("campl-selected"); + + //reset nav menus + projectlight.localNav.resetLocalNavigation(); + projectlight.localNav.hideMenu(); + } + + // if media queries are supported then remove columns on mobile layout + projectlight.removeGlobalNavigationColumnHeight(); + projectlight.removeNavigationColumnHeight(); + projectlight.removeContentColumnHeight(); + projectlight.removeSectionListChildrenColumnHeight(); + projectlight.removeFooterColumnsHeight(); + + //set height of carousel buttons + $(".campl-carousel-controls a").height($(".image-container").height()) + + projectlight.mobileLayout = true; + }else{ //desktop layout code + //if page width moves from mobile layout to desktop + if(projectlight.mobileLayout){ + //set current state flag + projectlight.mobileLayout = false; + + //reset nav menus + //hide dropdowns if open + projectlight.localNav.resetLocalNavigation(); + projectlight.localNav.hideMenu(); + //close global nav drawer + $("body").removeClass("campl-navigation-open"); + } + projectlight.setGlobalNavigationColumnHeight(); + projectlight.setNavigationColumnHeight(); + projectlight.setContentColumnHeight(); + projectlight.setSectionListChildrenColumnHeight(); + projectlight.setFooterColumnsHeight(); + + //remove fixed height on carousel buttons + //set height of carousel buttons + $(".campl-carousel-controls a").attr("style", "") + + projectlight.mobileLayout = false; + } + } + }) + + + +}) + + + + + + + diff --git a/web/javascripts/libs/ios-orientationchange-fix.js b/web/javascripts/libs/ios-orientationchange-fix.js new file mode 100644 index 0000000..84a8113 --- /dev/null +++ b/web/javascripts/libs/ios-orientationchange-fix.js @@ -0,0 +1,56 @@ +/*! A fix for the iOS orientationchange zoom bug. + Script by @scottjehl, rebound by @wilto. + MIT License. +*/ +(function(w){ + + // This fix addresses an iOS bug, so return early if the UA claims it's something else. + var ua = navigator.userAgent; + if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){ + return; + } + + var doc = w.document; + + if( !doc.querySelector ){ return; } + + var meta = doc.querySelector( "meta[name=viewport]" ), + initialContent = meta && meta.getAttribute( "content" ), + disabledZoom = initialContent + ",maximum-scale=1", + enabledZoom = initialContent + ",maximum-scale=10", + enabled = true, + x, y, z, aig; + + if( !meta ){ return; } + + function restoreZoom(){ + meta.setAttribute( "content", enabledZoom ); + enabled = true; + } + + function disableZoom(){ + meta.setAttribute( "content", disabledZoom ); + enabled = false; + } + + function checkTilt( e ){ + aig = e.accelerationIncludingGravity; + x = Math.abs( aig.x ); + y = Math.abs( aig.y ); + z = Math.abs( aig.z ); + + // If portrait orientation and in one of the danger zones + if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ + if( enabled ){ + disableZoom(); + } + } + else if( !enabled ){ + restoreZoom(); + } + } + + w.addEventListener( "orientationchange", restoreZoom, false ); + w.addEventListener( "devicemotion", checkTilt, false ); + +})( this ); \ No newline at end of file diff --git a/web/javascripts/libs/jquery-min.js b/web/javascripts/libs/jquery-min.js new file mode 100644 index 0000000..198b3ff --- /dev/null +++ b/web/javascripts/libs/jquery-min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g
Heading
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+++ +'Tis better to have loved and lost then never to have loved at all. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ William Shakespeare +
+ © 2013 University of Cambridge
+-
+
Code behind this page
-Study at Cambridge
+-
+
About the University
+-
+
Research at Cambridge
+-
+
| t |
