Skip to content

Commit

Permalink
Merge pull request #170 from mattwright324/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mattwright324 committed Sep 18, 2023
2 parents a3f05c7 + 6b47510 commit 7fc9258
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions css/youtube-metadata.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ html.dark .progress-bar {
color: #fff;
}

.wayback-cdx-older {
filter: brightness(0.75);
}

.export {
display: none;
}
Expand Down
8 changes: 6 additions & 2 deletions js/youtube-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -1262,19 +1262,23 @@

const hideOlder = $("#checkHideOlder").is(":checked")

function formatTime(waybackTime) {
return waybackTime.replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, "$1-$2-$3 $4:$5:$6")
}

let currentBase = null;
const linkHtml = []
for (let i in links) {
const link = links[i];

if (link[0] === currentBase) {
linkHtml.push(`<li class="cdx-link wayback-cdx-older" ${hideOlder ? "style='display:none'" : ""}>
<a target="_blank" href="${link[3]}">Archive.org - ${link[0]}</a> <small class="text-muted">${link[2]}</small></li>`)
<a target="_blank" href="${link[3]}">Archive.org - ${link[0]}</a> <small class="text-muted">${formatTime(link[2])}</small></li>`)
continue
}

currentBase = link[0]
linkHtml.push(`<li class="cdx-link wayback-cdx-newest"><a target="_blank" href="${link[3]}">Archive.org - ${link[0]}</a> <small class="text-muted">${link[2]}</small></li>`)
linkHtml.push(`<li class="cdx-link wayback-cdx-newest"><a target="_blank" href="${link[3]}">Archive.org - ${link[0]}</a> <small class="text-muted">${formatTime(link[2])}</small></li>`)
}
$("#wayback-append").html(`<ul>${linkHtml.join("")}</ul>`)
$("#wayback-show-older,#wayback-copy").show();
Expand Down

0 comments on commit 7fc9258

Please sign in to comment.