Skip to content
This repository has been archived by the owner on Dec 3, 2017. It is now read-only.

Feature/gitignore #12

Merged
merged 2 commits into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dat.json
portal.json
media/content
!media/content/icon.svg
5 changes: 0 additions & 5 deletions dat.json

This file was deleted.

Binary file removed media/content/hikari.jpg
Binary file not shown.
Binary file removed media/content/spike.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion portal.json

This file was deleted.

23 changes: 20 additions & 3 deletions scripts/rotonde.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,26 @@ function Rotonde()
this.load_account = async function()
{
var dat = window.location.toString();
var archive = new DatArchive(dat)
var portal_str = await archive.readFile('/portal.json');
var portal_data = JSON.parse(portal_str);
var archive = new DatArchive(dat);
var portal_data;
try {
var portal_str = await archive.readFile('/portal.json');
portal_data = JSON.parse(portal_str);
} catch (err) {
// If there is no portal.json update it with the defaults
portal_data = {
name: "new_name",
desc: "new_desc",
port: [
// @neauoire
"dat://2f21e3c122ef0f2555d3a99497710cd875c7b0383f998a2d37c02c042d598485/"
],
feed: [],
site: "",
dat: ""
};
await archive.writeFile('/portal.json', JSON.stringify(portal_data, null, 2));
}
portal_data.dat = dat;
this.portal = new Portal(portal_data);
this.portal.install(this.el);
Expand Down