-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerated.html
162 lines (141 loc) · 4.34 KB
/
generated.html
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!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: {
"displayFile" : async function(){
function previewFile() {
const content = document.getElementById("result")
const file = document.getElementById("inputFile").files[0]
const reader = new FileReader();
reader.addEventListener(
"load",
() => {
// this will then display a text file
content.innerText = reader.result;
},
false,
);
if (file) {
reader.readAsText(file);
}
}
previewFile()
}
},
/* /Actions */
/* Commands */
commands: {
"parseFile" : async function(el, value) {
this.app.actions.displayFile();
}
},
/* /Commands */
/* Routes */
routes: {
"/" : function() {
editor.pageData.page = 'homepage'
}
}
/* /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 -->
<template id="header">
</template>
<template id="menu">
</template>
<template id="upload-file">
<h2>upload-file interface</h2>
<h3>todolist</h3>
<ul>
<li>Find out how to cache stuff <a href="https://developer.mozilla.org/en-US/docs/Web/API/Cache">cache mdn docs</a></li>
<li>will need to check if there's enough room in the cache -> StorageManager.estimate()</li>
</ul>
<style>output {font-family: monospace;white-space: pre;}</style>
<form data-js="convert">
<input id="inputFile" name="file" required type="file" />
<button data-simply-command="parseFile">Submit</button>
</form>
<div id="result"></div>
</template>
<!-- /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="homepage">
<h1>YOG</h1>
<div>
<simply-render rel="upload-file"></simply-render>
</div>
</template>
<!-- /Page HTML templates -->
</div>
<script src="https://cdn.jsdelivr.net/gh/SimplyEdit/simplyview/dist/simply.everything.js"></script>
<script src="https://canary.simplyedit.io/1/simply-edit.js" data-simply-storage="none" data-api-key="muze"></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 -->
<!-- /Foot HTML -->
</body>
</html>