|
345 | 345 | </div> |
346 | 346 | <div class=menu style='display:none;left:0px;top:35px'> |
347 | 347 | <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> |
352 | 348 | </div> |
353 | 349 | </div> |
354 | 350 |
|
|
360 | 356 | <img class=m-icon> |
361 | 357 | </div> |
362 | 358 | <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> |
364 | 368 | </div> |
365 | 369 | </div> |
366 | 370 |
|
|
750 | 754 | }//https-server |
751 | 755 |
|
752 | 756 |
|
| 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 | + |
753 | 833 | // Compress-Archive -Path .\* -DestinationPath ".\$(Split-Path -Leaf $PWD).zip" |
754 | 834 | // Expand-Archive -Path .\archive.zip -DestinationPath . -Force |
755 | 835 |
|
|
758 | 838 |
|
759 | 839 | // 7z a -tzip "$(Split-Path -Leaf $PWD).zip" .\* |
760 | 840 | // 7z x archive.zip -y |
761 | | - menu_callback.more['save-zip'] = async function(){ |
| 841 | + menu_callback.snapshot['save-zip'] = async function(){ |
762 | 842 |
|
763 | 843 | console.log('save-zip'); |
764 | 844 | if(!tabs.cur.view){ |
|
818 | 898 | }//save-zip |
819 | 899 |
|
820 | 900 |
|
821 | | - menu_callback.more['load-zip'] = async function(){ |
| 901 | + menu_callback.snapshot['load-zip'] = async function(){ |
822 | 902 |
|
823 | 903 | console.log('load-zip'); |
824 | 904 | if(!tabs.cur.view){ |
|
874 | 954 | }//load-zip |
875 | 955 |
|
876 | 956 |
|
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 | | - |
934 | 957 | //: |
935 | 958 |
|
936 | 959 |
|
|
0 commit comments