Skip to content

Commit

Permalink
Fixing desktop and adding guide memory
Browse files Browse the repository at this point in the history
  • Loading branch information
afska committed Sep 1, 2017
1 parent 2c677b6 commit 7b995f0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/elements/gobstones-ide/gobstones-ide.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@
},

_renderMarkdown: function(markdown) {
if (!window.showdown) return "";
if (!window.showdown && window.GBS_DESKTOP) {
window.showdown = window.GBS_REQUIRE("showdown");
}

return new window.showdown.Converter({tables: true}).makeHtml(markdown);
},

Expand Down
3 changes: 2 additions & 1 deletion app/elements/project-selector/project-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h3 class="no-exercises">
this._startLoading();
this._guideLoader().all().then((guides) => {
this.guides = guides;
this.selectedGuide = 0;
this.selectedGuide = localStorage.getItem("selected-guide") || 0;
}).catch(() => this._stopLoading());
},

Expand Down Expand Up @@ -105,6 +105,7 @@ <h3 class="no-exercises">
},

_onGuideChange: function() {
localStorage.setItem("selected-guide", this.selectedGuide);
this._startLoading();
this._loadCurrentGuide();
},
Expand Down
13 changes: 11 additions & 2 deletions app/scripts/loaders/remote/fsLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,17 @@
}

load(getContext, callback) {
const files = this._loadDir(this.path);
this.loader.readRaw(getContext(), this._createZip(files), callback);
const deferred = $.Deferred();

try {
const files = this._loadDir(this.path);
this.loader.readRaw(getContext(), this._createZip(files), callback);
deferred.resolve();
} catch(e) {
deferred.reject(e);
}

return deferred.promise();
}

_loadDir(path) {
Expand Down
2 changes: 1 addition & 1 deletion app/start-electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ freeport((err, port) => {
width: 1024,
height: 800,
webPreferences: {
nodeIntegration: false,
nodeIntegration: true,
preload: __dirname + "/start-electron-preload.js",
webSecurity: false
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"freeport": "^1.0.5",
"recursive-readdir-sync": "^1.0.6",
"serve-static": "^1.12.2",
"setimmediate": "^1.0.5"
"setimmediate": "^1.0.5",
"showdown": "^1.7.3"
}
}

0 comments on commit 7b995f0

Please sign in to comment.