Skip to content

Commit

Permalink
some more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eik-S committed Feb 20, 2019
2 parents 391950d + b604dbf commit 838e323
Show file tree
Hide file tree
Showing 51 changed files with 264 additions and 45 deletions.
13 changes: 8 additions & 5 deletions HTTPKoaServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ app.use(router.allowedMethods())
// #####################

// initialization of the tray menu
var tray = new nw.Tray({ tooltip: 'Memex Local Server', icon: 'img/tray_icon.png'})
var tray = new nw.Tray({ tooltip: 'Memex Backup Helper', icon: 'img/tray_icon.png'})
var menu = new nw.Menu();
var AppName = new nw.MenuItem({ type: 'normal', label: 'Memex Backup Helper'})
var submenu = new nw.Menu();
var itemStartServer = new nw.MenuItem({ type: 'normal', label: 'Start Server', tooltip: 'Click here to start the memex backup server.', click: startServer, enabled: false })
var itemStopServer = new nw.MenuItem({ type: 'normal', label: 'Stop Server', tooltip: 'Click here to stop the memex backup server.', click: stopServer, enabled: false })
Expand All @@ -134,8 +135,6 @@ menu.append(new nw.MenuItem({ type: 'separator' }))
menu.append(itemCloseApp)
tray.menu = menu;

updateBackupLocation()

async function closeApp() {
stopServer()
closeTray()
Expand All @@ -149,7 +148,7 @@ async function closeTray() {
}
}

async function updateBackupLocation() {
function updateBackupLocation() {
stopServer()
backupPath = fs.readFileSync('./backup_location.txt', 'utf-8')
if (backupPath) {
Expand All @@ -172,8 +171,8 @@ async function selectNewBackupFolder() {
.addEventListener('click', async () => {
const path = document.getElementById('folderSelect').value
fs.writeFileSync('./backup_location.txt', path)
updateBackupLocation()
closeFolderSelect()
updateBackupLocation()
res(path)
})
document.getElementById('cancelButton')
Expand Down Expand Up @@ -212,3 +211,7 @@ async function stopServer() {
itemServerStatus.icon = './img/inactive.png'
}
}

gui.Window.get().on('loaded', () => {
updateBackupLocation()
})
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
# local-backup-server
Nodejs server for local backups of the memex browser extension.

## Rebuilding desktop applications

__Dependencies:__
```bash
# make sure npm & node <=10 is installed on your system
npm i pkg -g
# install the repos local dependencies from its package.json
npm install
```

__Rebuild:__
```bash
# macos, linux & windows
pkg .
# just for the host os
pkg . -t host
```

For more information on using pkg visit https://github.com/zeit/pkg
Nodejs server for local backups of the memex browser extension.
53 changes: 44 additions & 9 deletions folder-select.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
font-family: sans-serif;
font-family: 'Inter';
display: grid;
grid-template-columns: auto;
grid-template-rows: auto auto auto auto 1fr;
Expand All @@ -12,10 +12,15 @@ body {
"apply_button";
}
p {
color: #424242;
color: #173766;
font-weight: 200;
font-size: 16px;
}
img {
grid-area: logo;
width: 70%;
margin-top: 30px;
margin-bottom: 30px;
}
.info {
grid-area: para;
Expand All @@ -26,15 +31,23 @@ img {
width: 100px;
height: 30px;
width: 120px;
cursor: pointer;
}
.folder-select-bg {
position: absolute;
background-color: #424242;
width: 120px;
height: 30px;
border-radius: 4px;
color: white;
font-size: 15px;
font-weight: bold;
cursor: pointer;
border: 2px solid #173766;
background-color: #173766;
border-radius: 5px;

}
.folder-select-bg:hover {
color: #173766;
background-color: white;
}
input {
position: absolute;
Expand All @@ -49,38 +62,60 @@ input {
border-color: transparent;
background-color: transparent;
border-radius: 5px;
cursor: pointer;
}
input:focus {
outline: none;
cursor: pointer;
}
#pathPara {
text-align: center;
grid-area: path;
font-size: 16px;
color: #3eb995;
font-style: italic;
font-weight: 300;
}
#pathPara span {
text-align: center;
font-weight: 600;
font-size: 14px;
margin-top: 35px;
color: #173766;
font-style: normal;
}
#applyButton {
grid-area: apply_button;
align-self: end;
background-color: #6DaD87;
background-color: white;
border: 2px solid #3eb995;
width: 100px;
color: #3eb995;
font-size: 16px;
height: 40px;
border-radius: 4px;
cursor: pointer;

}
#applyButton:hover {
background-color: #3eb995;
color: white;
}

#applyButton:disabled {
visibility: hidden;
}
.cancel {
position: absolute;
top: 15px;
right: 15px;
font-weight: 800;
font-size: 18px;
margin-top: -15px;
color: #424242;
cursor: pointer;
width: 25px;
height: 25px;

}
.cancel:hover {
background-color: #efefef;
border-radius: 20px;
}
9 changes: 5 additions & 4 deletions folder-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
<head>
</head>
<body>
<div class="cancel" id="cancelButton"><img src="./img/cross.svg"/></div>
<img src="./img/icon_128x128.png">
<p class="info">Please choose a folder for your local backups.</p>
<button class="cancel" id="cancelButton">X</button>
<p class="info">Pick a folder for your local backups.</p>
<div class="select-container">
<button class="folder-select-bg">Select Folder</button>
<input type="file" id="folderSelect" nwdirectory directory>
</div>
<p id="pathPara"></p>
<button id="applyButton" disabled>Apply</button>
<button id="applyButton" disabled>Confirm</button>
<link rel="stylesheet" type="text/css" href="./folder-select.css">
<link rel="stylesheet" type="text/css" href="./fonts/inter/inter.css">
<script src="./HTTPKoaServer.js" ></script>
<script>

Expand All @@ -30,7 +31,7 @@
path = '...' + path.slice(-35)
}
applyButton.disabled = false
pathPara.innerHTML = '<span>Backups will be saved to:</span><br>'
pathPara.innerHTML = '<span class="">Backup Location:</span><br>'
+ path;
} else {
applyButton.disabled = true
Expand Down
Binary file added fonts/inter/Inter-Black.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Black.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-BlackItalic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-BlackItalic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Bold.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Bold.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-BoldItalic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-BoldItalic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraBold.woff
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraBold.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraBoldItalic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraBoldItalic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraLight-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraLight-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraLightItalic-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-ExtraLightItalic-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Italic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Italic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Light-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Light-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-LightItalic-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-LightItalic-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Medium.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Medium.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-MediumItalic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-MediumItalic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Regular.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Regular.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-SemiBold.woff
Binary file not shown.
Binary file added fonts/inter/Inter-SemiBold.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-SemiBoldItalic.woff
Binary file not shown.
Binary file added fonts/inter/Inter-SemiBoldItalic.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-Thin-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-Thin-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-ThinItalic-BETA.woff
Binary file not shown.
Binary file added fonts/inter/Inter-ThinItalic-BETA.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-italic.var.woff2
Binary file not shown.
Binary file added fonts/inter/Inter-upright.var.woff2
Binary file not shown.
Binary file added fonts/inter/Inter.var.woff2
Binary file not shown.
Loading

0 comments on commit 838e323

Please sign in to comment.