Skip to content

Commit 0aaab4f

Browse files
save file
1 parent ed4e573 commit 0aaab4f

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

utils/editors/text-diff/text-diff.html

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@
198198
{display:flex;flex:1;margin:5px 0;gap:10px}
199199

200200
#view1
201-
{flex:1;display:flex;flex-direction:column;border:1px solid var(--green);padding:5px}
201+
{flex:1;display:flex;flex-direction:column;border:1px solid var(--green);padding:5px;box-sizing:border-box}
202202

203203
#view2
204-
{flex:1;display:flex;flex-direction:column;border:1px solid var(--red);padding:5px}
204+
{flex:1;display:flex;flex-direction:column;border:1px solid var(--red);padding:5px;box-sizing:border-box}
205205

206206

207207
#hdr
@@ -214,7 +214,7 @@
214214
{flex:1}
215215

216216
#output
217-
{border:1px solid lightgray;padding:5px}
217+
{border:1px solid lightgray;padding:5px;box-sizing:border-box}
218218

219219
/*
220220
#output-hldr
@@ -254,29 +254,35 @@
254254
<file-mod id=file1 component></file-mod>
255255
<div id=label>primary</div>
256256
</div>
257-
<web-editor id=editor1 component></web-editor>
257+
<web-editor id=editor1 component mode=text></web-editor>
258258
</div>
259+
260+
<div id=slider-1 style='width:10px;cursor:ew-resize'></div>
261+
259262
<div id=view2>
260263
<div id=hdr>
261264
<file-mod id=file2 component></file-mod>
262265
<div id=label>secondary</div>
263266
</div>
264-
<web-editor id=editor2 component></web-editor>
267+
<web-editor id=editor2 component mode=text></web-editor>
265268
</div>
266269
</div>
270+
271+
<div id=slider-2 style='height:10px;cursor:ns-resize'></div>
272+
267273

268-
<web-editor id=output component></web-editor>
274+
<web-editor id=output component mode=text></web-editor>
269275
<!--
270276
<div id=output-hldr>
271277
<web-editor id=output component></web-editor>
272278
</div>
273279
-->
274280

281+
275282

276283
<log-mod component></log-mod>
277284

278285

279-
280286
<checkbox-one-template>
281287
<script src='https://html-loader-1024713184986.us-central1.run.app/'></script>
282288
</checkbox-one-template>
@@ -288,7 +294,8 @@
288294
<script>
289295

290296

291-
var slider = {};
297+
var slider1 = {mode:'vert'};
298+
var slider2 = {mode:'horiz'};
292299

293300
var ui = {};
294301
ui.mode = 'vert';
@@ -314,20 +321,36 @@
314321
$('#output-hdr [type=checkbox]').onclick = btn['output-chk'];
315322
$('[value=check]').onclick = btn.check;
316323

317-
318324

319325
var view1 = $('#view1');
320326
primary.filemod.initdom(view1);
321-
primary.editor.initdom(view1,{mode:'text'});
327+
primary.editor.initdom();
322328

323329
var view2 = $('#view2');
324330
secondary.filemod.initdom(view2);
325-
secondary.editor.initdom(view2,{mode:'text'});
331+
secondary.editor.initdom();
332+
var w = view2.offsetWidth;
333+
view2.style.flex = 'none';
334+
view2.style.width = w+'px';
335+
326336

327337
var node = $('#output');
328-
await output.initdom(node,{mode:'text'});
338+
output.initdom();
339+
setTimeout(()=>{
340+
var w = node.offsetHeight;console.log('w',w);
341+
node.style.flex = 'none';
342+
node.style.height = w+'px';
343+
},500);
329344

330345

346+
slider1.node = $.slider('#view1','#slider-1','#view2',null,slider1);
347+
slider2.node = $.slider('#main','#slider-2','#output',null,slider2);
348+
349+
350+
351+
352+
353+
331354

332355
var style = document.createElement('style');
333356
style.textContent = `

0 commit comments

Comments
 (0)