git @ Cat's Eye Technologies Super-Wumpus-Land / 40686a8
Update yoob.js files to 0.9. Chris Pressey 8 years ago
2 changed file(s) with 33 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
00 /*
1 * This file is part of yoob.js version 0.7
1 * This file is part of yoob.js version 0.9
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
9696 return div;
9797 };
9898
99 yoob.makePre = function(container, innerHTML) {
100 var elem = document.createElement('pre');
101 elem.innerHTML = innerHTML || '';
102 container.appendChild(elem);
103 return elem;
104 };
105
99106 yoob.makePanel = function(container, title, isOpen) {
100107 isOpen = !!isOpen;
101108 var panelContainer = document.createElement('div');
121128 textarea.rows = "" + rows;
122129 textarea.cols = "" + cols;
123130 if (initial) {
124 container.value = initial;
131 textarea.value = initial;
125132 }
126133 container.appendChild(textarea);
127134 return textarea;
193200 'callback': fun
194201 });
195202 };
203
204 yoob.makeSVG = function(container) {
205 var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
206 /* <svg viewBox = "0 0 200 200" version = "1.1"> */
207 container.appendChild(svg);
208 return svg;
209 };
210
211 yoob.makeSVGElem = function(svg, tag, cfg) {
212 var elem = document.createElementNS(svg.namespaceURI, tag);
213 for (var key in cfg) {
214 if (cfg.hasOwnProperty(key)) {
215 elem.setAttribute(key, cfg[key]);
216 }
217 }
218 svg.appendChild(elem);
219 return elem;
220 };
00 /*
1 * This file is part of yoob.js version 0.6
1 * This file is part of yoob.js version 0.8
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
3535 return this;
3636 };
3737
38 this.setPlayfield = function(pf) {
39 this.pf = pf;
40 return this;
41 };
42
3843 /*
3944 * Set the displayed dimensions of every cell.
4045 * cellWidth and cellHeight are canvas units of measure for each cell.