diff --git a/web/app.html b/web/app.html index a6b5f4e..0906009 100644 --- a/web/app.html +++ b/web/app.html @@ -64,6 +64,22 @@ + +
Modify list
+Include items
+ // + // remove div content + const node = document.getElementById("modifylist_content"); + while (node.firstChild) { + node.removeChild(node.lastChild); + } + // input name + // input description + // content + const existing_content = Object.keys(await fetch_item_filtered([itemlist_uuid])); + const modify_content = d3.select("#modifylist_content"); + const checkboxContainer = modify_content.append("div"); + fetch_item().then(function(data){ + Object.keys(data).forEach(uuid => { + const item = data[uuid]; + const div = checkboxContainer.append("div"); + + const checkbox = div.append("input") + .attr("type", "checkbox") + .attr("class", "checkbox-itemlist") + .attr("id", `checkbox-${uuid}`); + if (existing_content.includes(`${uuid}`)) { + checkbox.property("checked", true); + } + const link = `https://fr.aliexpress.com/item/${item.itemid}.html`; + const image = div.append("img") + .attr("src", item.image) + .attr("width", height*0.4) + .attr("height", height*0.4) + .on("click", function() { + window.open(link, '_blank', 'noopener,noreferrer'); + }) + .attr("alt", `Image ${uuid}`); + }); + }); +} + // delete item, pop-up confirm document.addEventListener('DOMContentLoaded', function () { const yesBtn = document.getElementById('yesBtn');