Show the URL
This commit is contained in:
parent
585f4bd00c
commit
7c745ef87b
2 changed files with 27 additions and 7 deletions
|
@ -4,6 +4,17 @@ p {
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.url {
|
||||
margin-top: 0px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#container {
|
||||
|
|
|
@ -33,23 +33,32 @@ function clearResults() {
|
|||
function addResult(title, extract, url) {
|
||||
const par = document.createElement("p");
|
||||
|
||||
const link = document.createElement("a");
|
||||
const titleText = createBoldedSpan(title);
|
||||
titleText.classList.add('title');
|
||||
const extractText = createBoldedSpan(extract);
|
||||
extractText.classList.add('extract');
|
||||
link.appendChild(titleText);
|
||||
par.appendChild(titleText);
|
||||
|
||||
separator = document.createTextNode(' - ')
|
||||
link.appendChild(separator);
|
||||
par.appendChild(separator);
|
||||
|
||||
link.appendChild(extractText);
|
||||
par.appendChild(extractText);
|
||||
|
||||
const div = document.createElement("div");
|
||||
|
||||
const urlPar = document.createElement("p");
|
||||
const urlText = document.createTextNode(url);
|
||||
urlPar.appendChild(urlText);
|
||||
urlPar.classList.add('url');
|
||||
div.appendChild(urlPar);
|
||||
div.appendChild(par);
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.appendChild(div);
|
||||
link.href = url;
|
||||
|
||||
par.appendChild(link);
|
||||
|
||||
const results = document.getElementById('results');
|
||||
results.appendChild(par);
|
||||
results.appendChild(link);
|
||||
}
|
||||
|
||||
function createBoldedSpan(title) {
|
||||
|
|
Loading…
Reference in a new issue