Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (79 sloc) 3.15 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/home.css">
<link href="css/material-icons.css" rel="stylesheet">
<link rel="stylesheet" href="css/materialize.min.css">
<script src="js/materialize.min.js"></script>
<title>CheapTags</title>
</head>
<body>
<nav>
<div class="nav-wrapper" style="background-color: #2196fe">
<a class="brand-logo center" >CheapTags</a>
</div>
</nav>
<script>
/**
* ACCESSING THE FILE SYSTEM IN HTML
*/
const fs = require("fs");
const os = require("os");
const files = fs.readdirSync(os.homedir());
console.log(files);
</script>
<div class="row" style="text-align: center;">
<div class="col s4" id="prevVisistedDiv">
<h5 style="text-align: center;">Previously Visited</h5>
<ul class="collection" id="prevVisitedUl">
</ul>
</div>
<div class="col s8" id="btnContainer">
<div class="col s12 btnDiv" >
<a id="selectFolderBtn" class="file_upload btn"><i class="material-icons left">file_upload</i>Choose Folder</a>
</div>
<div class="col s12 btnDiv" >
<a id="instagramImportBtn" class="camera_enhance btn"><i class="material-icons left">camera_enhance</i>Instagram Imp.</a>
</div>
<div class="col s12 btnDiv" >
<a id="viewTagsBtn" class="tag_faces btn"><i class="material-icons left">tag_faces</i>My Tags</a>
</div>
</div>
<div class="col s12" style="padding-top: 22%">
Version: <span id="version">v0.8</span>
<!-- the button onClick sends a quitAndInstall message to the electron main process -->
<button id="ready" class="btn" style="margin-left: 2%;background-color: #721896 !important;" onClick="ipcRenderer.send('quitAndInstall')">Check fore Updates</button>
</div>
</div>
<script>
/*
* UPDATES
*/
const ipcRenderer = require('electron').ipcRenderer;
// wait for an updateReady message
ipcRenderer.on('updateReady', function(event, text) {
// changes the text of the button
var container = document.getElementById('ready');
container.innerHTML = "new version ready!";
})
</script>
<script src="js/home.js"></script>
<script>
const ul = document.getElementById("prevVisitedUl");
ipcRenderer.on("data:prevVisited", function(e, prevVisited){
for (let folder of prevVisited){
let li = document.createElement("li");
li.className = "collection-item";
li.innerHTML = "<a onclick='javascript:void(0);'>" + folder + "</a>";
li.addEventListener("click", function(){
folderChosen(folder);
});
ul.appendChild(li);
}
});
</script>
</body>
</html>