@@ -11,7 +11,7 @@ const renameCurrent = require('./operations/rename-current');
1111const CurrentFile = require ( './current-file.mjs' ) ;
1212const DOMTree = require ( './dom-tree.mjs' ) ;
1313
14- const Cmd = module . exports ;
14+ const Cmd = require ( './cmd.mjs' ) ;
1515const DOM = {
1616 ...DOMTree ,
1717 ...CurrentFile ,
@@ -47,7 +47,6 @@ DOM.Events = Events;
4747const _loadRemote = require ( './load-remote' ) ;
4848const selectByPattern = require ( './select-by-pattern' ) ;
4949const isString = ( a ) => typeof a === 'string' ;
50- const SELECTED_FILE = 'selected-file' ;
5150
5251const TabPanel = {
5352 'js-left' : null ,
@@ -118,7 +117,7 @@ async function promptNew(typeName) {
118117}
119118
120119/**
121- * get current direcotory name
120+ * get current directory name
122121 */
123122module . exports . getCurrentDirName = ( ) => {
124123 const href = DOM
@@ -131,7 +130,7 @@ module.exports.getCurrentDirName = () => {
131130} ;
132131
133132/**
134- * get current direcotory path
133+ * get current directory path
135134 */
136135module . exports . getParentDirPath = ( panel ) => {
137136 const path = DOM . getCurrentDirPath ( panel ) ;
@@ -145,7 +144,7 @@ module.exports.getParentDirPath = (panel) => {
145144} ;
146145
147146/**
148- * get not current direcotory path
147+ * get not current directory path
149148 */
150149module . exports . getNotCurrentDirPath = ( ) => {
151150 const panel = DOM . getPanel ( {
@@ -155,18 +154,6 @@ module.exports.getNotCurrentDirPath = () => {
155154 return DOM . getCurrentDirPath ( panel ) ;
156155} ;
157156
158- /**
159- * unified way to get selected files
160- *
161- * @currentFile
162- */
163- module . exports . getSelectedFiles = ( ) => {
164- const panel = DOM . getPanel ( ) ;
165- const selected = DOM . getByClassAll ( SELECTED_FILE , panel ) ;
166-
167- return Array . from ( selected ) ;
168- } ;
169-
170157/*
171158 * unselect all files
172159 */
@@ -340,54 +327,6 @@ module.exports.getRefreshButton = (panel = DOM.getPanel()) => {
340327 return DOM . getByDataName ( 'js-refresh' , panel ) ;
341328} ;
342329
343- /**
344- * select current file
345- * @param currentFile
346- */
347- module . exports . selectFile = ( currentFile ) => {
348- const current = currentFile || DOM . getCurrentFile ( ) ;
349-
350- current . classList . add ( SELECTED_FILE ) ;
351-
352- return Cmd ;
353- } ;
354-
355- module . exports . unselectFile = ( currentFile ) => {
356- const current = currentFile || DOM . getCurrentFile ( ) ;
357-
358- current . classList . remove ( SELECTED_FILE ) ;
359-
360- return Cmd ;
361- } ;
362-
363- module . exports . toggleSelectedFile = ( currentFile ) => {
364- const current = currentFile || DOM . getCurrentFile ( ) ;
365- const name = DOM . getCurrentName ( current ) ;
366-
367- if ( name === '..' )
368- return Cmd ;
369-
370- current . classList . toggle ( SELECTED_FILE ) ;
371-
372- return Cmd ;
373- } ;
374-
375- module . exports . toggleAllSelectedFiles = ( ) => {
376- DOM
377- . getAllFiles ( )
378- . map ( DOM . toggleSelectedFile ) ;
379-
380- return Cmd ;
381- } ;
382-
383- module . exports . selectAllFiles = ( ) => {
384- DOM
385- . getAllFiles ( )
386- . map ( DOM . selectFile ) ;
387-
388- return Cmd ;
389- } ;
390-
391330module . exports . getAllFiles = ( ) => {
392331 const panel = DOM . getPanel ( ) ;
393332 const files = DOM . getFiles ( panel ) ;
@@ -436,18 +375,6 @@ module.exports.setHistory = (data, title, url) => {
436375 return ret ;
437376} ;
438377
439- /**
440- * selected file check
441- *
442- * @param currentFile
443- */
444- module . exports . isSelected = ( currentFile ) => {
445- if ( ! currentFile )
446- return false ;
447-
448- return DOM . isContainClass ( currentFile , SELECTED_FILE ) ;
449- } ;
450-
451378/**
452379 * get link from current (or param) file
453380 *
0 commit comments