-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerated.html
More file actions
136 lines (118 loc) · 3.68 KB
/
generated.html
File metadata and controls
136 lines (118 loc) · 3.68 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Component CSS -->
<style>
</style>
<!-- /Component CSS -->
<!-- Page CSS -->
<style>
</style>
<!-- /Page CSS -->
<!-- Head HTML -->
<!-- /Head HTML -->
<script>
var simplyDataApi = {};
var simplyApp = {};
window.addEventListener("simply-content-loaded", function() {
simply.bind = false;
/* Raw API */
var simplyRawApi = {
};
/* End of Raw API */
/* Data API */
simplyDataApi = {
};
/* End of Data API */
simplyApp = simply.app({
/* Actions */
actions: {
},
/* /Actions */
/* Commands */
commands: {
},
/* /Commands */
/* Routes */
routes: {
"/" : function (params) {
editor.pageData.page = 'hello'
}
}
/* /Routes */
});
});
function clone(ob) {
return JSON.parse(JSON.stringify(ob));
}
function updateDataSource(name) {
document.querySelectorAll('[data-simply-data="'+name+'"]').forEach(function(list) {
editor.list.applyDataSource(list, name);
list.dataBindingPaused = 0;
});
}
</script>
</head>
<body>
<!-- Body HTML -->
<!-- /Body HTML -->
<!-- Component HTML templates -->
<!-- /Component HTML templates -->
<header data-simply-path="/" data-simply-field="header" data-simply-content="template" data-simply-default-value="Header">
<template data-simply-template='Header' rel="header"></template>
</header>
<nav>
<simply-render rel="menu"></simply-render>
</nav>
<div class="main" data-simply-field="page" data-simply-content="template">
<!-- Page HTML templates -->
<template data-simply-template="home">
<h1>This is an App</h1>
</template>
<!-- /Page HTML templates -->
</div>
<script src="js/simply.everything.js"></script>
<script src="js/simply-edit.js" data-api-key="muze" data-simply-initOnEvent></script>
<script>
/* Transformers */
editor.transformers = {
};
/* /Transformers */
</script>
<script>
/* Sorters */
editor.sorters = {
};
/* /Sorters */
</script>
<script>
window.addEventListener("simply-content-loaded", function() {
/* Data sources */
/* /Data sources */
});
</script>
<!-- Foot HTML -->
<!-- importFoot -->
<script type="module">
import dc from 'https://cdn.jsdelivr.net/gh/potherca-blog/simplycode-dummy-component@v0.3.0/index.js'
document.body.insertAdjacentHTML('beforeend', dc.componentTemplates)
document.body.querySelector("[data-simply-field=page]").insertAdjacentHTML('beforeend', dc.pageTemplates);
// We need to make sure that both simplyApp _and_ dc[...] are loaded.
// Race conditions caused by network transport need to be mitigated...
/**
* @CHECKME: De we want routes? This is a new APP, do components even have routes?
*/
window.addEventListener("simply-content-loaded", () => {
Object.entries(dc.simplyApp.actions).forEach(([index,action]) => {
simplyApp.actions[index] = action
})
Object.entries(dc.simplyApp.commands).forEach(([index,command]) => {
simplyApp.commands[index] = command
})
})
editor.fireEvent('simply-init', document)
</script>
<!-- /Foot HTML -->
</body>
</html>