public/js/GameControls.js
function createCmdButton(cmd, label, forceCheckbox, className) {
        var button;
        button = document.createElement('button');
        button.className = className || 'btn';
        button.innerHTML = label;
        button.onclick = function() {
            var cl;
            var clients, doLogic;
            cl = node.game.clientList;
            // Get selected clients.
            clients = cl.getSelectedClients();
            if (!clients || clients.length === 0) return;
            // If the room's logic client is selected, handle it specially.
            if (node.game.roomLogicId) {
                doLogic = J.removeElement(cl.roomLogicId, clients);
            }

            node.socket.send(node.msg.create({
                target: 'SERVERCOMMAND',
                text:   'ROOMCOMMAND',
                data: {
                    type:    cmd,
                    roomId:  cl.roomId,
                    doLogic: !!doLogic,
                    clients: clients,
                    force:   forceCheckbox.checked
                }
            }));
        };

        return button;
    }
function createCmdButton(cmd, label, forceCheckbox, className) {
        var button;
        button = document.createElement('button');
        button.className = className || 'btn';
        button.innerHTML = label;
        button.onclick = function() {
            var cl;
            var clients, doLogic;
            cl = node.game.clientList;
            // Get selected clients.
            clients = cl.getSelectedClients();
            if (!clients || clients.length === 0) return;
            // If the room's logic client is selected, handle it specially.
            if (node.game.roomLogicId) {
                doLogic = J.removeElement(cl.roomLogicId, clients);
            }

            node.socket.send(node.msg.create({
                target: 'SERVERCOMMAND',
                text:   'ROOMCOMMAND',
                data: {
                    type:    cmd,
                    roomId:  cl.roomId,
                    doLogic: !!doLogic,
                    clients: clients,
                    force:   forceCheckbox.checked
                }
            }));
        };

        return button;
    }
function createCmdButton ( cmd , label , forceCheckbox , className ) { var button ; button = document . createElement ( 'button' ) ; button . className = className || 'btn' ; button . innerHTML = label ; button . onclick = function ( ) { var cl ; var clients , doLogic ; cl = node . game . clientList ; // Get selected clients. clients = cl . getSelectedClients ( ) ; if ( ! clients || clients . length === 0 ) return ; // If the room's logic client is selected, handle it specially. if ( node . game . roomLogicId ) { doLogic = J . removeElement ( cl . roomLogicId , clients ) ; } node . socket . send ( node . msg . create ( { target : 'SERVERCOMMAND' , text : 'ROOMCOMMAND' , data : { type : cmd , roomId : cl . roomId , doLogic : ! ! doLogic , clients : clients , force : forceCheckbox . checked } } ) ) ; } ; return button ; }
Helper functions. 
Make a button that sends a given ROOMCOMMAND.
Helper functions . Make a button that sends a given ROOMCOMMAND .