Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff H committed Aug 13, 2013
1 parent 5ac275c commit 3d4ac56
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions www/js/e.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,21 @@ var ProcCode;
var emsg_handle = function(tuple) {
var command = tuple[0];

/*
All events sent by the server should make
function calls to the erland controller.
Which is part of the erland app
*/

// get pointers to the erland UI
var myApp = erlandUI.app.getApplication();
var myC = myApp.getController('erland');

/*
then ANY rule below should make a call to
myC.something()
*/

switch(command.value)
{
case 'new':
Expand All @@ -51,14 +62,19 @@ var emsg_handle = function(tuple) {
break;
case 'create_window':
//createWindow(tuple);
// create a window/tab in the erland UI
myC.createWindow(tuple);
break;
case 'window_add_image':
//
// create add a '<img/>' tag to an existing window
myC.setWindowImage(tuple);
//windowAddImage(tuple);
break;
case 'window_update_image':
//console.log ( 'emsg_handle:window_update_image');
// update the '<img/>' tag in an existing window
// (this is the same as 'setWindowImage()'
myC.setWindowImage(tuple);
//windowUpdateImage(tuple);
break;
Expand All @@ -73,6 +89,7 @@ var emsg_handle = function(tuple) {
break;
default:
eClientStub(tuple);
break;
}
};

Expand Down Expand Up @@ -103,7 +120,8 @@ var constructE = function(tuple) {
constructTextArea(tuple);
break;
default:
alert("Invalid type argument to new: " + Type)
alert("Invalid type argument to new: " + Type) ;
break;
}
};

Expand Down Expand Up @@ -197,19 +215,30 @@ function launchEClock(tuple)
var Width = tuple[1];
var Height = tuple[2];

// make a call to the view controller to create the window
// and get back a ref to the DOM for processing
/*
make a call to the view controller to create the window
and get back a ref to the DOM for processing
*/

// so first get a pointer to the controller
var myApp = erlandUI.app.getApplication();
var myC = myApp.getController('erland');

// then call something that creates a window
// and returns a pointer to the canvas.dom inside that window
var dom = myC.createWindowCanvas( 'EClock' , Width , Height );

// now processing can talk to that dom directly
var processingInstance = new Processing(dom, sketchClock);
processingInstance.size(Width,Height);

};

function launchProcessing(tuple)
{
/*
see the comments in launchEClock() above
*/
var Width = tuple[1];
var Height = tuple[2];
var FuncName = tuple[3];
Expand Down

0 comments on commit 3d4ac56

Please sign in to comment.