![JAR search and dependency download from the Maven repository](/logo.png)
webapp.scripts.services.window.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of willow-servers Show documentation
Show all versions of willow-servers Show documentation
Willow operational servlets and servers
The newest version!
Box.Application.addService('window', function(application) {
'use strict';
var intercom = application.getGlobal("Intercom").getInstance();
var localStorage = application.getGlobal("localStorage"); //application.getService("configuration-store");
var name = application.getGlobal("name");
var hashChangeCallbacks = [];
var utils = application.getService("utils");
// Add utilities here for communicating between browser windows
// and keeping track of open windows, .i.e. routing component
function _open(url, target) {
window.open(url, target);
}
function openRadiator(host) {
_open("radiator.html#host=" + host, "hostradiator-" + host);
}
function openTerminal(user, host) {
_open("shell.html?user=" + user + "&host=" + host, "_blank");
}
function openAlerts() {
_open("alerts.html", "index-alerts");
}
function sendToRadiator(radiatorName, graphConfig) {
var openWindows = localStorage.willowWindows ? JSON.parse(localStorage.willowWindows) : [];
if (openWindows.indexOf("radiator-" + radiatorName) == -1) {
_open("radiator.html#&name=" + radiatorName, "radiator-" + radiatorName);
} else {
intercom.emit("radiator-" + radiatorName + "-addgraph");
}
}
return {
openRadiatorForHost: openRadiator,
sendGraphToRadiator: sendToRadiator,
openTerminalToHost: openTerminal,
openAlerts: openAlerts,
getQueryVariable: function(variable) {
return this.getUrlVariable(window.location.search, variable);
},
getHashVariable: function(variable) {
return this.getUrlVariable(window.location.hash, variable);
},
getUrlVariable: function(urlsegment, variable) {
if (!urlsegment) return(false);
urlsegment = urlsegment.substring(1);
var vars = urlsegment.split("&");
for (var i=0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy