Changed search layout for hyperlinks

This commit is contained in:
Ray 2024-11-15 23:34:25 +00:00
parent 705bd684fb
commit def6a30a2e
4 changed files with 69 additions and 60 deletions

View File

@ -17,6 +17,11 @@ input[type="text"].display, input[type="text"].display:active, input[type="text"
width: 100%; width: 100%;
} }
select {
text-align: left !important;
}
.cursor-default { .cursor-default {
cursor: default; cursor: default;
} }

File diff suppressed because one or more lines are too long

View File

@ -31,63 +31,58 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="pt-2 pb-2 mb-2 border-bottom"> <div class="pt-2 pb-2 mb-2 border-bottom">
<div class="row mb-2"> <div class="row mb-2">
<label for="textBox1" class="col-sm-3 col-form-label fw-bold">Search Term</label> <label for="textBox1" class="col-sm-2 col-form-label fw-bold">Search</label>
<div class="col-sm-7"> <div class="col-sm-10">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="Keyword" role="textbox" id="textBox1" /> <input type="text" class="form-control" role="textbox" id="textBox1" />
<select class="form-select pe-0 input-group-text" name="comboBox1">
<option value="anchor">Anchor</option>
<option value="link" selected>Link</option>
</select>
<button type="button" class="btn btn-secondary input-group-text">&#10005;</button> <button type="button" class="btn btn-secondary input-group-text">&#10005;</button>
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-3 cursor-default fw-bold">Search Field</div>
<div class="col-sm-7">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioGroup1" id="radioBox1" value="anchor">
<label class="form-check-label" for="radioBox1">Anchor Text</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioGroup1" id="radioBox2" value="link" checked>
<label class="form-check-label" for="radioBox2">Link Address</label>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3 cursor-default fw-bold">Display Type</div>
<div class="col-sm-7">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioGroup2" id="radioBox3" value="table" checked>
<label class="form-check-label" for="radioBox3">Table</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioGroup2" id="radioBox4" value="csv">
<label class="form-check-label" for="radioBox4">CSV</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioGroup2" id="radioBox5" value="links">
<label class="form-check-label" for="radioBox5">Links</label>
</div>
</div>
</div>
<div class="row mt-2 mb-2"> <div class="row mt-2 mb-2">
<div class="col-sm-3"></div> <div class="col-2"></div>
<div class="col-sm-7"> <div class="col-5">
<button type="button" class="btn btn-primary btn-sm">Load Results</button> <div class="input-group input-group-sm">
<span class="ps-1" role="label"></span> <button class="btn btn-primary" type="button">Load Results</button>
<select class="form-select" name="comboBox2">
<option value="table" selected>Table</option>
<option value="csv">CSV</option>
<option value="links">Links</option>
</select>
</div>
</div>
<div class="col-5 px-0">
<div class="pt-2" role="label"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="fw-bold clearfix cursor-pointer" data-bs-toggle="collapse" data-bs-target="#collapsPanel1" aria-expanded="false" aria-controls="collapsPanel1">&#11208;&nbsp;Options</div> <div class="fw-bold clearfix cursor-pointer" data-bs-toggle="collapse" data-bs-target="#collapsPanel1" aria-expanded="false" aria-controls="collapsPanel1">&#11208;&nbsp;Options</div>
<div class="row pt-2 pb-2 mb-2 border-bottom collapse" role="options" id="collapsPanel1"></div> <div class="row pb-2 mb-2 border-bottom collapse" id="collapsPanel1">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div class="row px-0" role="options"></div>
</div>
</div>
<div class="fw-bold clearfix cursor-pointer" data-bs-toggle="collapse" data-bs-target="#collapsPanel2" aria-expanded="false" aria-controls="collapsPanel2">&#11208;&nbsp;Filters</div> <div class="fw-bold clearfix cursor-pointer" data-bs-toggle="collapse" data-bs-target="#collapsPanel2" aria-expanded="false" aria-controls="collapsPanel2">&#11208;&nbsp;Filters</div>
<div class="row pt-2 collapse" role="filters" id="collapsPanel2"></div> <div class="row collapse" id="collapsPanel2">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div class="row px-0" role="filters"></div>
</div>
</div>
<div class="row pb-2 mb-2 border-bottom"></div> <div class="row pb-2 mb-2 border-bottom"></div>
<div class="row pt-2 mb-2"> <div class="row pt-2 mb-2">
<div class="col"> <div class="col px-0">
<table class="table table-bordered table-hover table-sm table-striped"> <table class="table table-bordered table-hover table-sm table-striped">
<thead></thead> <thead></thead>

View File

