diff --git a/impl/pixley.js/demo/pixley.html b/impl/pixley.js/demo/pixley.html index b59998e..ab2a3a0 100644 --- a/impl/pixley.js/demo/pixley.html +++ b/impl/pixley.js/demo/pixley.html @@ -46,7 +46,7 @@ <button id="start">Start</button> <button id="stop">Stop</button> <button id="step">Step</button> -<button onclick="c.wrapWith(document.getElementById('pixley-interpreter').innerHTML);">Wrap in Pixley Interpreter</button> +<button id="wrap" 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> @@ -234,7 +234,8 @@ c.init({ 'status': document.getElementById('status'), 'display': document.getElementById('display'), - 'output': document.getElementById('output') + 'output': document.getElementById('output'), + 'wrapButton': document.getElementById('wrap') }); c.connect({ 'start': 'start', diff --git a/impl/pixley.js/src/pixley-controller.js b/impl/pixley.js/src/pixley-controller.js index dc235d3..8cf9786 100644 --- a/impl/pixley.js/src/pixley-controller.js +++ b/impl/pixley.js/src/pixley-controller.js @@ -5,12 +5,14 @@ alert('ERROR! ' + msg); }; +var proto = new yoob.Controller(); function PixleyController() { this.init = function(cfg) { this.ast = undefined; this.status = cfg.status; this.display = cfg.display; this.output = cfg.output; + this.wrapButton = cfg.wrapButton; this.workerURL = cfg.workerURL || "../src/pixley-worker.js"; this.loadWorker(); this.running = false; @@ -80,5 +82,16 @@ this.wrapWith = function(lambdaText) { this.load('(' + lambdaText + ' (quote ' + depict(this.ast) + '))'); }; + + // Awkward But Hopefully Successful Attempts at Calling Super Methods + this.click_edit = function(e) { + proto.click_edit.apply(this, [e]); + if (this.wrapButton) this.wrapButton.disabled = true; + }; + + this.click_load = function(e) { + proto.click_load.apply(this, [e]); + if (this.wrapButton) this.wrapButton.disabled = false; + }; }; -PixleyController.prototype = new yoob.Controller(); +PixleyController.prototype = proto;