Professional Documents
Culture Documents
(function() {
"use strict";
// SET DURATION FOR AVATAR TO APPEAR
var defaultDuration = 800;
// SET DEFAULT AVATAR & change emojis - can be extended
// and changed by following the same syntax.
var avatars = {
'default': "??",
'5': "??",
'6': "??",
"7": "??",
"8": "??",
"9": "??"
}
function process(key) {
var avatar = avatars[key];
var duration = defaultDuration;
if (avatar) {
setAvatar(avatar);
if (reset != undefined) {
clearTimeout(reset);
}
reset = setTimeout(function() {
setAvatar(avatars['default']);
}, duration);
}
}
var reset;
//document.activeElement
var iframe;
setTimeout(function() {
iframe = document.querySelector("iframe").contentWindow.document;
iframe.body.addEventListener("keydown", listener, true);
console.log("Setup complete");
}, 3000);
})();