-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
47 lines (46 loc) · 1.64 KB
/
Copy pathscript.js
File metadata and controls
47 lines (46 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/***************************************
* REMAKE DEMO *
* =========== *
* *
* See how Remake works without *
* installing anything! *
* *
* For the full framework, with *
* data saving and user accounts: *
* *
* https://docs.remaketheweb.com/ *
***************************************/
/**
* Get the JSON which we will initialize Remake with
* if user is logged in, we will use the json file from Scratchpad
* else we will use a dummy json file
**/
(async () => await downloadJSON()
.then(startingData => {
Remake.demoInit({
// Log data to console when page is
// saved, useful for debugging
logDataOnSave: true,
// Load Sortable library for drag and
// drop reordering (only use if your
// app needs drag-and-drop reordering)
sortable: {sortablejs: Sortable},
// Load crostini for displaying
// temporary success/error notices
crostini: crostini,
// Load Handlebars for rendering the
// demo on the client-side
Handlebars: Handlebars,
// Where in localStorage to store data
demoLocalStorageNamespace: demoKey,
loginUrl: COGNITO_LOGIN_URL,
saveFunctions: {
_defaultSave: async function ({data, path, saveToId, elem}) {
localStorage.setItem(demoKey, JSON.stringify(data));
await saveButtonClicked();
}
},
// Initial data to load into the demo app
demoStartingData: startingData
});
}))();