commit 6d851bc5a84c5e2941f57349eee8ee865c9f77ea
parent 03826b795d2dc2e69386d7414387ae30ec4da8a2
Author: hhvn <hayden@haydenvh.com>
Date: Mon, 1 Mar 2021 17:02:30 +0000
bin/interface.sh config.def.sh include/common.sh: add a function that declutters help information in prompts
Diffstat:
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/bin/interface.sh b/bin/interface.sh
@@ -45,6 +45,7 @@ menu_boards(){
printf '=======================================================================Page:%- 3d=\n' "$page"
while prompt "Ne${k}x${s}t ${k}$([ $page -eq 0 ] && printf "${e}")p${s}revious ${k}u${s}sers ${k}s${s}elect rel${k}o${s}ad intro${k}d${s}uction mar${k}k${s} ${k}h${s}elp" input
do
+ oldprompt "$input"
parse_in "$input"
case "$cmd" in
x|"") page=$(($page+1)); break ;;
@@ -117,6 +118,7 @@ menu_list(){
printf '=%- 10s============================================================Page:%- 3d=\n' "$(echo "$board" | tr '[:lower:]' '[:upper:]')" "$page" | tr ' ' '=' | sed 's/==$/ =/;s/:=/: /'
while prompt "Ne${k}x${s}t ${k}$([ $page -eq 0 ] && printf "${e}")p${s}revious ${k}b${s}oards rel${k}o${s}ad ${k}r${s}ead ${k}$(check_post_perm $board $user noprint || printf "${e}")n${s}ew ${k}h${s}elp" input
do
+ oldprompt "$input"
parse_in "$input"
case "$cmd" in
x|"") page=$(($page+1)); break ;;
@@ -214,6 +216,7 @@ menu_read(){
total_in_thread=$(awk -v "file=$(echo "$file" | sed 's/ .*//')" -F" " '$6 == file' < $datadir/boards/$board/list | wc -l)
while prompt "($(($id2+1))/$total_in_thread) Ne${k}$([ $(($id2+1)) -eq $total_in_thread ] && printf "${e}")x${s}t ${k}$([ $id2 -eq 0 ] && printf "${e}")p${s}revious rep${k}$(check_reply_perm $board $user noprint)l${s}y ${k}b${s}oards b${k}a${s}ck ${k}h${s}elp" input
do
+ oldprompt "$input"
parse_in "$input"
case "$cmd" in
x)
@@ -306,6 +309,7 @@ menu_users(){
printf '=======================================================================Page:%- 3d=\n' "$page"
while prompt "Ne${k}x${s}t ${k}$([ $page -eq 0 ] && printf "${e}")p${s}revious ${k}b${s}oards ${k}i${s}nfo ${k}e${s}dit ${k}h${s}elp" input
do
+ oldprompt "$input"
parse_in "$input"
case "$cmd" in
x|"") page=$(($page+1)); break ;;
diff --git a/config.def.sh b/config.def.sh
@@ -38,6 +38,7 @@ ok____colour=34
num___colour=23
key___colour=12
date__colour=9
+old_prompt_style="=>"
verify_email=no
recover_email=yes # send emails with recovery passwords
diff --git a/include/common.sh b/include/common.sh
@@ -32,6 +32,12 @@ prompt(){
read $2
}
+oldprompt(){
+ tput cuu 1
+ tput el
+ printf "%s %s\n" "$old_prompt_style" "$1"
+}
+
anykey(){
tput sc
printf "Press enter to continue..."