git @ Cat's Eye Technologies Braktif / 0975187
Update yoob.js to released version 0.13. Chris Pressey 4 years ago
4 changed file(s) with 25 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
7070 var p = (new yoob.PresetManager()).init({
7171 selectElem: selectConfiguration,
7272 controller: controller
73 });
74 function makeCallback(sourceText) {
75 return function(id) {
76 sourceManager.loadSource(sourceText);
77 }
78 }
79 for (var i = 0; i < exampleConfigurations.length; i++) {
80 p.add(exampleConfigurations[i][0], makeCallback(exampleConfigurations[i][1]));
81 }
82 p.select(exampleConfigurations[0][0]);
73 }).populateFromPairs(sourceManager, exampleConfigurations);
8374 };
8475 for (var i = 0; i < deps.length; i++) {
8576 var elem = document.createElement('script');
00 /*
1 * This file is part of yoob.js version 0.13-PRE
1 * This file is part of yoob.js version 0.13
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
00 /*
1 * This file is part of yoob.js version 0.13-PRE
1 * This file is part of yoob.js version 0.13
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
00 /*
1 * This file is part of yoob.js version 0.12
1 * This file is part of yoob.js version 0.13
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
119119 }
120120 return this;
121121 };
122
123 /*
124 * When called with a yoob.SourceManager and an array of
125 * 2-element arrays of a name and a source text, this preset
126 * manager will be populated with each source text as a
127 * named preset. A callback to load the source text with
128 * the SourceManager will be automatically supplied.
129 */
130 this.populateFromPairs = function(sourceManager, pairs) {
131 function makeCallback(sourceText) {
132 return function(id) {
133 sourceManager.loadSource(sourceText);
134 }
135 }
136
137 for (var i = 0; i < pairs.length; i++) {
138 this.add(pairs[i][0], makeCallback(pairs[i][1]));
139 }
140 this.select(pairs[0][0]);
141 return this;
142 };
122143 };