home.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /**
  2. * Copyright (c) 2016, 2024, 5 Mode
  3. *
  4. * This file is part of BoxToBox.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  7. * and associated documentation files (the "Software"), to deal in the Software
  8. * without restriction, including without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in all copies or
  13. * substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  18. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  19. * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  21. *
  22. * home.js
  23. *
  24. * JS for the Home page.
  25. *
  26. * @author Daniele Bonini <my25mb@aol.com>
  27. * @copyrights (c) 2016, 2024, 5 Mode
  28. * @license https://opensource.org/licenses/BSD-3-Clause
  29. */
  30. function BOXTOBOXstartApp() {
  31. }
  32. /*
  33. * call to startApp
  34. *
  35. * @returns void
  36. */
  37. function _BOXTOBOXstartApp() {
  38. setTimeout("BOXTOBOXstartApp()", 1000);
  39. }
  40. function BOXTOBOXreload() {
  41. //window.location.reload();
  42. document.getElementById("frmUpload").submit();
  43. }
  44. function BOXTOBOXsetContentPos() {
  45. h=parseInt(window.innerHeight);
  46. w=parseInt(window.innerWidth);
  47. if (w>700) {
  48. myheight = parseInt(window.innerHeight - ($("#header").height()));
  49. $("#sidebar").css("height", myheight+"px");
  50. $("#coding").css("height", myheight+"px");
  51. $("#resizeBanner").hide();
  52. $("#content").show();
  53. } else {
  54. myheight = parseInt(window.innerHeight);
  55. $("#resizeBanner").css("height", myheight+"px");
  56. $("#content").hide();
  57. $("#resizeBanner").show();
  58. }
  59. }
  60. function BOXTOBOXsetFooterPos() {
  61. if (document.getElementById("footerCont")) {
  62. tollerance = 16;
  63. $("#footerCont").css("top", parseInt( window.innerHeight - $("#footerCont").height() - tollerance ) + "px");
  64. $("#footer").css("top", parseInt( window.innerHeight - $("#footer").height() - tollerance - 8) + "px");
  65. }
  66. }
  67. window.addEventListener("load", function() {
  68. setTimeout("BOXTOBOXsetContentPos()", 500);
  69. setTimeout("BOXTOBOXsetFooterPos()", 1000);
  70. setTimeout("_BOXTOBOXstartApp()", 10000);
  71. }, true);
  72. window.addEventListener("resize", function() {
  73. setTimeout("BOXTOBOXsetContentPos()", 500);
  74. setTimeout("BOXTOBOXsetFooterPos()", 1000);
  75. }, true);