Skip to content

Commit

Permalink
Add ImJoy integration (#95)
Browse files Browse the repository at this point in the history
* take out main.js

* Use waitress as production server

* Fix readme

* Add initial plugin code

* Support imjoy dialog

* Bump version

* Fix jquery warning

* Fix mkdir bug
  • Loading branch information
oeway authored Apr 23, 2020
1 parent 1b0cb18 commit 75de7d1
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 210 deletions.
2 changes: 1 addition & 1 deletion imjoy_elfinder/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.1.49"
"version": "0.1.50"
}
2 changes: 1 addition & 1 deletion imjoy_elfinder/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Provide a main module."""
"""Provide the app module."""
import argparse
import json
import os
Expand Down
12 changes: 8 additions & 4 deletions imjoy_elfinder/elfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def __rename(self) -> None:

if os.path.exists(new_name):
self._response[R_ERROR] = (
"File or folder with the same name" + "already exists"
"File or folder with the same name " + new_name + " already exists"
)
return

Expand Down Expand Up @@ -675,9 +675,11 @@ def __mkdir(self) -> None:
return

new_subdir = os.path.join(path, subdir)
if os.path.exists(subdir):
if os.path.exists(new_subdir):
self._response[R_ERROR] = (
"File or folder with the same name" + subdir + " already exists"
"File or folder with the same name "
+ subdir
+ " already exists"
)
return
try:
Expand Down Expand Up @@ -998,7 +1000,9 @@ def __paste(self) -> None:
return
# TODO thumbs # pylint: disable=fixme
if os.path.exists(new_dst):
self._response[R_ERROR] = "Unable to move files"
self._response[
R_ERROR
] = "File or folder with the same name already exists"
self._set_error_data(
fil, "File or folder with the same name already exists"
)
Expand Down
1 change: 1 addition & 0 deletions imjoy_elfinder/templates/elfinder/elfinder.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script src="https://lib.imjoy.io/imjoy-loader.js"></script>
<script>{% include "elfinder/main.js" %}</script>
<style>{% include "elfinder/main.css" %}</style>
</head>
<body>

Expand Down
17 changes: 17 additions & 0 deletions imjoy_elfinder/templates/elfinder/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.elfinder-quicklook-titlebar-icon .ui-icon {
margin-top: -2px!important;
}
.ui-dialog-buttonset {
order: 4;
margin-left: 5px;
margin-right: 5px;
min-width: 100px;
}
.dialog-btn{
height: 20px;
font-size: 0.6rem!important;
width: 35px;
padding-top: 0px!important;
padding-bottom: 2px!important;
padding-left: 5px!important;
}
Loading

0 comments on commit 75de7d1

Please # to comment.