Merge pull request #11 from 45Drives/dev-josh

Changes for v0.2.3
This commit is contained in:
Josh Boudreau 2021-06-02 13:59:25 -03:00 committed by GitHub
commit f250603265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 15 deletions

View File

@ -19,17 +19,17 @@ With no command line use needed, you can:
# Installation
## From Github Release
### Ubuntu
1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.2/cockpit-navigator_0.2.2-1focal_all.deb`
1. `# apt install ./cockpit-navigator_0.2.2-1focal_all.deb`
1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.3/cockpit-navigator_0.2.3-1focal_all.deb`
1. `# apt install ./cockpit-navigator_0.2.3-1focal_all.deb`
### EL7
1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.2/cockpit-navigator-0.2.2-1.el7.noarch.rpm`
1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.3/cockpit-navigator-0.2.3-1.el7.noarch.rpm`
### EL8
1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.2/cockpit-navigator-0.2.2-1.el8.noarch.rpm`
1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.2.3/cockpit-navigator-0.2.3-1.el8.noarch.rpm`
## From Source
1. Ensure dependencies are installed: `cockpit`, `python3`, `rsync`.
1. `$ git clone https://github.com/45Drives/cockpit-navigator.git`
1. `$ cd cockpit-navigator`
1. `$ git checkout <version>` (v0.2.2 is latest)
1. `$ git checkout <version>` (v0.2.3 is latest)
1. `# make install`
## From 45Drives Repositories
### Ubuntu

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
cockpit-navigator (0.2.3-1focal) focal; urgency=medium
* Fix closing contextmenu in el7.
* Hide rename in right click menu with multiple selected entries.
* Populate default link target to selected item from right click menu.
-- Josh Boudreau <jboudreau@45drives.com> Wed, 02 Jun 2021 13:57:00 -0300
cockpit-navigator (0.2.2-1focal) focal; urgency=low
* Set default value in rename prompt to current filename.

View File

@ -1,5 +1,5 @@
Name: cockpit-navigator
Version: 0.2.2
Version: 0.2.3
Release: 1%{?dist}
Summary: A File System Browser for Cockpit.
License: GPL-3.0+
@ -32,6 +32,10 @@ rm -rf %{buildroot}
/usr/share/cockpit/navigator/*
%changelog
* Wed Jun 02 2021 Josh Boudreau <jboudreau@45drives.com> 0.2.3-1
- Fix closing contextmenu in el7.
- Hide rename in right click menu with multiple selected entries.
- Populate default link target to selected item from right click menu.
* Wed Jun 02 2021 Josh Boudreau <jboudreau@45drives.com> 0.2.2-1
- Set default value in rename prompt to current filename.
* Wed Jun 02 2021 Josh Boudreau <jboudreau@45drives.com> 0.2.1-1

View File

@ -471,6 +471,7 @@ input:checked + .slider:before {
}
.nav-context-menu {
display: none;
position: absolute;
background-color: var(--container);
border: 1px solid var(--border);

View File

@ -178,6 +178,6 @@
</div>
</div>
</body>
<div class="nav-context-menu flex-col" id="nav-context-menu" hidden>
<div class="nav-context-menu flex-col" id="nav-context-menu">
</div>
</html>

View File

@ -721,7 +721,7 @@ class NavContextMenu {
this.dom_element = document.getElementById(id);
this.nav_window_ref = nav_window_ref;
this.menu_options = {};
window.addEventListener("click", (event) => {
document.documentElement.addEventListener("click", (event) => {
if (event.target !== this.dom_element)
this.hide();
});
@ -738,7 +738,7 @@ class NavContextMenu {
this.dom_element.appendChild(elem);
this.menu_options[func] = elem;
}
this.menu_options["paste"].hidden = true;
this.menu_options["paste"].style.display = "none";
}
new_dir() {
@ -750,7 +750,10 @@ class NavContextMenu {
}
new_link() {
this.nav_window_ref.ln();
var default_target = "";
if (this.nav_window_ref.selected_entries.size <= 1 && this.target !== this.nav_window_ref.pwd())
default_target = this.target.filename();
this.nav_window_ref.ln(default_target);
}
cut() {
@ -814,14 +817,19 @@ class NavContextMenu {
this.menu_options["cut"].hidden = false;
this.menu_options["delete"].hidden = false;
}
if (this.nav_window_ref.selected_entries.size > 1) {
this.menu_options["rename"].hidden = true;
} else {
this.menu_options["rename"].hidden = false;
}
this.target = target;
this.dom_element.hidden = false;
this.dom_element.style.display = "inline";
this.dom_element.style.left = event.clientX + "px";
this.dom_element.style.top = event.clientY + "px";
}
hide() {
this.dom_element.hidden = true;
this.dom_element.style.display = "none";
}
hide_paste() {
@ -1193,8 +1201,8 @@ class NavWindow {
this.refresh();
}
async ln() {
var link_target = window.prompt("Link Target: ");
async ln(default_target = "") {
var link_target = window.prompt("Link Target: ", default_target);
if (link_target === null)
return;
var link_name = window.prompt("Link Name: ");
@ -1389,7 +1397,7 @@ function set_up_buttons() {
document.getElementById("nav-refresh-btn").addEventListener("click", nav_window.refresh.bind(nav_window));
document.getElementById("nav-mkdir-btn").addEventListener("click", nav_window.mkdir.bind(nav_window));
document.getElementById("nav-touch-btn").addEventListener("click", nav_window.touch.bind(nav_window));
document.getElementById("nav-ln-btn").addEventListener("click", nav_window.ln.bind(nav_window));
document.getElementById("nav-ln-btn").addEventListener("click", nav_window.ln.bind(nav_window, ""));
document.getElementById("nav-delete-btn").addEventListener("click", nav_window.delete_selected.bind(nav_window));
document.getElementById("nav-edit-properties-btn").addEventListener("click", nav_window.show_edit_selected.bind(nav_window));
document.getElementById("nav-cancel-edit-btn").addEventListener("click", nav_window.hide_edit_selected.bind(nav_window));