Skip to content

Commit 8d218d5

Browse files
save file
1 parent 561d3d7 commit 8d218d5

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

utils/misc/global-state-diff/global-state-diff.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ <h3>
347347

348348
var process = {};
349349
var setup = {};
350+
var kd = {};
350351

351352

352353
//:
@@ -361,7 +362,7 @@ <h3>
361362
$('#script .copy').onclick = e=>navigator.clipboard.writeText(src.value);
362363
$('#script .paste').onclick = async e=>{var txt=await navigator.clipboard.readText();src.value=txt};
363364

364-
src.onkeydown = e=>e.key=='Enter' && process.script(src.value);
365+
src.onkeydown = kd.src;
365366
src.onfocus = e=>src.select();
366367
src.focus();
367368

@@ -383,6 +384,7 @@ <h3>
383384
$('#import .copy').onclick = e=>navigator.clipboard.writeText(src2.value);
384385
$('#import .paste').onclick = async e=>{var txt=await navigator.clipboard.readText();src2.value=txt};
385386

387+
srcs.onkeydown = kd.src2;
386388
src2.onfocus = e=>src2.select();
387389

388390
go2.onclick = function(){
@@ -397,6 +399,27 @@ <h3>
397399
}//initdom
398400

399401

402+
//:
403+
404+
405+
kd.src = function(e){
406+
407+
if(e.key=='Enter'){
408+
process.script(src.value);
409+
}
410+
411+
}//src
412+
413+
414+
kd.src2 = function(){
415+
416+
if(e.key=='Enter'){
417+
process.import(src2.value);
418+
}
419+
420+
}//src2
421+
422+
400423
//:
401424

402425

0 commit comments

Comments
 (0)