Skip to content

Commit

Permalink
updates to user review page. still not working
Browse files Browse the repository at this point in the history
  • Loading branch information
nfoster1492 committed Nov 14, 2023
1 parent f8f94fd commit 2338757
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions src/recommenderapp/static/review.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
$(document).ready(function () {

var selectedMovie = ''; // Variable to store the selected movie

$(function () {
$("#searchBox").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
url: "http://localhost:5000/search",
dataType: "json",
cache: false,
data: {
q: request.term,
},
success: function (data) {
response(data);
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(textStatus + " " + errorThrown);
},
});
},
select: function (event, ui) {
// Clear the previous selection
$("#selectedMovies").empty();
selectedMovie = ui.item.value;
// Append the new selection
var li = $("<li class='list-group-item'/>").text(selectedMovie);
$("#selectedMovies").append(li);
$("#searchBox").val("");
return false;
},
minLength: 1,
});
});

})
4 changes: 2 additions & 2 deletions src/recommenderapp/templates/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='stylesheet.css') }}">
<title>PopcornPicks</title>
<link rel="icon" href="{{ url_for('static', filename='Popcorn-icon.png') }}" />
<script src="{{ url_for('static', filename='script.js') }}"></script>
<script src="{{ url_for('static', filename='review.js') }}"></script>
<meta charset="utf-8" />
<meta name="viewport" content="width device-width, initial-scale=1" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
Expand Down Expand Up @@ -172,5 +172,5 @@

<script src="https://code.jquery.com/jquery-3.5.1.min.js" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" crossorigin="anonymous"></script>
<script src="{{ url_for('static', filename='script.js') }}"></script>
<script src="{{ url_for('static', filename='review.js') }}"></script>
</html>

0 comments on commit 2338757

Please sign in to comment.