Update tag.html
This commit is contained in:
parent
ddad57bc46
commit
9def4814f9
@ -90,62 +90,63 @@ function showList(){
|
|||||||
showLabels.setAttribute("onclick","javascript:updateShowTag('All');");
|
showLabels.setAttribute("onclick","javascript:updateShowTag('All');");
|
||||||
tagLable.appendChild(showLabels);
|
tagLable.appendChild(showLabels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(label of jsonData['labelColorDict']){
|
||||||
|
tagList.push(label);
|
||||||
|
let showLabels=document.createElement("button");
|
||||||
|
showLabels.setAttribute("class","Label");
|
||||||
|
showLabels.setAttribute("style","background-color:"+jsonData['labelColorDict'][label]);
|
||||||
|
showLabels.innerHTML=label;
|
||||||
|
showLabels.setAttribute("onclick","javascript:updateShowTag('"+label+"');");
|
||||||
|
tagLable.appendChild(showLabels);
|
||||||
|
}
|
||||||
|
|
||||||
for(i in jsonData){
|
for(i in jsonData){
|
||||||
for(label of jsonData[i]['labels']){
|
if(i!='labelColorDict'){
|
||||||
if(!(tagList.includes(label))){
|
let div=document.createElement("div");
|
||||||
tagList.push(label);
|
div.setAttribute("class","lists "+jsonData[i]['label']);
|
||||||
let showLabels=document.createElement("button");
|
let item=document.createElement("a");
|
||||||
showLabels.setAttribute("class","Label");
|
item.setAttribute("class","SideNav-item d-flex flex-items-center flex-justify-between");
|
||||||
showLabels.setAttribute("style","background-color:"+jsonData['labelColorDict'][label]);
|
item.setAttribute("href",jsonData[i]['postUrl']);
|
||||||
showLabels.innerHTML=label;
|
|
||||||
showLabels.setAttribute("onclick","javascript:updateShowTag('"+label+"');");
|
let center=document.createElement("div");
|
||||||
tagLable.appendChild(showLabels);
|
center.setAttribute("class","d-flex flex-items-center");
|
||||||
|
|
||||||
|
svg=document.createElementNS('http://www.w3.org/2000/svg','svg');
|
||||||
|
path=document.createElementNS("http://www.w3.org/2000/svg","path");
|
||||||
|
span=document.createElement("span");
|
||||||
|
svg.setAttributeNS(null,"class","SideNav-icon octicon");
|
||||||
|
svg.setAttributeNS(null,"style","witdh:16px;height:16px");
|
||||||
|
path.setAttributeNS(null, "d", IconList["post"]);
|
||||||
|
svg.appendChild(path);
|
||||||
|
|
||||||
|
let title=document.createElement("span");
|
||||||
|
title.setAttribute("class","listTitle");
|
||||||
|
title.innerHTML=jsonData[i]['postTitle'];
|
||||||
|
center.appendChild(svg);
|
||||||
|
center.appendChild(title);
|
||||||
|
|
||||||
|
let listLabels=document.createElement("div");
|
||||||
|
listLabels.setAttribute("class","listLabels");
|
||||||
|
|
||||||
|
for(label of jsonData[i]['labels']){
|
||||||
|
let LabelName=document.createElement("span");
|
||||||
|
LabelName.setAttribute("class","Label LabelName");
|
||||||
|
LabelName.setAttribute("style","background-color:"+jsonData['labelColorDict'][label]);
|
||||||
|
LabelName.innerHTML=label;
|
||||||
|
listLabels.appendChild(LabelName);
|
||||||
}
|
}
|
||||||
|
let LabelTime=document.createElement("span");
|
||||||
|
LabelTime.setAttribute("class","Label LabelTime");
|
||||||
|
LabelTime.setAttribute("style","background-color:"+jsonData[i]['dateLabelColor']);
|
||||||
|
LabelTime.innerHTML=jsonData[i]['createdDate'];
|
||||||
|
listLabels.appendChild(LabelTime);
|
||||||
|
|
||||||
|
item.appendChild(center);
|
||||||
|
item.appendChild(listLabels);
|
||||||
|
div.appendChild(item);
|
||||||
|
SideNav.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
let div=document.createElement("div");
|
|
||||||
div.setAttribute("class","lists "+jsonData[i]['label']);
|
|
||||||
let item=document.createElement("a");
|
|
||||||
item.setAttribute("class","SideNav-item d-flex flex-items-center flex-justify-between");
|
|
||||||
item.setAttribute("href",jsonData[i]['postUrl']);
|
|
||||||
|
|
||||||
let center=document.createElement("div");
|
|
||||||
center.setAttribute("class","d-flex flex-items-center");
|
|
||||||
|
|
||||||
svg=document.createElementNS('http://www.w3.org/2000/svg','svg');
|
|
||||||
path=document.createElementNS("http://www.w3.org/2000/svg","path");
|
|
||||||
span=document.createElement("span");
|
|
||||||
svg.setAttributeNS(null,"class","SideNav-icon octicon");
|
|
||||||
svg.setAttributeNS(null,"style","witdh:16px;height:16px");
|
|
||||||
path.setAttributeNS(null, "d", IconList["post"]);
|
|
||||||
svg.appendChild(path);
|
|
||||||
|
|
||||||
let title=document.createElement("span");
|
|
||||||
title.setAttribute("class","listTitle");
|
|
||||||
title.innerHTML=jsonData[i]['postTitle'];
|
|
||||||
center.appendChild(svg);
|
|
||||||
center.appendChild(title);
|
|
||||||
|
|
||||||
let listLabels=document.createElement("div");
|
|
||||||
listLabels.setAttribute("class","listLabels");
|
|
||||||
|
|
||||||
for(label of jsonData[i]['labels']){
|
|
||||||
let LabelName=document.createElement("span");
|
|
||||||
LabelName.setAttribute("class","Label LabelName");
|
|
||||||
LabelName.setAttribute("style","background-color:"+jsonData['labelColorDict'][label]);
|
|
||||||
LabelName.innerHTML=label;
|
|
||||||
listLabels.appendChild(LabelName);
|
|
||||||
}
|
|
||||||
let LabelTime=document.createElement("span");
|
|
||||||
LabelTime.setAttribute("class","Label LabelTime");
|
|
||||||
LabelTime.setAttribute("style","background-color:"+jsonData[i]['dateLabelColor']);
|
|
||||||
LabelTime.innerHTML=jsonData[i]['createdDate'];
|
|
||||||
listLabels.appendChild(LabelTime);
|
|
||||||
|
|
||||||
item.appendChild(center);
|
|
||||||
item.appendChild(listLabels);
|
|
||||||
div.appendChild(item);
|
|
||||||
SideNav.appendChild(div);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user