ASDSO Dam Safety Toolbox

Template: WhatLinksHere: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
Tag: Manual revert
No edit summary
Line 7: Line 7:
----
----
<html>
<html>
   <iframe id="iframeWin"
   <iframe id="iframe"
           src="/wiki/Special:WhatLinksHere/</html>{{PAGENAME}}<html>"
           src="/wiki/Special:WhatLinksHere/</html>{{PAGENAME}}<html>"
           style="border:none;width:100%;display:none;"
           style="border:none;width:100%;display:none;"
Line 15: Line 15:
   <script type="application/javascript">
   <script type="application/javascript">
     document.querySelector("iframe").addEventListener( "load", function(e) {
     document.querySelector("iframe").addEventListener( "load", function(e) {
       var iframeWin = document.getElementById("iframeWin");
       var iframe = document.getElementById("iframe");
       // Set iframe height
       // Set iframe height
       iframeWin.height = iframeWin.contentWindow.document.body.scrollHeight;
       iframe.height = iframe.contentWindow.document.body.scrollHeight;
       var content = (iframeWin.contentWindow || iframeWin.contentDocument);
       var content = (iframe.contentWindow || iframe.contentDocument);
       if (content.document)content = content.document;
       if (content.document)content = content.document;
       // Adjust padding/margin
       // Adjust padding/margin
       iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.marginLeft = "0px";
       iframe.contentWindow.document.getElementById('maincontentwrapper').style.marginLeft = "0px";
       iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.paddingLeft = "0px";
       iframe.contentWindow.document.getElementById('maincontentwrapper').style.paddingLeft = "0px";
       // Hide header, heading, back link & footer
       // Hide header, heading, back link & footer
       content.body.getElementsByTagName("header")[0].style.display = "none";
       content.body.getElementsByTagName("header")[0].style.display = "none";
       content.body.getElementsByClassName("firstHeading")[0].style.display = "none";
       content.body.getElementsByClassName("firstHeading")[0].style.display = "none";
       iframeWin.contentWindow.document.getElementById('contentSub').style.display = "none";
       iframe.contentWindow.document.getElementById('contentSub').style.display = "none";
       content.body.getElementsByTagName("footer")[0].style.display = "none";
       content.body.getElementsByTagName("footer")[0].style.display = "none";
       // Show iframe
       // Show iframe
       iframeWin.style.display="block";
       iframe.style.display="block";
     });
     });
   </script>
   </script>
</html>
</html>

Revision as of 15:40, 7 July 2023

Usage