mudlet-map-browser-script 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -103,6 +103,7 @@ class PageControls {
103
103
  this.settingsForm = document.querySelector("#settings form");
104
104
  this.resetSettingsButton = document.querySelector("#settings button[type='reset']");
105
105
  this.versions = document.querySelector("#versions");
106
+ this.releaseDescription = document.querySelector(".release-description");
106
107
  this.settings = new Settings();
107
108
  this.preview = new Preview(this.map, this);
108
109
  this.versionBadge = document.querySelector(".version-number");
@@ -121,6 +122,7 @@ class PageControls {
121
122
  if (this.versions) {
122
123
  this.versions.addEventListener("change", event => {
123
124
  this.replaceVersion(event.target.value);
125
+ this.releaseDescription.innerHTML = event.target.selectedOptions[0].getAttribute("data-description");
124
126
  bootstrap.Modal.getInstance(this.helpModal).hide();
125
127
  });
126
128
 
@@ -129,10 +131,12 @@ class PageControls {
129
131
  downloadTags(this.versions.getAttribute("data-tags")).then(tags => {
130
132
  tags.forEach(tag => {
131
133
  let option = document.createElement("option");
132
- option.setAttribute("value", tag);
133
- option.innerHTML = tag;
134
+ option.setAttribute("value", tag.tag_name);
135
+ option.setAttribute("data-description", tag.body.replaceAll("\n\n", "\n"));
136
+ option.innerHTML = tag.tag_name;
134
137
  this.versions.append(option);
135
138
  });
139
+ this.releaseDescription.innerHTML = this.versions.firstChild.getAttribute("data-description");
136
140
  });
137
141
  }
138
142
  });
@@ -594,8 +598,13 @@ class PageControls {
594
598
  for (let userDataKey in userData) {
595
599
  show = true;
596
600
  let dataElement = document.createElement("li");
597
- dataElement.classList = ["user-data"]
598
- dataElement.innerHTML = `<p>${userDataKey}:</p><p class="value">${userData[userDataKey].replaceAll("\\n", "\n")}</p>`;
601
+ dataElement.classList = ["user-data"];
602
+ let key = document.createElement("p");
603
+ key.append(`${userDataKey}:`);
604
+ let value = document.createElement("p");
605
+ value.append(`${userData[userDataKey].replaceAll("\\n", "\n")}`)
606
+ value.className = "value";
607
+ dataElement.append(key, value)
599
608
  containerList.append(dataElement);
600
609
  }
601
610
  container.style.display = show ? "initial" : "none";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudlet-map-browser-script",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {