Heh I'm getting kind of good at this

This commit is contained in:
idk
2020-01-11 22:01:37 -05:00
parent 01695e812a
commit 29d4d0b3c8
3 changed files with 41 additions and 3 deletions

18
info.js
View File

@@ -62,6 +62,9 @@ document.addEventListener("click", clickEvent => {
};
}
refreshIdentity();
} else if (clickEvent.target.id === "search-submit") {
console.log("attempting to create search tab");
goSearch();
} else if (clickEvent.target.id === "window-preface-title") {
console.log("attempting to create homepage tab");
goHome();
@@ -139,6 +142,21 @@ function onTabCreated() {
console.log("Tab Created");
}
function goSearch() {
function onTabError() {
console.log("Search tab created");
}
let createData = {
url:
"http://legwork.i2p/yacysearch.html?" +
"query=" +
document.getElementById("search-query").value
};
console.log("visiting legwork");
let creating = browser.tabs.create(createData);
creating(onTabCreated, onTabError);
}
function goTunnel() {
function onTabError() {
console.log("I2PTunnel tab created");

View File

@@ -1,7 +1,16 @@
/* Add a black background color to the top navigation bar */
.topnav {
overflow: hidden;
background-color: #e9e9e9;
/*background-color: #e9e9e9;*/
min-height: 3rem;
padding: .5rem;
background: #dee2e6;
border: 1px solid #dee2e6;
width: 64%;
min-width: 64%;
border-radius: 2px;
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
margin: .5rem .5rem .5rem 32%
}
/* Style the links inside the navigation bar */
@@ -24,7 +33,15 @@
}
/* Style the search box inside the navigation bar */
.topnav input[type=text] {
.topnav input[type=search] {
float: right;
padding: 6px;
border: none;
margin-top: 8px;
margin-right: 16px;
}
.topnav input[type=submit] {
float: right;
padding: 6px;
border: none;

View File

@@ -15,7 +15,10 @@
</div>
<div class="topnav">
<a id="window-visit-homepage" target="_blank" class="applicationName window-visit-homepage" href="#">Home Page</a>
<input type="text" placeholder="Search..">
<form action="http://legwork.i2p/yacysearch.html?" method="get">
<input type="search" name="query" id="search-query" placeholder="Search on legwork.i2p(Opens a new tab)">
<input type="submit" id="search-submit" text="Submit">
</form>
</div>
<div class="panel-section-separator"></div>
<div id="i2pbrowser-version"></div>