mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Merge branch 'master' into translate
This commit is contained in:
commit
70f74923e6
14 changed files with 115 additions and 73 deletions
4
.github/ISSUE_TEMPLATE/bug-report.md
vendored
4
.github/ISSUE_TEMPLATE/bug-report.md
vendored
|
@ -36,7 +36,7 @@ If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
**Bug occurs on official PairDrop instance https://pairdrop.net/**
|
**Bug occurs on official PairDrop instance https://pairdrop.net/**
|
||||||
No | Yes
|
No | Yes
|
||||||
Version: v1.10.1
|
Version: v1.10.3
|
||||||
|
|
||||||
**Bug occurs on self-hosted PairDrop instance**
|
**Bug occurs on self-hosted PairDrop instance**
|
||||||
No | Yes
|
No | Yes
|
||||||
|
@ -44,7 +44,7 @@ No | Yes
|
||||||
**Self-Hosted Setup**
|
**Self-Hosted Setup**
|
||||||
Proxy: Nginx | Apache2
|
Proxy: Nginx | Apache2
|
||||||
Deployment: docker run | docker compose | npm run start:prod
|
Deployment: docker run | docker compose | npm run start:prod
|
||||||
Version: v1.10.1
|
Version: v1.10.3
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
3
.github/workflows/zip-release.yml
vendored
3
.github/workflows/zip-release.yml
vendored
|
@ -26,9 +26,8 @@ jobs:
|
||||||
- name: Archive Release
|
- name: Archive Release
|
||||||
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # v0.7.6
|
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # v0.7.6
|
||||||
with:
|
with:
|
||||||
type: 'zip'
|
|
||||||
filename: 'pairdrop-cli.zip'
|
filename: 'pairdrop-cli.zip'
|
||||||
path: 'pairdrop-cli'
|
directory: 'pairdrop-cli'
|
||||||
exclusions: '*.git* /*node_modules/* .editorconfig'
|
exclusions: '*.git* /*node_modules/* .editorconfig'
|
||||||
- name: Upload Release
|
- name: Upload Release
|
||||||
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
||||||
|
|
|
@ -24,7 +24,7 @@ This opens PairDrop in the default browser where you can choose the receiver.
|
||||||
```bash
|
```bash
|
||||||
pairdrop -h
|
pairdrop -h
|
||||||
```
|
```
|
||||||
```bash
|
```
|
||||||
Send files or text with PairDrop via command-line interface.
|
Send files or text with PairDrop via command-line interface.
|
||||||
Current domain: https://pairdrop-dev.onrender.com/
|
Current domain: https://pairdrop-dev.onrender.com/
|
||||||
|
|
||||||
|
@ -35,44 +35,61 @@ Send text: pairdrop -t "text"
|
||||||
Specify domain: pairdrop -d "https://pairdrop.net/"
|
Specify domain: pairdrop -d "https://pairdrop.net/"
|
||||||
Show this help text: pairdrop (-h|--help)
|
Show this help text: pairdrop (-h|--help)
|
||||||
|
|
||||||
This pairdrop-cli version was released alongside v1.10.0
|
This pairdrop-cli version was released alongside v1.10.4
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
Download the bash file: [pairdrop-cli/pairdrop](/pairdrop-cli/pairdrop).
|
|
||||||
|
|
||||||
#### Linux
|
#### Linux / Mac
|
||||||
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
||||||
2. Unzip the archive to a folder of your choice e.g. `/usr/local/bin/pairdrop-cli/`
|
```shell
|
||||||
3. Make sure the bash file `/usr/local/bin/pairdrop-cli/pairdrop` is executable. Otherwise, use `chmod +x pairdrop`
|
wget "https://github.com/schlagmichdoch/PairDrop/releases/download/v1.10.4/pairdrop-cli.zip"
|
||||||
4. Add absolute path of the folder to PATH variable to make `pairdrop` available globally by executing
|
```
|
||||||
`export PATH=$PATH:/usr/local/bin/pairdrop-cli/`
|
or
|
||||||
|
```shell
|
||||||
<br>
|
curl -LO "https://github.com/schlagmichdoch/PairDrop/releases/download/v1.10.4/pairdrop-cli.zip"
|
||||||
|
```
|
||||||
#### Mac
|
2. Unzip the archive to a folder of your choice e.g. `/usr/share/pairdrop-cli/`
|
||||||
1. add bash file to `/usr/local/bin`
|
```shell
|
||||||
|
sudo unzip pairdrop-cli.zip -d /usr/share/pairdrop-cli/
|
||||||
|
```
|
||||||
|
3. Copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
|
||||||
|
```shell
|
||||||
|
sudo cp /usr/share/pairdrop-cli/.pairdrop-cli-config.example /usr/share/pairdrop-cli/.pairdrop-cli-config
|
||||||
|
```
|
||||||
|
4. Make the bash file _pairdrop_ executable
|
||||||
|
```shell
|
||||||
|
sudo chmod +x /usr/share/pairdrop-cli/pairdrop
|
||||||
|
```
|
||||||
|
5. Add a symlink to /usr/local/bin/ to include _pairdrop_ to _PATH_
|
||||||
|
```shell
|
||||||
|
sudo ln -s /usr/share/pairdrop-cli/pairdrop /usr/local/bin/pairdrop
|
||||||
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
||||||
2. Put file in a preferred folder e.g. `C:\Program Files\pairdrop-cli`
|
2. Put file in a preferred folder e.g. `C:\Program Files\pairdrop-cli`
|
||||||
3. Search for and open `Edit environment variables for your account`
|
3. Inside this folder, copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
|
||||||
4. Click `Environment Variables…`
|
4. Search for and open `Edit environment variables for your account`
|
||||||
5. Under *System Variables* select `Path` and click *Edit...*
|
5. Click `Environment Variables…`
|
||||||
6. Click *New*, insert the preferred folder (`C:\Program Files\pairdrop-cli`), click *OK* until all windows are closed
|
6. Under _System Variables_ select `Path` and click _Edit..._
|
||||||
7. Reopen Command prompt window
|
7. Click _New_, insert the preferred folder (`C:\Program Files\pairdrop-cli`), click *OK* until all windows are closed
|
||||||
|
8. Reopen Command prompt window
|
||||||
|
|
||||||
<br>
|
**Requirements**
|
||||||
|
|
||||||
### Requirements
|
|
||||||
As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
|
As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
|
||||||
Then, you can also use pairdrop-cli from the default Windows Command Prompt \
|
|
||||||
by using the shell file instead of the bash file: `pairdrop.sh -h` which then itself executes \
|
Then, you can also use pairdrop-cli from the default Windows Command Prompt
|
||||||
pairdrop-cli (the bash file) via the Git Bash.
|
by using the shell file instead of the bash file which then itself executes
|
||||||
|
_pairdrop-cli_ (the bash file) via the Git Bash.
|
||||||
|
```shell
|
||||||
|
pairdrop.sh -h
|
||||||
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -82,14 +99,15 @@ pairdrop-cli (the bash file) via the Git Bash.
|
||||||
It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Windows `Send to` menu:
|
It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Windows `Send to` menu:
|
||||||
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
||||||
2. Unzip the archive to a folder of your choice e.g. `C:\Program Files\pairdrop-cli\`
|
2. Unzip the archive to a folder of your choice e.g. `C:\Program Files\pairdrop-cli\`
|
||||||
3. Copy the shortcut _send with PairDrop.lnk_
|
3. Inside this folder, copy the file _.pairdrop-cli-config.example_ to _.pairdrop-cli-config_
|
||||||
4. Hit Windows Key+R, type: `shell:sendto` and hit Enter.
|
4. Copy the shortcut _send with PairDrop.lnk_
|
||||||
5. Paste the copied shortcut into the directory
|
5. Hit Windows Key+R, type: `shell:sendto` and hit Enter.
|
||||||
6. Open the properties window of the shortcut and edit the link field to point to _send-with-pairdrop.ps1_ located in the folder you used in step 2: \
|
6. Paste the copied shortcut into the directory
|
||||||
|
7. Open the properties window of the shortcut and edit the link field to point to _send-with-pairdrop.ps1_ located in the folder you used in step 2: \
|
||||||
`"C:\Program Files\PowerShell\7\pwsh.exe" -File "C:\Program Files\pairdrop-cli\send-with-pairdrop.ps1"`
|
`"C:\Program Files\PowerShell\7\pwsh.exe" -File "C:\Program Files\pairdrop-cli\send-with-pairdrop.ps1"`
|
||||||
7. You are done! You can now send multiple files and directories directly via PairDrop:
|
8. You are done! You can now send multiple files and directories directly via PairDrop:
|
||||||
|
|
||||||
> _context menu > Send to > PairDrop_
|
_context menu_ > _Send to_ > _PairDrop_
|
||||||
|
|
||||||
##### Requirements
|
##### Requirements
|
||||||
As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
|
As Windows cannot execute bash scripts natively, you need to install [Git Bash](https://gitforwindows.org/).
|
||||||
|
@ -100,14 +118,18 @@ As Windows cannot execute bash scripts natively, you need to install [Git Bash](
|
||||||
|
|
||||||
### Registering to open files with PairDrop
|
### Registering to open files with PairDrop
|
||||||
It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Nautilus `Scripts` menu:
|
It is possible to send multiple files with PairDrop via the context menu by adding pairdrop-cli to Nautilus `Scripts` menu:
|
||||||
1. Download the latest _pairdrop-cli.zip_ from the [releases page](https://github.com/schlagmichdoch/PairDrop/releases)
|
1. Register _pairdrop_ as executable via [guide above](#linux).
|
||||||
2. Unzip the archive to a folder of your choice e.g. `/usr/local/bin/pairdrop-cli/`
|
2. Copy the shell file _send-with-pairdrop_ to `~/.local/share/nautilus/scripts/` to include it in the context menu
|
||||||
3. Copy the shell file _send-with-pairdrop.sh_ to `/home/<user>/.local/share/nautilus/scripts/`
|
```shell
|
||||||
4. Edit the shell file and edit the variable `pathToPairDropCli` to point to the pairdrop-cli executable from step 2 (e.g. `/usr/local/bin/pairdrop-cli/pairdrop`)
|
cp /usr/share/pairdrop-cli/send-with-pairdrop ~/.local/share/nautilus/scripts/
|
||||||
5. Make sure the shell file `/home/<user>/.local/share/nautilus/scripts/send-with-pairdrop.sh` is executable. Otherwise, use `chmod +x send-with-pairdrop.sh`
|
```
|
||||||
6. You are done! You can now send multiple files and directories directly via PairDrop:
|
3. Make the shell file _send-with-pairdrop_ executable
|
||||||
|
```shell
|
||||||
|
chmod +x ~/.local/share/nautilus/scripts/send-with-pairdrop`
|
||||||
|
```
|
||||||
|
4. You are done! You can now send multiple files and directories directly via PairDrop:
|
||||||
|
|
||||||
> _context menu > Scripts > send-with-pairdrop.sh_
|
_context menu_ > _Scripts_ > _send-with-pairdrop_
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -115,6 +137,6 @@ It is possible to send multiple files with PairDrop via the context menu by addi
|
||||||
The [File Handling API](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files)
|
The [File Handling API](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files)
|
||||||
was implemented, but it was removed as default file associations were overwritten ([#17](https://github.com/schlagmichdoch/PairDrop/issues/17),
|
was implemented, but it was removed as default file associations were overwritten ([#17](https://github.com/schlagmichdoch/PairDrop/issues/17),
|
||||||
[#116](https://github.com/schlagmichdoch/PairDrop/issues/116) [#190](https://github.com/schlagmichdoch/PairDrop/issues/190))
|
[#116](https://github.com/schlagmichdoch/PairDrop/issues/116) [#190](https://github.com/schlagmichdoch/PairDrop/issues/190))
|
||||||
and it only worked with explicitly specified file types and not with directories at all.
|
and it only worked with explicitly specified file types and couldn't handle directories at all.
|
||||||
|
|
||||||
[< Back](/README.md)
|
[< Back](/README.md)
|
||||||
|
|
18
package-lock.json
generated
18
package-lock.json
generated
|
@ -1,19 +1,19 @@
|
||||||
{
|
{
|
||||||
"name": "pairdrop",
|
"name": "pairdrop",
|
||||||
"version": "1.10.1",
|
"version": "1.10.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pairdrop",
|
"name": "pairdrop",
|
||||||
"version": "1.10.1",
|
"version": "1.10.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-rate-limit": "^7.1.5",
|
"express-rate-limit": "^7.1.5",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"unique-names-generator": "^4.3.0",
|
"unique-names-generator": "^4.3.0",
|
||||||
"ws": "^8.15.0"
|
"ws": "^8.16.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=15"
|
"node": ">=15"
|
||||||
|
@ -640,9 +640,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.15.0",
|
"version": "8.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
|
||||||
"integrity": "sha512-H/Z3H55mrcrgjFwI+5jKavgXvwQLtfPCUEp6pi35VhoB0pfcHnSoyuTzkBEZpzq49g1193CUEwIvmsjcotenYw==",
|
"integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
@ -1102,9 +1102,9 @@
|
||||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
|
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "8.15.0",
|
"version": "8.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",
|
||||||
"integrity": "sha512-H/Z3H55mrcrgjFwI+5jKavgXvwQLtfPCUEp6pi35VhoB0pfcHnSoyuTzkBEZpzq49g1193CUEwIvmsjcotenYw==",
|
"integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pairdrop",
|
"name": "pairdrop",
|
||||||
"version": "1.10.1",
|
"version": "1.10.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "server/index.js",
|
"main": "server/index.js",
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
"express-rate-limit": "^7.1.5",
|
"express-rate-limit": "^7.1.5",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"unique-names-generator": "^4.3.0",
|
"unique-names-generator": "^4.3.0",
|
||||||
"ws": "^8.15.0"
|
"ws": "^8.16.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=15"
|
"node": ">=15"
|
||||||
|
|
1
pairdrop-cli/.pairdrop-cli-config.example
Normal file
1
pairdrop-cli/.pairdrop-cli-config.example
Normal file
|
@ -0,0 +1 @@
|
||||||
|
DOMAIN=https://pairdrop.net/
|
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# PairDrop version when this file was last changed
|
||||||
|
version="v1.10.4"
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# Help #
|
# Help #
|
||||||
############################################################
|
############################################################
|
||||||
|
@ -17,7 +20,7 @@ help()
|
||||||
echo -e "Specify domain:\t\t$(basename "$0") -d \"https://pairdrop.net/\""
|
echo -e "Specify domain:\t\t$(basename "$0") -d \"https://pairdrop.net/\""
|
||||||
echo -e "Show this help text:\t$(basename "$0") (-h|--help)"
|
echo -e "Show this help text:\t$(basename "$0") (-h|--help)"
|
||||||
echo
|
echo
|
||||||
echo "This pairdrop-cli version was released alongside v1.10.0"
|
echo "This pairdrop-cli version was released alongside ${version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
openPairDrop()
|
openPairDrop()
|
||||||
|
@ -337,12 +340,15 @@ popd > '/dev/null';
|
||||||
|
|
||||||
config_path="${script_path}/.pairdrop-cli-config"
|
config_path="${script_path}/.pairdrop-cli-config"
|
||||||
|
|
||||||
|
# If config file does not exist, try to create it. If it fails log error message and exit
|
||||||
[ ! -f "$config_path" ] &&
|
[ ! -f "$config_path" ] &&
|
||||||
specifyDomain "https://pairdrop.net/" &&
|
specifyDomain "https://pairdrop.net/" &&
|
||||||
[ ! -f "$config_path" ] &&
|
[ ! -f "$config_path" ] &&
|
||||||
echo "Could not create config file. Add 'DOMAIN=https://pairdrop.net/' to a file called .pairdrop-cli-config in the same file as this 'pairdrop' bash file"
|
echo "Could not create config file. Add 'DOMAIN=https://pairdrop.net/' to a file called .pairdrop-cli-config in the same file as this 'pairdrop' bash file (${script_path})" &&
|
||||||
|
exit
|
||||||
|
|
||||||
[ ! -f "$config_path" ] || export "$(grep -v '^#' "$config_path" | xargs)"
|
# Read config variables
|
||||||
|
export "$(grep -v '^#' "$config_path" | xargs)"
|
||||||
|
|
||||||
setOs
|
setOs
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# edit this to point to the pairdrop-cli executable
|
|
||||||
pathToPairDropCli="/usr/local/bin/pairdrop-cli/pairdrop"
|
|
||||||
|
|
||||||
# Initialize an array
|
# Initialize an array
|
||||||
lines=()
|
lines=()
|
||||||
|
|
||||||
|
@ -17,4 +14,4 @@ length=${#lines[@]}
|
||||||
# Remove the last entry
|
# Remove the last entry
|
||||||
unset 'lines[length-1]'
|
unset 'lines[length-1]'
|
||||||
|
|
||||||
$pathToPairDropCli "${lines[@]}"
|
pairdrop "${lines[@]}"
|
Binary file not shown.
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 12 KiB |
|
@ -582,7 +582,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
<div class="title-wrapper" dir="ltr">
|
<div class="title-wrapper" dir="ltr">
|
||||||
<h1>PairDrop</h1>
|
<h1>PairDrop</h1>
|
||||||
<div class="font-subheading">v1.10.1</div>
|
<div class="font-subheading">v1.10.3</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="font-subheading" data-i18n-key="about.claim" data-i18n-attrs="text"></div>
|
<div class="font-subheading" data-i18n-key="about.claim" data-i18n-attrs="text"></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -1978,12 +1978,15 @@ class ReceiveTextDialog extends Dialog {
|
||||||
this._receiveTextQueue = [];
|
this._receiveTextQueue = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectionEmpty() {
|
||||||
|
return !window.getSelection().toString()
|
||||||
|
}
|
||||||
|
|
||||||
async _onKeyDown(e) {
|
async _onKeyDown(e) {
|
||||||
if (!this.isShown()) return
|
if (!this.isShown()) return
|
||||||
|
|
||||||
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey)) {
|
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey) && this.selectionEmpty()) {
|
||||||
await this._onCopy()
|
await this._onCopy()
|
||||||
this.hide();
|
|
||||||
}
|
}
|
||||||
else if (e.code === "Escape") {
|
else if (e.code === "Escape") {
|
||||||
this.hide();
|
this.hide();
|
||||||
|
@ -2014,9 +2017,18 @@ class ReceiveTextDialog extends Dialog {
|
||||||
|
|
||||||
// Beautify text if text is short
|
// Beautify text if text is short
|
||||||
if (text.length < 2000) {
|
if (text.length < 2000) {
|
||||||
// replace urls with actual links
|
// replace URLs with actual links
|
||||||
this.$text.innerHTML = this.$text.innerHTML.replace(/((https?:\/\/|www)[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\-._~:\/?#\[\]@!$&'()*+,;=]+)/g, url => {
|
this.$text.innerHTML = this.$text.innerHTML
|
||||||
return `<a href="${url}" target="_blank">${url}</a>`;
|
.replace(/(^|(?<=(<br>|\s)))(https?:\/\/|www.)(([a-z]|[A-Z]|[0-9]|[\-_~:\/?#\[\]@!$&'()*+,;=%]){2,}\.)(([a-z]|[A-Z]|[0-9]|[\-_~:\/?#\[\]@!$&'()*+,;=%.]){2,})/g,
|
||||||
|
(url) => {
|
||||||
|
let link = url;
|
||||||
|
|
||||||
|
// prefix www.example.com with http protocol to prevent it from being a relative link
|
||||||
|
if (link.startsWith('www')) {
|
||||||
|
link = "http://" + link
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<a href="${link}" target="_blank">${url}</a>`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2049,7 +2061,10 @@ class ReceiveTextDialog extends Dialog {
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
super.hide();
|
super.hide();
|
||||||
setTimeout(() => this._dequeueRequests(), 500);
|
setTimeout(() => {
|
||||||
|
this._dequeueRequests();
|
||||||
|
this.$text.innerHTML = "";
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const cacheVersion = 'v1.10.1';
|
const cacheVersion = 'v1.10.3';
|
||||||
const cacheTitle = `pairdrop-cache-${cacheVersion}`;
|
const cacheTitle = `pairdrop-cache-${cacheVersion}`;
|
||||||
const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions
|
const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions
|
||||||
const relativePathsToCache = [
|
const relativePathsToCache = [
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
max-height: 350px;
|
max-height: 350px;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
word-wrap: anywhere;
|
word-wrap: anywhere;
|
||||||
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea:before {
|
.textarea:before {
|
||||||
|
@ -335,6 +336,7 @@ x-dialog x-paper {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
max-width: 450px;
|
max-width: 450px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
|
@ -382,10 +384,6 @@ x-dialog:not([show]) x-paper {
|
||||||
transform: scale(0.1);
|
transform: scale(0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
x-dialog a {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pair Devices Dialog & Public Room Dialog */
|
/* Pair Devices Dialog & Public Room Dialog */
|
||||||
|
|
||||||
.input-key-container {
|
.input-key-container {
|
||||||
|
@ -784,7 +782,7 @@ x-dialog x-paper {
|
||||||
background-color: var(--bg-color-secondary) !important;
|
background-color: var(--bg-color-secondary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea * {
|
.textarea *:not(a) {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
color: unset !important;
|
color: unset !important;
|
||||||
|
@ -797,6 +795,10 @@ x-dialog x-paper {
|
||||||
font-weight: unset !important;
|
font-weight: unset !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x-dialog a {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
/* Image/Video/Audio Preview */
|
/* Image/Video/Audio Preview */
|
||||||
.file-preview {
|
.file-preview {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue