function generateMenu(availableOptions) { function createPhotoName(photo) { if (photo == "none") return "☆ manquant"; if (photo == "bad") return "★ mauvais"; if (photo == "ok") return "★★ acceptable"; if (photo == "good") return "★★★ bon"; } function createYearName(year) { if (year == "50s") return "1956 - 1959"; if (year == "60s") return "1960 - 1969"; if (year == "70s") return "1970 - 1979"; if (year == "80s") return "1980 - 1989"; if (year == "90s") return "1990 - 1999"; if (year == "00s") return "2000 - 2009"; if (year == "10s") return "2010 - 2016"; } function createDimensionName(dimension) { if (dimension == "18") return "< 20cm"; if (dimension == "20") return "20cm - 29cm"; if (dimension == "30") return "30cm - 39cm"; if (dimension == "40") return "40cm - 49cm"; if (dimension == "50") return "50cm - 59cm"; if (dimension == "60") return "60cm - 69cm"; if (dimension == "70") return "70cm - 79cm"; if (dimension == "80") return "80cm - 89cm"; if (dimension == "90") return "90cm - 99cm"; if (dimension == "100") return ">= 100cm"; } function createHelpName(photo) { if (photo == "yes") return 'Oui Oui'; if (photo == "no") return "Non"; } hasExist = false; for (photo of availableOptions.photos) { if (!hasExist && (photo == "bad" || photo == "ok" || photo == "good")) { html = '\n'; html += ''; $(".box.photos .item-cont .generated").append(html); hasExist = true; } html = '\n'; html += ''; $(".box.photos .item-cont .generated").append(html); } for (year of availableOptions.years) { html = '\n'; html += ''; $(".box.years .item-cont .generated").append(html); } for (month of availableOptions.months) { html = '\n'; html += ''; $(".box.months .item-cont .generated").append(html); } for (genre of availableOptions.genres) { html = '\n'; html += ''; $(".box.genres .item-cont .generated").append(html); } for (theme of availableOptions.themes) { html = '\n'; html += ''; $(".box.themes .item-cont .generated").append(html); } for (dimension of availableOptions.dimensions) { html = '\n'; html += ''; $(".box.dimensions .item-cont .generated").append(html); } for (help of availableOptions.helps) { html = '\n'; html += ''; $(".box.help .item-cont .generated").append(html); } $(".box.places select").append('