Compare commits
No commits in common. "a7d56bae10dee21ac6e28de2fa5ad797b2b7d7d4" and "022046cd3f9bc9e33b24b519cb94d821a4037d7e" have entirely different histories.
a7d56bae10
...
022046cd3f
@ -17,10 +17,7 @@ window_controllers = {}
|
|||||||
|
|
||||||
|
|
||||||
def get_window_controller():
|
def get_window_controller():
|
||||||
controller = None
|
if session.get('win_controller_id') is None:
|
||||||
try:
|
|
||||||
controller = window_controllers[ session["win_controller_id"] ]
|
|
||||||
except Exception as e:
|
|
||||||
id = secrets.token_hex(16)
|
id = secrets.token_hex(16)
|
||||||
controller = WindowController()
|
controller = WindowController()
|
||||||
view = controller.get_window(1).get_view(0)
|
view = controller.get_window(1).get_view(0)
|
||||||
@ -31,9 +28,8 @@ def get_window_controller():
|
|||||||
|
|
||||||
session['win_controller_id'] = id
|
session['win_controller_id'] = id
|
||||||
window_controllers.update( {id: controller } )
|
window_controllers.update( {id: controller } )
|
||||||
controller = window_controllers[ session["win_controller_id"] ]
|
|
||||||
|
|
||||||
return controller
|
return window_controllers[ session["win_controller_id"] ]
|
||||||
|
|
||||||
|
|
||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
@ -72,12 +68,6 @@ def listFiles(_hash = None):
|
|||||||
path = view.get_path_part_from_hash(_hash)
|
path = view.get_path_part_from_hash(_hash)
|
||||||
view.push_to_path(path)
|
view.push_to_path(path)
|
||||||
|
|
||||||
error_msg = view.get_error_message()
|
|
||||||
if error_msg != None:
|
|
||||||
view.unset_error_message()
|
|
||||||
return msgHandler.createMessageJSON("danger", error_msg)
|
|
||||||
|
|
||||||
|
|
||||||
sub_path = view.get_current_sub_path()
|
sub_path = view.get_current_sub_path()
|
||||||
files = view.get_files_formatted()
|
files = view.get_files_formatted()
|
||||||
fave = db.session.query(Favorites).filter_by(link = sub_path).first()
|
fave = db.session.query(Favorites).filter_by(link = sub_path).first()
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#video-controls {
|
#video-controls {
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 2.5em;
|
bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,19 +38,6 @@
|
|||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noselect {
|
|
||||||
-webkit-touch-callout: none; /* iOS Safari */
|
|
||||||
-webkit-user-select: none; /* Safari */
|
|
||||||
-khtml-user-select: none; /* Konqueror HTML */
|
|
||||||
-moz-user-select: none; /* Old versions of Firefox */
|
|
||||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
||||||
user-select: none; /* Non-prefixed version, currently
|
|
||||||
supported by Chrome, Edge, Opera and Firefox */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.volume-control-positioner {
|
.volume-control-positioner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 2em;
|
bottom: 2em;
|
||||||
|
@ -29,10 +29,7 @@ const loadFavePath = (e) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openFile = (eve) => {
|
const openFile = (eve) => {
|
||||||
let target = eve.target;
|
const target = eve.target;
|
||||||
if (!target.getAttribute("title"))
|
|
||||||
target = target.parentElement
|
|
||||||
|
|
||||||
const ftype = target.getAttribute("ftype");
|
const ftype = target.getAttribute("ftype");
|
||||||
const title = target.getAttribute("title");
|
const title = target.getAttribute("title");
|
||||||
const hash = target.getAttribute("hash");
|
const hash = target.getAttribute("hash");
|
||||||
|
7
src/core/static/js/react-ui-logic.js
vendored
7
src/core/static/js/react-ui-logic.js
vendored
@ -78,14 +78,13 @@ class FilesList extends React.Component {
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
{card_header}
|
{card_header}
|
||||||
|
<input hash={hash} onClick={this.openThis} ftype={filetype} class="btn btn-secondary btn-sm float-right" title={name} type="button" value="Open"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body text-center noselect" title={name} hash={hash} ftype={filetype} onDoubleClick={this.openThis}>
|
<div class="card-body text-center">
|
||||||
{card_body}
|
{card_body}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<a href={"api/file-manager-action/files/" + hash} download class="btn btn-secondary btn-sm float-left">Download</a>
|
<input hash={hash} onClick={this.openThisLocally} ftype={filetype} class="btn btn-secondary btn-sm float-right" type="button" value="Open Locally"/>
|
||||||
<input hash={hash} onClick={this.openThisLocally} ftype={filetype} class="btn btn-secondary btn-sm float-left" type="button" value="Open Locally"/>
|
|
||||||
<input hash={hash} onClick={this.openThis} ftype={filetype} class="btn btn-secondary btn-sm float-right" title={name} type="button" value="Open"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -9,8 +9,8 @@ from os.path import isdir, isfile, join
|
|||||||
|
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from .utils import Settings, Launcher
|
from . import Path, Settings, Launcher
|
||||||
from . import Path
|
|
||||||
|
|
||||||
class View(Settings, Launcher, Path):
|
class View(Settings, Launcher, Path):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -20,7 +20,6 @@ class View(Settings, Launcher, Path):
|
|||||||
self.images = []
|
self.images = []
|
||||||
self.desktop = []
|
self.desktop = []
|
||||||
self.ungrouped = []
|
self.ungrouped = []
|
||||||
self.error_message = None
|
|
||||||
|
|
||||||
self.set_to_home()
|
self.set_to_home()
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ class View(Settings, Launcher, Path):
|
|||||||
self.files = []
|
self.files = []
|
||||||
|
|
||||||
if not isdir(path):
|
if not isdir(path):
|
||||||
self._set_error_message("Path can not be accessed.")
|
self.set_to_home()
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
for f in listdir(path):
|
for f in listdir(path):
|
||||||
@ -121,15 +120,6 @@ class View(Settings, Launcher, Path):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def _set_error_message(self, text):
|
|
||||||
self.error_message = text
|
|
||||||
|
|
||||||
def unset_error_message(self):
|
|
||||||
self.error_message = None
|
|
||||||
|
|
||||||
def get_error_message(self):
|
|
||||||
return self.error_message
|
|
||||||
|
|
||||||
def get_current_directory(self):
|
def get_current_directory(self):
|
||||||
return self.get_path()
|
return self.get_path()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user