kopia lustrzana https://github.com/backface/turtlestitch
add new example folder (currently empty)
rodzic
02b34eed69
commit
302151c4b4
|
@ -472,3 +472,33 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
IDE_Morph.prototype.uploadStitches = function () {
|
||||
tStitch.upload();
|
||||
};
|
||||
|
||||
ProjectDialogMorph.prototype.getExamplesProjectList = function () {
|
||||
var dir,
|
||||
projects = [];
|
||||
|
||||
//dir = this.ide.getURL('http://snap.berkeley.edu/snapsource/Examples/');
|
||||
dir = this.ide.getURL(getBaseURL() + '/stitchcode/examples/');
|
||||
dir.split('\n').forEach(
|
||||
function (line) {
|
||||
var startIdx = line.search(new RegExp('href=".*xml"')),
|
||||
endIdx,
|
||||
name,
|
||||
dta;
|
||||
if (startIdx > 0) {
|
||||
endIdx = line.search(new RegExp('.xml'));
|
||||
name = line.substring(startIdx + 6, endIdx);
|
||||
dta = {
|
||||
name: name,
|
||||
thumb: null,
|
||||
notes: null
|
||||
};
|
||||
projects.push(dta);
|
||||
}
|
||||
}
|
||||
);
|
||||
projects.sort(function (x, y) {
|
||||
return x.name < y.name ? -1 : 1;
|
||||
});
|
||||
return projects;
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue