mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-01-08 15:09:30 +01:00
[feature] add show name and show open all controls to individual groups
This commit is contained in:
parent
f888c3e5ca
commit
b3418bc01c
@ -113,14 +113,14 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-group-order-headerbody.is-group-openall-show .group-header,
|
.is-group-order-headerbody .group-header-name.group-header,
|
||||||
.is-group-order-headerbody.is-group-name-show .group-header,
|
.is-group-order-headerbody .group-header-openall.group-header,
|
||||||
.is-group-order-headerbody.is-edit .group-header {
|
.is-group-order-headerbody.is-edit .group-header {
|
||||||
padding-bottom: calc(var(--layout-space) * var(--layout-gutter));
|
padding-bottom: calc(var(--layout-space) * var(--layout-gutter));
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-group-order-bodyheader.is-group-openall-show .group-header,
|
.is-group-order-bodyheader .group-header-name.group-header,
|
||||||
.is-group-order-bodyheader.is-group-name-show .group-header,
|
.is-group-order-bodyheader .group-header-openall.group-header,
|
||||||
.is-group-order-bodyheader.is-edit .group-header {
|
.is-group-order-bodyheader.is-edit .group-header {
|
||||||
padding-top: calc(var(--layout-space) * var(--layout-gutter));
|
padding-top: calc(var(--layout-space) * var(--layout-gutter));
|
||||||
}
|
}
|
||||||
|
@ -4,19 +4,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="menu-item-form">
|
<div class="menu-item-form">
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<input id="control-group-name-show" class="control-group-name-show" type="checkbox" tabindex="-1">
|
<div class="form-inline">
|
||||||
<label for="control-group-name-show"><span class="label-icon"></span> Show</label>
|
<button class="control-group-name-show button" tabindex="-1">Show all</button>
|
||||||
|
<button class="control-group-name-hide button" tabindex="-1">Hide all</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-helper">
|
||||||
|
<p class="control-group-name-helper form-helper-item">Individual Group Names can be shown or hidden from their respective edit controls.</p>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<div class="form-indent">
|
<label for="control-group-name-size-range">Size</label>
|
||||||
<div class="form-wrap">
|
<div class="form-group form-group-block">
|
||||||
<label for="control-group-name-size-range">Size</label>
|
<input id="control-group-name-size-range" class="control-group-name-size-range mr-3" type="range" value="0" tabindex="-1">
|
||||||
<div class="form-group form-group-block">
|
<input class="control-group-name-size-number form-group-item-medium form-group-radius-left" type="number" value="0" tabindex="-1">
|
||||||
<input id="control-group-name-size-range" class="control-group-name-size-range mr-3" type="range" value="0" tabindex="-1">
|
<button class="control-group-name-size-default button" tabindex="-1" title="Reset to default"><span class="icon-replay"></span></button>
|
||||||
<input class="control-group-name-size-number form-group-item-medium form-group-radius-left" type="number" value="0" tabindex="-1">
|
|
||||||
<button class="control-group-name-size-default button" tabindex="-1" title="Reset to default"><span class="icon-replay"></span></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,25 +4,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="menu-item-form">
|
<div class="menu-item-form">
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<input id="control-group-openall-show" class="control-group-openall-show" type="checkbox" tabindex="-1">
|
<div class="form-inline">
|
||||||
<label for="control-group-openall-show"><span class="label-icon"></span> Show</label>
|
<button class="control-group-openall-show button" tabindex="-1">Show all</button>
|
||||||
|
<button class="control-group-openall-hide button" tabindex="-1">Hide all</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-helper">
|
<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>
|
<p class="control-group-openall-helper form-helper-item">Individual Group Open all buttons can be shown or hidden from their respective edit controls.</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>
|
||||||
|
<hr>
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<div class="form-indent">
|
<label for="control-group-openall-size-range">Size</label>
|
||||||
<div class="form-wrap">
|
<div class="form-group form-group-block">
|
||||||
<label for="control-group-openall-size-range">Size</label>
|
<input id="control-group-openall-size-range" class="control-group-openall-size-range mr-3" type="range" value="0" tabindex="-1">
|
||||||
<div class="form-group form-group-block">
|
<input class="control-group-openall-size-number form-group-item-medium form-group-radius-left" type="number" value="0" tabindex="-1">
|
||||||
<input id="control-group-openall-size-range" class="control-group-openall-size-range mr-3" type="range" value="0" tabindex="-1">
|
<button class="control-group-openall-size-default button" tabindex="-1" title="Reset to default"><span class="icon-replay"></span></button>
|
||||||
<input class="control-group-openall-size-number form-group-item-medium form-group-radius-left" type="number" value="0" tabindex="-1">
|
|
||||||
<button class="control-group-openall-size-default button" tabindex="-1" title="Reset to default"><span class="icon-replay"></span></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -3,8 +3,13 @@ var bookmarks = (function() {
|
|||||||
var mod = {};
|
var mod = {};
|
||||||
|
|
||||||
mod.all = [{
|
mod.all = [{
|
||||||
name: "Cool stuff",
|
name: {
|
||||||
openAll: true,
|
text: "Cool stuff",
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
items: [{
|
items: [{
|
||||||
display: "icon",
|
display: "icon",
|
||||||
letter: "AS",
|
letter: "AS",
|
||||||
@ -127,8 +132,13 @@ var bookmarks = (function() {
|
|||||||
timeStamp: 1546453111953
|
timeStamp: 1546453111953
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
name: "Dev sites",
|
name: {
|
||||||
openAll: true,
|
text: "Dev sites",
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
items: [{
|
items: [{
|
||||||
display: "icon",
|
display: "icon",
|
||||||
letter: "DEV",
|
letter: "DEV",
|
||||||
|
@ -3944,12 +3944,17 @@ var control = (function() {
|
|||||||
}],
|
}],
|
||||||
names: [{
|
names: [{
|
||||||
element: ".control-group-name-show",
|
element: ".control-group-name-show",
|
||||||
path: "group.name.show",
|
type: "button",
|
||||||
type: "checkbox",
|
|
||||||
func: function() {
|
func: function() {
|
||||||
|
link.mod.name.show();
|
||||||
|
link.groupAndItems();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
element: ".control-group-name-hide",
|
||||||
|
type: "button",
|
||||||
|
func: function() {
|
||||||
|
link.mod.name.hide();
|
||||||
link.groupAndItems();
|
link.groupAndItems();
|
||||||
render.class();
|
|
||||||
render.dependents();
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
element: ".control-group-name-size-range",
|
element: ".control-group-name-size-range",
|
||||||
@ -4049,12 +4054,17 @@ var control = (function() {
|
|||||||
}],
|
}],
|
||||||
openall: [{
|
openall: [{
|
||||||
element: ".control-group-openall-show",
|
element: ".control-group-openall-show",
|
||||||
path: "group.openAll.show",
|
type: "button",
|
||||||
type: "checkbox",
|
|
||||||
func: function() {
|
func: function() {
|
||||||
|
link.mod.openall.show();
|
||||||
|
link.groupAndItems();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
element: ".control-group-openall-hide",
|
||||||
|
type: "button",
|
||||||
|
func: function() {
|
||||||
|
link.mod.openall.hide();
|
||||||
link.groupAndItems();
|
link.groupAndItems();
|
||||||
render.class();
|
|
||||||
render.dependents();
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
element: ".control-group-openall-size-range",
|
element: ".control-group-openall-size-range",
|
||||||
@ -6435,24 +6445,6 @@ var control = (function() {
|
|||||||
],
|
],
|
||||||
name: "is-group-area-justify-" + state.get.current().group.area.justify
|
name: "is-group-area-justify-" + state.get.current().group.area.justify
|
||||||
}],
|
}],
|
||||||
name: [{
|
|
||||||
remove: [
|
|
||||||
"is-group-name-show"
|
|
||||||
],
|
|
||||||
condition: function() {
|
|
||||||
return state.get.current().group.name.show;
|
|
||||||
},
|
|
||||||
name: "is-group-name-show"
|
|
||||||
}],
|
|
||||||
openall: [{
|
|
||||||
remove: [
|
|
||||||
"is-group-openall-show"
|
|
||||||
],
|
|
||||||
condition: function() {
|
|
||||||
return state.get.current().group.openAll.show;
|
|
||||||
},
|
|
||||||
name: "is-group-openall-show"
|
|
||||||
}],
|
|
||||||
order: [{
|
order: [{
|
||||||
remove: [
|
remove: [
|
||||||
"is-group-order-headerbody",
|
"is-group-order-headerbody",
|
||||||
@ -6689,8 +6681,6 @@ var control = (function() {
|
|||||||
classCheck(all.header.border);
|
classCheck(all.header.border);
|
||||||
classCheck(all.header.position);
|
classCheck(all.header.position);
|
||||||
classCheck(all.group.area);
|
classCheck(all.group.area);
|
||||||
classCheck(all.group.name);
|
|
||||||
classCheck(all.group.openall);
|
|
||||||
classCheck(all.group.order);
|
classCheck(all.group.order);
|
||||||
classCheck(all.group.border);
|
classCheck(all.group.border);
|
||||||
classCheck(all.link);
|
classCheck(all.link);
|
||||||
@ -7178,34 +7168,6 @@ var control = (function() {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
group: [{
|
|
||||||
condition: function() {
|
|
||||||
return state.get.current().group.name.show;
|
|
||||||
},
|
|
||||||
dependents: function() {
|
|
||||||
return [
|
|
||||||
"[for=control-group-name-size-range]",
|
|
||||||
".control-group-name-size-range",
|
|
||||||
".control-group-name-size-number",
|
|
||||||
".control-group-name-size-default"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
condition: function() {
|
|
||||||
return state.get.current().group.openAll.show;
|
|
||||||
},
|
|
||||||
dependents: function() {
|
|
||||||
return [
|
|
||||||
"[for=control-group-openall-size-range]",
|
|
||||||
".control-group-openall-size-range",
|
|
||||||
".control-group-openall-size-number",
|
|
||||||
".control-group-openall-size-default",
|
|
||||||
".control-group-openall-style-label",
|
|
||||||
".control-group-openall-style-box",
|
|
||||||
".control-group-openall-style-clear"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
link: [{
|
link: [{
|
||||||
condition: function() {
|
condition: function() {
|
||||||
return state.get.current().link.show;
|
return state.get.current().link.show;
|
||||||
@ -7483,7 +7445,6 @@ var control = (function() {
|
|||||||
disableCheck(all.header.menu);
|
disableCheck(all.header.menu);
|
||||||
disableCheck(all.header.position);
|
disableCheck(all.header.position);
|
||||||
disableCheck(all.header.color);
|
disableCheck(all.header.color);
|
||||||
disableCheck(all.group);
|
|
||||||
disableCheck(all.link);
|
disableCheck(all.link);
|
||||||
disableCheck(all.theme);
|
disableCheck(all.theme);
|
||||||
disableCheck(all.background);
|
disableCheck(all.background);
|
||||||
|
156
src/js/link.js
156
src/js/link.js
@ -6,22 +6,29 @@ var link = (function() {
|
|||||||
destination: null
|
destination: null
|
||||||
},
|
},
|
||||||
group: {
|
group: {
|
||||||
name: null,
|
name: {
|
||||||
openAll: null,
|
text: null,
|
||||||
|
show: null
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: null
|
||||||
|
},
|
||||||
items: null
|
items: null
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
stagedGroup.init = function() {
|
stagedGroup.init = function() {
|
||||||
stagedGroup.group.items = [];
|
stagedGroup.group.items = [];
|
||||||
stagedGroup.group.openAll = true;
|
stagedGroup.group.name.show = true;
|
||||||
|
stagedGroup.group.openAll.show = 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.text = null;
|
||||||
stagedGroup.group.openAll = null;
|
stagedGroup.group.name.show = null;
|
||||||
|
stagedGroup.group.openAll.show = null;
|
||||||
stagedGroup.group.items = null;
|
stagedGroup.group.items = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,6 +142,32 @@ var link = (function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod.name = {
|
||||||
|
show: function() {
|
||||||
|
bookmarks.get().forEach(function(arrayItem, index) {
|
||||||
|
arrayItem.name.show = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
hide: function() {
|
||||||
|
bookmarks.get().forEach(function(arrayItem, index) {
|
||||||
|
arrayItem.name.show = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mod.openall = {
|
||||||
|
show: function() {
|
||||||
|
bookmarks.get().forEach(function(arrayItem, index) {
|
||||||
|
arrayItem.openAll.show = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
hide: function() {
|
||||||
|
bookmarks.get().forEach(function(arrayItem, index) {
|
||||||
|
arrayItem.openAll.show = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
mod.edit = {
|
mod.edit = {
|
||||||
mode: {
|
mode: {
|
||||||
open: function() {
|
open: function() {
|
||||||
@ -383,7 +416,7 @@ var link = (function() {
|
|||||||
var groupName = helper.node("div|class:group-name");
|
var groupName = helper.node("div|class:group-name");
|
||||||
var groupNameText = helper.makeNode({
|
var groupNameText = helper.makeNode({
|
||||||
tag: "h1",
|
tag: "h1",
|
||||||
text: stagedGroup.group.name,
|
text: stagedGroup.group.name.text,
|
||||||
attr: [{
|
attr: [{
|
||||||
key: "class",
|
key: "class",
|
||||||
value: "group-name-text"
|
value: "group-name-text"
|
||||||
@ -392,6 +425,18 @@ var link = (function() {
|
|||||||
groupName.appendChild(groupNameText);
|
groupName.appendChild(groupNameText);
|
||||||
groupHeaderItemName.appendChild(groupName);
|
groupHeaderItemName.appendChild(groupName);
|
||||||
|
|
||||||
|
var groupOpenall = helper.node("div|class:group-openall form-group");
|
||||||
|
var groupOpenallItem = helper.node("button|class:button group-openall-item,tabindex:1,title:Open all Bookmarks in this Group");
|
||||||
|
var groupOpenallItemText = helper.node("span:Open all|class:button-text");
|
||||||
|
groupOpenallItem.appendChild(groupOpenallItemText);
|
||||||
|
groupOpenall.appendChild(groupOpenallItem);
|
||||||
|
|
||||||
|
if (state.get.current().group.openAll.style == "clear") {
|
||||||
|
helper.addClass(groupOpenallItem, "button-link");
|
||||||
|
};
|
||||||
|
|
||||||
|
groupHeaderItemOpenall.appendChild(groupOpenall);
|
||||||
|
|
||||||
var groupControl = helper.node("div|class:group-control form-group");
|
var groupControl = helper.node("div|class:group-control form-group");
|
||||||
|
|
||||||
var groupControlItemUp = helper.node("button|class:button group-control-item group-control-item-up,tabindex:-1,title:Move this group up");
|
var groupControlItemUp = helper.node("button|class:button group-control-item group-control-item-up,tabindex:-1,title:Move this group up");
|
||||||
@ -453,30 +498,17 @@ var link = (function() {
|
|||||||
render.remove.group(copyStagedGroup);
|
render.remove.group(copyStagedGroup);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
var groupOpenall = helper.node("div|class:group-openall form-group");
|
|
||||||
|
|
||||||
var groupOpenallItem = helper.node("button|class:button group-openall-item,tabindex:1,title:Open all Bookmarks in this Group");
|
|
||||||
var groupOpenallItemText = helper.node("span:Open all|class:button-text");
|
|
||||||
groupOpenallItem.appendChild(groupOpenallItemText);
|
|
||||||
groupOpenall.appendChild(groupOpenallItem);
|
|
||||||
|
|
||||||
|
|
||||||
if (state.get.current().group.openAll.style == "clear") {
|
|
||||||
helper.addClass(groupOpenallItem, "button-link");
|
|
||||||
};
|
|
||||||
|
|
||||||
groupOpenallItem.addEventListener("click", function() {
|
groupOpenallItem.addEventListener("click", function() {
|
||||||
render.group.openall.all(copyStagedGroup);
|
render.group.openall.all(copyStagedGroup);
|
||||||
});
|
});
|
||||||
|
|
||||||
groupHeaderItemOpenall.appendChild(groupOpenall);
|
|
||||||
|
|
||||||
groupHeader.appendChild(groupHeaderItemControl);
|
groupHeader.appendChild(groupHeaderItemControl);
|
||||||
if (state.get.current().group.name.show) {
|
if (stagedGroup.group.name.show && stagedGroup.group.name.text.replace(/\s/g, "") != "") {
|
||||||
|
helper.addClass(groupHeader, "group-header-name");
|
||||||
groupHeader.appendChild(groupHeaderItemName);
|
groupHeader.appendChild(groupHeaderItemName);
|
||||||
};
|
};
|
||||||
if (state.get.current().group.openAll.show && stagedGroup.group.openAll && stagedGroup.group.items.length > 0) {
|
if (stagedGroup.group.openAll.show && stagedGroup.group.items.length > 0) {
|
||||||
|
helper.addClass(groupHeader, "group-header-openall");
|
||||||
groupHeader.appendChild(groupHeaderItemOpenall);
|
groupHeader.appendChild(groupHeaderItemOpenall);
|
||||||
};
|
};
|
||||||
group.appendChild(groupHeader);
|
group.appendChild(groupHeader);
|
||||||
@ -495,6 +527,17 @@ var link = (function() {
|
|||||||
var form = helper.node("form|class:group-form");
|
var form = helper.node("form|class:group-form");
|
||||||
var fieldset = helper.node("fieldset");
|
var fieldset = helper.node("fieldset");
|
||||||
|
|
||||||
|
// group name
|
||||||
|
var groupFormInputNameShowWrap = helper.node("div|class:form-wrap");
|
||||||
|
var groupFormInputNameShowLabel = helper.node("label|for:group-form-input-name-show");
|
||||||
|
var groupFormInputNameShowText = helper.node("span:Show Group name");
|
||||||
|
var groupFormInputNameShowIcon = helper.node("span|class:label-icon");
|
||||||
|
var groupFormInputNameShowInput = helper.node("input|type:checkbox,class:group-form-input-name-show,id:group-form-input-name-show,placeholder:Example group,tabindex:1,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false,checked");
|
||||||
|
var groupFormInputNameIndentWrap = helper.node("div|class:form-wrap");
|
||||||
|
var groupFormInputNameIndent = helper.node("div|class:form-indent");
|
||||||
|
var groupFormInputNameWrap = helper.node("div|class:form-wrap");
|
||||||
|
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");
|
||||||
|
|
||||||
// group position
|
// group position
|
||||||
var groupFormPositionInputWrap = helper.node("div|class:form-wrap");
|
var groupFormPositionInputWrap = helper.node("div|class:form-wrap");
|
||||||
var groupFormPositionLabel = helper.node("label:Position|for:group-form-position");
|
var groupFormPositionLabel = helper.node("label:Position|for:group-form-position");
|
||||||
@ -502,42 +545,40 @@ var link = (function() {
|
|||||||
var groupFormRandomNameButtonWrap = helper.node("div|class:form-wrap");
|
var groupFormRandomNameButtonWrap = helper.node("div|class:form-wrap");
|
||||||
var groupFormRandomNameButton = helper.node("button:Random Group name|class:button,type:button,tabindex:1");
|
var groupFormRandomNameButton = helper.node("button:Random Group name|class:button,type:button,tabindex:1");
|
||||||
|
|
||||||
// group name
|
|
||||||
var groupFormNameInputWrap = helper.node("div|class:form-wrap");
|
|
||||||
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");
|
|
||||||
|
|
||||||
// open all
|
// open all
|
||||||
var groupFormOpenAllInputWrap = helper.node("div|class:form-wrap");
|
var groupFormOpenAllInputWrap = helper.node("div|class:form-wrap");
|
||||||
var groupFormInputOpenallLabel = helper.node("label|for:group-form-input-openall");
|
var groupFormInputOpenallLabel = helper.node("label|for:group-form-input-openall");
|
||||||
var groupFormInputOpenallLabelText = helper.node("span:Show Open all in this Group");
|
var groupFormInputOpenallLabelText = helper.node("span:Show Open all");
|
||||||
var groupFormInputOpenallLabelIcon = helper.node("span|class:label-icon");
|
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 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 groupFormOpenAllInputHelper = 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 groupFormOpenAllInputHelperItem = helper.node("p:Open all button will appear if there is at least one Bookmark in this Group.|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");
|
groupFormInputNameShowLabel.appendChild(groupFormInputNameShowIcon);
|
||||||
|
groupFormInputNameShowLabel.appendChild(groupFormInputNameShowText);
|
||||||
|
groupFormInputNameShowWrap.appendChild(groupFormInputNameShowInput);
|
||||||
|
groupFormInputNameShowWrap.appendChild(groupFormInputNameShowLabel);
|
||||||
|
groupFormInputNameWrap.appendChild(groupFormInputName);
|
||||||
|
groupFormRandomNameButtonWrap.appendChild(groupFormRandomNameButton);
|
||||||
|
groupFormInputNameIndent.appendChild(groupFormInputNameWrap);
|
||||||
|
groupFormInputNameIndent.appendChild(groupFormRandomNameButtonWrap);
|
||||||
|
groupFormInputNameIndentWrap.appendChild(groupFormInputNameIndent);
|
||||||
|
|
||||||
groupFormPositionInputWrap.appendChild(groupFormPositionLabel);
|
groupFormPositionInputWrap.appendChild(groupFormPositionLabel);
|
||||||
groupFormPositionInputWrap.appendChild(groupFormPositionSelect);
|
groupFormPositionInputWrap.appendChild(groupFormPositionSelect);
|
||||||
groupFormRandomNameButtonWrap.appendChild(groupFormRandomNameButton);
|
|
||||||
groupFormNameInputWrap.appendChild(groupFormInputNameLabel);
|
|
||||||
groupFormNameInputWrap.appendChild(groupFormInputName);
|
|
||||||
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelIcon);
|
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelIcon);
|
||||||
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelText);
|
groupFormInputOpenallLabel.appendChild(groupFormInputOpenallLabelText);
|
||||||
groupFormOpenAllInputHelper1.appendChild(groupFormOpenAllInputHelper1Item);
|
|
||||||
groupFormOpenAllInputHelper2.appendChild(groupFormOpenAllInputHelper2Item);
|
|
||||||
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInput);
|
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInput);
|
||||||
groupFormOpenAllInputWrap.appendChild(groupFormInputOpenallLabel);
|
groupFormOpenAllInputWrap.appendChild(groupFormInputOpenallLabel);
|
||||||
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInputHelper1);
|
groupFormOpenAllInputHelper.appendChild(groupFormOpenAllInputHelperItem);
|
||||||
groupFormOpenAllInputWrap.appendChild(groupFormOpenAllInputHelper2);
|
|
||||||
|
|
||||||
fieldset.appendChild(groupFormNameInputWrap);
|
fieldset.appendChild(groupFormInputNameShowWrap);
|
||||||
fieldset.appendChild(groupFormRandomNameButtonWrap);
|
fieldset.appendChild(groupFormInputNameIndentWrap);
|
||||||
fieldset.appendChild(helper.node("hr"));
|
fieldset.appendChild(helper.node("hr"));
|
||||||
fieldset.appendChild(groupFormPositionInputWrap);
|
fieldset.appendChild(groupFormPositionInputWrap);
|
||||||
fieldset.appendChild(helper.node("hr"));
|
fieldset.appendChild(helper.node("hr"));
|
||||||
fieldset.appendChild(groupFormOpenAllInputWrap);
|
fieldset.appendChild(groupFormOpenAllInputWrap);
|
||||||
|
fieldset.appendChild(groupFormOpenAllInputHelper);
|
||||||
form.appendChild(fieldset);
|
form.appendChild(fieldset);
|
||||||
|
|
||||||
var makeGroupOptions = function() {
|
var makeGroupOptions = function() {
|
||||||
@ -551,9 +592,10 @@ var link = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var populateForm = function() {
|
var populateForm = function() {
|
||||||
|
groupFormInputNameShowInput.checked = stagedGroup.group.name.show;
|
||||||
groupFormPositionSelect.selectedIndex = stagedGroup.position.origin;
|
groupFormPositionSelect.selectedIndex = stagedGroup.position.origin;
|
||||||
groupFormInputName.value = stagedGroup.group.name;
|
groupFormInputName.value = stagedGroup.group.name.text;
|
||||||
groupFormOpenAllInput.checked = stagedGroup.group.openAll;
|
groupFormOpenAllInput.checked = stagedGroup.group.openAll.show;
|
||||||
};
|
};
|
||||||
|
|
||||||
var setLastPosition = function() {
|
var setLastPosition = function() {
|
||||||
@ -575,21 +617,31 @@ var link = (function() {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
}, false);
|
}, false);
|
||||||
|
groupFormInputNameShowInput.addEventListener("change", function(event) {
|
||||||
|
stagedGroup.group.name.show = this.checked;
|
||||||
|
if (stagedGroup.group.name.show) {
|
||||||
|
groupFormInputName.removeAttribute("disabled");
|
||||||
|
groupFormRandomNameButton.removeAttribute("disabled");
|
||||||
|
} else {
|
||||||
|
groupFormInputName.setAttribute("disabled", "");
|
||||||
|
groupFormRandomNameButton.setAttribute("disabled", "");
|
||||||
|
};
|
||||||
|
}, false);
|
||||||
groupFormPositionSelect.addEventListener("change", function(event) {
|
groupFormPositionSelect.addEventListener("change", function(event) {
|
||||||
stagedGroup.position.destination = this.selectedIndex;
|
stagedGroup.position.destination = this.selectedIndex;
|
||||||
}, false);
|
}, false);
|
||||||
groupFormInputName.addEventListener("input", function(event) {
|
groupFormInputName.addEventListener("input", function(event) {
|
||||||
stagedGroup.group.name = this.value;
|
stagedGroup.group.name.text = this.value;
|
||||||
}, false);
|
}, false);
|
||||||
groupFormRandomNameButton.addEventListener("click", function(event) {
|
groupFormRandomNameButton.addEventListener("click", function(event) {
|
||||||
var randomName = helper.randomString({
|
var randomName = helper.randomString({
|
||||||
mix: true
|
mix: true
|
||||||
});
|
});
|
||||||
stagedGroup.group.name = randomName;
|
stagedGroup.group.name.text = randomName;
|
||||||
groupFormInputName.value = randomName;
|
groupFormInputName.value = randomName;
|
||||||
}, false);
|
}, false);
|
||||||
groupFormOpenAllInput.addEventListener("change", function(event) {
|
groupFormOpenAllInput.addEventListener("change", function(event) {
|
||||||
stagedGroup.group.openAll = this.checked;
|
stagedGroup.group.openAll.show = this.checked;
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
@ -987,10 +1039,10 @@ var link = (function() {
|
|||||||
bookmarks.get().forEach(function(arrayItem, index) {
|
bookmarks.get().forEach(function(arrayItem, index) {
|
||||||
var option = helper.makeNode({
|
var option = helper.makeNode({
|
||||||
tag: "option",
|
tag: "option",
|
||||||
text: arrayItem.name,
|
text: arrayItem.name.text,
|
||||||
attr: [{
|
attr: [{
|
||||||
key: "value",
|
key: "value",
|
||||||
value: arrayItem.name
|
value: arrayItem.name.text
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
groupExistingGroup.appendChild(option);
|
groupExistingGroup.appendChild(option);
|
||||||
@ -1674,7 +1726,7 @@ var link = (function() {
|
|||||||
var form = render.group.form({
|
var form = render.group.form({
|
||||||
useStagedGroup: true
|
useStagedGroup: true
|
||||||
});
|
});
|
||||||
var heading = "Edit " + stagedGroup.group.name;
|
var heading = "Edit " + stagedGroup.group.name.text;
|
||||||
var successAction = function() {
|
var successAction = function() {
|
||||||
var copyStagedGroup = JSON.parse(JSON.stringify(stagedGroup));
|
var copyStagedGroup = JSON.parse(JSON.stringify(stagedGroup));
|
||||||
bookmarks.mod.edit.group(copyStagedGroup);
|
bookmarks.mod.edit.group(copyStagedGroup);
|
||||||
@ -1768,8 +1820,8 @@ var link = (function() {
|
|||||||
stagedGroup.group = JSON.parse(JSON.stringify(copyStagedGroup.group));
|
stagedGroup.group = JSON.parse(JSON.stringify(copyStagedGroup.group));
|
||||||
stagedGroup.position = JSON.parse(JSON.stringify(copyStagedGroup.position));
|
stagedGroup.position = JSON.parse(JSON.stringify(copyStagedGroup.position));
|
||||||
var heading;
|
var heading;
|
||||||
if (stagedGroup.group.name != null && stagedGroup.group.name != "") {
|
if (stagedGroup.group.name.text != null && stagedGroup.group.name.text != "") {
|
||||||
heading = "Remove " + stagedGroup.group.name;
|
heading = "Remove " + stagedGroup.group.name.text;
|
||||||
} else {
|
} else {
|
||||||
heading = "Remove unnamed group";
|
heading = "Remove unnamed group";
|
||||||
};
|
};
|
||||||
|
@ -885,8 +885,16 @@ var update = (function() {
|
|||||||
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) {
|
data.bookmarks.forEach(function(arrayItem, index) {
|
||||||
arrayItem.openAll = true;
|
arrayItem.name = {
|
||||||
|
show: data.state.group.name.show,
|
||||||
|
text: arrayItem.name
|
||||||
|
};
|
||||||
|
arrayItem.openAll = {
|
||||||
|
show: data.state.group.openAll.show
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
delete data.state.group.name.show;
|
||||||
|
delete data.state.group.openAll.show;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -283,6 +283,9 @@
|
|||||||
<script src="js/helper.js"></script>
|
<script src="js/helper.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
window.addEventListener("load", function() {
|
||||||
|
helper.addClass(helper.e("html"), "is-ready");
|
||||||
|
}, false);
|
||||||
var formElements = ["button", "input", "textarea", "select"];
|
var formElements = ["button", "input", "textarea", "select"];
|
||||||
var textElements = ["label", ".form-group-text", ".form-grid", ".form-feedback"];
|
var textElements = ["label", ".form-group-text", ".form-grid", ".form-feedback"];
|
||||||
var disable = {
|
var disable = {
|
||||||
|
Loading…
Reference in New Issue
Block a user