Skip to content

Commit 28dce34

Browse files
author
Steve Krouse
committed
added console logs to unbreakable-links
1 parent cfd9d32 commit 28dce34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unbreakable-links/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const repoPathFromScriptAttribute = () => {
1313
const rawGitLink = (repoPath, filePath, commitHash) => "https://cdn.rawgit.com/" + repoPath + "/" + (commitHash ? commitHash : "master") + filePath
1414

1515
const load = (repoPath, filePath, commitHash) => {
16+
console.log("would have loaded: " + rawGitLink(repoPath, filePath, commitHash))
1617
return // disabled for now
1718
document.body.style.margin = "0 0 0 0px"
1819
const iframe = document.createElement("iframe")
@@ -50,8 +51,6 @@ const getFileExistsNow = (repoPath, filePath) => fetch(
5051
.then(resp => resp.status == 200)
5152

5253
const showBanner = (repoPath, filePath, status, newCommitHash) => {
53-
return // disabled for now
54-
// TODO add links to newCommitHash page in banner text
5554
const onclick = `onclick="window.location.search = '?version=${newCommitHash}'"`
5655
const bannerText = {
5756
"FILE-NEVER-EXISTED": `This page doesn't exist in our archives.`,
@@ -62,6 +61,9 @@ const showBanner = (repoPath, filePath, status, newCommitHash) => {
6261
"NEWER-VERSION-DELETED-AVAILABLE": `This page has been deleted, but this is not <a ${onclick}>the most up-to-date version in the archive</a>.`
6362
}[status]
6463

64+
console.log("would have said: " + bannerText)
65+
return // disabled for now
66+
6567
const iconDiv = document.createElement('span')
6668
iconDiv.style.width = "30px"
6769
iconDiv.style.display = "inline-block"

0 commit comments

Comments
 (0)