[feature] add open all links in new tab

This commit is contained in:
zombieFox 2020-02-23 18:30:01 +00:00
parent ec83292655
commit 5416d6393d
8 changed files with 32 additions and 13 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -1,6 +1,6 @@
<div id="menu-content-groups-openall" class="menu-content-item">
<div class="menu-item-header">
<h1 class="menu-item-header-text">Open all Bookmarks</h1>
<h1 class="menu-item-header-text">Open all</h1>
</div>
<div class="menu-item-form">
<div class="form-wrap">

View File

@ -3555,7 +3555,7 @@ var control = (function() {
}
}, {
element: ".control-link-newtab",
path: "link.newTab",
path: "link.item.newTab",
type: "checkbox",
func: function() {
link.groupAndItems();

View File

@ -464,12 +464,7 @@ var link = (function() {
};
groupOpenallItem.addEventListener("click", function() {
console.log(copyStagedGroup.group.items);
copyStagedGroup.group.items.forEach(function(arrayItem, index) {
chrome.tabs.create({
url: arrayItem.url
});
})
render.group.openall.all(copyStagedGroup);
});
groupHeaderItemOpenall.appendChild(groupOpenall);
@ -576,6 +571,23 @@ var link = (function() {
}
},
openall: {
all: function(copyStagedGroup) {
if (state.get.current().link.item.newTab) {
copyStagedGroup.group.items.forEach(function(arrayItem, index) {
chrome.tabs.create({
url: arrayItem.url
});
});
} else {
var first = copyStagedGroup.group.items.shift();
copyStagedGroup.group.items.forEach(function(arrayItem, index) {
chrome.tabs.create({
url: arrayItem.url
});
});
window.location.href = first.url;
};
},
size: function() {
var html = helper.e("html");
html.style.setProperty("--group-openall-size", state.get.current().group.openAll.size + "em");
@ -644,7 +656,7 @@ var link = (function() {
value: 1
}]
};
if (state.get.current().link.newTab) {
if (state.get.current().link.item.newTab) {
linkPanelFrontOptions.attr.push({
key: "target",
value: "_blank"

View File

@ -873,6 +873,13 @@ var update = (function() {
style: "box"
};
return data;
},
"4.44.0": function(data) {
if (!"newTab" in state.get.current().link.item && "newTab" in state.get.current().link) {
state.get.current().link.item.newTab = state.get.current().link.newTab;
delete state.get.current().link.newTab;
};
return data;
}
};

View File

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

View File

@ -2,7 +2,7 @@
"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.",
"version": "4.43.0",
"version": "4.44.0",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"