Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

fullscreen.js 5.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var Unibase;
  2. (function (Unibase) {
  3. let Apps;
  4. (function (Apps) {
  5. let Collaboration;
  6. (function (Collaboration) {
  7. let Components;
  8. (function (Components) {
  9. class Fullscreen {
  10. constructor() {
  11. this.ssMenuBarFullScreen = false;
  12. this.isDocFullscreen = false;
  13. }
  14. refreshWordDocumentHeight(docObj) {
  15. this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
  16. let fullscreenElement = docObj.element;
  17. this.wordDocRibbon = document.getElementsByClassName('biz-doc-ribbon')[0];
  18. this.wordDocToolbar = document.getElementsByClassName('biz-doc-bottomtoolbar')[0];
  19. this.wordDocFooter = fullscreenElement.parentElement.nextElementSibling;
  20. this.wordDocFooter.style.display = "none";
  21. this.wordDocRibbon.style.display = 'none';
  22. this.wordDocToolbar.style.display = 'none';
  23. docObj.height = window.innerHeight + 'px';
  24. document.getElementsByClassName('e-de-text-target')[0].contentWindow.document.addEventListener("keyup", (e) => {
  25. this.refreshDocumentHeightProps(fullscreenElement);
  26. event.preventDefault();
  27. this.exitFullscreenEsc(e, docObj);
  28. if (e.keyCode == 122) {
  29. if (!this.isDocFullscreen) {
  30. this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
  31. docObj.height = this.totalHeight + 'px';
  32. this.isDocFullscreen = true;
  33. }
  34. else {
  35. this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
  36. docObj.height = this.totalHeight + 'px';
  37. this.isDocFullscreen = false;
  38. }
  39. }
  40. });
  41. document.body.addEventListener("keyup", (e) => {
  42. this.exitFullscreenEsc(e, this.docBase.wordDocumentObj);
  43. });
  44. }
  45. refreshDocumentHeightProps(fullscreenElement) {
  46. this.ribbonHeight = document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight;
  47. this.toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;
  48. this.footerHeight = fullscreenElement.parentElement.nextElementSibling.offsetHeight;
  49. }
  50. exitFullscreenEsc(e, docObj) {
  51. if (e.keyCode == 27) {
  52. this.refreshDocumentHeightProps(docObj.element);
  53. this.wordDocRibbon.style.display = '';
  54. this.wordDocToolbar.style.display = '';
  55. this.wordDocFooter.style.display = "";
  56. this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
  57. docObj.height = this.totalHeight + 'px';
  58. }
  59. }
  60. refreshSpreadsheetHeight(ssObj) {
  61. this.sheetBase = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
  62. this.dialog = Unibase.Apps.Collaboration.Components.Sheets.Dialogue.Instance();
  63. this.ssMenuBarFullScreen = true;
  64. let fullscreenElement = ssObj.element;
  65. let sheetPannelElement = document.getElementById("DocumentViewer_sheet_panel");
  66. fullscreenElement.parentElement.nextElementSibling.style.display = "none";
  67. fullscreenElement.parentElement.previousElementSibling.style.display = "none";
  68. document.getElementById('DocumentViewer_ribbon').style.display = 'none';
  69. var footerHeight = sheetPannelElement.nextElementSibling.offsetHeight;
  70. var headerHeight = sheetPannelElement.previousElementSibling.offsetHeight;
  71. sheetPannelElement.style.height = window.innerHeight - footerHeight - headerHeight + "px";
  72. this.dialog.renderMenubarFullscreenDialog();
  73. }
  74. inintEvents() {
  75. }
  76. removeEvetns() {
  77. }
  78. static Instance() {
  79. if (this.instance === undefined) {
  80. this.instance = new Fullscreen();
  81. }
  82. return this.instance;
  83. }
  84. }
  85. Components.Fullscreen = Fullscreen;
  86. })(Components = Collaboration.Components || (Collaboration.Components = {}));
  87. })(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
  88. })(Apps = Unibase.Apps || (Unibase.Apps = {}));
  89. })(Unibase || (Unibase = {}));