Commit 8cea2eb900da0f812c3fb191844aaaef532b6d06
1 parent
367056d9
Beautifier passe
Testing with my new editor. Doesn't work for PHP nor HTML :'(
Showing
4 changed files
with
180 additions
and
204 deletions
Show diff stats
css/crep.css
1 | -body | ||
2 | -{ | ||
3 | - background: #C5C5ED url('../img/mainBgPattern.png'); | ||
4 | - overflow-y: scroll; | 1 | +body { |
2 | + background: #C5C5ED url('../img/mainBgPattern.png'); | ||
3 | + overflow-y: scroll; | ||
5 | } | 4 | } |
6 | 5 | ||
7 | -.navbar-lower | ||
8 | -{ | ||
9 | - margin-top: 50px; | ||
10 | - width: 100%; | 6 | +.navbar-lower { |
7 | + margin-top: 50px; | ||
8 | + width: 100%; | ||
11 | } | 9 | } |
12 | 10 | ||
13 | -.panel-default | ||
14 | -{ | ||
15 | - border-color: #89B3D1; | 11 | +.panel-default { |
12 | + border-color: #89B3D1; | ||
16 | } | 13 | } |
17 | 14 | ||
18 | -.panel | ||
19 | -{ | ||
20 | - background-color: #749BD1; | 15 | +.panel { |
16 | + background-color: #749BD1; | ||
21 | } | 17 | } |
22 | 18 | ||
23 | -.panel-default > .panel-heading | ||
24 | -{ | ||
25 | - background-color: #89B3D1; | ||
26 | - border-color: #89B3D1; | 19 | +.panel-default > .panel-heading { |
20 | + background-color: #89B3D1; | ||
21 | + border-color: #89B3D1; | ||
27 | } | 22 | } |
28 | 23 | ||
29 | -.panel-footer | ||
30 | -{ | ||
31 | - background-color: #89B3D1; | ||
32 | - border-color: #89B3D1; | 24 | +.panel-footer { |
25 | + background-color: #89B3D1; | ||
26 | + border-color: #89B3D1; | ||
33 | } | 27 | } |
34 | 28 | ||
35 | -.navbar-default .navbar-brand | ||
36 | -{ | ||
37 | - color: #FFF; | ||
38 | - font-family: brandFont; | ||
39 | - font-size: 30px; | 29 | +.navbar-default .navbar-brand { |
30 | + color: #FFF; | ||
31 | + font-family: brandFont; | ||
32 | + font-size: 30px; | ||
40 | } | 33 | } |
41 | 34 | ||
42 | -.navbar-default .navbar-nav > li > a | ||
43 | -{ | ||
44 | - color: #CCC; | ||
45 | - font-family: linkFont; | 35 | +.navbar-default .navbar-nav > li > a { |
36 | + color: #CCC; | ||
37 | + font-family: linkFont; | ||
46 | } | 38 | } |
47 | 39 | ||
48 | -.navbar-default .navbar-toggle .icon-bar | ||
49 | -{ | ||
50 | - background-color: #fff; | 40 | +.navbar-default .navbar-toggle .icon-bar { |
41 | + background-color: #fff; | ||
51 | } | 42 | } |
52 | 43 | ||
53 | -.navbar-default | ||
54 | -{ | ||
55 | - background-color: #749BD1; | ||
56 | - border-color: #5276A8; | 44 | +.navbar-default { |
45 | + background-color: #749BD1; | ||
46 | + border-color: #5276A8; | ||
57 | } | 47 | } |
58 | 48 | ||
59 | -@font-face | ||
60 | -{ | ||
61 | - font-family: brandFont; | ||
62 | - src: url(../fonts/robotech-gp.ttf); | 49 | +@font-face { |
50 | + font-family: brandFont; | ||
51 | + src: url(../fonts/robotech-gp.ttf); | ||
63 | } | 52 | } |
64 | 53 | ||
65 | -@font-face | ||
66 | -{ | ||
67 | - font-family: linkFont; | ||
68 | - src: url(../fonts/robotaur.ttf); | 54 | +@font-face { |
55 | + font-family: linkFont; | ||
56 | + src: url(../fonts/robotaur.ttf); | ||
69 | } | 57 | } |
70 | 58 | ||
71 | -#mainContainer | ||
72 | -{ | ||
73 | - overflow-x: auto; | 59 | +#mainContainer { |
60 | + overflow-x: auto; | ||
74 | } | 61 | } |
75 | 62 | ||
76 | -.carousel-inner > .item > img, .carousel-inner > .item > a > img | ||
77 | -{ | ||
78 | - max-height: 600px; | 63 | +.carousel-inner > .item > img, .carousel-inner > .item > a > img { |
64 | + max-height: 600px; | ||
79 | } | 65 | } |
80 | 66 | ||
81 | -.jumbotron, #map-canvas | ||
82 | -{ | ||
83 | - margin: 30px inherit; | 67 | +.jumbotron, #map-canvas { |
68 | + margin: 30px inherit; | ||
84 | } | 69 | } |
85 | 70 | ||
86 | -.jumbotron | ||
87 | -{ | ||
88 | - padding: 30px; | 71 | +.jumbotron { |
72 | + padding: 30px; | ||
89 | } | 73 | } |
90 | 74 | ||
91 | -#description img | ||
92 | -{ | ||
93 | - float:left; | ||
94 | - width:200px; | ||
95 | - height:200px; | ||
96 | - margin-right:10px; | 75 | +#description img { |
76 | + float: left; | ||
77 | + width: 200px; | ||
78 | + height: 200px; | ||
79 | + margin-right: 10px; | ||
97 | } | 80 | } |
98 | 81 | ||
99 | -video | ||
100 | -{ | ||
101 | - max-width: 100%; | 82 | +video { |
83 | + max-width: 100%; | ||
102 | } | 84 | } |
103 | 85 | ||
104 | -#map-canvas | ||
105 | -{ | ||
106 | - width: 100%; | ||
107 | - height: 400px; | 86 | +#map-canvas { |
87 | + width: 100%; | ||
88 | + height: 400px; | ||
108 | } | 89 | } |
109 | 90 | ||
110 | -#map-canvas img | ||
111 | -{ | ||
112 | - max-height: 400px; | ||
113 | - max-width: 100%; | 91 | +#map-canvas img { |
92 | + max-height: 400px; | ||
93 | + max-width: 100%; | ||
114 | } | 94 | } |
115 | 95 | ||
116 | -#footer | ||
117 | -{ | ||
118 | - | ||
119 | - margin-top: 30px; | ||
120 | - margin-bottom: 30px; | 96 | +#footer { |
97 | + margin-top: 30px; | ||
98 | + margin-bottom: 30px; | ||
121 | } | 99 | } |
122 | 100 | ||
123 | -#footer img, .logo | ||
124 | -{ | ||
125 | - max-height: 100px; | ||
126 | - max-width: 100%; | 101 | +#footer img, .logo { |
102 | + max-height: 100px; | ||
103 | + max-width: 100%; | ||
127 | } | 104 | } |
js/crep.js
1 | function removeAfter(string, pattern) { | 1 | function removeAfter(string, pattern) { |
2 | - var n = string.indexOf(pattern); | ||
3 | - return string.substring(0, n != -1 ? n : string.length); | 2 | + var n = string.indexOf(pattern); |
3 | + return string.substring(0, n != -1 ? n : string.length); | ||
4 | } | 4 | } |
5 | 5 | ||
6 | function pageName(href) { | 6 | function pageName(href) { |
7 | - if (href.indexOf(window.location.host) >= 0) { | ||
8 | - href = removeAfter(removeAfter(href, '?'), '#') | ||
9 | - hrefE = href.split('/') | ||
10 | - return hrefE[hrefE.length - 1] | ||
11 | - } | ||
12 | - return false | 7 | + if (href.indexOf(window.location.host) >= 0) { |
8 | + href = removeAfter(removeAfter(href, '?'), '#'); | ||
9 | + hrefE = href.split('/'); | ||
10 | + return hrefE[hrefE.length - 1]; | ||
11 | + } | ||
12 | + return false; | ||
13 | } | 13 | } |
14 | 14 | ||
15 | function updateScrollData() { | 15 | function updateScrollData() { |
16 | - history.state.scrollTop = $(document.body).scrollTop() | ||
17 | - history.replaceState(history.state) | 16 | + history.state.scrollTop = $(document.body).scrollTop(); |
17 | + history.replaceState(history.state); | ||
18 | } | 18 | } |
19 | 19 | ||
20 | function pageSpecific(location) { | 20 | function pageSpecific(location) { |
21 | - if (pageName(location) == 'contact') { | ||
22 | - initializeMap() | ||
23 | - } | ||
24 | - $(document).scroll(updateScrollData) | 21 | + if (pageName(location) == 'contact') { |
22 | + initializeMap(); | ||
23 | + } | ||
24 | + $(document).scroll(updateScrollData); | ||
25 | } | 25 | } |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | function actLink(ev) { | 29 | function actLink(ev) { |
30 | - var location = ev.currentTarget.href | ||
31 | - var page = pageName(location) | ||
32 | - if (page && page != pageName(window.location.href)) { | ||
33 | - loadDoc(location, function () { | ||
34 | - history.pushState({ | ||
35 | - loc: location | ||
36 | - }, document.title, location) | ||
37 | - }) | ||
38 | - return false | ||
39 | - } | 30 | + var location = ev.currentTarget.href; |
31 | + var page = pageName(location); | ||
32 | + if (page && page != pageName(window.location.href)) { | ||
33 | + loadDoc(location, function() { | ||
34 | + history.pushState({ | ||
35 | + loc: location | ||
36 | + }, document.title, location); | ||
37 | + }); | ||
38 | + return false; | ||
39 | + } | ||
40 | } | 40 | } |
41 | 41 | ||
42 | function dynamiseLinks(el) { | 42 | function dynamiseLinks(el) { |
43 | - $("a", el).click(actLink) | 43 | + $("a", el).click(actLink); |
44 | } | 44 | } |
45 | 45 | ||
46 | function loadDoc(location, callback) { | 46 | function loadDoc(location, callback) { |
47 | - if (!callback) { | ||
48 | - callback = function () { | ||
49 | - return undefined | ||
50 | - } | ||
51 | - } | ||
52 | - var eventsLeft = 2 | ||
53 | - var html = '' | ||
54 | - var mainContainer = $("#mainContainer") | ||
55 | - var oldHeight = mainContainer.height() | 47 | + if (!callback) { |
48 | + callback = function() { | ||
49 | + return undefined; | ||
50 | + }; | ||
51 | + } | ||
52 | + var eventsLeft = 2; | ||
53 | + var html = ''; | ||
54 | + var mainContainer = $("#mainContainer"); | ||
55 | + var oldHeight = mainContainer.height(); | ||
56 | 56 | ||
57 | - function events() { | ||
58 | - eventsLeft += -1 | ||
59 | - if (eventsLeft <= 0) { | ||
60 | - // In | ||
61 | - // Calculations | ||
62 | - mainContainer.html(html) | ||
63 | - mainContainer.height('auto') | ||
64 | - newHeight = mainContainer.height() | ||
65 | - mainContainer.height(oldHeight) | ||
66 | - // Transition | ||
67 | - mainContainer.animate({ | ||
68 | - height: newHeight, | ||
69 | - opacity: 1, | ||
70 | - }, 'fast', function () { | ||
71 | - mainContainer.height('auto') | ||
72 | - dynamiseLinks(mainContainer) | ||
73 | - pageSpecific(location) | ||
74 | - callback() | ||
75 | - }) | ||
76 | - } | 57 | + function events() { |
58 | + eventsLeft += -1; | ||
59 | + if (eventsLeft <= 0) { | ||
60 | + // In | ||
61 | + // Calculations | ||
62 | + mainContainer.html(html); | ||
63 | + mainContainer.height('auto'); | ||
64 | + newHeight = mainContainer.height(); | ||
65 | + mainContainer.height(oldHeight); | ||
66 | + // Transition | ||
67 | + mainContainer.animate({ | ||
68 | + height: newHeight, | ||
69 | + opacity: 1, | ||
70 | + }, 'fast', function() { | ||
71 | + mainContainer.height('auto'); | ||
72 | + dynamiseLinks(mainContainer); | ||
73 | + pageSpecific(location); | ||
74 | + callback(); | ||
75 | + }); | ||
76 | + } | ||
77 | } | 77 | } |
78 | // Out | 78 | // Out |
79 | - $(document).off('scroll', updateScrollData) | ||
80 | - $(document.body).animate({ | ||
81 | - scrollTop: $('.navbar-lower').height() | ||
82 | - }, 'fast') | ||
83 | - $.get(location + '?c', function (data) { | ||
84 | - html = data | ||
85 | - events() | ||
86 | - }) | ||
87 | - mainContainer.height(oldHeight) | ||
88 | - mainContainer.animate({ | ||
89 | - opacity: 0 | ||
90 | - }, 'fast', events) | 79 | + $(document).off('scroll', updateScrollData); |
80 | + $(document.body).animate({ | ||
81 | + scrollTop: $('.navbar-lower').height() | ||
82 | + }, 'fast'); | ||
83 | + $.get(location + '?c', function(data) { | ||
84 | + html = data; | ||
85 | + events(); | ||
86 | + }); | ||
87 | + mainContainer.height(oldHeight); | ||
88 | + mainContainer.animate({ | ||
89 | + opacity: 0 | ||
90 | + }, 'fast', events); | ||
91 | } | 91 | } |
92 | 92 | ||
93 | function historyChange(ev) { | 93 | function historyChange(ev) { |
94 | - loadDoc(ev.state.loc, function () { | ||
95 | - if (ev.state.scrollTop > $('.navbar-lower').height()) { | ||
96 | - $(document.body).animate({ | ||
97 | - scrollTop: ev.state.scrollTop | ||
98 | - }, 'fast') | ||
99 | - } | ||
100 | - }) | 94 | + loadDoc(ev.state.loc, function() { |
95 | + if (ev.state.scrollTop > $('.navbar-lower').height()) { | ||
96 | + $(document.body).animate({ | ||
97 | + scrollTop: ev.state.scrollTop | ||
98 | + }, 'fast'); | ||
99 | + } | ||
100 | + }); | ||
101 | } | 101 | } |
102 | 102 | ||
103 | -$(document).ready(function () { | ||
104 | - dynamiseLinks(document.body) | ||
105 | - var current = window.location.href | ||
106 | - pageSpecific(current) | ||
107 | - history.replaceState({ | ||
108 | - loc: current | ||
109 | - }, document.title, current) | ||
110 | - window.onpopstate = historyChange | ||
111 | - $('.navbar-fixed-top .navbar-toggle').click(function () { | ||
112 | - $(document.body).animate({ | ||
113 | - scrollTop: 0 | ||
114 | - }) | ||
115 | - }) | ||
116 | -}) | 103 | +$(document).ready(function() { |
104 | + dynamiseLinks(document.body); | ||
105 | + var current = window.location.href; | ||
106 | + pageSpecific(current); | ||
107 | + history.replaceState({ | ||
108 | + loc: current | ||
109 | + }, document.title, current); | ||
110 | + window.onpopstate = historyChange; | ||
111 | + $('.navbar-fixed-top .navbar-toggle').click(function() { | ||
112 | + $(document.body).animate({ | ||
113 | + scrollTop: 0 | ||
114 | + }); | ||
115 | + }); | ||
116 | +}); | ||
117 | 117 | ||
118 | function initializeMap() { | 118 | function initializeMap() { |
119 | - var mapCanvas = document.getElementById('map-canvas'); | ||
120 | - mapCanvas.innerHTML = '' | ||
121 | - var polytechPos = new google.maps.LatLng(50.6074998, 3.1373338); | ||
122 | - var mapOptions = { | ||
123 | - center: polytechPos, | ||
124 | - zoom: 16, | ||
125 | - mapTypeId: google.maps.MapTypeId.ROADMAP | ||
126 | - } | ||
127 | - var map = new google.maps.Map(mapCanvas, mapOptions) | ||
128 | - var marker = new google.maps.Marker({ | ||
129 | - place: { | ||
130 | - location: polytechPos, | ||
131 | - query: "Polytech Lille" | ||
132 | - }, | ||
133 | - attribution: { | ||
134 | - source: "Coupe de Robotique des Écoles Primaires", | ||
135 | - webUrl: window.location.host | ||
136 | - }, | ||
137 | - map: map, | ||
138 | - title: "Polytech Lille" | ||
139 | - }) | ||
140 | - var infowindow = new google.maps.InfoWindow({ | ||
141 | - content: "<strong>Polytech Lille</strong><br/>Lieux des évènements de la Coupe de Robotique des Écoles Primaires" | ||
142 | - }) | ||
143 | - marker.addListener('click', function () { | ||
144 | - infowindow.open(map, this) | ||
145 | - }) | ||
146 | -} | ||
147 | \ No newline at end of file | 119 | \ No newline at end of file |
120 | + var mapCanvas = document.getElementById('map-canvas'); | ||
121 | + mapCanvas.innerHTML = ''; | ||
122 | + var polytechPos = new google.maps.LatLng(50.6074998, 3.1373338); | ||
123 | + var mapOptions = { | ||
124 | + center: polytechPos, | ||
125 | + zoom: 16, | ||
126 | + mapTypeId: google.maps.MapTypeId.ROADMAP | ||
127 | + }; | ||
128 | + var map = new google.maps.Map(mapCanvas, mapOptions); | ||
129 | + var marker = new google.maps.Marker({ | ||
130 | + place: { | ||
131 | + location: polytechPos, | ||
132 | + query: "Polytech Lille" | ||
133 | + }, | ||
134 | + attribution: { | ||
135 | + source: "Coupe de Robotique des Écoles Primaires", | ||
136 | + webUrl: window.location.host | ||
137 | + }, | ||
138 | + map: map, | ||
139 | + title: "Polytech Lille" | ||
140 | + }); | ||
141 | + var infowindow = new google.maps.InfoWindow({ | ||
142 | + content: "<strong>Polytech Lille</strong><br/>Lieux des évènements de la Coupe de Robotique des Écoles Primaires" | ||
143 | + }); | ||
144 | + marker.addListener('click', function() { | ||
145 | + infowindow.open(map, this); | ||
146 | + }); | ||
147 | +} |
pages/contact.php
@@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
7 | <p><span class="glyphicon glyphicon-map-marker"></span> Polytech Lille</p> | 7 | <p><span class="glyphicon glyphicon-map-marker"></span> Polytech Lille</p> |
8 | <p>2, Bd Langevin</p> | 8 | <p>2, Bd Langevin</p> |
9 | <p>59655 Villeneuve d'Ascq Cedex</p> | 9 | <p>59655 Villeneuve d'Ascq Cedex</p> |
10 | - | ||
11 | </div> | 10 | </div> |
12 | 11 | ||
13 | <div id="map-canvas"> | 12 | <div id="map-canvas"> |
pages/schools.php
@@ -3,13 +3,13 @@ | @@ -3,13 +3,13 @@ | ||
3 | require_once ("creds.php"); | 3 | require_once ("creds.php"); |
4 | 4 | ||
5 | try { | 5 | try { |
6 | - | 6 | + |
7 | $link = @mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__); | 7 | $link = @mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__); |
8 | 8 | ||
9 | if (!$link) { | 9 | if (!$link) { |
10 | throw new Exception('Impossible de se connecter : ' . mysql_error()); | 10 | throw new Exception('Impossible de se connecter : ' . mysql_error()); |
11 | } | 11 | } |
12 | - | 12 | + |
13 | if (!mysql_select_db('crep', $link)) { | 13 | if (!mysql_select_db('crep', $link)) { |
14 | throw new Exception('Selection de la base de donnees impossible'); | 14 | throw new Exception('Selection de la base de donnees impossible'); |
15 | } | 15 | } |
@@ -29,7 +29,7 @@ try { | @@ -29,7 +29,7 @@ try { | ||
29 | <table class="table table-striped table-responsive table-bordered"> | 29 | <table class="table table-striped table-responsive table-bordered"> |
30 | <div class="panel_heading"> | 30 | <div class="panel_heading"> |
31 | <thead> | 31 | <thead> |
32 | - <tr> | 32 | + <tr> |
33 | <th>Nom de l'école</th> | 33 | <th>Nom de l'école</th> |
34 | <th>Circonscription</th> | 34 | <th>Circonscription</th> |
35 | <th>Adresse</th> | 35 | <th>Adresse</th> |
@@ -39,7 +39,7 @@ try { | @@ -39,7 +39,7 @@ try { | ||
39 | </div > | 39 | </div > |
40 | <tbody> | 40 | <tbody> |
41 | <?php | 41 | <?php |
42 | - | 42 | + |
43 | while ($row = mysql_fetch_assoc($resultat)) { | 43 | while ($row = mysql_fetch_assoc($resultat)) { |
44 | echo '<tr>'; | 44 | echo '<tr>'; |
45 | echo '<td>'; | 45 | echo '<td>'; |