0 | 0 |
/*
|
1 | |
* This file is part of yoob.js version 0.7
|
|
1 |
* This file is part of yoob.js version 0.9
|
2 | 2 |
* Available from https://github.com/catseye/yoob.js/
|
3 | 3 |
* This file is in the public domain. See http://unlicense.org/ for details.
|
4 | 4 |
*/
|
|
96 | 96 |
return div;
|
97 | 97 |
};
|
98 | 98 |
|
|
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 |
|
99 | 106 |
yoob.makePanel = function(container, title, isOpen) {
|
100 | 107 |
isOpen = !!isOpen;
|
101 | 108 |
var panelContainer = document.createElement('div');
|
|
121 | 128 |
textarea.rows = "" + rows;
|
122 | 129 |
textarea.cols = "" + cols;
|
123 | 130 |
if (initial) {
|
124 | |
container.value = initial;
|
|
131 |
textarea.value = initial;
|
125 | 132 |
}
|
126 | 133 |
container.appendChild(textarea);
|
127 | 134 |
return textarea;
|
|
193 | 200 |
'callback': fun
|
194 | 201 |
});
|
195 | 202 |
};
|
|
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 |
};
|