Skip to content

Commit

Permalink
Deploying to gh-pages from @ a36fbbd 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Jun 20, 2024
1 parent 861c19c commit dff4382
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
5 changes: 1 addition & 4 deletions iD.css
Original file line number Diff line number Diff line change
Expand Up @@ -5144,14 +5144,11 @@

.ideditor .form-field-input-traffic-preview {
display: flex;
flex-wrap: wrap;
flex-direction: column;
gap: 8px;
margin: 8px 0;
}
.ideditor .form-field-input-traffic-preview img {
/* min-width: 50px;
max-width: 100%; */
width: 100%;
max-height: 100px;
}
/* Field - lists with labeled input items as table
Expand Down
20 changes: 15 additions & 5 deletions iD.js
Original file line number Diff line number Diff line change
Expand Up @@ -65539,14 +65539,24 @@
function updateTrafficSignPreview(newValue) {
if (typeof newValue !== "string")
return;
const [countryCode, values] = (newValue == null ? void 0 : newValue.split(":")) || [];
if (!countryCode || !values || !trafficSignsPromise)
let defaultCountryCode = newValue == null ? void 0 : newValue.split(":")[0].toUpperCase();
if (!defaultCountryCode || !trafficSignsPromise)
return;
trafficSignsPromise.then((trafficSignsDB) => {
const signIds = values.split(/[;,]+/).map((signId) => signId.split("[")[0]);
const URLs = signIds.map((signId) => {
const signs = newValue.split(/[;,]+/).map((_signId) => {
var _a2;
const signId = _signId.trim();
const countryCode = signId.includes(":") ? signId.split(":")[0].toUpperCase() : defaultCountryCode;
const code = signId.split(":").at(-1).split("[")[0].toUpperCase();
const variant = (_a2 = signId.split("[")[1]) == null ? void 0 : _a2.split("]")[0].toUpperCase();
return { countryCode, code, variant };
});
const URLs = signs.map((sign2) => {
var _a2, _b;
return (_b = (_a2 = trafficSignsDB[countryCode]) == null ? void 0 : _a2[signId]) == null ? void 0 : _b[0];
const def2 = (_b = (_a2 = trafficSignsDB[sign2.countryCode]) == null ? void 0 : _a2[sign2.code]) == null ? void 0 : _b.urls;
if (!def2)
return void 0;
return def2[sign2.variant] || def2[""] || Object.values(def2)[0];
}).filter(Boolean);
trafficPreview.selectAll("img").remove();
trafficPreview.selectAll("img").data(URLs, (d2) => d2).enter().append("img").attr("src", (d2) => d2);
Expand Down
6 changes: 3 additions & 3 deletions iD.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion iD.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions iD.min.js.map

Large diffs are not rendered by default.

0 comments on commit dff4382

Please sign in to comment.