File tree Expand file tree Collapse file tree 1 file changed +64
-2
lines changed Expand file tree Collapse file tree 1 file changed +64
-2
lines changed Original file line number Diff line number Diff line change 43
43
var log ;
44
44
45
45
46
+ var password ;
47
+
48
+
49
+ var btn = { } ;
46
50
51
+
52
+ //:
53
+
54
+
47
55
async function init ( ) {
48
56
49
57
menumod = menumod ( ) ;
@@ -126,6 +134,14 @@ <h3>encrypt</h3>
126
134
127
135
< div id =hdr >
128
136
137
+ < div id =encrypt-root >
138
+
139
+ < input id =password >
140
+
141
+ < input id =encrypt value =encrypt >
142
+
143
+ </ div >
144
+
129
145
< filemod-api >
130
146
< script src ='https://html-loader-1024713184986.us-central1.run.app/ '> </ script >
131
147
</ filemod-api >
@@ -151,7 +167,9 @@ <h3>encrypt</h3>
151
167
152
168
var root = rootnode ;
153
169
154
-
170
+ $ ( '#encrypt' ) . onclick = btn . encrypt ;
171
+
172
+
155
173
filemod . initdom ( root ) ;
156
174
157
175
@@ -169,9 +187,53 @@ <h3>encrypt</h3>
169
187
} //initdom
170
188
171
189
190
+ //:
191
+
192
+
193
+ btn . encrypt = function ( ) {
194
+ } //encrypt
195
+
172
196
173
- function complete ( ) {
197
+ //:
198
+
199
+
200
+ function complete ( file ) {
201
+
202
+ editor . filename ( file ) ;
203
+ editor . filename . save . hide ( ) ;
204
+ filemod . cur = file ;
205
+ menumod . close ( ) ;
206
+ editor . focus ( ) ;
207
+
174
208
} //complete
209
+
210
+
211
+ complete . load = async function ( file , blob ) {
212
+
213
+ var txt ;
214
+ if ( typeof blob == 'string' ) {
215
+ txt = blob ;
216
+ } else {
217
+ txt = await blob . text ( ) ;
218
+ }
219
+
220
+ editor . clear ( ) ;
221
+ output . kill ( ) ;
222
+ editor . setValue ( txt , - 1 ) ;
223
+ complete ( file ) ;
224
+
225
+ } //complete.load
226
+
227
+
228
+ complete . save = function ( file , confirm = true ) {
229
+
230
+ complete ( file ) ;
231
+
232
+ if ( confirm ) {
233
+ log . green ( file . filename , 'saved' ) ;
234
+ }
235
+
236
+ } //save
175
237
176
238
177
239
init . stack . complete ;
You can’t perform that action at this time.
0 commit comments