Skip to content

Commit 1a07730

Browse files
save file
1 parent f01e930 commit 1a07730

1 file changed

Lines changed: 87 additions & 64 deletions

File tree

utils/misc/nodejs-terminal/v3.0/nodejs-terminal-v3.0.html

Lines changed: 87 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,6 @@
345345
</div>
346346
<div class=menu style='display:none;left:0px;top:35px'>
347347
<div id=https-server class=menu-opt>install https-server</div>
348-
<div id=save-zip class=menu-opt>save snapshot zip</div>
349-
<div id=load-zip class=menu-opt>load snapshot zip</div>
350-
<div id=save-tar class=menu-opt>save snapshot tar</div>
351-
<div id=load-tar class=menu-opt>load snapshot tar</div>
352348
</div>
353349
</div>
354350

@@ -360,7 +356,15 @@
360356
<img class=m-icon>
361357
</div>
362358
<div class=menu style='display:none;left:0px;top:35px'>
363-
Empty
359+
<div id=save-zip class=menu-opt>save snapshot zip</div>
360+
<div id=load-zip class=menu-opt>load snapshot zip</div>
361+
<!--
362+
<div id=save-tar class=menu-opt>save snapshot tar</div>
363+
<div id=load-tar class=menu-opt>load snapshot tar</div>
364+
-->
365+
<div>
366+
Empty
367+
</div>
364368
</div>
365369
</div>
366370

@@ -750,6 +754,82 @@
750754
}//https-server
751755

752756

757+
758+
759+
760+
761+
762+
763+
/*
764+
menu_callback.more['save-tar'] = async function(){
765+
766+
console.log('save-tar');
767+
if(!tabs.cur.view){
768+
log.red('no active terminal');
769+
return;
770+
}
771+
772+
var cwd = tabs.cur.view.terminal.shell.cwd;
773+
var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs;
774+
console.log(cwd_abs);
775+
if(cwd===null){
776+
term.writeln.red('can only save tar relative to workdir');
777+
return;
778+
}
779+
780+
var term = tabs.cur.view.terminal.term;
781+
782+
term.writeln('');
783+
term.writeln.green('saving tar ...');
784+
785+
786+
}//save-tar
787+
788+
789+
menu_callback.more['load-tar'] = async function(){
790+
791+
console.log('load-tar');
792+
if(!tabs.cur.view){
793+
log.red('no active terminal');
794+
return;
795+
}
796+
797+
var cwd = tabs.cur.view.terminal.shell.cwd;
798+
var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs;
799+
console.log(cwd_abs);
800+
if(cwd===null){
801+
term.writeln.red('can only load tar relative to workdir');
802+
return;
803+
}
804+
805+
var term = tabs.cur.view.terminal.term;
806+
807+
term.writeln('');
808+
term.writeln.green('loading tar ...');
809+
810+
811+
}//load-tar
812+
813+
*/
814+
815+
816+
//:
817+
818+
819+
menu_callback.snapshot = function(type,opt){
820+
//console.log('more',type,opt);
821+
if(type=='opt'){
822+
823+
menu_callback.more[opt.id]();
824+
825+
}
826+
827+
//tabs.focus();
828+
829+
830+
}//snapshot
831+
832+
753833
// Compress-Archive -Path .\* -DestinationPath ".\$(Split-Path -Leaf $PWD).zip"
754834
// Expand-Archive -Path .\archive.zip -DestinationPath . -Force
755835

@@ -758,7 +838,7 @@
758838

759839
// 7z a -tzip "$(Split-Path -Leaf $PWD).zip" .\*
760840
// 7z x archive.zip -y
761-
menu_callback.more['save-zip'] = async function(){
841+
menu_callback.snapshot['save-zip'] = async function(){
762842

763843
console.log('save-zip');
764844
if(!tabs.cur.view){
@@ -818,7 +898,7 @@
818898
}//save-zip
819899

820900

821-
menu_callback.more['load-zip'] = async function(){
901+
menu_callback.snapshot['load-zip'] = async function(){
822902

823903
console.log('load-zip');
824904
if(!tabs.cur.view){
@@ -874,63 +954,6 @@
874954
}//load-zip
875955

876956

877-
menu_callback.more['save-tar'] = async function(){
878-
879-
console.log('save-tar');
880-
if(!tabs.cur.view){
881-
log.red('no active terminal');
882-
return;
883-
}
884-
885-
var cwd = tabs.cur.view.terminal.shell.cwd;
886-
var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs;
887-
console.log(cwd_abs);
888-
if(cwd===null){
889-
term.writeln.red('can only save tar relative to workdir');
890-
return;
891-
}
892-
893-
var term = tabs.cur.view.terminal.term;
894-
895-
term.writeln('');
896-
term.writeln.green('saving tar ...');
897-
898-
899-
}//save-tar
900-
901-
902-
menu_callback.more['load-tar'] = async function(){
903-
904-
console.log('load-tar');
905-
if(!tabs.cur.view){
906-
log.red('no active terminal');
907-
return;
908-
}
909-
910-
var cwd = tabs.cur.view.terminal.shell.cwd;
911-
var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs;
912-
console.log(cwd_abs);
913-
if(cwd===null){
914-
term.writeln.red('can only load tar relative to workdir');
915-
return;
916-
}
917-
918-
var term = tabs.cur.view.terminal.term;
919-
920-
term.writeln('');
921-
term.writeln.green('loading tar ...');
922-
923-
924-
}//load-tar
925-
926-
927-
//:
928-
929-
930-
menu_callback.snapshot = function(type,opt){
931-
}//snapshot
932-
933-
934957
//:
935958

936959

0 commit comments

Comments
 (0)