diff --git a/index.php b/index.php index d6e43e0..3564bad 100755 --- a/index.php +++ b/index.php @@ -22,9 +22,6 @@ if (!file_exists($toLoad)) { header('Status: 200 OK'); // FastCGI fix } -if (isset($_GET['c'])) { - require_once("$toLoad"); -} else { ?> @@ -42,8 +39,6 @@ if (isset($_GET['c'])) { - - @@ -52,7 +47,7 @@ if (isset($_GET['c'])) {
-
@@ -63,5 +58,4 @@ if (isset($_GET['c'])) { diff --git a/js/contact.js b/js/contact.js new file mode 100755 index 0000000..df02cb6 --- /dev/null +++ b/js/contact.js @@ -0,0 +1,45 @@ +$(document).ready(function() { +// enhance tel-links (from http://stackoverflow.com/a/18921965/2766106) +$("a[href^='tel:']").each(function () { + var target = "call-" + this.href.replace(/[^a-z0-9]*/gi, ""); + var link = this; + + // load in iframe to supress potential errors when protocol is not available + $("body").append(""); + link.target = target; + + // replace tel with callto on desktop browsers for skype fallback + if (!navigator.userAgent.match(/(mobile)/gi)) { + link.href = link.href.replace(/^tel:/, "callto:"); + } +}); + + // Carte + var mapCanvas = document.getElementById('map-canvas'); + mapCanvas.innerHTML = ''; + var polytechPos = new google.maps.LatLng(50.6074998, 3.1373338); + var mapOptions = { + center: polytechPos, + zoom: 16, + mapTypeId: google.maps.MapTypeId.ROADMAP + }; + var map = new google.maps.Map(mapCanvas, mapOptions); + var marker = new google.maps.Marker({ + place: { + location: polytechPos, + query: "Polytech Lille" + }, + attribution: { + source: "Coupe de Robotique des Écoles Primaires", + webUrl: window.location.host + }, + map: map, + title: "Polytech Lille" + }); + var infowindow = new google.maps.InfoWindow({ + content: "Polytech Lille
Lieux des évènements de la Coupe de Robotique des Écoles Primaires" + }); + marker.addListener('click', function () { + infowindow.open(map, this); + }); +}); diff --git a/js/crep.js b/js/crep.js deleted file mode 100755 index f0ff1c5..0000000 --- a/js/crep.js +++ /dev/null @@ -1,161 +0,0 @@ -function removeAfter(string, pattern) { - var n = string.indexOf(pattern); - return string.substring(0, n != -1 ? n : string.length); -} - -function pageName(href) { - if (href.indexOf(window.location.host) >= 0) { - href = removeAfter(removeAfter(href, '?'), '#'); - hrefE = href.split('/'); - return hrefE[hrefE.length - 1]; - } - return false; -} - -function updateScrollData() { - history.state.scrollTop = $(document.body).scrollTop(); - history.replaceState(history.state); -} - -function pageSpecific(location) { - if (pageName(location) == 'contact') { - initializeMap(); - - // enhance tel-links (from http://stackoverflow.com/a/18921965/2766106) - $("a[href^='tel:']").each(function () { - var target = "call-" + this.href.replace(/[^a-z0-9]*/gi, ""); - var link = this; - - // load in iframe to supress potential errors when protocol is not available - $("body").append(""); - link.target = target; - - // replace tel with callto on desktop browsers for skype fallback - if (!navigator.userAgent.match(/(mobile)/gi)) { - link.href = link.href.replace(/^tel:/, "callto:"); - } - }); - } - $(document).scroll(updateScrollData); -} - - - -function actLink(ev) { - var location = ev.currentTarget.href; - var page = pageName(location); - if (page && page != pageName(window.location.href)) { - loadDoc(location, function () { - history.pushState({ - loc: location - }, document.title, location); - }); - return false; - } -} - -function dynamiseLinks(el) { - $("a", el).click(actLink); -} - -function loadDoc(location, callback) { - if (!callback) { - callback = function () { - return undefined; - }; - } - var eventsLeft = 2; - var html = ''; - var mainContainer = $("#mainContainer"); - var oldHeight = mainContainer.height(); - - function events() { - eventsLeft += -1; - if (eventsLeft <= 0) { - // In - // Calculations - mainContainer.html(html); - mainContainer.height('auto'); - newHeight = mainContainer.height(); - mainContainer.height(oldHeight); - // Transition - mainContainer.animate({ - height: newHeight, - opacity: 1, - }, 'fast', function () { - mainContainer.height('auto'); - dynamiseLinks(mainContainer); - pageSpecific(location); - callback(); - }); - } - } - // Out - $(document).off('scroll', updateScrollData); - $(document.body).animate({ - scrollTop: $('.navbar-lower').height() - }, 'fast'); - $.get('pages/' + pageName(location) + '.php', function (data) { - html = data; - events(); - }); - mainContainer.height(oldHeight); - mainContainer.animate({ - opacity: 0 - }, 'fast', events); -} - -function historyChange(ev) { - loadDoc(ev.state.loc, function () { - if (ev.state.scrollTop > $('.navbar-lower').height()) { - $(document.body).animate({ - scrollTop: ev.state.scrollTop - }, 'fast'); - } - }); -} - -$(document).ready(function () { - dynamiseLinks(document.body); - var current = window.location.href; - pageSpecific(current); - history.replaceState({ - loc: current - }, document.title, current); - window.onpopstate = historyChange; - $('.navbar-fixed-top .navbar-toggle').click(function () { - $(document.body).animate({ - scrollTop: 0 - }); - }); -}); - -function initializeMap() { - var mapCanvas = document.getElementById('map-canvas'); - mapCanvas.innerHTML = ''; - var polytechPos = new google.maps.LatLng(50.6074998, 3.1373338); - var mapOptions = { - center: polytechPos, - zoom: 16, - mapTypeId: google.maps.MapTypeId.ROADMAP - }; - var map = new google.maps.Map(mapCanvas, mapOptions); - var marker = new google.maps.Marker({ - place: { - location: polytechPos, - query: "Polytech Lille" - }, - attribution: { - source: "Coupe de Robotique des Écoles Primaires", - webUrl: window.location.host - }, - map: map, - title: "Polytech Lille" - }); - var infowindow = new google.maps.InfoWindow({ - content: "Polytech Lille
Lieux des évènements de la Coupe de Robotique des Écoles Primaires" - }); - marker.addListener('click', function () { - infowindow.open(map, this); - }); -} diff --git a/pages/contact.php b/pages/contact.php index 3484e70..8442406 100755 --- a/pages/contact.php +++ b/pages/contact.php @@ -21,3 +21,5 @@
+ + diff --git a/pages/description.php b/pages/description.php index c0ca9e9..23d8fbc 100755 --- a/pages/description.php +++ b/pages/description.php @@ -1,4 +1,4 @@ -v class="container" id="description"> +

Descriptif détaillé

-- libgit2 0.21.2