Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoalabi committed Nov 16, 2019
0 parents commit 7f1db1e
Show file tree
Hide file tree
Showing 22 changed files with 10,504 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
.idea/workspace.xml
/output
19 changes: 19 additions & 0 deletions .idea/$PRODUCT_WORKSPACE_FILE$

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/nota.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions app/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function setDefaultConfig() {
localStorage.setItem('config', JSON.stringify({
'backgroundColor': '#002b36',
'color': '#ffffff',
'preferredDirectoryPath': null,
'recentFiles': [],
'fontSize': "14px",
}));
return getConfig();
}

function getConfig() {
let config = JSON.parse(localStorage.getItem('config'));
if (config !== null) {
return config
}
return setDefaultConfig();
}

function setConfig(config) {
let current = getConfig();
let updated = {...current, ...config}
localStorage.setItem('config', JSON.stringify(updated))
return updated;
}

module.exports = {
getConfig,
setConfig,
setDefaultConfig
}
95 changes: 95 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' 'unsafe-inline';connect-src *">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>nota</title>
<link rel="stylesheet" href="./styles/styles.css">
<link rel="stylesheet" href="./styles/animate.css">
</head>
<body>
<section class="preferences">
<div class="preferences__title">
Preferences...
</div>
<form action="#">
<div class="preferences__form">
<div class="row">
<div class="row-8">
Background Color
</div>
<div class="row-4">
<label for="backgroundColor"></label>
<select name="backgroundColor" id="backgroundColor">
<option value="#002b36">Dark</option>
<option value="#ffffff">White</option>
</select>
</div>
</div>
<div class="row">
<div class="row-8">
Text Color
</div>
<div class="row-4">
<label for="color"></label>
<select name="color" id="color">
<option value="#002b36">Dark</option>
<option value="#ffffff">White</option>
</select>
</div>
</div>
<div class="row">
<div class="row-8">
Font Size
</div>
<div class="row-4">
<label for="fontSize"></label>
<select name="fontSize" id="fontSize">
<option value="10px">10 points</option>
<option value="12px">12 points</option>
<option value="14px">14 points</option>
<option value="16px">16 points</option>
<option value="24px">24 points</option>
</select>
</div>
</div>
<div class="row">
<div class="row-8">
<div>
<div>Preferred Save Path</div>
<small class="current-directory-path"></small>
</div>
</div>
<div class="row-4">
<label for="preferredDirectoryPath"></label>
<div class="preferences__selectPath">
<div class="preferences__selectPath-text">Select Path</div>
</div>
<input class="preferences__selectedPath" type="hidden" name="preferredDirectoryPath" id="preferredDirectoryPath" value="desktop">
</div>
</div>
</div>
<div class="preferences__buttons">
<button class="preferences__cancel">Cancel</button>
<div>
<button type="submit" class="preferences__save">Save</button>
<button type="submit" class="preferences__save save_close">Save & Close</button>
</div>
</div>
</form>
</section>
<div class="main-container">
<label>
<textarea class="text-box" autofocus></textarea>
</label>
<div class="no_save_alert animated bounceInUp">
No need to save! ;)
</div>
</div>
</body>
</html>

<script src="renderer.js"></script>
27 changes: 27 additions & 0 deletions app/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const electron = require('electron');
const {remote, ipcRenderer,shell} = electron;
const path = require("path");
const mainProcess = remote.require('./main.js');
const app = remote.app;
const fs = require("fs");
const BrowserWindow = remote.BrowserWindow;
const currentWindow = remote.getCurrentWindow();
const config = require('./config');
const EventEmitter = require('events');


window.pre = {
EventEmitter,
remote,
config,
fs,
path,
mainProcess,
app,
BrowserWindow,
currentWindow,
ipcRenderer,
shell,
};

window.__devtron = {require: require, process: process}
Loading

0 comments on commit 7f1db1e

Please sign in to comment.