From 19a92c4b10bfe6660b39d177e4793db3916d0133 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 4 Apr 2013 18:00:09 -0600 Subject: [PATCH] finishing up preliminary print dom work. --- .../js-assembler/runtime-src/baselib-boxes.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/whalesong/js-assembler/runtime-src/baselib-boxes.js b/whalesong/js-assembler/runtime-src/baselib-boxes.js index 7f495ab..4c87172 100644 --- a/whalesong/js-assembler/runtime-src/baselib-boxes.js +++ b/whalesong/js-assembler/runtime-src/baselib-boxes.js @@ -3,7 +3,7 @@ // Exceptions -(function(baselib) { +(function(baselib, $) { 'use strict'; var exports = {}; baselib.boxes = exports; @@ -43,16 +43,18 @@ }; Box.prototype.toDomNode = function(params) { - var node = document.createElement("span"); + var node = $(''); if (params.getMode() === 'constructor') { - node.appendChild(document.createTextNode("(box ")); - node.appendChild(params.recur(this.val)); - node.appendChild(document.createTextNode(")")); + node.append($('').text('(').addClass('lParen')); + node.append($('').text('box')); + node.append(" "); + node.append(params.recur(this.val)); + node.append($('').text(')').addClass('rParen')); } else { - node.appendChild(document.createTextNode('#&')); - node.appendChild(params.recur(this.val)); + node.append($('').text('#&')); + node.append(params.recur(this.val)); } - return node; + return node.get(0); }; Box.prototype.equals = function(other, aUnionFind) { @@ -101,4 +103,4 @@ exports.makeImmutableBox = makeImmutableBox; -}(this.plt.baselib)); \ No newline at end of file +}(this.plt.baselib, jQuery));