From: Jeremy Thomas Date: Thu, 11 Jan 2024 21:16:09 +0000 (+0000) Subject: Merge branch 'master' of github.com:jgthms/bulma X-Git-Tag: 1.0.0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ad384ca415d74723bc7949fcc50f65556da04d4;p=thirdparty%2Fbulma.git Merge branch 'master' of github.com:jgthms/bulma --- 2ad384ca415d74723bc7949fcc50f65556da04d4 diff --cc docs/_javascript/index.js index 7e11dbc2c,251c4f9ee..3ca25ce22 --- a/docs/_javascript/index.js +++ b/docs/_javascript/index.js @@@ -97,28 -97,34 +97,28 @@@ document.addEventListener("DOMContentLo const $amis = document.getElementById("amis"); - if ($amis) { - fetch("https://jgthms.com/amis.json") - .then((response) => { - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } - - return response.json(); - }) - .then((response) => { - const { by_id, home } = response; - - home.forEach((id) => { - const ami = by_id[id]; - const { url, alt = "", width, height } = ami; - const el = document.createElement("a"); - el.className = "bd-sponsor-item bd-partner-sponsor"; - el.href = url; - el.target = "_blank"; - el.title = alt; - const extension = ami.svg ? ".svg" : ".png"; - const img = document.createElement("img"); - img.src = `/images/amis/${id}${extension}`; - img.height = height; - img.width = width; - el.appendChild(img); - $amis.appendChild(el); - }); + fetch("https://jgthms.com/amis/new.json") + .then((response) => { + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } + + return response.json(); + }) + .then((response) => { + response.forEach((item) => { + const el = document.createElement("a"); + el.className = "bd-sponsor-item bd-partner-sponsor"; + el.href = "url"; + el.target = "_blank"; + el.title = item.title || item.id; + + const extension = item.svg ? ".svg" : ".png"; + const img = document.createElement("img"); + img.src = `https://jgthms.com/amis/images/${item.id}${extension}`; + + el.appendChild(img); + $amis.appendChild(el); }); - }); + } }); diff --cc docs/lib/index.js index 00fdaf5b5,a43597aa9..53a1dd9a6 --- a/docs/lib/index.js +++ b/docs/lib/index.js @@@ -86,26 -86,39 +86,26 @@@ document.addEventListener("DOMContentLo var $amis = document.getElementById("amis"); - if ($amis) { - fetch("https://jgthms.com/amis.json").then(function (response) { - if (!response.ok) { - throw new Error("HTTP error! Status: " + response.status); - } - - return response.json(); - }).then(function (response) { - var by_id = response.by_id, - home = response.home; - - - home.forEach(function (id) { - var ami = by_id[id]; - var url = ami.url, - _ami$alt = ami.alt, - alt = _ami$alt === undefined ? "" : _ami$alt, - width = ami.width, - height = ami.height; - - var el = document.createElement("a"); - el.className = "bd-sponsor-item bd-partner-sponsor"; - el.href = url; - el.target = "_blank"; - el.title = alt; - var extension = ami.svg ? ".svg" : ".png"; - var img = document.createElement("img"); - img.src = "/images/amis/" + id + extension; - img.height = height; - img.width = width; - el.appendChild(img); - $amis.appendChild(el); - }); + fetch("https://jgthms.com/amis/new.json").then(function (response) { + if (!response.ok) { + throw new Error("HTTP error! Status: " + response.status); + } + + return response.json(); + }).then(function (response) { + response.forEach(function (item) { + var el = document.createElement("a"); + el.className = "bd-sponsor-item bd-partner-sponsor"; + el.href = "url"; + el.target = "_blank"; + el.title = item.title || item.id; + + var extension = item.svg ? ".svg" : ".png"; + var img = document.createElement("img"); + img.src = "https://jgthms.com/amis/images/" + item.id + extension; + + el.appendChild(img); + $amis.appendChild(el); }); - }); - }); + } -}); ++});