diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index acb69664..48a6b9d9 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -75,6 +75,10 @@ function opclick(ev) { // writing a blank value makes ie8 segfault w if (window.localStorage) localStorage.setItem('opmode', dest || '.'); + + var input = document.querySelector('.opview.act input:not([type="hidden"])') + if (input) + input.focus(); } @@ -88,7 +92,7 @@ function goto(dest) { obj[a].classList.remove('act'); if (dest) { - var dom_obj = document.getElementById('op_' + dest).classList.add('act'); + document.getElementById('op_' + dest).classList.add('act'); document.querySelector('#ops>a[data-dest=' + dest + ']').classList.add('act'); var fn = window['goto_' + dest]; diff --git a/scripts/copyparty-android.sh b/scripts/copyparty-android.sh index 90e10129..d99ecdd6 100755 --- a/scripts/copyparty-android.sh +++ b/scripts/copyparty-android.sh @@ -5,8 +5,6 @@ _msg() { printf "$2"'\033[1;30m>\033[0;33m>\033[1m>\033[0m %s\n' "$1" >&2; } imsg() { _msg "$1" ''; } msg() { _msg "$1" \\n; } -mkdir -p ~/src - ## ## helper which installs termux packages @@ -24,22 +22,6 @@ addpkg() { apt install -y $1 } -## -## ensure git and copyparty is available - -[ -e ~/src/copyparty/.ok ] || { - command -v git >/dev/null || - addpkg git - - msg "downloading copyparty from github" - ( - cd ~/src - rm -rf copyparty - git clone https://github.com/9001/copyparty - touch copyparty/.ok - ) -} - ## ## ensure python is available @@ -49,20 +31,21 @@ command -v python3 >/dev/null || ## ## ensure virtualenv and dependencies are available -[ -e ~/src/copyparty/.env/.ok ] || { ( - cd ~/src/copyparty - rm -rf .env +ve=$HOME/ve.copyparty + +[ -e $ve/.ok ] || ( + rm -rf $ve msg "creating python3 virtualenv" - python3 -m venv .env + python3 -m venv $ve - msg "installing python dependencies" - . .env/bin/activate - pip install jinja2 + msg "installing copyparty" + . $ve/bin/activate + pip install copyparty deactivate - touch .env/.ok -) } + touch $ve/.ok +) ## ## add copyparty alias to bashrc @@ -75,9 +58,5 @@ grep -qE '^alias copyparty=' ~/.bashrc 2>/dev/null || { ## ## start copyparty -imsg "activating virtualenv" -. ~/src/copyparty/.env/bin/activate - imsg "starting copyparty" -PYTHONPATH=~/src/copyparty python3 -m copyparty "$@" - +$ve/bin/python -m copyparty "$@" diff --git a/scripts/deps-docker/easymde-ln.patch b/scripts/deps-docker/easymde-ln.patch index 32e67697..7c8430d2 100644 --- a/scripts/deps-docker/easymde-ln.patch +++ b/scripts/deps-docker/easymde-ln.patch @@ -50,7 +50,7 @@ diff -NarU2 easymde-mod1/src/js/easymde.js easymde-edit/src/js/easymde.js + if (line_dom) { + var ret_y = 0; + var el = line_dom; -+ while ((el.getAttribute('class') + '').indexOf('editor-preview-side') < 0) { ++ while (el && (el.getAttribute('class') + '').indexOf('editor-preview-side') < 0) { + ret_y += el.offsetTop; + el = el.offsetParent; + }