Skip to content

Commit cdb15d7

Browse files
committed
many fixes and improvements
1 parent 56a5ff4 commit cdb15d7

File tree

10 files changed

+137
-82
lines changed

10 files changed

+137
-82
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ All Dracula based themes are here with permission from the author. Please suppor
8989

9090
These directions currently work for the macOS. I haven't tested for finished the Linux or Windows installation. All external programs should be installed before first running the Modal File Manager. Otherwise, you will have to modify the path used to execute external programs to find them.
9191

92-
I have a run script made with [Mask](https://github.com/jakedeichert/mask) and [Node.js](https://nodejs.org/en/). You have to put a copy of [NW.js](https://nwjs.io/) in the 'misc' directory as `nwjs.app`. Or, you can change the script. I'm assuming you aren't changing the script in the following.
92+
I have a run script made with [Mask](https://github.com/jakedeichert/mask) and [Node.js](https://nodejs.org/en/). You have to put a copy of [NW.js](https://nwjs.io/) in the 'misc' directory as `nwjs.app`. Or, you can change the script. I'm assuming you aren't changing the script in the following. Also, the scripts in the mask file are running in a [fish shell](https://github.com/fish-shell/fish-shell). If you don't have fish shell on your system, you will need to either install it or convert the script to run in zsh or sh.
9393

9494
So, download the repository, create the `misc` directory, put nwjs.app in the `misc` directory. On the command line, run the following commands to compile and run the program:
9595

@@ -313,8 +313,7 @@ These commands can be ran from the command prompt. They all act upon the current
313313

314314
### Extension Commands
315315

316-
These commands require inputs and supply results. Therefore these commands can`t be used in
317-
hotkeys or command prompt. They are loaded and used in a different way as well.
316+
These commands require inputs and supply results. Therefore these commands can`t be used in hotkeys or the command prompt. They are loaded and used in a different way as well. Please refer to the [Creating Extensions Section](#creating-extensions) for more details.
318317

319318
| Function Name | Description |
320319
| --- | ---------- |
@@ -347,7 +346,9 @@ hotkeys or command prompt. They are loaded and used in a different way as well.
347346
| `copyEntriesCommand` | Copy the entry list to the destination entry. |
348347
| `moveEntriesCommand` | Move the entry list to the destination entry. |
349348
| `deleteEntriesCommand` | Delete the entry list |
350-
| `editEntriesCommand` | Edit the entry |
349+
| `editEntryCommand` | Edit the entry |
350+
| `getRightDir` | Get the directory path for the right panel. |
351+
| `getLeftDir` | Get the directory path for the left panel. |
351352

352353
## Creating Themes
353354

package-lock.json

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/bundle.bin

4.71 KB
Binary file not shown.

public/bundle.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/bundle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Entry.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{#if ((localCursor.pane === pane) && (localCursor.entry.name == entry.name))}
1+
{#if (((localCursor.pane === pane) && (localCursor.entry.name == entry.name))||(entry.selected))}
22
<div class='entry'
33
style="background-color: {localTheme.cursorColor};"
44
on:click={cursorToEntry(pane, entry, index)}
@@ -227,7 +227,7 @@
227227
var shiftKey = e.shiftKey;
228228
switch(type) {
229229
case 'over':
230-
if(e.shiftKey) {
230+
if(shiftKey) {
231231
e.dataTransfer.dropEffect = 'move';
232232
} else {
233233
e.dataTransfer.dropEffect = 'copy';

src/components/FileManager.svelte

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@
661661
extensions.addExtCommand('moveEntriesCommand', 'Move the list of entries to the new location.', moveEntriesCommand);
662662
extensions.addExtCommand('deleteEntriesCommand', 'Delete the list of entries.', deleteEntriesCommand);
663663
extensions.addExtCommand('editEntryCommand', 'Edit the given entry.', editEntryCommand);
664+
extensions.addExtCommand('getRightDir', 'Get the path for the right pane.', getRightDir);
665+
extensions.addExtCommand('getLeftDir', 'Get the path for the left pane.', getLeftDir);
664666
}
665667
666668
function installDefaultCommands() {
@@ -1359,7 +1361,10 @@
13591361
//
13601362
// There is an editor defined by the user. Use it.
13611363
//
1362-
var file = localFS.appendPath(entry.dir, entry.name);
1364+
var file = entry;
1365+
if(typeof entry === 'object'){
1366+
file = localFS.appendPath(entry.dir, entry.name);
1367+
}
13631368
var editor = localFS.readFile(userEditor).toString().trim();
13641369
if(editor.endsWith('.app')) {
13651370
localFS.openFileWithProgram(editor, file);
@@ -1543,17 +1548,32 @@
15431548
title: title,
15441549
noShowButton: false
15451550
};
1546-
msgBoxItems = [{
1547-
type: 'label',
1548-
for: 'msgboxMain',
1549-
text: msg,
1550-
id: 'msgboxMain'
1551-
}];
1551+
1552+
//
1553+
// If the msg starts with a tag open, then assume it is
1554+
// a block of html and use that for displaying. Otherwise,
1555+
// use a label.
1556+
//
1557+
if(msg[0] === '<') {
1558+
msgBoxItems = [{
1559+
type: 'html',
1560+
text: msg,
1561+
id: 'msgboxMain'
1562+
}];
1563+
} else {
1564+
msgBoxItems = [{
1565+
type: 'label',
1566+
for: 'msgboxMain',
1567+
text: msg,
1568+
id: 'msgboxMain'
1569+
}];
1570+
}
15521571
msgCallBack = (e) => {};
15531572
showMessageBox = true;
15541573
}
15551574
1556-
function pickItem(title, items, returnValue) {
1575+
function pickItem(title, items, returnValue, extra) {
1576+
if(typeof extra === 'undefined') extra = false;
15571577
msgBoxConfig = {
15581578
title: title,
15591579
noShowButton: false
@@ -1562,7 +1582,8 @@
15621582
type: 'picker',
15631583
selections: items,
15641584
value: items[0].value,
1565-
id: 'msgboxMain'
1585+
id: 'msgboxMain',
1586+
extra: extra
15661587
}];
15671588
msgCallBack = (e) => {
15681589
returnValue(e[0].value);
@@ -2246,5 +2267,13 @@
22462267
}
22472268
});
22482269
}
2270+
2271+
function getRightDir() {
2272+
return(localRightDir);
2273+
}
2274+
2275+
function getLeftDir() {
2276+
return(localLeftDir);
2277+
}
22492278
</script>
22502279

0 commit comments

Comments
 (0)