Le serveur gitlab sera inaccessible le mercredi 19 février 2020 de 13h à 14h pour une intervention de maintenance programmée.

Commit 98989d24 authored by Benzakein Jeremy's avatar Benzakein Jeremy

ready for rapport

parent 0f55b797
......@@ -14,7 +14,7 @@
<body>
<nav class="navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="#" aria-disabled="true">Star Peolpe</a>
<a class="navbar-brand" href="#" aria-disabled="true">StarPeolpe</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample02"
aria-controls="navbarsExample02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
......@@ -27,7 +27,7 @@
<li class="nav-item">
<a class="nav-link" href="people.html">Les Personnages</a>
</li>
<li>
<li class="nav-item">
<a class="nav-link" href="rapport.html">Le Rapport</a>
</li>
<li class="nav-item">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"
integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="index.html">StarPeople</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample02"
aria-controls="navbarsExample02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExample02">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="people.html">Les Personnages</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Le Rapport</a>
</li>
<li class="nav-item">
<a class="nav-link" href="test.html">Test Bing Image API</a>
</li>
</ul>
</div>
</nav>
<div class="jumbotron jumbotron-fluid bg-warning custom-jumbo">
<h1 class="display-3">Rapport</h1>
<hr>
<div class="rapportBody">
Le rapport est a rédiger ici.
</div>
<div id="imgContainer"></div>
</div>
<p class="foot">&#169; Copyrights 2019, StarPeople, Jeremy Benzakein & Raphaël Kern, CentraleSupelec, Gif-sur-Yvette
</p>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
</script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="test.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -24,21 +24,28 @@
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="test.html">Test</a>
<li class="nav-item">
<a class="nav-link" href="people.html">Les Personnages</a>
</li>
<li class="nav-item">
<a class="nav-link" href="people.html">People</a>
<a class="nav-link" href="rapport.html">Le Rapport</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Test Bing Image API</a>
</li>
</ul>
</div>
</nav>
<div class="jumbotron jumbotron-fluid bg-warning custom-jumbo">
<h1 class="display-3">Page pour tester l'API Bing Image Search</h1>
<h3>Page pour tester l'API Bing Image Search</h3>
<hr>
<p class="lead">
<input type="text" id="searchQuery"></input>
<a class="btn btn-primary btn-lg" href="#" role="button" id="getImage">Go</a>
Entrer un terme dans la barre de recherche et une image de l'API Bing Image Search s'affiche.
</p>
<hr>
<input type="text" id="searchQuery"></input>
<a class="btn btn-primary btn-lg" href="#" role="button" id="getImage">Go</a>
<div id="imgContainer"></div>
</div>
<p class="foot">&#169; Copyrights 2019, StarPeople, Jeremy Benzakein & Raphaël Kern, CentraleSupelec, Gif-sur-Yvette
......
/*jshint esversion: 8*/
$('#getImage').click(function (e) {
$('#imgContainer').text("");
e.preventDefault();
let searchTerm = removeAccents($('#searchQuery').val());
$.get("/getPortrait/" + searchTerm, resultImgUrl => {
let img = $('<img id="portrait">'); //Equivalent: $(document.createElement('img'))
let img = $('img');
img.attr('id', imageResult);
img.attr('src', resultImgUrl);
img.attr('width', '100%');
img.appendTo('#imgContainer');
});
});
$('#searchQuery').keypress(function (e) {
//Trigger the search if user pressed the "Enter" key
if(e.charcode == "13") $('#getImage').click();
});
function removeAccents(str) {
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment