[openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)

Marwin Hochfelsner notifications at github.com
Wed Jul 16 01:11:28 UTC 2025


@hlfan commented on this pull request.



> +    if (data.icon && OSM.WIKIMEDIA_COMMONS_URL) {
+      let src = OSM.WIKIMEDIA_COMMONS_URL + "Special:Redirect/file/" + encodeURIComponent(data.icon);
+      if (!data.icon.endsWith(".svg")) src += "?width=128";
+      $("<a>")
+        .attr("href", OSM.WIKIMEDIA_COMMONS_URL + "File:" + encodeURIComponent(data.icon))
+        .append($("<img>").attr({ src, height: "32" }))
+        .addClass("float-end mb-1 ms-2")
+        .appendTo(cell);
+    }
+    if (data.label) {
+      const label = $btn
+        .siblings(`a[href*="wikidata.org/entity/${data.qid}"]`)
+        .clone()
+        .text(data.label.value)
+        .attr("dir", "auto");
+      cell.append($("<span>").append(label));

To group label elements and article elements. Not neeeded, removed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6127#discussion_r2208997158
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6127/review/3022788388 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250715/65dad3c4/attachment.htm>


More information about the rails-dev mailing list