mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-01-24 06:48:58 +01:00
[feature] add open all override control at group level
This commit is contained in:
parent
8052736db6
commit
74ea775af1
@ -7,6 +7,12 @@
|
|||||||
<input id="control-group-openall-show" class="control-group-openall-show" type="checkbox" tabindex="-1">
|
<input id="control-group-openall-show" class="control-group-openall-show" type="checkbox" tabindex="-1">
|
||||||
<label for="control-group-openall-show"><span class="label-icon"></span> Show</label>
|
<label for="control-group-openall-show"><span class="label-icon"></span> Show</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-helper">
|
||||||
|
<p class="control-group-openall-show-helper form-helper-item">The Open all button will show when there is at least one Bookmark in a Group.</p>
|
||||||
|
</div>
|
||||||
|
<div class="form-helper">
|
||||||
|
<p class="control-group-openall-show-helper form-helper-item">This can be overridden for individual Groups using their edit conttrols.</p>
|
||||||
|
</div>
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<div class="form-indent">
|
<div class="form-indent">
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
|
@ -4,6 +4,7 @@ var bookmarks = (function() {
|
|||||||
|
|
||||||
mod.all = [{
|
mod.all = [{
|
||||||
name: "Cool stuff",
|
name: "Cool stuff",
|
||||||
|
openAll: true,
|
||||||
items: [{
|
items: [{
|
||||||
display: "icon",
|
display: "icon",
|
||||||
letter: "AS",
|
letter: "AS",
|
||||||
@ -127,6 +128,7 @@ var bookmarks = (function() {
|
|||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
name: "Dev sites",
|
name: "Dev sites",
|
||||||
|
openAll: true,
|
||||||
items: [{
|
items: [{
|
||||||
display: "icon",
|
display: "icon",
|
||||||
letter: "DEV",
|
letter: "DEV",
|
||||||
|
@ -7,18 +7,21 @@ var link = (function() {
|
|||||||
},
|
},
|
||||||
group: {
|
group: {
|
||||||
name: null,
|
name: null,
|
||||||
|
openAll: null,
|
||||||
items: null
|
items: null
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
stagedGroup.init = function() {
|
stagedGroup.init = function() {
|
||||||
stagedGroup.group.items = [];
|
stagedGroup.group.items = [];
|
||||||
|
stagedGroup.group.openAll = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
stagedGroup.reset = function() {
|
stagedGroup.reset = function() {
|
||||||
stagedGroup.position.origin = null;
|
stagedGroup.position.origin = null;
|
||||||
stagedGroup.position.destination = null;
|
stagedGroup.position.destination = null;
|
||||||
stagedGroup.group.name = null;
|
stagedGroup.group.name = null;
|
||||||
|
stagedGroup.group.openAll = null;
|
||||||
stagedGroup.group.items = null;
|
stagedGroup.group.items = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -473,7 +476,7 @@ var link = (function() {
|
|||||||
if (state.get.current().group.name.show) {
|
if (state.get.current().group.name.show) {
|
||||||
groupHeader.appendChild(groupHeaderItemName);
|
groupHeader.appendChild(groupHeaderItemName);
|
||||||
};
|
};
|
||||||
if (state.get.current().group.openAll.show && stagedGroup.group.items.length > 0) {
|
if (state.get.current().group.openAll.show && stagedGroup.group.openAll && stagedGroup.group.items.length > 0) {
|
||||||
groupHeader.appendChild(groupHeaderItemOpenall);
|
groupHeader.appendChild(groupHeaderItemOpenall);
|
||||||
};
|
};
|
||||||
group.appendChild(groupHeader);
|
group.appendChild(groupHeader);
|
||||||
@ -501,17 +504,40 @@ var link = (function() {
|
|||||||
|
|
||||||
// group name
|
// group name
|
||||||
var groupFormNameInputWrap = helper.node("div|class:form-wrap");
|
var groupFormNameInputWrap = helper.node("div|class:form-wrap");
|
||||||
var groupFormInputLabel = helper.node("label:Name|for:group-form-input-name");
|
var groupFormInputNameLabel = helper.node("label:Name|for:group-form-input-name");
|
||||||
var groupFormInputName = helper.node("input|type:text,class:group-form-input-name,id:group-form-input-name,placeholder:Example group,tabindex:1,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false");
|
var groupFormInputName = helper.node("input|type:text,class:group-form-input-name,id:group-form-input-name,placeholder:Example group,tabindex:1,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false");
|
||||||
|
|
||||||
|
// open all
|
||||||
|
var groupFormOpenAllInputWrap = helper.node("div|class:form-wrap");
|
||||||
|
var groupFormInputOpenallLabel = helper.node("label|for:group-form-input-openall");
|
||||||
|
var groupFormInputOpenallLabelText = helper.node("span:Show Open all in this Group");
|
||||||
|
var groupFormInputOpenallLabelIcon = helper.node("span|class:label-icon");
|
||||||
|
var groupFormOpenAllInput = helper.node("input|type:checkbox,class:group-form-input-openall,id:group-form-input-openall,placeholder:Example group,tabindex:1,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false,checked");
|
||||||
|
var groupFormOpenAllInputHelper1 = helper.node("div|class:form-helper");
|
||||||
|
var groupFormOpenAllInputHelper1Item = helper.node("p:Override the global Group setting to show or hide the Open all button.|class:link-form-input-icon-helper form-helper-item");
|
||||||
|
var groupFormOpenAllInputHelper2 = helper.node("div|class:form-helper");
|
||||||
|
var groupFormOpenAllInputHelper2Item = helper.node("p:The Open all button will show when there is at least one Bookmark in this Group.|class:link-form-input-icon-helper form-helper-item");
|
||||||
|
|
||||||
groupFormPositionInputWrap.appendChild(groupFormPositionLabel);
|
groupFormPositionInputWrap.appendChild(groupFormPositionLabel);
|
||||||
groupFormPositionInputWrap.appendChild(groupFormPositionSelect);
|
groupFormPositionInputWrap.appendChild(groupFormPositionSelect);
|
||||||
groupFormRandomNameButtonWrap.appendChild(groupFormRandomNameButton);
|
groupFormRandomNameButtonWrap.appendChild(groupFormRandomNameButton);
|
||||||
groupFormNameInputWrap.appendChild(groupFormInputLabel);
|
groupFormNameInputWrap.appendChild(groupFormInputNameLabel);
|
||||||
groupFormNameInputWrap.appendChild(groupFormInputName);
|
groupFormNameInputWrap.appendChild(groupFormInputName);
|
||||||
|
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelIcon);
|
||||||
|
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelText);
|
||||||
|
groupFormOpenAllInputHelper1.appendChild(groupFormOpenAllInputHelper1Item);
|
||||||
|
groupFormOpenAllInputHelper2.appendChild(groupFormOpenAllInputHelper2Item);
|
||||||
|
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInput);
|
||||||
|
groupFormOpenAllInputWrap.appendChild(groupFormInputOpenallLabel);
|
||||||
|
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInputHelper1);
|
||||||
|
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInputHelper2);
|
||||||
|
|
||||||
fieldset.appendChild(groupFormNameInputWrap);
|
fieldset.appendChild(groupFormNameInputWrap);
|
||||||
fieldset.appendChild(groupFormRandomNameButtonWrap);
|
fieldset.appendChild(groupFormRandomNameButtonWrap);
|
||||||
|
fieldset.appendChild(helper.node("hr"));
|
||||||
fieldset.appendChild(groupFormPositionInputWrap);
|
fieldset.appendChild(groupFormPositionInputWrap);
|
||||||
|
fieldset.appendChild(helper.node("hr"));
|
||||||
|
fieldset.appendChild(groupFormOpenAllInputWrap);
|
||||||
form.appendChild(fieldset);
|
form.appendChild(fieldset);
|
||||||
|
|
||||||
var makeGroupOptions = function() {
|
var makeGroupOptions = function() {
|
||||||
@ -527,6 +553,7 @@ var link = (function() {
|
|||||||
var populateForm = function() {
|
var populateForm = function() {
|
||||||
groupFormPositionSelect.selectedIndex = stagedGroup.position.origin;
|
groupFormPositionSelect.selectedIndex = stagedGroup.position.origin;
|
||||||
groupFormInputName.value = stagedGroup.group.name;
|
groupFormInputName.value = stagedGroup.group.name;
|
||||||
|
groupFormOpenAllInput.checked = stagedGroup.group.openAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
var setLastPosition = function() {
|
var setLastPosition = function() {
|
||||||
@ -561,6 +588,9 @@ var link = (function() {
|
|||||||
stagedGroup.group.name = randomName;
|
stagedGroup.group.name = randomName;
|
||||||
groupFormInputName.value = randomName;
|
groupFormInputName.value = randomName;
|
||||||
}, false);
|
}, false);
|
||||||
|
groupFormOpenAllInput.addEventListener("change", function(event) {
|
||||||
|
stagedGroup.group.openAll = this.checked;
|
||||||
|
}, false);
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
},
|
},
|
||||||
|
@ -884,6 +884,9 @@ var update = (function() {
|
|||||||
"5.0.0": function(data) {
|
"5.0.0": function(data) {
|
||||||
data.state.layout.direction = "vertical";
|
data.state.layout.direction = "vertical";
|
||||||
data.state.link.area.direction = "ltr";
|
data.state.link.area.direction = "ltr";
|
||||||
|
data.bookmarks.forEach(function(arrayItem, index) {
|
||||||
|
arrayItem.openAll = true;
|
||||||
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user