Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,25 @@ var FigureRouter = Backbone.Router.extend({

index: function () {
console.log("index");
var cb = () => {
showModal("welcomeModal");
};
// Check for ?file=http://...json
// TODO: do we ONLY want to do this on index?
// OR ?image=1&image=2 (also handled for /new?image=1&image=2 below)
if (window.location.search.length > 1) {
const searchParams = new URLSearchParams(window.location.search.substring(1));
if (searchParams.has("file")) {
const file = searchParams.get("file");
var cb = function () {
figureModel.load_from_url(file);
};
figureModel.checkSaveAndClear(cb);
return;
} else if (searchParams.has("image")) {
var cb = function () {
figureModel.addImages(searchParams.getAll("image"));
};
}
}
hideModals();
var cb = () => {
showModal("welcomeModal");
};
figureModel.checkSaveAndClear(cb);
},

Expand Down
Loading