Add header image and link

Add a nice Orcinus header image with a link to https://greywyvern.com/orcinus/ Eventually this might link to online documentation or something?

Move the show-page-titles checkbox from being created by javascript to actually being in the HTML. Unnecessary JS complexity removed. Add a popper tooltip
This commit is contained in:
Brian Huisman 2023-09-14 10:33:59 -04:00
parent 4c78a5245f
commit da52e0f7bf
4 changed files with 49 additions and 38 deletions

View file

@ -1312,7 +1312,8 @@ if (!$_SESSION['admin_username']) {
<body class="pt-5">
<nav class="navbar fixed-top navbar-expand-md bg-body-secondary">
<div class="container-fluid">
<span class="navbar-brand flex-grow-1 flex-md-grow-0 mb-1">Orcinus</span><?php
<a href="https://greywyvern.com/orcinus/" class="navbar-brand flex-grow-1 flex-md-grow-0 mb-1"
target="_blank" title="Orcinus Search v<?php echo $_ODATA['version']; ?>">Orcinus</a><?php
if ($_SESSION['admin_username']) { ?>
<div class="flex-grow-0 order-md-last">
<var class="me-1" title="Orcinus Site Search - Version: <?php echo $_ODATA['version']; ?>">
@ -1938,7 +1939,10 @@ if (!$_SESSION['admin_username']) {
</tr>
<tr>
<th class="pe-0"></th>
<th class="fs-5 text-nowrap" scope="col" id="os_header_url">URL</th>
<th class="fs-5 text-nowrap" scope="col">URL
<input type="checkbox" class="form-check-input fs-6 ms-1 mt-2" id="os_show_page_titles"
data-bs-toggle="tooltip" data-bs-placement="top" title="Show Page Titles">
</th>
<td class="text-center w-100">
<span class="d-none d-sm-inline">Showing pages </span><?php
echo min($_RDATA['page_index_offset'] + 1, $_RDATA['page_index_found_rows']);

View file

@ -83,3 +83,14 @@ img.svg-icon-flag {
#os_queries_thead > tr > th.os_asc > img {
transform:rotate(180deg);
}
nav.navbar {
background-image:url(../img/header/001.png);
background-repeat:no-repeat;
background-attachment:scroll;
background-position:-0.6em -1em;
background-size:7em;
}
nav.navbar .navbar-brand {
opacity:0.01;
}

BIN
orcinus/img/header/001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -208,45 +208,41 @@ if (os_index_filter_by_status) {
}, false);
}
let os_header_url = document.getElementById('os_header_url');
let os_show_page_titles = document.getElementById('os_show_page_titles');
let os_index_table = document.getElementById('os_index_table');
if (os_header_url && os_index_table) {
let input = document.createElement('input');
input.type = 'checkbox';
input.title = 'Show Page Titles';
input.classList.add('form-check-input', 'fs-6', 'ms-2', 'mt-2');
if (os_index_table.classList.contains('show-page-titles'))
input.checked = 'checked';
os_header_url.appendChild(input);
input.addEventListener('change', function() {
if (this.checked) {
os_index_table.classList.add('show-page-titles');
} else os_index_table.classList.remove('show-page-titles');
if (os_show_page_titles && os_index_table) {
if (os_index_table.classList.contains('show-page-titles'))
os_show_page_titles.checked = 'checked';
fetch(new Request('./admin.php'), {
method: 'POST',
headers: { 'Content-type': 'application/json' },
body: JSON.stringify({
action: 'setsession',
variable: 'index_show_page_titles',
value: (this.checked) ? 'on' : 'off'
})
})
.then((response) => response.text())
.then((data) => {
try {
data = JSON.parse(data);
} catch(e) {
data = {
'status': 'Error',
'message': 'Invalid response from server'
};
}
os_show_page_titles.addEventListener('change', function() {
if (this.checked) {
os_index_table.classList.add('show-page-titles');
} else os_index_table.classList.remove('show-page-titles');
if (data.status != 'Success')
console.log('Could not save session variable. Reason: ' + data.message);
});
}, false);
fetch(new Request('./admin.php'), {
method: 'POST',
headers: { 'Content-type': 'application/json' },
body: JSON.stringify({
action: 'setsession',
variable: 'index_show_page_titles',
value: (this.checked) ? 'on' : 'off'
})
})
.then((response) => response.text())
.then((data) => {
try {
data = JSON.parse(data);
} catch(e) {
data = {
'status': 'Error',
'message': 'Invalid response from server'
};
}
if (data.status != 'Success')
console.log('Could not save session variable. Reason: ' + data.message);
});
}, false);
}
let os_index_check_all = document.querySelectorAll('input[name="os_index_check_all"]');