This commit is contained in:
ed 2020-05-06 00:11:36 +02:00
parent 5dcefab183
commit c4bea13be5
3 changed files with 17 additions and 34 deletions

View file

@ -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];

View file

@ -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 "$@"

View file

@ -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;
+ }