Start Session

Submit Completed Graph
More info
A
2, 22
22, 2
50, 50
0, 0
900, 1
A.)
B.)
C.)
D.)
E.)
6
inputA
1
inputB
What input would make the highlighted line of code run?
var inputA = parseFloat(this.get('inputA').textString); var inputB = parseFloat(this.get('inputB').textString); if (inputA < inputB) { } else { alertOK(inputB); }
alertOK(inputA);
grade

var grade = parseFloat(this.get('grade').textString); if (grade > 89) { alertOK('You got an A+!'); } else if (grade > 85) { alertOK('You got an A!'); } else if (grade > 79) { alertOK('You got an A-!'); } else if (grade > 76) { alertOK('You got a B+'); } else if (grade > 72) { alertOK('You got a B'); } else { alertOK('Your grade is lower than B'); }
$world.get('answerA').show() that.owner.show()

this KeyboardEvent

altGraphKey false

altKey false

bubbles true

cancelBubble false

cancelable true

charCode 0

clipboardData undefined

ctrlKey false

currentTarget null

defaultPrevented true

detail 0

eventPhase 0

getKeyChar Function

getKeyCode Function

getKeyString Function

getPosition Function

getPositionIn Function

getTargetMorph Function

hand HandMorph

hasLivelyPatch true

isAltDown Function

isArrowKey Function

isCommandKey Function

isCtrlDown Function

isInBoundsOf Function

isKeyboardEvent true

isLeftMouseButtonDown Function

isMiddleMouseButtonDown Function

isMouseEvent false

isRightMouseButtonDown Function

isShiftDown Function

isStopped true

keyCode 8

keyIdentifier U+0008

keyLocation 0

layerX 0

layerY 0

location 0

metaKey false

mousePoint Point

pageX 0

pageY 0

path NodeList

repeat false

returnValue false

scaledPos Point

shiftKey false

srcElement HTMLDivElement

stop Function

target HTMLDivElement

timeStamp 1412307702658

type keyup

view function () { var identi...

which 8

world World

inherited from KeyboardEvent.prototype
Filter:
X
Bind 'this' to selection
Inspector on: KeyboardEvent
X

Menu
[exited 0,pid 14405] /usr/bin/env bash -c ls /home/lively/LivelyKernel/users/alrusso
X

Menu
JavaScript Workspace
X

Menu
SubserverViewer
X

Menu
ObjectRepositoryServer
OptimizedLoadingServer
PartsBinCopy
PeerJSSubserver
PollServer
PrologNodeSWIServer
PrologServer
PythonSubserver
QBFScoresServer
RServer
RelaxExamples
SQLiteServer
SessionTracker
StateSynchronization
StaticFileServer
Store
TMNT
TestServer
TmpServer
TwitterAuthServer
URLShortener
UVicLibraryServer
UploadServer
UserDataServer
UserServer
UserDataServer is running at /nodejs/UserDataServer/

+
-
open log
module.exports = function(routeapp) {
    app.get(route, function(req, res) {
        res.end("UserDataServer is running!");
    });
    var foo = '';
    var fs = require('fs');
    
    // For testing/debug   
    app.get(route + 'dump', function(req, res) {
        res.end(foo);
    });
    
    app.post(route + 'send', function(req, res) {
        if (req.body && req.body.userData) {
            foo = foo + req.body.userData;
            fs.appendFile("users/alrusso/userDataFile2", req.body.userData, function(err) {
                if (err) {
                    foo = foo + 'there was an error\n';
                }
            });
            res.send({status: "ok", message: "data was received"});
        } else {
           // no data
           res.send({status: 'nok', message: 'No data received'});
        }
    });      
};
X
ObjectEditor -- <lively.morphic.World#1>
X

Menu
// changed at Fri Oct 10 2014 12:29:58 GMT-0700 (PDT) by unknown_user
this.addScript(function onLoad() {
    //this.get("eventStoreDef") && this.get("eventStoreDef").evalAll();
    // set up localStorage of userData, if not already there
/*    var a = {};
    if (localStorage.getItem('userData')) {
        // don't overwrite any data already stored in localStorage
        a = JSON.parse(localStorage.getItem('userData'));
    }
    localStorage.setItem('userData', JSON.stringify(a));
    
    // the "recordSpec" lets us describe what we want to capture. Add new options,
    // handlers, etc. as you need it
    Global.userData = {};
    Global.recordSpec = [
        {type: 'onMouseDown'},
        //{type: 'onMouseMove', throttle: 300},
        //{type: 'onKeyDown'},
        {type: 'onKeyUp'}];
        
    Global.eventStore = {
        // we just use an array as a storage for events
        events: [],
        
        // return the events
        getEvents: function() { return this.events },
        
        // clear the store
        pruneAll: function() { this.events.clear() },
    
X
<lively.morphic.World#1>
Tag:
run
save
Tests

-- ALL --
onLoad
Scripts
-
+
-
Connections
+
-- ALL --
savedWorldAsURL,AttributeConnection(<lively.morphic.World#1>.savedWorldAsURL --> <lively.morphic.World#1>.visitNewPageAfterSaveAs)
all
Error in handleEvent when calling <lively.morphic.World#1>>>onMouseDownEntryTypeError: Cannot read property 'events' of undefined stack:TypeError: Cannot read property 'events' of undefined at World.eval [as onMouseDown] (eval at <anonymous> (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:16380:29), <anonymous>:39:30) at World.lively.morphic.Morph.addMethods.onMouseDownEntry (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:33241:21) at EventHandler.Object.subclass.handleEvent (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32507:60) at HTMLDivElement.eventSpec.handlerFunc (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32449:57) at Object.e.dispatchEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:7839) at Object.e.fireEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:6633) at Object.e.down (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:4470) at Object.h.mousedown (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:11165) at Object.e.eventHandler (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:5970)
Error in handleEvent when calling <lively.morphic.World#1>>>onMouseDownEntryTypeError: Cannot read property 'events' of undefined stack:TypeError: Cannot read property 'events' of undefined at World.eval [as onMouseDown] (eval at <anonymous> (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:16380:29), <anonymous>:39:30) at World.lively.morphic.Morph.addMethods.onMouseDownEntry (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:33241:21) at EventHandler.Object.subclass.handleEvent (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32507:60) at HTMLDivElement.eventSpec.handlerFunc (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32449:57) at Object.e.dispatchEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:7839) at Object.e.fireEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:6633) at Object.e.down (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:4470) at Object.h.mousedown (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:11165) at Object.e.eventHandler (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:5970)
Error in handleEvent when calling <lively.morphic.World#1>>>onMouseDownEntryTypeError: Cannot read property 'events' of undefined stack:TypeError: Cannot read property 'events' of undefined at World.eval [as onMouseDown] (eval at <anonymous> (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:16380:29), <anonymous>:39:30) at World.lively.morphic.Morph.addMethods.onMouseDownEntry (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:33241:21) at EventHandler.Object.subclass.handleEvent (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32507:60) at HTMLDivElement.eventSpec.handlerFunc (http://lively-web.org/generated/3bbd4b256d811b947705af80b2ef40b2/combinedModules.js:32449:57) at Object.e.dispatchEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:7839) at Object.e.fireEvent (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:6633) at Object.e.down (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:4470) at Object.h.mousedown (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:11165) at Object.e.eventHandler (http://lively-web.org/core/lib/pointerevents/pointerevents.min.js:31:5970)