Skip to content

Commit 2d17a16

Browse files
committed
feat: add "view history"
Fixes #94
1 parent bbe78dd commit 2d17a16

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

index.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,38 @@ function showDetails(data, connected) {
168168
back_button.onclick = function() { cy.nodes().selectify(); cy.nodes(`[id = '${data.id}']`).unselect(); cy.nodes("#simulators").select(); cy.nodes().unselectify(); unhighlightNode(null, true); };
169169
back_p.appendChild(back_button);
170170
details_bottom.appendChild(back_p);
171-
// Edit footer
171+
// View/edit footer
172172
edit_p = document.createElement("p");
173173
edit_p.classList.add("mt-3", "text-end");
174+
// Edit footer
174175
edit_link = document.createElement("a");
175176
edit_link.classList.add("link-secondary");
176177
edit_link.href = `${REPO_URL}/edit/${GIT_BRANCH}/${DATA_FOLDER}/${data["short_name"].replaceAll(" ", "-")}.yaml`;
177-
edit_link.innerHTML = "Edit this description on GitHub ";
178-
edit_link.innerHTML += `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
179-
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"/>
180-
</svg>`;
178+
edit_link.innerHTML = "Edit this description";
181179
edit_link.target = "_blank";
182180
edit_p.appendChild(edit_link);
181+
182+
slash = document.createTextNode(" / ");
183+
edit_p.appendChild(slash);
184+
185+
// View footer
186+
view_link = document.createElement("a");
187+
view_link.href = `${REPO_URL}/blob/${GIT_BRANCH}/${DATA_FOLDER}/${data["short_name"].replaceAll(" ", "-")}.yaml`;
188+
view_link.innerHTML = "view history";
189+
view_link.target = "_blank";
190+
edit_p.appendChild(view_link);
191+
192+
on_github = document.createTextNode(" on GitHub ");
193+
edit_p.appendChild(on_github);
194+
github_logo = document.createElementNS("http://www.w3.org/2000/svg", "svg");
195+
github_logo.setAttributeNS(null, "width", "16");
196+
github_logo.setAttributeNS(null, "height","16");
197+
github_logo.setAttributeNS(null, "fill", "currentColor");
198+
github_logo.setAttributeNS(null, "class", "bi bi-github");
199+
github_logo.setAttributeNS(null, "viewBox", "0 0 16 16");
200+
github_logo.innerHTML = `<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"/>`;
201+
edit_p.appendChild(github_logo);
202+
183203
details_bottom.appendChild(edit_p);
184204
}
185205

0 commit comments

Comments
 (0)