Added search fuunctionality.
This commit is contained in:
parent
677fe2f020
commit
d71187f861
18
index.html
18
index.html
@ -21,24 +21,26 @@
|
|||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<!-- Uploader -->
|
<!-- Uploader -->
|
||||||
<h2 id="fullPathHeader">
|
<h2 id="controls">
|
||||||
<button type="button" title="Other Options" onclick="tgglElmView('popOutControls')">⚙</button>
|
<button type="button" title="Other Options" onclick="tgglElmView('popOutControls')">⚙</button>
|
||||||
<button type="button" title="Refresh" onclick="getDir('./')">↻</button>
|
<button type="button" title="Refresh" onclick="getDir('./')">↻</button>
|
||||||
<button type="button" title="Back" onclick="getDir('../')">⇐</button>
|
<button type="button" title="Back" onclick="getDir('../')">⇐</button>
|
||||||
<button type="button" id="faves" title="Favorites" onclick="faveManager(this)">☆</button>
|
<input type="text" placeholder="Search..." onkeyup="searchPage(this)" name="" value="">
|
||||||
<span id="faves-constraint" >
|
<button type="button" onclick="clearSearch()" title="Clears search..." >Clear Search</button>
|
||||||
<button onclick="getFavesList(); tgglElmView(this.parentElement.children[1].id)">Faves List ↕</button>
|
<button onclick="getFavesList(); tgglElmView('favesList')">Faves List ↕</button>
|
||||||
<ol id="favesList" style="display: none;"> </ol>
|
</h2>
|
||||||
</span>
|
|
||||||
Path: <span id="path"></span>
|
<h2 id="fullPathHeader">
|
||||||
|
<button type="button" id="faves" onclick="faveManager(this)" title="Add/Delete from favorites..." >☆</button>
|
||||||
|
Path:<span id="path"></span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<!-- Dynamic content targets -->
|
<!-- Dynamic content targets -->
|
||||||
|
<ul id="favesList" style="display: none;"> </ul>
|
||||||
<div id="dynDiv"></div>
|
<div id="dynDiv"></div>
|
||||||
<div id="imgView" style="display:none;"></div>
|
<div id="imgView" style="display:none;"></div>
|
||||||
<div id="fileView" style="display:none;"></div>
|
<div id="fileView" style="display:none;"></div>
|
||||||
|
|
||||||
|
|
||||||
<div id="popOutControls" style="display:none;">
|
<div id="popOutControls" style="display:none;">
|
||||||
<center>
|
<center>
|
||||||
<form>
|
<form>
|
||||||
|
@ -2,3 +2,7 @@ html {
|
|||||||
margin: 0em;
|
margin: 0em;
|
||||||
padding: 0em;
|
padding: 0em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ol, ul, li {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
z-index: -999;
|
z-index: -999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fullPathHeader, #dynDiv,
|
#controls, #fullPathHeader, #dynDiv,
|
||||||
.errorStyling, .dirStyle, .movieStyle, .fileStyle {
|
.errorStyling, .dirStyle, .movieStyle, .fileStyle {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -49,6 +49,7 @@
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding: 1.5em;
|
padding: 1.5em;
|
||||||
max-height: 632px;
|
max-height: 632px;
|
||||||
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#favesList > li:hover {
|
#favesList > li:hover {
|
||||||
@ -58,16 +59,15 @@
|
|||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#fullPathHeader,
|
||||||
#fullPathHeader {
|
#controls {
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0.5em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#dynDiv {
|
#controls { top: 0em; }
|
||||||
margin-top: 5em;
|
#fullPathHeader { top: 2em; }
|
||||||
}
|
#dynDiv { margin-top: 5em; }
|
||||||
|
|
||||||
#imgView, #imgArea, #fileView {
|
#imgView, #imgArea, #fileView {
|
||||||
width: 800px;
|
width: 800px;
|
||||||
@ -101,7 +101,10 @@
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
#imgView { overflow: hidden; left: 15em; }
|
#imgView {
|
||||||
|
overflow: hidden;
|
||||||
|
left: 15em;
|
||||||
|
}
|
||||||
|
|
||||||
#NewItem {
|
#NewItem {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
@ -19,7 +19,7 @@ const faveManager = (elm) => {
|
|||||||
// Basically resetting path nodes and setting them up
|
// Basically resetting path nodes and setting them up
|
||||||
// to the new path and just doing a refresh
|
// to the new path and just doing a refresh
|
||||||
const loadFave = (elm) => {
|
const loadFave = (elm) => {
|
||||||
let path = elm.innerHTML;
|
let path = elm.getAttribute("name");
|
||||||
let parts = path.split("/");
|
let parts = path.split("/");
|
||||||
let size = parts.length;
|
let size = parts.length;
|
||||||
pathNodes = [];
|
pathNodes = [];
|
||||||
|
@ -9,6 +9,29 @@ const tgglElmView = (id) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchPage = (elm) => {
|
||||||
|
let query = elm.value.toLowerCase();
|
||||||
|
let list = document.getElementById("dynDiv").childNodes;
|
||||||
|
let size = list.length;
|
||||||
|
|
||||||
|
for (var i = 0; i < size; i++) {
|
||||||
|
if (!list[i].title.toLowerCase().includes(query)) {
|
||||||
|
list[i].style.display = "none";
|
||||||
|
} else {
|
||||||
|
list[i].style.display = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const clearSearch = () => {
|
||||||
|
let list = document.getElementById("dynDiv").childNodes;
|
||||||
|
let size = list.length;
|
||||||
|
|
||||||
|
for (var i = 0; i < size; i++) {
|
||||||
|
list[i].style.display = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const enableEdit = (obj) => {
|
const enableEdit = (obj) => {
|
||||||
obj.style.backgroundColor = "#ffffffff";
|
obj.style.backgroundColor = "#ffffffff";
|
||||||
obj.style.color = '#000000ff';
|
obj.style.color = '#000000ff';
|
||||||
|
@ -22,8 +22,12 @@ const generateFavesList = (data) => {
|
|||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
let liTag = document.createElement("LI");
|
let liTag = document.createElement("LI");
|
||||||
let txtNode = document.createTextNode(favesList[i].innerHTML);
|
let name = favesList[i].innerHTML;
|
||||||
|
let parts = (name.includes("/")) ? name.split("/") : name.split("\\");
|
||||||
|
let txtNode = document.createTextNode(parts[parts.length - 2]);
|
||||||
|
|
||||||
|
liTag.setAttribute("name", name);
|
||||||
|
liTag.setAttribute("title", name);
|
||||||
liTag.setAttribute("onclick", "loadFave(this)");
|
liTag.setAttribute("onclick", "loadFave(this)");
|
||||||
liTag.appendChild(txtNode);
|
liTag.appendChild(txtNode);
|
||||||
listView.appendChild(liTag);
|
listView.appendChild(liTag);
|
||||||
|
Loading…
Reference in New Issue
Block a user