You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.3 KiB

  1. function notifyOpener() {
  2. //console.log(self.opener.popupWin);
  3. document.querySelector('#connection').style.display = 'none';
  4. if(self.opener || !self.opener.Popup.win)
  5. self.opener.Popup.win = self;
  6. }
  7. setInterval( notifyOpener, 200 );
  8. self.focus();
  9. /**
  10. * When an error occured
  11. */
  12. window.onerror = function() {
  13. document.querySelector('#connection').style.display = 'block';
  14. };
  15. /**
  16. * When the popup is closed
  17. */
  18. window.onunload = function() {
  19. //self.opener.Roster_ajaxToggleChat();
  20. };
  21. var Visio = {
  22. fullScreen: function() {
  23. var elem = document.getElementById("visio");
  24. if (!document.fullscreenElement && // alternative standard method
  25. !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
  26. if (document.documentElement.requestFullscreen) {
  27. document.documentElement.requestFullscreen();
  28. } else if (document.documentElement.mozRequestFullScreen) {
  29. document.documentElement.mozRequestFullScreen();
  30. } else if (document.documentElement.webkitRequestFullscreen) {
  31. document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
  32. }
  33. } else {
  34. if (document.cancelFullScreen) {
  35. document.cancelFullScreen();
  36. } else if (document.mozCancelFullScreen) {
  37. document.mozCancelFullScreen();
  38. } else if (document.webkitCancelFullScreen) {
  39. document.webkitCancelFullScreen();
  40. }
  41. }
  42. },
  43. log: function(content) {
  44. var date = new Date();
  45. movim_prepend([
  46. "log",
  47. "<div>["
  48. + date.getHours() + ":"+date.getMinutes() + ":"+date.getSeconds() + "] "
  49. + content +
  50. "</div>"]);
  51. },
  52. /*
  53. * @brief Call a function in the main window
  54. * @param Array, array[0] is the name of the function, then the params
  55. */
  56. call: function(args) {
  57. if( self.opener && !self.opener.closed ) {
  58. // The popup is open so call it
  59. var func = args[0];
  60. args.shift();
  61. var params = args;
  62. self.opener[func].apply(null, params);
  63. }
  64. }
  65. }
  66. movim_add_onload(function()
  67. {
  68. document.getElementById("toggle-screen").onclick = function() { Visio.fullScreen(); };
  69. });