diff --git a/MovieVerse-Mobile/app/js/actor-details.js b/MovieVerse-Mobile/app/js/actor-details.js index 7e2fc096..2128c1aa 100644 --- a/MovieVerse-Mobile/app/js/actor-details.js +++ b/MovieVerse-Mobile/app/js/actor-details.js @@ -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); diff --git a/MovieVerse-Mobile/app/js/company-details.js b/MovieVerse-Mobile/app/js/company-details.js index 88177a0c..e8ea0cac 100644 --- a/MovieVerse-Mobile/app/js/company-details.js +++ b/MovieVerse-Mobile/app/js/company-details.js @@ -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); diff --git a/MovieVerse-Mobile/app/js/director-details.js b/MovieVerse-Mobile/app/js/director-details.js index 098a5066..f7e7c792 100644 --- a/MovieVerse-Mobile/app/js/director-details.js +++ b/MovieVerse-Mobile/app/js/director-details.js @@ -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); diff --git a/MovieVerse-Mobile/app/js/movie-details.js b/MovieVerse-Mobile/app/js/movie-details.js index b366aebe..358b9d7c 100644 --- a/MovieVerse-Mobile/app/js/movie-details.js +++ b/MovieVerse-Mobile/app/js/movie-details.js @@ -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); diff --git a/MovieVerse-Mobile/app/js/tv-details.js b/MovieVerse-Mobile/app/js/tv-details.js index c5652bf1..78b47ba6 100644 --- a/MovieVerse-Mobile/app/js/tv-details.js +++ b/MovieVerse-Mobile/app/js/tv-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/actor-details.js b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/actor-details.js index 7e2fc096..2128c1aa 100644 --- a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/actor-details.js +++ b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/actor-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/company-details.js b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/company-details.js index 88177a0c..e8ea0cac 100644 --- a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/company-details.js +++ b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/company-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/director-details.js b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/director-details.js index 098a5066..f7e7c792 100644 --- a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/director-details.js +++ b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/director-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/movie-details.js b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/movie-details.js index b366aebe..358b9d7c 100644 --- a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/movie-details.js +++ b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/movie-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/tv-details.js b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/tv-details.js index c5652bf1..78b47ba6 100644 --- a/MovieVerse-Mobile/www/MovieVerse-Frontend/js/tv-details.js +++ b/MovieVerse-Mobile/www/MovieVerse-Frontend/js/tv-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/js/actor-details.js b/MovieVerse-Mobile/www/js/actor-details.js index 7e2fc096..2128c1aa 100644 --- a/MovieVerse-Mobile/www/js/actor-details.js +++ b/MovieVerse-Mobile/www/js/actor-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/js/company-details.js b/MovieVerse-Mobile/www/js/company-details.js index 88177a0c..e8ea0cac 100644 --- a/MovieVerse-Mobile/www/js/company-details.js +++ b/MovieVerse-Mobile/www/js/company-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/js/director-details.js b/MovieVerse-Mobile/www/js/director-details.js index 098a5066..f7e7c792 100644 --- a/MovieVerse-Mobile/www/js/director-details.js +++ b/MovieVerse-Mobile/www/js/director-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/js/movie-details.js b/MovieVerse-Mobile/www/js/movie-details.js index b366aebe..358b9d7c 100644 --- a/MovieVerse-Mobile/www/js/movie-details.js +++ b/MovieVerse-Mobile/www/js/movie-details.js @@ -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); diff --git a/MovieVerse-Mobile/www/js/tv-details.js b/MovieVerse-Mobile/www/js/tv-details.js index c5652bf1..78b47ba6 100644 --- a/MovieVerse-Mobile/www/js/tv-details.js +++ b/MovieVerse-Mobile/www/js/tv-details.js @@ -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);