Jump to content

Featured Replies

17 hours ago, Matt said:

Same steps as above, the JS is:

I think that needs an additional condition to only show for members, doesn’t it?

  • 3 weeks later...
On 2/7/2025 at 7:15 AM, Matt said:

Yeah, it's super easy in Invision Community 5. Barely an inconvenience.

The javascript I paste in is this:

<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
      let newLi = document.createElement("li");
      let newLink = document.createElement("a");
      newLink.href = "#";
      newLink.innerText = "Back to Top";
      newLink.setAttribute( 'style', 'padding: .8em');

      let newIcon = document.createElement("i");
      newIcon.classList.add("fa", "fa-arrow-up");

      newLink.prepend(newIcon);

      newLink.addEventListener("click", function (event) {
          event.preventDefault();
          window.scrollTo({ top: 0, behavior: "smooth" });
      });

      newLi.appendChild(newLink);

      let ul = document.querySelector('nav.ipsBreadcrumb--bottom a[data-action="defaultStream"]').closest("ul");
      if (ul) {
          ul.appendChild(newLi);
      }
  });
</script>

On 2/7/2025 at 8:00 AM, Matt said:

Same steps as above, the JS is:

<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
      let newLi = document.createElement("li");
      let newLink = document.createElement("a");
      newLink.href = ipsSettings.baseURL + 'markallread/?csrfKey=' + ipsSettings.csrfKey;
      newLink.innerText = "Mark Site Read";
      newLink.setAttribute( 'style', 'padding: .8em');

      let newIcon = document.createElement("i");
      newIcon.classList.add("fa", "fa-solid", "fa-eye");

      newLink.prepend(newIcon);
      newLi.appendChild(newLink);

      let ul = document.querySelector('nav.ipsBreadcrumb--bottom a[data-action="defaultStream"]').closest("ul");
      if (ul) {
          ul.appendChild(newLi);
      }
  });
</script>

CleanShot 2025-02-07 at 13.01.51@2x.png

I did it first without recording, then removed it but didn't refresh the page before recording, that's all.

@Matt This then leaves a small blank area where the Text Block is, within the footer. Any way to make that go away?

4 hours ago, My Sharona said:

@Matt This then leaves a small blank area where the Text Block is, within the footer. Any way to make that go away?

I guessing that nothing should be displayed because the only time that there would be padding or margin is when a style is defined or when the browser has a defined style such as for a div tag. If there is padding or a margin, you could probably target it via a section if or class from that area.

You could target it via a section "id" or class selector with css.

14 hours ago, EDK-Tech said:

I guessing that nothing should be displayed because the only time that there would be padding or margin is when a style is defined or when the browser has a defined style such as for a div tag. If there is padding or a margin, you could probably target it via a section if or class from that area.

Thank you. Setting the padding to none got rid of the display.

Recently Browsing 0

  • No registered users viewing this page.