HTTP/1.1 200 OK
Cache-Control: private
Keep-Alive: true
Content-Length: 38613
Content-Type: text/html; charset=utf-8
Server: ScreenConnect/20.7.29386.7502-25308623 Microsoft-HTTPAPI/2.0
P3P: CP="NON CUR OUR STP STA PRE"
Date: Fri, 15 Jan 2021 03:03:40 GMT
Connection: close
<!DOCTYPE html>
<html>
<head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<script>
function setTaggedSessionInfo(tag, taggedSessionInfo) {
var oldTaggedSessionInfo = window._taggedSessionInfos[tag];
window._taggedSessionInfos[tag] = taggedSessionInfo;
if (!oldTaggedSessionInfo || taggedSessionInfo.SessionID != oldTaggedSessionInfo.SessionID || taggedSessionInfo.Code != oldTaggedSessionInfo.Code)
SC.pagedata.notifyDirty();
}
// backwards compatibility with extensions
function setTaggedSessionID(tag, sessionID) {
window.setTaggedSessionInfo(tag, { SessionID: sessionID });
}
function getTaggedSessionInfo(tag) {
return window._taggedSessionInfos[tag];
}
</script>
<script src="Script.ashx?__Cache=44960c72-610a-4c6a-b393-f55e0d1c95ae" id="defaultScript"></script>
<link href="App_Themes/LightWithRed/Default.css?__Cache=09fea76f-818e-414f-805c-f9488e2bc019" type="text/css" rel="stylesheet" /><link href="FavIcon.axd?__Cache=e34bc08c-b1b0-46df-a972-08f8e4b9a752" rel="shortcut icon" />
<script>SC.util.mergeIntoContext({"focusedControlID":null,"userDisplayName":"","isUserAuthenticated":false,"antiForgeryToken":"6RRU6i/Eiselar8377ZJZ40+esFexlxsaLSvPMtXC+sBAADtfBn6Ja8tQg==","isUserAdministrator":false,"canManageSharedToolbox":false,"pageBaseFileName":"Guest","notifyActivityFrequencyMilliseconds":600000,"loginAfterInactivityMilliseconds":0,"canChangePassword":false,"controlPanelUrl":null,"pageType":"GuestPage","processType":2,"userAgentOverride":null,"sessionTypeInfos":[]});</script>
<link href="App_Extensions/c42e9fe5-f4aa-4698-bb71-ae68b8a23890/Base.css" type="text/css" rel="stylesheet" />
<script>SC.extension.addInitializeProc('fa369545-ba27-4670-b053-a9f65f3269b0', function (extensionContext) {
if (SC.context.pageType == 'AdministrationPage' && SC.context.isUserAuthenticated)
SC.service.GetThemeInfo(function (themeInfo) {
SC.util.includeStyleSheet(extensionContext.baseUrl + 'css/Style.css');
});
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function (eventArgs) {
switch (eventArgs.commandName) {
case 'WebConfigSave':
SC.dialog.showModalButtonDialog(
'Prompt',
SC.res['AdvancedConfig.ApplyChanges'],
'OK',
'Default',
function (container) {
SC.ui.setContents(container, [
eventArgs.commandArgument === 'WebConfigRestore' ? $p(SC.res['AdvancedConfig.RestoreDefaults.WebConfigWarning']) : $p(SC.res['AdvancedConfig.RestartInstanceWarning'])
]);
},
function () {
var appSettings = JSON.parse(sessionStorage.getItem('WebConfigAppSettings'));
var pageSettings = JSON.parse(JSON.stringify(appSettings.location));
delete appSettings.location;
SC.service.WriteChangesToWebConfig(appSettings, pageSettings, function (result) {
if (result === 'OK') {
sessionStorage.removeItem('WebConfigAppSettings');
SC.dialog.showModalActivityAndReload('Save', true, window.location.href.split('#')[0]);
} else {
SC.dialog.showModalMessageBox(SC.res['AdvancedConfig.SaveError.Title'], SC.res['AdvancedConfig.SaveError.WebConfigDescription'] + ' ' + result);
}
});
}
);
break;
case 'AppConfigSave':
SC.dialog.showModalButtonDialog(
'Prompt',
SC.res['AdvancedConfig.ApplyChanges'],
'OK',
'Default',
function (container) {
SC.ui.setContents(container, [
eventArgs.commandArgument === 'AppConfigRestore' ? $p(SC.res['AdvancedConfig.RestoreDefaults.AppConfigWarning']) : $p(SC.res['AdvancedConfig.ReinstallWarning'])
]);
},
function () {
var systemSettings = JSON.parse(sessionStorage.getItem('AppConfigAppSettings')).SystemSettings;
var userInterfaceSettings = JSON.parse(sessionStorage.getItem('AppConfigAppSettings')).UserInterfaceSettings;
SC.service.WriteChangesToAppConfig(systemSettings, userInterfaceSettings, AppConfigDefaults, function (result) {
if (result === 'OK') {
sessionStorage.removeItem('AppConfigAppSettings');
window.location.reload();
} else {
SC.dialog.showModalMessageBox(SC.res['AdvancedConfig.SaveError.Title'], SC.res['AdvancedConfig.SaveError.AppConfigDescription'] + ' ' + result);
}
});
}
);
break;
}
});
});</script>
<script>SC.extension.addInitializeProc('c42e9fe5-f4aa-4698-bb71-ae68b8a23890', function (extensionContext) {
/** Adavanced SMTP Settings (1.2.0.0) **/
var extensionId = extensionContext.baseUrl.split("/").slice(-2)[0];
/***** Extension Help Option *****/
var helpLink = "https://help.screenconnect.com/Extension:Advanced_SMTP_Settings";
var extensionResourceID = "EditSMTPSettings";
SC.event.addGlobalHandler(SC.event.QueryCommandButtonState, function(eventArgs){
switch(eventArgs.commandName) {
case 'EditExtensionSettings':
if (eventArgs.commandContext.extensionInfo.ExtensionID == extensionId && eventArgs.commandElement._commandName == "EditExtensionSettings"){
SC.ui.addElement(eventArgs.target.parentElement,"A",{href:"#",_commandName:'command_' + extensionId,_innerText:SC.res['Extension.' + extensionResourceID + '.CommandText']});
SC.ui.addElement(eventArgs.target.parentElement,"A",{href:"#",_commandName:(SC.context.scriptBaseUrl.indexOf("https://") == helpLink.indexOf("https://") ? 'ShowHelpLink_' : 'OpenHelpLink_') + extensionId,_innerText:SC.res['Command.Help.Text'].replace(" ▽","")});
}
break;
}
});
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function(eventArgs){
switch (eventArgs.commandName) {
case 'ShowHelpLink_' + extensionId:
SC.dialog.showModalPage(SC.res['Command.Help.Text'].replace(" ▽",""), helpLink, null);
break;
case 'OpenHelpLink_' + extensionId:
window.open(helpLink, "_blank");
break;
}
});
/*********************************/
SC.event.addGlobalHandler(SC.event.QueryCommandButtons,function (eventArgs) {
switch (eventArgs.area) {
case 'ExtrasPopoutPanel':
case 'ShowLink_' + extensionId:
if (SC.context.pageType == 'AdministrationPage') {
eventArgs.buttonDefinitions.push(
{ commandName: 'command_' + extensionId,
text: SC.res['Extension.EditSMTPSettings.CommandText']}
);
}
break;
case 'ShowReturnLink_' + extensionId:
if (SC.context.pageType == 'AdministrationPage') {
eventArgs.buttonDefinitions.push(
{ commandName: 'returncommand_' + extensionId,
text: SC.res['Extension.EditSMTPSettings.ReturnCommandText']}
);
}
break;
}
});
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function (eventArgs) {
switch(eventArgs.commandName)
{
case 'command_' + extensionId:
window.location.href = extensionContext.baseUrl + (SC.context.productVersion.substring(0,1) == "5" ? "Legacy" : "") + 'AdvAdmin.aspx';
break;
case 'returncommand_' + extensionId:
window.location.href = SC.context.scriptBaseUrl + 'Administration?Tab=' + extensionContext.settingValues.MailTabNumber;
break;
}
});
SC.event.addGlobalHandler(SC.event.PreRender, function (eventArgs) {
if (SC.context.pageType == 'AdministrationPage' && SC.context.tabKeys[SC.context.tabIndex] == 'Mail') {
SC.util.includeStyleSheet(extensionContext.baseUrl + 'DisplayButtonPanel.css');
if (SC.context.tabKeys.length > 1)
SC.ui.addContent($('buttonPanel'), SC.command.queryAndCreateCommandButtons('ShowLink_' + extensionId));
else {
SC.ui.addContent($('buttonPanel'), SC.command.queryAndCreateCommandButtons('ShowReturnLink_' + extensionId));
// Ensure 6.0+ Navigation Icons are being pulled from the right location.
Array.prototype.forEach.call(
document.querySelectorAll('.NavigationPanel img'),
function(img){
img.src = img.src.replace("App_Extensions/" + extensionId + "/","");
});
// Backward compatibility for password info tooltip on 5.5 and earlier.
if (SC.context.productVersion.split('.')[0] == "5" && SC.context.productVersion.split('.')[1] < "6"){
$("smtpPasswordStorageNotice").title = SC.res['MailPanel.smtpPasswordStorageNotice'];
}
}
}
});
});</script>
<script>SC.extension.addInitializeProc('0586dae2-3bf3-4fd0-a23d-4c0bec73b053', function (extensionContext) {
/**[ Extension Constants and Globals ]**/
const extensionId=extensionContext.baseUrl.split('/').slice(-2)[0];
var activeEditor = null;
/**[ Extension Options ]**/
SC.res['HelpPanel.Link'+extensionId+'.Url']='https://help.screenconnect.com/Extension:Edit_Web.Config_AppSettings';
SC.event.addGlobalHandler(SC.event.QueryCommandButtonState,function(e){
if(e.commandElement._commandName=='EditExtensionSettings'&&e.commandContext.extensionInfo.ExtensionID==extensionId){
SC.ui.addElement(e.target.parentElement,'A',{_commandName:'command_'+extensionId,_commandArgument:'WebConfig',_innerText:SC.res['Extension.ConfigEditor.WebConfig.CommandText']});
SC.ui.addElement(e.target.parentElement,'A',{_commandName:'command_'+extensionId,_commandArgument:'AppConfig',_innerText:SC.res['Extension.ConfigEditor.AppConfig.CommandText']});
SC.ui.addElement(e.target.parentElement,'A',{_commandName:'NavigateHelpLink',_commandArgument:extensionId,_innerText:SC.res['Command.Help.Text'].replace(' ▽','')});
}
});
/**[ Helper Methods ]**/
function addCacheBuster(url) {
var cachebuster = '__CacheBuster=' + new Date().getTime();
return (
url.indexOf('?') != -1 ?
url.split('?')[0] + '?' + cachebuster + '&' + url.split('?')[1] :
(url.indexOf('#') != -1 ?
url.split('#')[0] + '?' + cachebuster + '#' + url.split('#')[1] :
url + '?' + cachebuster
)
);
}
function httpRequestJSONObjectAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
callback(JSON.parse(xmlHttp.responseText));
} else if (xmlHttp.readyState === 4) {
console.warn('Metaquery failed');
}
};
xmlHttp.open('GET', addCacheBuster(theUrl), true);
xmlHttp.send();
}
/**[ Event Handlers ]**/
/* // Removed while transitioning to an official extension to avoid confusion with current supported extensions.
SC.event.addGlobalHandler(SC.event.QueryCommandButtons,function (e) {
if (e.area=='ExtrasPopoutPanel' && SC.context.pageType == 'AdministrationPage')
e.buttonDefinitions.push({
commandName: 'command_' + extensionId, commandArgument: 'WebConfig',
text: SC.res['Extension.ConfigEditor.WebConfig.CommandText']
},{
commandName: 'command_' + extensionId, commandArgument: 'AppConfig',
text: SC.res['Extension.ConfigEditor.AppConfig.CommandText']
});
});
*/
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function (e) {
if (e.commandName == 'command_' + extensionId) {
activeEditor = e.commandArgument;
SC.event.addHandler(window, 'message', messageHandler);
SC.dialog.showModalPage(
SC.res['Extension.ConfigEditor.'+e.commandArgument+'.CommandText'],
addCacheBuster(extensionContext.baseUrl + 'ConfigEditor.aspx?DM=parent&Type='+e.commandArgument),
function(e){
activeEditor = null;
SC.event.removeHandler(window, 'message', messageHandler);
}
);
}
});
var messageHandler = function(e) {
if (document.querySelector('iframe').src.startsWith(e.origin)) {
switch (e.data.commandName) {
case 'GetLiveConfigs':
SC.service.ConfigEditorGetConfigFiles(function(response){
e.source.postMessage({
commandName: 'processLoadedData',
commandArgument: response
},window.location.origin);
});
break;
case 'SaveUpdatedConfigs':
SC.service.ConfigEditorSaveConfigFiles(
e.data.commandArgument["app.config"],
e.data.commandArgument["web.config"],
function(_){
var response = _ ? {
'updatedAppConfigXml':e.data.commandArgument["app.config"],
'updatedWebConfigXml':e.data.commandArgument["web.config"]
} : _;
e.source.postMessage({
commandName: 'processSaveComplete',
commandArgument: response
},window.location.origin);
}
);
break;
}
}
};
});</script>
<title>
ConnectWise Control Remote Support Software
</title></head>
<body>
<div class="HiddenPanel"></div>
<script>
SC.ui.setVisible(document.body, false);
</script>
<div class="OuterPanel">
<div class="HeaderPanel"></div>
<div class="GlobalBar"></div> <!--TODO SHELL-->
<div class="NavigationPanel ArrowNavigation" tabindex="10"></div>
<div class="MainPanel">
<div class="ContentPanel">
<div>
<div class="WelcomePanel"></div>
<div class="ActionPanel"></div>
</div>
<div class="InfoPanel"></div>
</div>
</div>
</div>
<script>
SC.context.scriptBaseUrl = SC.util.getBaseUrl($('defaultScript').src);
</script>
<script>
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function (eventArgs) {
var session = null;
var hostAccessToken = null;
switch (eventArgs.commandName) {
case 'JoinBySessionID':
session = SC.pagedata.get().Sessions.filter(function (s) { return s.SessionID == eventArgs.commandArgument; })[0];
break;
case 'JoinByTag':
var taggedSessionInfo = window.getTaggedSessionInfo(eventArgs.commandArgument);
hostAccessToken = taggedSessionInfo.HostAccessToken;
session = SC.pagedata.get().Sessions.filter(function (s) { return s.SessionID == taggedSessionInfo.SessionID || (taggedSessionInfo.Code && s.Code.toLowerCase() == taggedSessionInfo.Code.toLowerCase()); })[0];
break;
}
// older IE only allows launching urls on actual clicks and this could be sent by a keystroke
if (session && (SC.command.doesClickDispatch(eventArgs.commandElement) || !SC.util.isCapable(SC.util.Caps.InternetExplorer, null, { major: 11 }))) {
SC.launch.startJoinSession(
{ session: session, hostAccessToken: hostAccessToken, processType: hostAccessToken ? SC.types.ProcessType.Host : SC.types.ProcessType.Guest },
function (joinInfo, _, onSuccess, onFailure) {
onSuccess(
SC.util.getClientLaunchParameters(
joinInfo.session.SessionID,
joinInfo.session.SessionType,
joinInfo.session.Name,
joinInfo.fieldMap.participantName.value,
null,
joinInfo.hostAccessToken,
joinInfo.processType
)
);
}
);
}
});
SC.event.addGlobalHandler(SC.event.QueryJoinInfo, function (eventArgs) {
if (eventArgs.session) {
eventArgs.shouldShowPrompt = SC.util.getSessionTypeBooleanResource('JoinPanel.{0}PromptVisible', eventArgs.session.SessionType);
eventArgs.promptText = SC.util.getSessionTypeResource('JoinPanel.{0}PromptMessage', eventArgs.session.SessionType);
eventArgs.buttonText = SC.util.getSessionTypeResource('JoinPanel.{0}PromptButtonText', eventArgs.session.SessionType);
eventArgs.fieldMap.participantName = {
labelText: SC.util.getSessionTypeResource('JoinPanel.{0}ParticipantNameLabelText', eventArgs.session.SessionType),
value: '',
visible: SC.util.getSessionTypeBooleanResource('JoinPanel.{0}PromptParticipantNameVisible', eventArgs.session.SessionType),
};
}
});
SC.event.addGlobalHandler(SC.event.QueryParticipantJoinedCount, function (eventArgs) {
var sessionInfo = SC.pagedata.get();
var session = sessionInfo.Sessions.find(function (s) { return s.SessionID === eventArgs.clientLaunchParameters.s; });
if (session !== undefined)
eventArgs.participantJoinedCount = session.ActiveConnections.filter(function (ac) {
if (eventArgs.clientLaunchParameters.n)
return ac.ProcessType == SC.types.ProcessType.Host;
return ac.ProcessType == SC.types.ProcessType.Guest && ac.ParticipantName == eventArgs.clientLaunchParameters.r;
}).length;
});
SC.event.addGlobalHandler(SC.event.QueryPanels, function (eventArgs) {
switch (eventArgs.area) {
case 'GuestActionPanel':
eventArgs.panelDefinitions.push({
initProc: function (container) {
SC.ui.setContents(container, $div({ className: 'Loading' }));
},
isVisibleProc: function (pass, previousPassVisibleCount, sessionInfo) {
return pass == 1 && sessionInfo == null;
}
});
eventArgs.panelDefinitions.push({
initProc: function (container) {
SC.ui.setContents(container, [
$a({ _commandName: 'JoinByTag', _commandArgument: 'DefaultSession', className: 'GoLink Large', _attributeMap: { 'aria-label': SC.res['GuestActionPanel.ButtonDescription'] } }),
$h2({ _htmlResource: 'GuestActionPanel.InvitationSession.Heading' }),
$p({ _htmlResource: 'GuestActionPanel.InvitationSession.Message' }),
]);
},
isVisibleProc: function (pass, previousPassVisibleCount, sessionInfo) {
return pass == 3 &&
previousPassVisibleCount == 0 &&
sessionInfo != null &&
sessionInfo.Sessions.find(function (s) { return s.SessionID == window.getTaggedSessionInfo('DefaultSession').SessionID; });
}
});
eventArgs.panelDefinitions.push({
initProc: function (container) {
SC.ui.setContents(container, [
$h2({ _htmlResource: 'GuestActionPanel.CodeSession.Heading' }),
$p({ _htmlResource: 'GuestActionPanel.CodeSession.Message' }),
$p({ className: 'GuestActionBar' }, [
SC.ui.createSearchTextBox({ _commandName: 'JoinByTag', _commandArgument: 'DefaultCode', value: window.getTaggedSessionInfo('DefaultCode').Code || '' }, function (eventArgs) {
var sessionCode = SC.util.getTrimmedOrNull(SC.event.getElement(eventArgs).value);
window.setTaggedSessionInfo('DefaultCode', { Code: sessionCode });
}),
$a({ _commandName: 'JoinByTag', _commandArgument: 'DefaultCode', className: 'GoLink Medium', _attributeMap: { 'aria-label': SC.res['GuestActionPanel.ButtonDescription'] } }),
]),
]);
},
isVisibleProc: function (pass, previousPassVisibleCount, sessionInfo) {
return pass == 5 && previousPassVisibleCount == 0 && sessionInfo != null && sessionInfo.DoNonPublicCodeSessionsExist;
},
refreshProc: function (container, sessionInfo, wasMadeVisible) {
var taggedSessionInfo = window.getTaggedSessionInfo('DefaultCode');
SC.ui.setDisabled(
SC.ui.findDescendentByTag(container, 'A'),
!sessionInfo.Sessions.find(function (s) { return taggedSessionInfo.Code && s.Code.toLowerCase() == taggedSessionInfo.Code.toLowerCase(); })
);
if (wasMadeVisible)
SC.ui.findDescendentByTag(container, 'INPUT').focus();
}
});
eventArgs.panelDefinitions.push({
initProc: function (container) {
SC.ui.setContents(container, [
$h2({ _htmlResource: 'GuestActionPanel.PublicSession.Heading' }),
$p({ _htmlResource: 'GuestActionPanel.PublicSession.Message' }),
$p({ className: 'GuestActionBar' }, [
$select(),
$a({ _commandName: 'JoinBySessionID', className: 'GoLink Medium', _attributeMap: { 'aria-label': SC.res['GuestActionPanel.ButtonDescription'] } }),
]),
]);
SC.event.addHandler(SC.ui.findDescendentByTag(container, 'SELECT'), 'change', function (eventArgs) {
var selectBox = SC.event.getElement(eventArgs);
SC.ui.findDescendentByTag(container, 'A')._commandArgument = selectBox.options[selectBox.selectedIndex].value;
});
},
isVisibleProc: function (pass, previousPassVisibleCount, sessionInfo) {
return pass == 5 && previousPassVisibleCount == 0 && sessionInfo != null && sessionInfo.Sessions.filter(function (s) { return s.IsPublic; }).length > 0;
},
refreshProc: function (container, sessionInfo, wasMadeVisible) {
var selectBox = SC.ui.findDescendentByTag(container, 'SELECT');
var link = SC.ui.findDescendentByTag(container, 'A');
SC.ui.setContents(selectBox,
sessionInfo.Sessions.filter(function (s) { return s.IsPublic; }).map(function (s) {
return $option({ value: s.SessionID }, s.Name);
})
);
var optionIndex = Array.prototype.findIndex.call(selectBox.options, function (o) { return o.value == link._commandArgument; });
if (optionIndex != -1)
selectBox.selectedIndex = optionIndex;
else
link._commandArgument = selectBox.options[selectBox.selectedIndex].value;
}
});
eventArgs.panelDefinitions.push({
initProc: function (container) {
SC.ui.setContents(container, [
$h2({ _htmlResource: 'GuestActionPanel.NoAvailableSessions.Heading' }),
$p({ _htmlResource: 'GuestActionPanel.NoAvailableSessions.Message' }),
]);
},
isVisibleProc: function (pass, previousPassVisibleCount, sessionInfo) {
return pass == 8 && previousPassVisibleCount == 0;
}
});
break;
}
});
SC.event.addGlobalHandler(SC.event.PreRender, function () {
window._taggedSessionInfos = {};
SC.css.ensureClass(document.documentElement, 'ShowMenu', false);
var queryStringMap = SC.util.parseQueryString(window.location.search);
window.setTaggedSessionInfo('DefaultCode', { Code: queryStringMap.Code });
window.setTaggedSessionInfo('DefaultSession', { SessionID: queryStringMap.Session, HostAccessToken: queryStringMap.HostAccessToken });
var welcomePanel = $('.WelcomePanel');
var actionPanel = $('.ActionPanel');
SC.ui.setVisible(welcomePanel, SC.util.getBooleanResource('GuestWelcomePanel.Visible'));
SC.ui.setContents(welcomePanel, [
$h2({ _htmlResource: 'GuestWelcomePanel.Heading' }),
$p({ _htmlResource: 'GuestWelcomePanel.Message' }),
]);
SC.panellist.queryAndInitializePanels(actionPanel);
SC.panellist.refreshPanels(actionPanel, null);
var getTaggedValuesFunc = function (propertyName) {
return Object.keys(window._taggedSessionInfos)
.map(function (key) { return window._taggedSessionInfos[key]; })
.filter(function (_) { return _[propertyName]; })
.map(function (_) { return _[propertyName]; });
}
SC.pagedata.startPageDataLoop(function (version, onSuccess, onFailure) {
return SC.service.GetGuestSessionInfo(
getTaggedValuesFunc('Code'),
getTaggedValuesFunc('SessionID'),
version,
onSuccess,
onFailure
);
});
});
SC.event.addGlobalHandler(SC.event.PageDataRefreshed, function (eventArgs) {
SC.panellist.refreshPanels($('.ActionPanel'), eventArgs.pageData);
if (!window._hasJoinedDefault && !SC.util.isCapable(SC.util.Caps.InternetExplorer, null, { major: 11 })) {
SC.command.dispatchExecuteCommand(window.document.body, window.document.body, window.document.body, 'JoinByTag', 'DefaultSession');
window._hasJoinedDefault = true;
}
});
</script>
<script>
SC.event.addGlobalHandler(SC.event.QueryCommandButtons, function (eventArgs) {
switch (eventArgs.area) {
case 'TrayIconPanel':
eventArgs.buttonDefinitions.push(
{ commandName: 'Extras', imageUrl: 'Images/ExtensionIcon.svg', className: 'ExtrasButton' },
{ commandName: 'Applications', imageUrl: 'Images/WaffleIcon.svg' }
);
break;
case 'ToolsPanel':
eventArgs.buttonDefinitions.push(
{ commandName: 'Extras', imageUrl: 'Images/Extras.svg', className: 'ExtrasButton' },
{ commandName: 'Login' }
);
break;
case 'UserPopoutPanel':
eventArgs.buttonDefinitions.push(
{ commandName: 'NavigateControlPanel' },
{ commandName: 'ChangePassword' },
{ commandName: 'Logout' }
);
break;
case 'HelpPopoutPanel':
if (SC.context.pageType !== 'GuestPage' && SC.context.pageType != 'LoginPage') {
eventArgs.buttonDefinitions.push({ commandName: 'GiveFeedback' });
for (var i = 1; ; i++) {
var resourceValue = SC.res['HelpPanel.Link' + i + '.Text'];
if (resourceValue === undefined || resourceValue === '')
break;
eventArgs.buttonDefinitions.push({ commandName: 'NavigateHelpLink', commandArgument: i, text: resourceValue });
}
}
break;
}
});
SC.event.addGlobalHandler(SC.event.QueryCommandButtonState, function (eventArgs) {
switch (eventArgs.commandName) {
case 'User':
eventArgs.isVisible = SC.context.isUserAuthenticated;
break;
case 'Login':
eventArgs.isVisible = SC.context.pageType != 'SetupWizardPage' && SC.context.pageType != 'LoginPage' && !SC.context.isUserAuthenticated;
break;
case 'NavigateControlPanel':
eventArgs.isVisible = !!SC.context.controlPanelUrl;
break;
case 'ChangePassword':
eventArgs.isVisible = SC.context.canChangePassword;
break;
case 'Extras':
case 'Applications':
eventArgs.isVisible = SC.popout.computePopoutCommandsVisible(eventArgs);
break;
case 'Help':
eventArgs.isVisible = SC.popout.computePopoutCommandsVisible(eventArgs);
break;
}
});
SC.event.addGlobalHandler(SC.event.ExecuteCommand, function (eventArgs) {
switch (eventArgs.commandName) {
case 'Extras':
case 'Applications':
SC.popout.showPanelFromCommand(eventArgs, null, function (popoutPanel) {
SC.css.ensureClass(popoutPanel, eventArgs.commandName + 'Popout', true);
});
break;
case 'Login':
SC.util.sendToLogin(SC.types.LoginReason.None, false);
break;
case 'Logout':
SC.util.sendToLogin(SC.types.LoginReason.Logout, false);
break;
case 'User':
SC.popout.togglePanel(eventArgs.commandElement, function (popoutPanel) {
['HelpPopoutPanel', 'UserPopoutPanel'].forEach(function (_) {
var commandButtons = SC.command.queryAndCreateCommandButtons(_);
if (commandButtons.length)
popoutPanel.appendChild($div(commandButtons));
});
SC.command.updateCommandButtonsState(popoutPanel);
});
break;
case 'NavigateControlPanel':
window.open(SC.context.controlPanelUrl);
break;
case 'ChangePassword':
window.location.href = SC.context.changePasswordPageUrl;
break;
case 'NavigateHelpLink':
window.open(SC.res['HelpPanel.Link' + eventArgs.commandArgument + '.Url']);
break;
case 'ToggleMenu':
SC.css.toggleClass(document.documentElement, 'ShowMenu');
break;
case 'GiveFeedback':
SC.dialog.showModalButtonDialog(
'GiveFeedback',
SC.res['Command.GiveFeedback.Text'],
SC.res['Command.GiveFeedback.ButtonText'],
'Default',
function (container) {
SC.ui.setContents(container, [
$div({ _textResource: 'GiveFeedbackPanel.ReviewLabelText' }),
$div({ className: 'RatingSelectionPanel' },
['Good', 'Neutral', 'Bad'].map(function (rating) {
return $span(
$label({ className: rating }, [
$input({ type: 'radio', name: 'rating', value: rating.toLowerCase() }),
$div({ className: 'RadioImage' }),
$span({ _textResource: 'GiveFeedbackPanel.' + rating + 'RatingLabelText' }),
])
);
})
),
$div([
$label({ _textResource: 'GiveFeedbackPanel.EmailLabelText' }, [
$input({ type: 'email', id: 'email' }),
]),
]),
$div([
$label({ _textResource: 'GiveFeedbackPanel.CommentsLabelText' }, [
SC.ui.createTextBox({ id: 'commentsBox' }, true),
]),
]),
]);
},
function (eventArgs) {
SC.service.SendFeedback(
Array.prototype.map.call(document.querySelectorAll('input[name=rating]:checked'), function (e) { return e.value; })[0],
$('commentsBox').value,
$('email').value,
function () {
SC.dialog.showModalMessageBox(
SC.res['GiveFeedbackPanel.SuccessHeading'],
SC.res['GiveFeedbackPanel.SuccessMessage']
);
}
);
}
);
break;
case 'ManageToolbox':
SC.toolbox.showToolboxDialog(eventArgs.commandName, eventArgs.commandArgument);
break;
case 'Navigate':
window.location.href = eventArgs.commandArgument;
break;
}
});
SC.event.addGlobalHandler(SC.event.QueryNavigationLinks, function (eventArgs) {
Array.prototype.push.apply(eventArgs.navigationLinks, SC.context.sessionTypeInfos.map(function (_) {
return {
href: SC.context.scriptBaseUrl + SC.context.hostPageUrl + '#' + SC.util.getEnumValueName(SC.types.SessionType, _.sessionType),
text: SC.util.getSessionTypeResource('NavigationPanel.{0}LinkText', _.sessionType),
imageUrl: SC.util.formatString('Images/Navigation{0}.svg', SC.util.getEnumValueName(SC.types.SessionType, _.sessionType)),
hasDynamicAlignment: false, // TODO SHELL
sessionType: _.sessionType,
}
}));
if (SC.context.isUserAdministrator)
eventArgs.navigationLinks.push({
href: SC.context.scriptBaseUrl + SC.context.administrationPageUrl,
text: SC.res['NavigationPanel.AdministrationLinkText'],
imageUrl: 'Images/NavigationAdministration.svg',
hasDynamicAlignment: true, // TODO S