Separate init functions from event handling setup
Adds a new section for all functions that add event handlers.
This commit is contained in:
parent
3fdc69ceda
commit
59387b34ea
52
app/ui.js
52
app/ui.js
|
@ -237,6 +237,34 @@ var UI;
|
|||
UI.initSetting('reconnect_delay', 5000);
|
||||
},
|
||||
|
||||
initRFB: function() {
|
||||
try {
|
||||
UI.rfb = new RFB({'target': document.getElementById('noVNC_canvas'),
|
||||
'onNotification': UI.notification,
|
||||
'onUpdateState': UI.updateState,
|
||||
'onDisconnected': UI.disconnectFinished,
|
||||
'onPasswordRequired': UI.passwordRequired,
|
||||
'onXvpInit': UI.updateXvpButton,
|
||||
'onClipboard': UI.clipboardReceive,
|
||||
'onBell': UI.bell,
|
||||
'onFBUComplete': UI.initialResize,
|
||||
'onFBResize': UI.updateSessionSize,
|
||||
'onDesktopName': UI.updateDesktopName});
|
||||
return true;
|
||||
} catch (exc) {
|
||||
var msg = "Unable to create RFB client -- " + exc;
|
||||
Util.Error(msg);
|
||||
UI.showStatus(msg, 'error');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/* ------^-------
|
||||
* /INIT
|
||||
* ==============
|
||||
* EVENT HANDLERS
|
||||
* ------v------*/
|
||||
|
||||
addResizeHandlers: function() {
|
||||
window.addEventListener('resize', UI.applyResizeMode);
|
||||
window.addEventListener('resize', UI.updateViewClip);
|
||||
|
@ -416,30 +444,8 @@ var UI;
|
|||
window.addEventListener('msfullscreenchange', UI.updateFullscreenButton);
|
||||
},
|
||||
|
||||
initRFB: function() {
|
||||
try {
|
||||
UI.rfb = new RFB({'target': document.getElementById('noVNC_canvas'),
|
||||
'onNotification': UI.notification,
|
||||
'onUpdateState': UI.updateState,
|
||||
'onDisconnected': UI.disconnectFinished,
|
||||
'onPasswordRequired': UI.passwordRequired,
|
||||
'onXvpInit': UI.updateXvpButton,
|
||||
'onClipboard': UI.clipboardReceive,
|
||||
'onBell': UI.bell,
|
||||
'onFBUComplete': UI.initialResize,
|
||||
'onFBResize': UI.updateSessionSize,
|
||||
'onDesktopName': UI.updateDesktopName});
|
||||
return true;
|
||||
} catch (exc) {
|
||||
var msg = "Unable to create RFB client -- " + exc;
|
||||
Util.Error(msg);
|
||||
UI.showStatus(msg, 'error');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/* ------^-------
|
||||
* /INIT
|
||||
* /EVENT HANDLERS
|
||||
* ==============
|
||||
* VISUAL
|
||||
* ------v------*/
|
||||
|
|
Loading…
Reference in New Issue