@ -52,9 +52,7 @@ class AContentService extends ContentService {
col2 += a.GenerateCheckBox(3, "Sort By Anchor Text", true); col2 += a.GenerateCheckBox(3, "Sort By Anchor Text", true);
col2 += a.GenerateCheckBox(2, "Trim Anchor Text", true); col2 += a.GenerateCheckBox(2, "Trim Anchor Text", true);
let col3 = ""; let html = a.GenerateCols(col1, col2);
let html = a.GenerateCols(col1, col2, col3);
a.SetHtml(a.Panel1, html); a.SetHtml(a.Panel1, html);
} }
@ -67,20 +65,18 @@ class AContentService extends ContentService {
col1 += a.GenerateCheckBox(5, "Hide Duplicates", true); col1 += a.GenerateCheckBox(5, "Hide Duplicates", true);
col1 += a.GenerateCheckBox(14, "Hide Blank Anchors", true); col1 += a.GenerateCheckBox(14, "Hide Blank Anchors", true);
col1 += a.GenerateCheckBox(15, "Hide Blank Links", true); col1 += a.GenerateCheckBox(15, "Hide Blank Links", true);
col1 += a.GenerateCheckBox(11, "Hide Fragments", true);
col1 += a.GenerateCheckBox(13, "Hide Mailto/Tel", true);
col1 += a.GenerateCheckBox(16, "Hide Javascript", true);
let col2 = ""; let col2 = "";
col2 += a.GenerateCheckBox(11, "Hide Fragments", true); col2 += a.GenerateCheckBox(6, "Show Title", true);
col2 += a.GenerateCheckBox(13, "Hide Mailto/Tel", true); col2 += a.GenerateCheckBox(7, "Show Target", false);
col2 += a.GenerateCheckBox(16, "Hide Javascript", true); col2 += a.GenerateCheckBox(8, "Show Rel", false);
col2 += a.GenerateCheckBox(9, "Show Type", false);
col2 += a.GenerateCheckBox(10, "Show Count", false);
let col3 = ""; let html = a.GenerateCols(col1, col2);
col3 += a.GenerateCheckBox(6, "Show Title", true);
col3 += a.GenerateCheckBox(7, "Show Target", false);
col3 += a.GenerateCheckBox(8, "Show Rel", false);
col3 += a.GenerateCheckBox(9, "Show Type", false);
col3 += a.GenerateCheckBox(10, "Show Count", false);
let html = a.GenerateCols(col1, col2, col3);
a.SetHtml(a.Panel2, html); a.SetHtml(a.Panel2, html);
} }
@ -123,7 +119,7 @@ class AContentService extends ContentService {
return null; return null;
} }
return a.Container.querySelectorAll("span[role='label']")[0]; return a.Container.querySelectorAll("[role='label']")[0];
} }
get MemoBox1() { get MemoBox1() {
@ -206,7 +202,7 @@ class AContentService extends ContentService {
a.Label1.innerText = "Showing " + newResults.length + " of " + totalCount + " result" + (totalCount == 1 ? "" : "s"); a.Label1.innerText = "Showing " + newResults.length + " of " + totalCount + " result" + (totalCount == 1 ? "" : "s");
} }
switch (a.#getRadioGroup(2)) { switch (a.#getComboBox(2)) {
case "table": case "table":
a.#renderTable(newResults); a.#renderTable(newResults);
break; break;
@ -226,8 +222,6 @@ class AContentService extends ContentService {
const currentUrl = await a.#popupService.GetLocation(); const currentUrl = await a.#popupService.GetLocation();
const currentHostname = (new URL(currentUrl)).hostname; const currentHostname = (new URL(currentUrl)).hostname;
const radioGroup1 = a.#getRadioGroup(1);
let result = []; let result = [];
for (let i=0; i<items.length; i++) { for (let i=0; i<items.length; i++) {
@ -290,7 +284,7 @@ class AContentService extends ContentService {
// Search term // Search term
if (!String.isNullOrWhitespace(a.TextBox1.value)) { if (!String.isNullOrWhitespace(a.TextBox1.value)) {
if (radioGroup1.value == "anchor") { if (a.#getComboBox(1) == "anchor") {
if (!text.toLowerCase().includes(a.TextBox1.value.toLowerCase())) { if (!text.toLowerCase().includes(a.TextBox1.value.toLowerCase())) {
continue; continue;
} }
@ -379,6 +373,21 @@ class AContentService extends ContentService {
return result[0].checked; return result[0].checked;
} }
#getComboBox(num) {
const a = this;
if (a.Container == null) {
return "";
}
const result = a.Container.querySelectorAll("select[name='comboBox" + num + "']");
if (result.length <= 0) {
return "";
}
return result[0].value;
}
#getRadioGroup(num) { #getRadioGroup(num) {
const a = this; const a = this;