diff --git a/public/global/movies/script.js b/public/global/movies/script.js deleted file mode 100644 index 040d9fd..0000000 --- a/public/global/movies/script.js +++ /dev/null @@ -1,97 +0,0 @@ - -document.addEventListener('DOMContentLoaded', async () => { - await loadmovie(); -}); - -async function loadmovie() { - fetch("/api/movies") - .then(response => response.json()) - .then(data => { rendermovie(data); }); -} - -function splitByTitle(movies) { - result = movies.reduce(function (r, a) { - var letter = a.title[0].toUpperCase(); - r[letter] = r[letter] || []; - r[letter].push(a); - return r; - }, Object.create(null)); - - return result; -} - -function splitByDate(movies) { - result = movies.reduce(function (r, a) { - var year = new Date(a.released).getFullYear(); - r[year] = r[year] || []; - r[year].push(a); - return r; - }, Object.create(null)); - - return result; -} - -function createMElement(movie) { - var row = document.createElement("div"); - row.className = "col"; - - row.innerHTML = "
"+ movie.released + "
" + - // ""+ movie.genre + "
" + - "