From 030f8e6cd09bdee8efe5b59f558180b360b122bd Mon Sep 17 00:00:00 2001 From: Victor Xie Date: Sat, 31 Mar 2018 22:19:44 +0800 Subject: [PATCH] Minor fixes. - Improve web browser compatibility: 'onclick' will be fired AFTER 'onchange' on Safari. - Fix JS error on web page: useless eval() invocation will raise error on external HDD with multiple partitions. - Kill dangling aria2c process before forking the service process. --- aria2/perp/aria2/rc.main | 1 + aria2/webs/Module_aria2.asp | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/aria2/perp/aria2/rc.main b/aria2/perp/aria2/rc.main index a36c5bd..361525f 100755 --- a/aria2/perp/aria2/rc.main +++ b/aria2/perp/aria2/rc.main @@ -15,6 +15,7 @@ if test ${1} = 'start' ; then echo "Awaiting $Aria2_sleep seconds before launching aria2..." sleep $Aria2_sleep fi + killall -q aria2c exec /koolshare/aria2/aria2c --conf-path=/koolshare/aria2/aria2.conf fi fi diff --git a/aria2/webs/Module_aria2.asp b/aria2/webs/Module_aria2.asp index 372513b..bd7b81f 100644 --- a/aria2/webs/Module_aria2.asp +++ b/aria2/webs/Module_aria2.asp @@ -222,6 +222,8 @@ function buildswitch() { } function update_visibility(r) { + if (r && r.type == "checkbox") + oncheckclick(r); var rrt = document.getElementById("switch"); if (document.aria2_form.aria2_enable.value !== "1") { rrt.checked = false; @@ -556,7 +558,7 @@ function initial_dir() { function initial_dir_status(data) { if (data != "" && data.length != 2) { get_layer_items("0"); - eval("var default_dir=" + data); + //eval("var default_dir=" + data); } else { //document.getElementById("EditExports").style.display = "none"; disk_flag = 1; @@ -1176,7 +1178,7 @@ function toggle_func() { - + (范围: 1 - 100; 默认: 30) @@ -1293,7 +1295,7 @@ function toggle_func() { - + * @@ -1463,7 +1465,7 @@ function toggle_func() { - + * @@ -1564,7 +1566,7 @@ function toggle_func() { - + *