Skip to content

Commit

Permalink
Final: Enhance app functionalities (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Sep 8, 2024
1 parent d12635d commit 5d4618a
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 15 deletions.
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/app/js/actor-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ async function populateActorDetails(actor, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;
movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
6 changes: 5 additions & 1 deletion MovieVerse-Mobile/app/js/company-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,11 @@ function displayCompanyMovies(movies) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
6 changes: 5 additions & 1 deletion MovieVerse-Mobile/app/js/director-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ async function populateDirectorDetails(director, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/app/js/movie-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,10 @@ async function populateMovieDetails(movie, imdbRating, rtRating, metascore, awar

const similarMovieTitle = document.createElement('p');
similarMovieTitle.classList.add('actor-name');
similarMovieTitle.textContent = similarMovie.title;
const titleWords = similarMovie.title.split(' ');
const truncatedTitle = titleWords.length > 5 ? titleWords.slice(0, 5).join(' ') + ' ...' : similarMovie.title;
similarMovieTitle.textContent = truncatedTitle;

similarMovieDetails.appendChild(similarMovieTitle);

similarMovieItem.appendChild(similarMovieDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/app/js/tv-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,10 @@ async function populateTvSeriesDetails(tvSeries, imdbRating, rated) {

const similarTvName = document.createElement('p');
similarTvName.classList.add('similar-tv-name');
similarTvName.textContent = similarTv.name;
const tvNameWords = similarTv.name.split(' ');
const truncatedTvName = tvNameWords.length > 5 ? tvNameWords.slice(0, 5).join(' ') + ' ...' : similarTv.name;
similarTvName.textContent = truncatedTvName;

similarTvDetails.appendChild(similarTvName);

similarTvItem.appendChild(similarTvDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ async function populateActorDetails(actor, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;
movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,11 @@ function displayCompanyMovies(movies) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ async function populateDirectorDetails(director, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,10 @@ async function populateMovieDetails(movie, imdbRating, rtRating, metascore, awar

const similarMovieTitle = document.createElement('p');
similarMovieTitle.classList.add('actor-name');
similarMovieTitle.textContent = similarMovie.title;
const titleWords = similarMovie.title.split(' ');
const truncatedTitle = titleWords.length > 5 ? titleWords.slice(0, 5).join(' ') + ' ...' : similarMovie.title;
similarMovieTitle.textContent = truncatedTitle;

similarMovieDetails.appendChild(similarMovieTitle);

similarMovieItem.appendChild(similarMovieDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/www/MovieVerse-Frontend/js/tv-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,10 @@ async function populateTvSeriesDetails(tvSeries, imdbRating, rated) {

const similarTvName = document.createElement('p');
similarTvName.classList.add('similar-tv-name');
similarTvName.textContent = similarTv.name;
const tvNameWords = similarTv.name.split(' ');
const truncatedTvName = tvNameWords.length > 5 ? tvNameWords.slice(0, 5).join(' ') + ' ...' : similarTv.name;
similarTvName.textContent = truncatedTvName;

similarTvDetails.appendChild(similarTvName);

similarTvItem.appendChild(similarTvDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/www/js/actor-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ async function populateActorDetails(actor, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;
movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
6 changes: 5 additions & 1 deletion MovieVerse-Mobile/www/js/company-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,11 @@ function displayCompanyMovies(movies) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
6 changes: 5 additions & 1 deletion MovieVerse-Mobile/www/js/director-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ async function populateDirectorDetails(director, credits) {

const movieTitle = document.createElement('p');
movieTitle.classList.add('movie-title');
movieTitle.textContent = movie.title;
const movieTitleWords = movie.title.split(' ');
const truncatedMovieTitle = movieTitleWords.length > 5 ? movieTitleWords.slice(0, 5).join(' ') + ' ...' : movie.title;

movieTitle.textContent = truncatedMovieTitle;

movieDetails.appendChild(movieTitle);

movieItem.appendChild(movieDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/www/js/movie-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,10 @@ async function populateMovieDetails(movie, imdbRating, rtRating, metascore, awar

const similarMovieTitle = document.createElement('p');
similarMovieTitle.classList.add('actor-name');
similarMovieTitle.textContent = similarMovie.title;
const titleWords = similarMovie.title.split(' ');
const truncatedTitle = titleWords.length > 5 ? titleWords.slice(0, 5).join(' ') + ' ...' : similarMovie.title;
similarMovieTitle.textContent = truncatedTitle;

similarMovieDetails.appendChild(similarMovieTitle);

similarMovieItem.appendChild(similarMovieDetails);
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/www/js/tv-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,10 @@ async function populateTvSeriesDetails(tvSeries, imdbRating, rated) {

const similarTvName = document.createElement('p');
similarTvName.classList.add('similar-tv-name');
similarTvName.textContent = similarTv.name;
const tvNameWords = similarTv.name.split(' ');
const truncatedTvName = tvNameWords.length > 5 ? tvNameWords.slice(0, 5).join(' ') + ' ...' : similarTv.name;
similarTvName.textContent = truncatedTvName;

similarTvDetails.appendChild(similarTvName);

similarTvItem.appendChild(similarTvDetails);
Expand Down

0 comments on commit 5d4618a

Please sign in to comment.