mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
misc
This commit is contained in:
parent
5dcefab183
commit
c4bea13be5
|
@ -75,6 +75,10 @@ function opclick(ev) {
|
||||||
// writing a blank value makes ie8 segfault w
|
// writing a blank value makes ie8 segfault w
|
||||||
if (window.localStorage)
|
if (window.localStorage)
|
||||||
localStorage.setItem('opmode', dest || '.');
|
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');
|
obj[a].classList.remove('act');
|
||||||
|
|
||||||
if (dest) {
|
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');
|
document.querySelector('#ops>a[data-dest=' + dest + ']').classList.add('act');
|
||||||
|
|
||||||
var fn = window['goto_' + dest];
|
var fn = window['goto_' + dest];
|
||||||
|
|
|
@ -5,8 +5,6 @@ _msg() { printf "$2"'\033[1;30m>\033[0;33m>\033[1m>\033[0m %s\n' "$1" >&2; }
|
||||||
imsg() { _msg "$1" ''; }
|
imsg() { _msg "$1" ''; }
|
||||||
msg() { _msg "$1" \\n; }
|
msg() { _msg "$1" \\n; }
|
||||||
|
|
||||||
mkdir -p ~/src
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## helper which installs termux packages
|
## helper which installs termux packages
|
||||||
|
|
||||||
|
@ -24,22 +22,6 @@ addpkg() {
|
||||||
apt install -y $1
|
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
|
## ensure python is available
|
||||||
|
|
||||||
|
@ -49,20 +31,21 @@ command -v python3 >/dev/null ||
|
||||||
##
|
##
|
||||||
## ensure virtualenv and dependencies are available
|
## ensure virtualenv and dependencies are available
|
||||||
|
|
||||||
[ -e ~/src/copyparty/.env/.ok ] || { (
|
ve=$HOME/ve.copyparty
|
||||||
cd ~/src/copyparty
|
|
||||||
rm -rf .env
|
[ -e $ve/.ok ] || (
|
||||||
|
rm -rf $ve
|
||||||
|
|
||||||
msg "creating python3 virtualenv"
|
msg "creating python3 virtualenv"
|
||||||
python3 -m venv .env
|
python3 -m venv $ve
|
||||||
|
|
||||||
msg "installing python dependencies"
|
msg "installing copyparty"
|
||||||
. .env/bin/activate
|
. $ve/bin/activate
|
||||||
pip install jinja2
|
pip install copyparty
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
touch .env/.ok
|
touch $ve/.ok
|
||||||
) }
|
)
|
||||||
|
|
||||||
##
|
##
|
||||||
## add copyparty alias to bashrc
|
## add copyparty alias to bashrc
|
||||||
|
@ -75,9 +58,5 @@ grep -qE '^alias copyparty=' ~/.bashrc 2>/dev/null || {
|
||||||
##
|
##
|
||||||
## start copyparty
|
## start copyparty
|
||||||
|
|
||||||
imsg "activating virtualenv"
|
|
||||||
. ~/src/copyparty/.env/bin/activate
|
|
||||||
|
|
||||||
imsg "starting copyparty"
|
imsg "starting copyparty"
|
||||||
PYTHONPATH=~/src/copyparty python3 -m copyparty "$@"
|
$ve/bin/python -m copyparty "$@"
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ diff -NarU2 easymde-mod1/src/js/easymde.js easymde-edit/src/js/easymde.js
|
||||||
+ if (line_dom) {
|
+ if (line_dom) {
|
||||||
+ var ret_y = 0;
|
+ var ret_y = 0;
|
||||||
+ var el = line_dom;
|
+ 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;
|
+ ret_y += el.offsetTop;
|
||||||
+ el = el.offsetParent;
|
+ el = el.offsetParent;
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in a new issue