mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 18:37:15 +02:00
docs: API Reference now presents _index.html_ instead of _full.hml_
This commit is contained in:
@ -37,17 +37,12 @@ apiIframe = document.getElementById('apiIframe');
|
|||||||
hash = window.location.hash;
|
hash = window.location.hash;
|
||||||
if (hash.length == 0) {
|
if (hash.length == 0) {
|
||||||
// sets default hash for the API Reference
|
// sets default hash for the API Reference
|
||||||
hash = "#full";
|
hash = "#index.html";
|
||||||
history.pushState(null, "", hash);
|
history.pushState(null, "", hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the iframe source based on the hash in the URL
|
// set the iframe source based on the hash in the URL
|
||||||
if (hash.startsWith("#wg21.link/")) {
|
apiIframe.src = "gen/" + hash.slice(1);
|
||||||
apiIframe.src = "https://" + hash.slice(1);
|
|
||||||
apiIframe.height = 900;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
apiIframe.src = "gen/" + hash.slice(1) + ".html";
|
|
||||||
|
|
||||||
// receives content height from the subpage displayed in the iframe
|
// receives content height from the subpage displayed in the iframe
|
||||||
// works only for the pages in the same domain as the main docs
|
// works only for the pages in the same domain as the main docs
|
||||||
@ -57,18 +52,15 @@ iFrameResize({
|
|||||||
// obtains the link URL clicked in the subpage
|
// obtains the link URL clicked in the subpage
|
||||||
onMessage: function(messageData) {
|
onMessage: function(messageData) {
|
||||||
url = messageData.message;
|
url = messageData.message;
|
||||||
if (url.startsWith("https://wg21.link/")) {
|
if (url.search("api_reference/gen") == -1) {
|
||||||
hash = '#' + messageData.message.replace("https://", "");
|
window.open(url);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pos = messageData.message.indexOf('#');
|
pos_start = messageData.message.lastIndexOf('/');
|
||||||
if(pos == -1) {
|
hash = '#' + messageData.message.slice(pos_start + 1)
|
||||||
pos = messageData.message.lastIndexOf('/');
|
history.pushState(null, "", hash);
|
||||||
}
|
window.location.reload();
|
||||||
hash = '#' + messageData.message.slice(pos + 1);
|
|
||||||
}
|
}
|
||||||
history.pushState(null, "", hash);
|
|
||||||
window.location.reload();
|
|
||||||
}
|
}
|
||||||
},'#apiIframe')
|
},'#apiIframe')
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user