[feature] add search in new tab control

This commit is contained in:
zombieFox 2020-02-20 17:39:03 +00:00
parent dc59045cc3
commit 926bb35ed5
9 changed files with 45 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "4.40.4", "version": "4.41.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "4.40.4", "version": "4.41.0",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -602,6 +602,11 @@
<p class="control-header-search-size-helper form-helper-item">Only the Search box width control will change the Width of the Search box.</p> <p class="control-header-search-size-helper form-helper-item">Only the Search box width control will change the Width of the Search box.</p>
</div> </div>
<hr> <hr>
<div class="form-wrap">
<input id="control-header-search-newtab" class="control-header-search-newtab" type="checkbox" tabindex="-1">
<label for="control-header-search-newtab"><span class="label-icon"></span> Open Search results in a new tab</label>
</div>
<hr>
<div class="form-wrap"> <div class="form-wrap">
<input id="control-header-search-newline" class="control-header-search-newline" type="checkbox" tabindex="-1"> <input id="control-header-search-newline" class="control-header-search-newline" type="checkbox" tabindex="-1">
<label for="control-header-search-newline"><span class="label-icon"></span> New line</label> <label for="control-header-search-newline"><span class="label-icon"></span> New line</label>

View File

@ -2192,6 +2192,31 @@ var control = (function() {
render.update.control.header(); render.update.control.header();
render.update.control.menu(); render.update.control.menu();
} }
}, {
element: ".control-header-search-newtab",
path: "header.search.newTab",
type: "checkbox",
func: function() {
header.render.item.clear();
header.render.item.all();
header.render.search.width.size();
greeting.render.clear();
greeting.render.all();
clock.render.clear();
clock.render.all();
transitional.render.clear();
transitional.render.all();
date.render.clear();
date.render.all();
render.class();
render.dependents();
render.update.control.header();
bind.control.header();
search.render.engine();
search.bind.input();
search.bind.clear();
dropdown.bind.editAdd();
}
}, { }, {
element: ".control-header-search-newline", element: ".control-header-search-newline",
path: "header.search.newLine", path: "header.search.newLine",
@ -6738,6 +6763,7 @@ var control = (function() {
".control-header-search-size-number", ".control-header-search-size-number",
".control-header-search-size-default", ".control-header-search-size-default",
".control-header-search-size-helper", ".control-header-search-size-helper",
".control-header-search-newtab",
".control-header-search-newline", ".control-header-search-newline",
".control-header-search-newline-helper" ".control-header-search-newline-helper"
]; ];

View File

@ -352,6 +352,10 @@ var header = (function() {
helper.addClass(searchInput, "input-clear"); helper.addClass(searchInput, "input-clear");
}; };
if (state.get.current().header.search.newTab) {
form.setAttribute("target", "_blank");
};
return headerSearchBody; return headerSearchBody;
}, },
editAdd: function() { editAdd: function() {

View File

@ -118,7 +118,8 @@ var state = (function() {
justify: "center" justify: "center"
}, },
size: 1, size: 1,
newLine: false newLine: false,
newTab: false
}, },
editAdd: { editAdd: {
show: true, show: true,

View File

@ -861,6 +861,10 @@ var update = (function() {
delete data.state.group.area.alignment; delete data.state.group.area.alignment;
data.state.header.area.align = "center"; data.state.header.area.align = "center";
return data; return data;
},
"4.41.0": function(data) {
data.state.header.search.newTab = false;
return data;
} }
}; };

View File

@ -1,6 +1,6 @@
var version = (function() { var version = (function() {
var current = "4.40.4"; var current = "4.41.0";
var name = "Naughty Goose"; var name = "Naughty Goose";

View File

@ -2,7 +2,7 @@
"name": "nightTab", "name": "nightTab",
"short_name": "nightTab", "short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "4.40.4", "version": "4.41.0",
"manifest_version": 2, "manifest_version": 2,
"chrome_url_overrides": { "chrome_url_overrides": {
"newtab": "index.html" "newtab": "index.html"