Skip to content

Commit

Permalink
Merge pull request #16 from penguineer/tracker_html
Browse files Browse the repository at this point in the history
Tracker Table: Use HTML and populate values via JavaScript
  • Loading branch information
penguineer authored Jul 19, 2022
2 parents 7f2df32 + 0d506e2 commit 438ab1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 7 additions & 7 deletions www/aw.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ urlParam = function(name){
}

populateTrackerInfo = function(json) {
$("#tracker").html(`
<table>
<tr><th>Type: </th><td>`+json.tracker.type+`</td></tr>
<tr><th>URI: </th><td><a href="`+json.tracker.uri+`" target="_new">`+json.tracker.uri+`</a></td></tr>
<tr><th>User Name: </th><td>`+json.tracker.user_name+`</td></tr>
</table>
`);
$("#tracker-type").text(json.tracker.type);

var tracker_uri = $("#tracker-uri");
tracker_uri.attr("href", json.tracker.uri);
tracker_uri.text(json.tracker.uri);

$("#tracker-user-name").text(json.tracker.user_name);
}

populateNotes = function(json) {
Expand Down
8 changes: 7 additions & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@

<div id="tracker-box" class="meta-box">
<h2>Tracker</h2>
<div id="tracker"></div>
<div id="tracker">
<table>
<tr><th>Type: </th><td id="tracker-type"></td></tr>
<tr><th>URI: </th><td><a id="tracker-uri" target="_new"></a></td></tr>
<tr><th>User Name: </th><td id="tracker-user-name"></td></tr>
</table>
</div>
</div>

<div id="param-box" class="meta-box">
Expand Down

0 comments on commit 438ab1b

Please sign in to comment.