ASDSO Dam Safety Toolbox

Template: WhatLinksHere: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
No edit summary
Line 7: Line 7:
----
----
<html>
<html>
<iframe id="iframeWin"  
  <iframe id="iframeWin"
        src="/wiki/Special:WhatLinksHere/</html>{{PAGENAME}}<html>"
          src="/wiki/Special:WhatLinksHere/</html>{{PAGENAME}}<html>"
        style="border:none; width:100%; display:none;"
          style="border:none;height:100%;width:100%;display:none;"
        title="What Links Here"></iframe>
          title="What Links Here">
  </iframe>


 
  <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 content = (iframeWin.contentWindow || iframeWin.contentDocument);
    console.log(e.data);
      if (content.document)content = content.document;
    console.log(e.data.params);
      // Adjust padding/margin
    console.log(e.data.params.height);
      iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.marginLeft = "0px";
 
      iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.paddingLeft = "0px";
    var iframeWin = document.getElementById("iframeWin");
      // Hide header, heading, back link & footer
    var content = (iframeWin.contentWindow || iframeWin.contentDocument);
      content.body.getElementsByTagName("header")[0].style.display = "none";
    if (content.document)content = content.document;
      content.body.getElementsByClassName("firstHeading")[0].style.display = "none";
    // Adjust padding/margin
      iframeWin.contentWindow.document.getElementById('contentSub').style.display = "none";
    iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.marginLeft = "0px";
      content.body.getElementsByTagName("footer")[0].style.display = "none";
    iframeWin.contentWindow.document.getElementById('maincontentwrapper').style.paddingLeft = "0px";
      // Show iframe
    // Hide header, heading, back link & footer
      iframeWin.style.display="block";
    content.body.getElementsByTagName("header")[0].style.display = "none";
    });
    content.body.getElementsByClassName("firstHeading")[0].style.display = "none";
  </script>
    iframeWin.contentWindow.document.getElementById('contentSub').style.display = "none";
    content.body.getElementsByTagName("footer")[0].style.display = "none";
    // Show iframe
    iframeWin.style.display="block";
  });
</script>
</html>
</html>

Revision as of 13:31, 7 July 2023

Usage