Commits

Cat's Eye Technologies  committed 859ef18

Replace .wrapIt() with .wrapWith() (caller decides wrapper.)

  • Participants
  • Parent commits 7407ad9

Comments (0)

Files changed (2)

File impl/pixley.js/demo/pixley.html

 <button id="start">Start</button>
 <button id="stop">Stop</button>
 <button id="step">Step</button>
-<button onclick="c.wrapIt();">Wrap it!</button>
+<button onclick="c.wrapWith(document.getElementById('pixley-interpreter').innerHTML);">Wrap in Pixley Interpreter</button>
 <input id="speed" type="range" min="0" max="200" value="0" />
 <span id="status"></span>
 
   c.init({
     'status': document.getElementById('status'),
     'display': document.getElementById('display'),
-    'output': document.getElementById('output'),
-    'pixleyInterpreter': document.getElementById('pixley-interpreter').innerHTML,
+    'output': document.getElementById('output')
   });
   c.connect({
     'start': 'start',

File impl/pixley.js/src/pixley-controller.js

     this.init = function(cfg) {
         this.ast = undefined;
         this.status = cfg.status;
-        this.pixleyInterpreter = cfg.pixleyInterpreter || '???';
         this.display = cfg.display;
         this.output = cfg.output;
         this.workerURL = cfg.workerURL || "../src/pixley-worker.js";
         this.draw();
     };
 
-    this.wrapIt = function() {
-        var text = '(' + this.pixleyInterpreter +
-                   ' (quote ' + depict(this.ast) + '))';
-        this.load(text);
+    this.wrapWith = function(lambdaText) {
+        this.load('(' + lambdaText + ' (quote ' + depict(this.ast) + '))');
     };
 };
 PixleyController.prototype = new yoob.Controller();