Skip to content

Commit

Permalink
host /path shortcuts, supports complex paths 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
MAKIO135 committed Apr 8, 2019
1 parent 2f16d3a commit f848c31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ You can also build it for your system using `npm run build_osx`, `npm run build_
- send to **multiple hosts** at once:
`;2a#foo` in ORCΛ sends `/foo` to the third and tenth hosts in Λioi

- **host /path shortcuts**: (supports **complex paths**)
`;#1;2f` in ORCΛ sends `0.2` to the second host in Λioi with its path defined in Λioi
`;#a;yo;135` in ORCΛ sends `yo 135` to the tenth host in Λioi with its path defined in Λioi

Λioi does not support:
- complex paths (eg. `/foo/bar`)
- negative values
Expand Down
9 changes: 7 additions & 2 deletions desktop/src/scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ const parseOrcaMsg = data => {

let indexes = [0]
let path = clientPath
if(clientPath.includes('#')) {

if(clientPath.startsWith('#')) {
indexes = [parseInt(clientPath[1], 36)]
path = document.querySelector(`p.msg[data-index="${indexes[0]}"]`).innerText.split(' ')[0].substr(1)
}
else if(clientPath.includes('#')) {
const [clientArg, pathArg] = clientPath.split('#')
indexes = clientArg.split('').map(d=>parseInt(d,36))
indexes = clientArg.split('').map(d=>parseInt(d, 36))
path = pathArg
}

Expand Down

0 comments on commit f848c31

Please sign in to comment.