[feature] add open all links in new tab
This commit is contained in:
parent
ec83292655
commit
5416d6393d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "nightTab",
|
||||
"version": "4.43.0",
|
||||
"version": "4.44.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -3555,7 +3555,7 @@ var control = (function() {
|
|||
}
|
||||
}, {
|
||||
element: ".control-link-newtab",
|
||||
path: "link.newTab",
|
||||
path: "link.item.newTab",
|
||||
type: "checkbox",
|
||||
func: function() {
|
||||
link.groupAndItems();
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var version = (function() {
|
||||
|
||||
var current = "4.43.0";
|
||||
var current = "4.44.0";
|
||||
|
||||
var name = "Naughty Goose";
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue