var title = document.createElement("div");
title.setAttribute("class", "title");
- title.appendChild(grip)
+ ul.appendChild(grip)
ul.appendChild(title);
var p = document.createElement("p");
addbtn.style.display = "flex";
var cols = document.getElementsByTagName("ul");
for (let col of cols) {
+ col.style.bottom = "26px";
title = col.getElementsByClassName("title")[0];
rmbutton = document.createElement("span");
rmbutton.setAttribute("class", "rmcol");
});
title.appendChild(rmbutton);
title.getElementsByClassName("add")[0].style.display = "flex";
- title.getElementsByTagName("p")[0].style.width = "calc(100% - 90px)";
+ titlep = title.getElementsByTagName("p")[0];
+ editTitle = document.createElement("input");
+ titlep.insertAdjacentHTML("afterend", "<input type='text' class='colname' placeholder='category' value='" + titlep.innerText + "'>");
+ titlep.remove();
+ col.getElementsByClassName("grip")[0].style.display = "inline-block";
}
editMode = true;
}
function closeEdit(editbtn) {
- editbtn.style.background = hoverbg;
+ editbtn.style.background = "";
editbtn.innerText = "e";
addbtn = document.getElementById("addcol");
addbtn.style.display = "none";
var cols = document.getElementsByTagName("ul");
for (let col of cols) {
+ col.style.bottom = "0";
rmbutton = col.getElementsByClassName("title")[0].getElementsByClassName("rmcol")[0];
rmbutton.remove();
title = col.getElementsByClassName("title")[0];
title.getElementsByClassName("add")[0].style.display = "";
- title.getElementsByTagName("p")[0].style.width = "calc(100% - 45px)";
+ editTitle = title.getElementsByClassName("colname")[0];
+ titlep = document.createElement("p");
+ titlep.innerText = editTitle.value;
+ editTitle.remove();
+ title.appendChild(titlep);
+ col.getElementsByClassName("grip")[0].style.display = "none";
}
+ save();
editMode = false;
}
});
title.appendChild(rmbutton);
title.getElementsByClassName("add")[0].style.display = "flex";
- title.getElementsByTagName("p")[0].style.width = "calc(100% - 90px)";
+ titlep = title.getElementsByTagName("p")[0];
+ editTitle = document.createElement("input");
+ titlep.insertAdjacentHTML("afterend", "<input type='text' class='colname' placeholder='category'>");
+ titlep.remove();
mainlist.push(["new"]);
save();
function save_options() {
- var l1name = document.getElementById('l1').value;
- var l2name = document.getElementById('l2').value;
- var l3name = document.getElementById('l3').value;
var bgvalue = document.getElementById('bg').value;
var fgvalue = document.getElementById('fg').value;
console.log(bgvalue);
chrome.storage.sync.set({
- "l1name": l1name,
- "l2name": l2name,
- "l3name": l3name,
"bgvalue": bgvalue,
"fgvalue": fgvalue,
}, function() {
function restore_options() {
chrome.storage.sync.get({
- "l1name": "Productivity",
- "l2name": "General",
- "l3name": "Social",
"bgvalue": "#2E3440",
"fgvalue": "#D8DEE9"},
function(items) {
- document.getElementById('l1').value = items["l1name"];
- document.getElementById('l2').value = items["l2name"];
- document.getElementById('l3').value = items["l3name"];
document.getElementById('bg').value = items["bgvalue"];
document.getElementById('fg').value = items["fgvalue"];
});
}
ul {
+ position: relative;
list-style: none;
padding: 0;
width: 10rem;
margin-top: 2.5px
}
+input.colname {
+ width: calc(100% - 68px);
+ height: 19px;
+ margin: 14px 0 6px 0;
+ border: 2px var(--hover-bg) dashed;
+ background-color: var(--default-bg);
+ color: inherit;
+ font-family: inherit;
+}
+
.remove {
width: 29px;
height: 35px;
padding: 0;
- background: var(--hover-bg);
+ background-color: var(--hover-bg);
float: right;
text-align: center;
justify-content: center;
}
.save:hover, .save:focus, .save:focus-within {
- background: var(--hover-grn);
+ background-color: var(--hover-grn);
}
.remove:hover {
- background: var(--remove-bg);
+ background-color: var(--remove-bg);
}
#edit, #addcol {
justify-content: center;
align-items: center;
cursor: pointer;
+ font-weight: bold;
}
#edit:hover {
display: none;
}
-a, ul > .title > p {
+a, ul > .title > p, .colname {
width: calc(100% - 45px);
display: inline-block;
}
/* border: 2px dashed var(--default-fg);*/
}
+span.grip {
+ content: '....';
+ position: relative;
+ right: 20px;
+ top: 35px;
+ width: 10px;
+ height: 20px;
+ display: none;
+ overflow: hidden;
+ line-height: 5px;
+ padding: 3px 4px;
+ cursor: move;
+ vertical-align: middle;
+ font-size: 12px;
+ font-family: sans-serif;
+ font-weight: bold;
+ letter-spacing: 2px;
+}
+
+span.grip::after {
+ content: '.. .. .. ..';
+}
+
.glyphicon-move {
cursor: move;
cursor: -webkit-grabbing;
.title p {
width: 160px;
- margin-left: 0.5rem;
- margin-bottom: 0.5rem !important;
+ margin: 16px 0 8px 0;
}