if (!yuu.InputState) require("./input");
if (!yuu.Material) require("./gfx");
+ function getCommand (element) {
+ var command = element.getAttribute('data-yuu-command');
+ if (!command || command === 'data-yuu-command')
+ element.setAttribute('data-yuu-command', command = element.id);
+ return command;
+ }
+
yuu.Director = yT({
constructor: function (commandStack, input, tickHz) {
/** Manage and update a set of Scenes
yuu.downloadURL(
yuu.canvas.toDataURL("image/png"),
document.title + " (" + date + ").png");
- this.toast("\uf030", 0.5, "screenshot");
+ this.toast("📷", 0.5, "screenshot");
} catch (exc) {
var dialog = yuu.showError(exc);
if (dialog)
var elements = element.querySelectorAll("[data-yuu-command]");
yf.each(function (element) {
- var command = element.getAttribute("data-yuu-command");
+ var command = getCommand(element);
switch (element.tagName.toLowerCase()) {
case "input":
switch (element.type.toLowerCase()) {
function handleElement (event) {
/*jshint validthis:true */
/* `this` comes from being a DOM element event handler. */
- var command = this.getAttribute("data-yuu-command");
+ var command = getCommand(this);
switch (this.tagName.toLowerCase()) {
case "input":
switch (this.type.toLowerCase()) {
yuu.defaultKeybinds.bind("f11", "++fullscreen");
yuu.defaultKeybinds.bind("f12", "screenshot");
yuu.defaultKeybinds.bind(
- "control+s", "++mute && toast \uf026 1 mute || toast \uf028 1 mute");
+ "control+s", "++mute && toast 🔈 1 mute || toast 🔊 1 mute");
var director = yuu.director = new yuu.Director();
/** The standard director */