Move to ES6 missing static methods

This commit is contained in:
Juanjo Diaz 2018-01-29 07:28:57 -08:00
parent 78db60c760
commit a607c19f45
2 changed files with 47 additions and 47 deletions

View File

@ -657,10 +657,8 @@ export default class Display {
this.onflush();
}
}
}
// Class Methods
Display.changeCursor = (target, pixels, mask, hotx, hoty, w, h) => {
static changeCursor(target, pixels, mask, hotx, hoty, w, h) {
if ((w === 0) || (h === 0)) {
target.style.cursor = 'none';
return;
@ -697,4 +695,6 @@ Display.changeCursor = (target, pixels, mask, hotx, hoty, w, h) => {
const url = canvas.toDataURL();
target.style.cursor = 'url(' + url + ')' + hotx + ' ' + hoty + ', default';
};
}
}

View File

@ -1592,6 +1592,14 @@ export default class RFB extends EventTargetMixin {
Log.Info("Sending XVP operation " + op + " (version " + ver + ")");
RFB.messages.xvpOp(this._sock, ver, op);
}
static genDES(password, challenge) {
const passwd = [];
for (let i = 0; i < password.length; i++) {
passwd.push(password.charCodeAt(i));
}
return (new DES(passwd)).encrypt(challenge);
};
}
// Class Methods
@ -1892,14 +1900,6 @@ RFB.messages = {
}
};
RFB.genDES = (password, challenge) => {
const passwd = [];
for (let i = 0; i < password.length; i++) {
passwd.push(password.charCodeAt(i));
}
return (new DES(passwd)).encrypt(challenge);
};
RFB.encodingHandlers = {
RAW() {
if (this._FBU.lines === 0) {