From eda57224d9d3f2462f3fbdea3ecf6710133fdf38 Mon Sep 17 00:00:00 2001 From: Brian Huisman Date: Wed, 21 Jun 2023 15:07:57 -0400 Subject: [PATCH] Remove need for 'jw_depth' value By using the location of the search.js script file, we can determine the root URL of an offline installation as long as the online script has been installed at https://example.com/orcinus/js/search.js --- orcinus/admin.php | 15 ------------ orcinus/config.php | 4 +--- orcinus/js/search.js | 44 ++++++++++++++++++++-------------- orcinus/js/template.offline.js | 5 ++-- 4 files changed, 29 insertions(+), 39 deletions(-) diff --git a/orcinus/admin.php b/orcinus/admin.php index 1323df4..5de39d1 100644 --- a/orcinus/admin.php +++ b/orcinus/admin.php @@ -902,11 +902,6 @@ if (!$_SESSION['admin_username']) { OS_setValue('jw_compression', (int)$_POST['os_jw_compression']); } - if (isset($_POST['os_jw_depth'])) { - $_POST['os_jw_depth'] = max(0, min(255, (int)$_POST['os_jw_depth'])); - OS_setValue('jw_depth', (int)$_POST['os_jw_depth']); - } - if ($_POST['os_submit'] == 'os_jw_config') { $_SESSION['message'][] = 'Offline javascript search settings have been saved.'; break; @@ -1002,7 +997,6 @@ if (!$_SESSION['admin_username']) { 's_filetypes' => json_encode($_RDATA['s_filetypes'], JSON_INVALID_UTF8_IGNORE), 's_category_list' => json_encode($_RDATA['s_category_list'], JSON_INVALID_UTF8_IGNORE), 'jw_compression' => $_ODATA['jw_compression'], - 'jw_depth' => str_repeat('../', $_ODATA['jw_depth']), 's_limit_query' => $_ODATA['s_limit_query'], 's_limit_terms' => $_ODATA['s_limit_terms'], 's_limit_term_length' => $_ODATA['s_limit_term_length'], @@ -2303,15 +2297,6 @@ if (!$_SESSION['admin_username']) { -
  • - -