git @ Cat's Eye Technologies Lexeduct / f35fde7
Inject init args properly. Better initial input text. Chris Pressey 6 years ago
2 changed file(s) with 29 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1717 var transformerNames;
1818
1919 this.init = function(cfg) {
20 container = document.getElementById('container');
21 input = yoob.makeTextArea(container, 40, 20);
22 input.value = document.getElementById('initial-text').innerHTML;
23
20 container = cfg.container;
21 input = yoob.makeTextArea(container, 40, 20, cfg.initialText);
22
2423 var transformersPanel = yoob.makeDiv(container);
2524 transformersPanel.style.border = "2px solid black";
2625 transformersPanel.style.display = "inline-block";
1111 <div id="container"></div>
1212
1313 <pre style="display: none;" id="initial-text">
14 This is a text.
15 It is a text.
16 And such things.
14 A thing of beauty is a joy for ever:
15 Its loveliness increases; it will never
16 Pass into nothingness; but still will keep
17 A bower quiet for us, and a sleep
18 Full of sweet dreams, and health, and quiet breathing.
19 Therefore, on every morrow, are we wreathing
20 A flowery band to bind us to the earth,
21 Spite of despondence, of the inhuman dearth
22 Of noble natures, of the gloomy days,
23 Of all the unhealthy and o'er-darkened ways
24 Made for our searching: yes, in spite of all,
25 Some shape of beauty moves away the pall
26 From our dark spirits. Such the sun, the moon,
27 Trees old and young, sprouting a shady boon
28 For simple sheep; and such are daffodils
29 With the green world they live in; and clear rills
30 That for themselves a cooling covert make
31 'Gainst the hot season; the mid forest brake,
32 Rich with a sprinkling of fair musk-rose blooms:
33 And such too is the grandeur of the dooms
34 We have imagined for the mighty dead;
35 All lovely tales that we have heard or read:
36 An endless fountain of immortal drink,
37 Pouring unto us from the heaven's brink.
1738 </pre>
1839
1940 </body>
2243 <script src="lexeduct-browser.js"></script>
2344 <script>
2445 (new LexeductUI()).init({
25 'container': document.getElementById('container')
46 'container': document.getElementById('container'),
47 'initialText': document.getElementById('initial-text').innerHTML
2648 });
2749 </script>