comparison editor.js @ 119:77f7cd65e121

Add selection of number and string literals. Support inward navigation of lambdas.
author Mike Pavone <pavone@retrodev.com>
date Wed, 17 Apr 2013 00:23:05 -0700
parents 0a66fe3a368a
children d5dc9507d612
comparison
equal deleted inserted replaced
118:0a66fe3a368a 119:77f7cd65e121
81 node.appendChild(base); 81 node.appendChild(base);
82 }; 82 };
83 83
84 intlit.prototype.toHTML = function(node, up) { 84 intlit.prototype.toHTML = function(node, up) {
85 this.up = up; 85 this.up = up;
86 var astNode = this;
86 this.domNode = newEl('span', { 87 this.domNode = newEl('span', {
87 className: 'integer', 88 className: 'integer',
88 textContent: this.val 89 textContent: this.val,
90 onclick: function(event) {
91 main_module.scalarClick(this, astNode, event);
92 }
89 }); 93 });
90 node.appendChild(this.domNode); 94 node.appendChild(this.domNode);
91 }; 95 };
92 96
93 floatlit.prototype.toHTML = function(node, up) { 97 floatlit.prototype.toHTML = function(node, up) {
94 this.up = up; 98 this.up = up;
99 var astNode = this;
95 this.domNode = newEl('span', { 100 this.domNode = newEl('span', {
96 className: 'float', 101 className: 'float',
97 textContent: this.val 102 textContent: this.val,
103 onclick: function(event) {
104 main_module.scalarClick(this, astNode, event);
105 }
98 }); 106 });
99 node.appendChild(this.domNode); 107 node.appendChild(this.domNode);
100 }; 108 };
101 109
102 strlit.prototype.toHTML = function(node, up) { 110 strlit.prototype.toHTML = function(node, up) {
103 this.up = up; 111 this.up = up;
112 var astNode = this;
104 this.domNode = newEl('span', { 113 this.domNode = newEl('span', {
105 className: 'string', 114 className: 'string',
106 contentEditable: 'true', 115 contentEditable: 'true',
107 textContent: this.val 116 textContent: this.val,
117 onclick: function(event) {
118 main_module.scalarClick(this, astNode, event);
119 }
108 }); 120 });
109 node.appendChild(this.domNode); 121 node.appendChild(this.domNode);
110 }; 122 };
111 123
112 listlit.prototype.toHTML = function(node, up) { 124 listlit.prototype.toHTML = function(node, up) {