add new example folder (currently empty)

pull/3/merge
Michael Aschauer 2015-01-15 12:18:04 +01:00
rodzic 02b34eed69
commit 302151c4b4
1 zmienionych plików z 30 dodań i 0 usunięć

Wyświetl plik

@ -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;
};