diff --git a/README.md b/README.md index 8c0c61d..751598f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/desktop/src/scripts/helpers.js b/desktop/src/scripts/helpers.js index d860269..681cee3 100644 --- a/desktop/src/scripts/helpers.js +++ b/desktop/src/scripts/helpers.js @@ -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 }