File tree Expand file tree Collapse file tree
utils/misc/nodejs-terminal/v3.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 558558 snapshot . list = $ ( snapshot . menu , '#list' ) ;
559559 snapshot . item = $ ( snapshot . list , '.item' ) ;
560560 snapshot . item . remove ( ) ;
561- ls . read . snapshot_list . value . forEach ( snapshot . additem ) ;
561+ ls . read . snapshot_list . value . forEach ( snapshot . add ) ;
562562
563563
564564 var links = $ ( '#links-menu' ) ;
879879 //:
880880
881881
882- snapshot . additem = function ( file ) {
882+ snapshot . add = function ( file ) {
883883
884+ var list = ls . read . snapshot_list ;
885+ list . push ( file ) ;
886+ ls . write . snapshot_list = list ;
887+
888+
884889 var empty = $ ( snapshot . list , '#empty' ) ;
885890 if ( empty ) {
886891 empty . remove ( ) ;
909914 e . stopPropagation ( ) ;
910915 nitem . remove ( ) ;
911916
917+ var list = ls . read . snapshot_list ;
918+ var f1 = JSON . stringify ( file ) ;
919+ var n = list . length ;
920+ for ( var i = 0 ; i < n ; i ++ ) {
921+
922+ var file2 = list [ i ] ;
923+ var f2 = JSON . stringify ( file2 ) ;
924+ if ( f1 == f2 ) {
925+ console . log ( 'remove : found' , i ) ;
926+ list . splice ( i , 1 ) ;
927+ ls . write . snapshot_list = list ;
928+ return ;
929+ }
930+
931+ } //for
932+
912933 } //remove
913934
914935 } //additem
932953
933954 menu_callback . snapshot . add = function ( ) {
934955
935- snapshot . additem ( cur . file ) ;
956+ snapshot . add ( cur . file ) ;
936957
937958 } //add
938959
You can’t perform that action at this time.
0 commit comments