surf.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Copyright (c) 2016, 2024, 5 Mode
  3. *
  4. * This file is part of LightOff.
  5. *
  6. * LightOff is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * LightOff is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with LightOff. If not, see <https://www.gnu.org/licenses/>.
  18. *
  19. * surf.js
  20. *
  21. * JS for the surfing page.
  22. *
  23. * @author Daniele Bonini <my25mb@aol.com>
  24. * @copyrights (c) 2016, 2024, 5 Mode
  25. * @license https://opensource.org/licenses/BSD-3-Clause
  26. */
  27. function LIGHTOFFsetFooterPos() {
  28. if (document.getElementById("footerCont")) {
  29. tollerance = 16;
  30. $("#LIGHTOFFfooterCont").css("top", parseInt( window.innerHeight - $("#LIGHTOFFfooterCont").height() - tollerance ) + "px");
  31. $("#LIGHTOFFfooter").css("top", parseInt( window.innerHeight - $("#LIGHTOFFfooter").height() - tollerance ) + "px");
  32. $("#LIGHTOFFfooterCont").css("display","none");
  33. $("#LIGHTOFFfooter").css("display","none");
  34. }
  35. }
  36. function LIGHTOFFhideImages() {
  37. s = document.body.innerHTML;
  38. //s = s.replaceAll('src="', 'src="none-');
  39. //s = s.replaceAll("src='", "src='none-");
  40. s = s.replaceAll(/.png/gi, ".404png");
  41. s = s.replaceAll(/.jpg/gi, ".404jpg");
  42. s = s.replaceAll(/.jpeg/gi, ".404jpeg");
  43. s = s.replaceAll(/.gif/gi, ".404gif");
  44. s = s.replaceAll(/.webp/gi, ".404webp");
  45. s = s.replaceAll(/.svg/gi, ".404svg");
  46. document.body.innerHTML = s;
  47. }
  48. window.addEventListener("load", function() {
  49. //setTimeout("LIGHTOFFsetFooterPos()", 1000);
  50. setTimeout("LIGHTOFFhideImages()", 1500);
  51. }, true);
  52. window.addEventListener("resize", function() {
  53. setTimeout("LIGHTOFFsetFooterPos()", 1000);
  54. }, true);