123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
"use strict";
modulum('BrowserWindowsService', ['InitService'],
function(context, cls) {
context.BrowserWindowsService = context.oo.StaticClass( {
__name: "BrowserWindowsService",
_eventListener: null,
init: function() {
this._eventListener = new cls.EventListener();
window.addEventListener("multiWindowUnloadRoot", () => {
window.close();
});
},
isRootWindow: function() {
return window._multiWindowData.isRoot;
},
getRootGbc: function() {
let rootWindow = window._multiWindowData.rootWindow;
return rootWindow && rootWindow.gbc;
},
getRootSession: function() {
let rootGbc = this.getRootGbc();
return rootGbc && rootGbc.SessionService.getCurrent();
},
getParentGbc: function() {
},
getParentSession: function() {
let parentWindow = window._multiWindowData.parentWindow;
let parentGbc = parentWindow && parentWindow.gbc;
return parentGbc && parentGbc.SessionService.getCurrent();
},
countChildWindows: function(filter = (w) => true) {
return window._multiWindowData.directChildren.filter(filter).length;
},
closeAllChildren: function() {
if (this.isRootWindow()) {
let children = window._multiWindowData.directChildren;
while (children.length) {
var w = children.pop();
w.__desactivateEndingPopup = true;
}
}
}
});
context.InitService.register(context.BrowserWindowsService);
});