forked from bagder/roffit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jhauga/jhauga-resolveOptionLinks
Special Characters and Links: 2 scripts added, and Makefile edited. This pull request contains **"jhauga-resolveOptionLinks"** branch with: 1. Two supporting script files added that edit .dump file after nroff build. 2. Makefile edited to run two supporting scripts after build. 3. Example folder with proof of concept of support scripts used in Makefile. This pull request will resolve: 1. [roffit issue bagder#36](bagder#36) 2. [curl issue #11381](curl/curl#11381)
- Loading branch information
Showing
22 changed files
with
23,294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
|
||
<!--_END_OUT--> | ||
</div> | ||
</div> | ||
<script> | ||
var setScroll = 0; | ||
function showTop(clicked) { | ||
if (clicked == undefined) clicked = 0; | ||
let toTop = document.getElementById("toTop"); | ||
if (clicked == 1) toTop.style.display = "inline-block"; | ||
if (setScroll == 0) { | ||
setScroll = 1; | ||
document.addEventListener('scroll', function() { | ||
if (document.documentElement.scrollTop > 500) { | ||
toTop.style.display = 'inline-block'; | ||
} else { | ||
toTop.style.display = 'none'; | ||
} | ||
}); | ||
} | ||
} | ||
function showLink(curTask) { | ||
var curhref; | ||
if (curTask == "b") { curhref = "https://curl.se/docs/"; } else { curhref = "javascript:void(0)"; } | ||
var aBrokenLink = document.getElementsByTagName('a'); | ||
var theBrokenLink = [], theBrokenLinkIndex = 0; | ||
for (i = 0; i < aBrokenLink.length; i++) { | ||
if (aBrokenLink[i].href == curhref) { | ||
theBrokenLink[theBrokenLinkIndex] = aBrokenLink[i]; | ||
theBrokenLinkIndex++; | ||
aBrokenLink[i].style.background = 'yellow'; | ||
aBrokenLink[i].style.border = '1px solid black'; | ||
aBrokenLink[i].style.padding = '2px'; | ||
} | ||
} | ||
setTimeout(function() { | ||
for (i in theBrokenLink) { | ||
if (theBrokenLink[i].style.background == "yellow") theBrokenLink[i].style.background = ""; | ||
} | ||
}, 800); | ||
setTimeout(function() { | ||
for (i in theBrokenLink) { | ||
theBrokenLink[i].style.border = ''; | ||
theBrokenLink[i].style.padding = ''; | ||
} | ||
}, 1500); | ||
} | ||
function searchOptions(txt) { | ||
let optionMenu = document.getElementById("optionMenu"); | ||
let optionMenuLi = optionMenu.getElementsByTagName("li"); | ||
for (i = 0; i < optionMenuLi.length; i++) { | ||
let curLI = optionMenuLi[i].innerText; | ||
if (curLI.indexOf(txt) > -1) { | ||
optionMenuLi[i].style.display = ""; | ||
} else { | ||
optionMenuLi[i].style.display = "none"; | ||
} | ||
} | ||
} | ||
function toggleSearchButton(showhide, onoff) { | ||
let showItem = showhide.nextElementSibling; | ||
let curData = onoff.dataset; | ||
if (curData.onoff == 0) { | ||
curData.onoff = 1; | ||
showItem.style.display = ""; | ||
onoff.style.background = "white"; | ||
onoff.style.color = "black"; | ||
onoff.innerHTML = onoff.innerHTML.replace("Show", "Hide"); | ||
} else { | ||
curData.onoff = 0; | ||
showItem.style.display = "none"; | ||
onoff.style.background = ""; | ||
onoff.style.color = ""; | ||
onoff.innerHTML = onoff.innerHTML.replace("Hide", "Show"); | ||
} | ||
} | ||
function addOptionLinks() { | ||
let optionMenu = document.getElementById("optionMenu"); | ||
let optionMenuLi = optionMenu.getElementsByTagName("li"); | ||
let fullOptionList = document.getElementById("fullOptionList"); | ||
fullOptionList.style.display = ""; | ||
let i = 0; | ||
while (i < 14) { | ||
optionMenuLi[0].remove(); | ||
i++; | ||
} | ||
i = 0; | ||
while (i < 4) { | ||
optionMenu.children[0].remove(); | ||
i++; | ||
} | ||
optionMenuLi = fullOptionList.getElementsByTagName("li"); | ||
for (i = 0; i < optionMenuLi.length; i++) { | ||
optionMenuLi[i].getElementsByTagName("a")[0].addEventListener("click", function() { | ||
var hValue; | ||
if (this.innerHTML.indexOf(",") > -1 || this.innerHTML.indexOf("<") > -1) { | ||
if (this.innerHTML.indexOf(",") > -1 && this.innerHTML.indexOf("<") > -1) { | ||
this.href = "#" + this.innerHTML.substr(0, this.innerHTML.indexOf(",")); | ||
} else { | ||
if (this.innerHTML.indexOf(",") > -1 && this.innerHTML.indexOf("<") == -1) { this.href = "#" + this.innerHTML.substr(0, this.innerHTML.indexOf(",")); } | ||
else { this.href = "#" + this.innerHTML.substr(0,this.innerHTML.indexOf("<")); } | ||
} | ||
hValue = this.href; | ||
} else { | ||
this.href = "#" + this.innerHTML; | ||
hValue = this.href; | ||
} | ||
let hasSpace = 1; | ||
while (hasSpace == 1) { | ||
if (hValue.indexOf(" ") > -1) { | ||
hValue = hValue.replace(" ", ""); | ||
} else { | ||
hasSpace = 0; | ||
} | ||
} | ||
if (hValue.indexOf("#-#") > -1 || hValue.indexOf("#-:") > -1) { | ||
if (hValue.indexOf("#-#") > -1) { hValue = hValue.replace("#-#", "#--progress-bar"); } | ||
else { hValue = hValue.replace("#-:", "#--next"); } | ||
this.href = hValue; | ||
} else { | ||
this.href = hValue; | ||
} | ||
}); | ||
} | ||
} | ||
showTop(); | ||
addOptionLinks(); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.