|
74 | 74 | var log; |
75 | 75 |
|
76 | 76 |
|
| 77 | + var jszip; |
| 78 | + |
| 79 | + var libs = {}; |
| 80 | + |
| 81 | + |
77 | 82 | //: |
78 | 83 |
|
79 | 84 |
|
|
152 | 157 | })(); |
153 | 158 |
|
154 | 159 |
|
| 160 | + |
| 161 | + libs.jszip = async function(){ |
| 162 | + }//jszip |
| 163 | + |
| 164 | + |
155 | 165 | </script> |
156 | 166 |
|
157 | 167 |
|
|
284 | 294 | <div id=https-server class=menu-opt>install https-server</div> |
285 | 295 | <div id=save-snapshot class=menu-opt>save snapshot</div> |
286 | 296 | <div id=load-snapshot class=menu-opt>load snapshot</div> |
| 297 | + <div id=save-zip class=menu-opt>save zip</div> |
| 298 | + <div id=load-zip class=menu-opt>load zip</div> |
| 299 | + <div id=save-tar class=menu-opt>save tar</div> |
| 300 | + <div id=load-tar class=menu-opt>load tar</div> |
287 | 301 | </div> |
288 | 302 | </div> |
289 | 303 |
|
|
572 | 586 | //console.log('more',type,opt); |
573 | 587 | if(type=='opt'){ |
574 | 588 |
|
575 | | - switch(opt.id){ |
576 | | - |
577 | | - case 'https-server' : menu_callback['https-server'](); break; |
578 | | - case 'save-snapshot' : menu_callback['save-snapshot'](); break; |
579 | | - case 'load-snapshot' : menu_callback['load-snapshot'](); break; |
580 | | - |
581 | | - }//switch |
| 589 | + menu_callback.more[opt.id](); |
582 | 590 |
|
583 | 591 | } |
584 | 592 |
|
|
587 | 595 | }//more |
588 | 596 |
|
589 | 597 |
|
590 | | - menu_callback['https-server'] = async function(){ |
| 598 | + menu_callback.more['https-server'] = async function(){ |
591 | 599 |
|
592 | 600 | if(!tabs.cur.view){ |
593 | 601 | log.red('no active terminal'); |
|
654 | 662 | }//https-server |
655 | 663 |
|
656 | 664 |
|
657 | | - menu_callback['save-snapshot'] = async function(){ |
| 665 | + menu_callback.more['save-snapshot'] = async function(){ |
658 | 666 | console.log('save-snapshot'); |
659 | 667 | if(!tabs.cur.view){ |
660 | 668 | log.red('no active terminal'); |
|
761 | 769 | }//take-snapsht |
762 | 770 |
|
763 | 771 |
|
764 | | - menu_callback['load-snapshot'] = async function(){ |
| 772 | + menu_callback.more['load-snapshot'] = async function(){ |
765 | 773 | console.log('load-snapshot'); |
766 | 774 | if(!tabs.cur.view){ |
767 | 775 | log.red('no active terminal'); |
|
859 | 867 | }//restore-snapshot |
860 | 868 |
|
861 | 869 |
|
| 870 | + menu_callback.more['save-zip'] = async function(){ |
| 871 | + |
| 872 | + console.log('save-zip'); |
| 873 | + if(!tabs.cur.view){ |
| 874 | + log.red('no active terminal'); |
| 875 | + return; |
| 876 | + } |
| 877 | + |
| 878 | + var cwd = tabs.cur.view.terminal.shell.cwd; |
| 879 | + var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs; |
| 880 | + console.log(cwd_abs); |
| 881 | + if(cwd===null){ |
| 882 | + term.writeln.red('can only save zip relative to workdir'); |
| 883 | + return; |
| 884 | + } |
| 885 | + |
| 886 | + var term = tabs.cur.view.terminal.term; |
| 887 | + |
| 888 | + term.writeln(''); |
| 889 | + term.writeln.green('saving zip ...'); |
| 890 | + |
| 891 | + |
| 892 | + }//save-zip |
| 893 | + |
| 894 | + |
| 895 | + menu_callback.more['load-zip'] = async function(){ |
| 896 | + |
| 897 | + console.log('load-zip'); |
| 898 | + if(!tabs.cur.view){ |
| 899 | + log.red('no active terminal'); |
| 900 | + return; |
| 901 | + } |
| 902 | + |
| 903 | + var cwd = tabs.cur.view.terminal.shell.cwd; |
| 904 | + var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs; |
| 905 | + console.log(cwd_abs); |
| 906 | + if(cwd===null){ |
| 907 | + term.writeln.red('can only load zip relative to workdir'); |
| 908 | + return; |
| 909 | + } |
| 910 | + |
| 911 | + var term = tabs.cur.view.terminal.term; |
| 912 | + |
| 913 | + term.writeln(''); |
| 914 | + term.writeln.green('loading zip ...'); |
| 915 | + |
| 916 | + |
| 917 | + }//load-zip |
| 918 | + |
| 919 | + |
| 920 | + menu_callback.more['save-tar'] = async function(){ |
| 921 | + |
| 922 | + console.log('save-tar'); |
| 923 | + if(!tabs.cur.view){ |
| 924 | + log.red('no active terminal'); |
| 925 | + return; |
| 926 | + } |
| 927 | + |
| 928 | + var cwd = tabs.cur.view.terminal.shell.cwd; |
| 929 | + var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs; |
| 930 | + console.log(cwd_abs); |
| 931 | + if(cwd===null){ |
| 932 | + term.writeln.red('can only save tar relative to workdir'); |
| 933 | + return; |
| 934 | + } |
| 935 | + |
| 936 | + var term = tabs.cur.view.terminal.term; |
| 937 | + |
| 938 | + term.writeln(''); |
| 939 | + term.writeln.green('saving tar ...'); |
| 940 | + |
| 941 | + |
| 942 | + }//save-tar |
| 943 | + |
| 944 | + |
| 945 | + menu_callback.more['load-tar'] = async function(){ |
| 946 | + |
| 947 | + console.log('load-tar'); |
| 948 | + if(!tabs.cur.view){ |
| 949 | + log.red('no active terminal'); |
| 950 | + return; |
| 951 | + } |
| 952 | + |
| 953 | + var cwd = tabs.cur.view.terminal.shell.cwd; |
| 954 | + var cwd_abs = tabs.cur.view.terminal.shell.cwd_abs; |
| 955 | + console.log(cwd_abs); |
| 956 | + if(cwd===null){ |
| 957 | + term.writeln.red('can only load tar relative to workdir'); |
| 958 | + return; |
| 959 | + } |
| 960 | + |
| 961 | + var term = tabs.cur.view.terminal.term; |
| 962 | + |
| 963 | + term.writeln(''); |
| 964 | + term.writeln.green('loading tar ...'); |
| 965 | + |
| 966 | + |
| 967 | + }//load-tar |
| 968 | + |
| 969 | + |
| 970 | + //: |
| 971 | + |
| 972 | + |
862 | 973 | menu_callback.snapshot = function(type,opt){ |
863 | 974 | }//snapshot |
864 | 975 |
|
865 | 976 |
|
| 977 | + //: |
| 978 | + |
| 979 | + |
866 | 980 | menu_callback.links = function(type,opt){ |
867 | 981 | }//links |
868 | 982 |
|
|
0 commit comments