Toggle Simplenote Sidebar

Button in footer to hide Simplenote siadebar.

  1. // ==UserScript==
  2. // @name Toggle Simplenote Sidebar
  3. // @namespace http://calon.weblogs.us/
  4. // @version 0.1
  5. // @description Button in footer to hide Simplenote siadebar.
  6. // @match https://app.simplenote.com/*
  7. // @include https://app.simplenote.com/*
  8. // @match http://app.simplenote.com/*
  9. // @include http://app.simplenote.com/*
  10. // @supportURL calon.xu@gmail.com
  11. // ==/UserScript==
  12.  
  13. var footList = document.createElement("li");
  14. var toggleButton = document.createElement("a");
  15. toggleButton.innerHTML = "Hide";
  16. footList.appendChild(toggleButton);
  17.  
  18. var footerrightElement = document.getElementsByClassName("footer-right");
  19. footerrightElement[0].insertBefore(footList, footerrightElement[0].firstChild);
  20.  
  21. var sidebarElement = document.getElementsByClassName("sidebar");
  22. var noteElement = document.getElementsByClassName("note");
  23.  
  24. toggleButton.onclick = function toggle() {
  25. if (sidebarElement[0].style.width == "0px") {
  26. noteElement[0].style.left = "361px";
  27. sidebarElement[0].style.width = "360px";
  28. toggleButton.innerHTML = "Hide";
  29. } else {
  30. noteElement[0].style.left = "0px";
  31. sidebarElement[0].style.width = "0px";
  32. toggleButton.innerHTML = "Show";
  33. }
  34. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址