comparison editor.js @ 25:4d87c38404d6

List literals, fixes to implicit self property lookup, import statement and editor improvements
author Mike Pavone <pavone@retrodev.com>
date Mon, 02 Apr 2012 22:28:48 -0700
parents 068d63627b16
children fe593c1df568
comparison
equal deleted inserted replaced
24:fe3533494ce9 25:4d87c38404d6
67 }; 67 };
68 68
69 strlit.prototype.toHTML = function(node) { 69 strlit.prototype.toHTML = function(node) {
70 node.appendChild(newEl('span', { 70 node.appendChild(newEl('span', {
71 className: 'string', 71 className: 'string',
72 contentEditable: 'true',
72 textContent: this.val 73 textContent: this.val
73 })); 74 }));
74 }; 75 };
75 76
76 funcall.prototype.toHTML = function(node) { 77 funcall.prototype.toHTML = function(node) {
78 var astNode = this;
77 var base = newEl('div', { 79 var base = newEl('div', {
78 className: 'funcall' 80 className: 'funcall'
79 }); 81 });
80 var parts = this.name.split(':'); 82 var parts = this.name.split(':');
81 for (var i in parts ) { 83 for (var i in parts ) {
82 if(parts[i]) { 84 if(parts[i]) {
83 base.appendChild(newEl('span', {textContent: parts[i] + ':', className: 'funpart'})); 85 base.appendChild(newEl('span', {
86 textContent: parts[i] + ':',
87 className: 'funpart',
88 onclick: function() {
89 return mainModule.funClick(this, astNode);
90 }}));
84 if (this.args[i]) { 91 if (this.args[i]) {
85 this.args[i].toHTML(base); 92 this.args[i].toHTML(base);
86 } 93 }
87 } 94 }
88 } 95 }