Remove electron aspect.

This commit is contained in:
kor 2019-02-04 12:12:03 +13:00
parent 82810ed954
commit 6b014f9905
77 changed files with 13 additions and 182 deletions

2
.gitattributes vendored
View File

@ -1 +1 @@
docs/logic/lib/* linguist-vendored
logic/lib/* linguist-vendored

13
.gitignore vendored
View File

@ -1,11 +1,8 @@
node_modules/
builds/
.DS_Store
*/.DS_Store
package-lock.json
docs/content/media/*.pdf
docs/content/media/*.zip
docs/content/media/*.rar
docs/content/media/*.html
docs/content/media/*.mobi
content/media/*.pdf
content/media/*.zip
content/media/*.rar
content/media/*.html
content/media/*.mobi

View File

@ -2,15 +2,12 @@
**Memex** is a [personal knowledge base](https://scholar.colorado.edu/csci_techreports/931/).
A bookmarks and notes application to help with storage and overview.
A bookmarks and notes tool to help with storage and overview.
Read-only and 'sever-less' for easy sharing.
<img src='https://raw.githubusercontent.com/kormyen/memex/master/PREVIEW.jpg'/>
Memex has two modes:
1. **website** that is read-only and 'sever-less' for easy sharing
2. **standalone** application for bookmark and note cataloging
Memex supports:
- filtering
@ -25,7 +22,7 @@ Memex supports:
- projects
- themes
To change theme simply drag a [theme svg file](https://github.com/hundredrabbits/Themes/tree/master/themes) onto the Memex webpage or app
To change theme simply drag a [theme svg file](https://github.com/hundredrabbits/Themes/tree/master/themes) onto the Memex webpage
More information on themes can be found [here](https://github.com/hundredrabbits/Themes)
@ -40,29 +37,17 @@ More information on themes can be found [here](https://github.com/hundredrabbits
git clone git@github.com:kormyen/memex.git
```
Then open `memex/docs/index.html` in any web browser
The web content is isolated in a folder to seperate it from Electron (app-building) files
The folder is called 'docs' so that the 'Github Pages' feature can host it, another folder name doesn't seem supported
### App Development
```
git clone git@github.com:kormyen/memex.git
cd memex
npm install
npm start
```
Then open `memex/index.html` in any web browser
### Data
[memex/docs/content/data.ndtl](docs/content/data.ndtl)
[memex/content/data.ndtl](content/data.ndtl)
Stored in a human-readable, flat-file database called [Indental](https://wiki.xxiivv.com/#indental) which is made by Devine Lu Linvega
### Settings
[memex/docs/content/settings.js](docs/content/settings.js)
[memex/content/settings.js](content/settings.js)
| Setting | Description |
| ---: | :--- |
@ -96,7 +81,6 @@ Stored in a human-readable, flat-file database called [Indental](https://wiki.xx
- Database parser: [Indental](https://wiki.xxiivv.com/#indental)
- Theming: [Themes](https://github.com/hundredrabbits/Themes)
- Grid layout: [Masonry](https://masonry.desandro.com/)
- App builder: [Electron](https://electronjs.org/)
- Icons: [Font Awesome](https://fontawesome.com/)
### Thanks

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

View File

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 183 KiB

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 282 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 441 KiB

After

Width:  |  Height:  |  Size: 441 KiB

View File

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 406 KiB

View File

Before

Width:  |  Height:  |  Size: 672 KiB

After

Width:  |  Height:  |  Size: 672 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

Before

Width:  |  Height:  |  Size: 576 KiB

After

Width:  |  Height:  |  Size: 576 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 MiB

After

Width:  |  Height:  |  Size: 3.2 MiB

View File

Before

Width:  |  Height:  |  Size: 960 KiB

After

Width:  |  Height:  |  Size: 960 KiB

View File

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 274 KiB

View File

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 363 KiB

After

Width:  |  Height:  |  Size: 363 KiB

View File

Before

Width:  |  Height:  |  Size: 702 KiB

After

Width:  |  Height:  |  Size: 702 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 329 KiB

After

Width:  |  Height:  |  Size: 329 KiB

View File

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 306 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 258 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

Before

Width:  |  Height:  |  Size: 615 KiB

After

Width:  |  Height:  |  Size: 615 KiB

BIN
icon.icns

Binary file not shown.

BIN
icon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

120
main.js
View File

@ -1,120 +0,0 @@
const {app, BrowserWindow, webFrame, Menu} = require('electron')
const path = require('path')
const url = require('url')
const shell = require('electron').shell;
const fs = require('fs');
const { ipcMain } = require('electron');
const FILELOCATION = 'docs/content/data.ndtl';
let is_shown = true;
this.handleRedirect = (e, url) =>
{
if(url != app.win.webContents.getURL())
{
e.preventDefault()
require('electron').shell.openExternal(url)
}
}
app.inspect = function()
{
app.win.toggleDevTools();
}
app.toggle_fullscreen = function()
{
app.win.setFullScreen(app.win.isFullScreen() ? false : true);
}
app.toggle_visible = function()
{
if(process.platform == "win32")
{
if(!app.win.isMinimized())
{
app.win.minimize();
}
else
{
app.win.restore();
}
}
else
{
if(is_shown)
{
app.win.hide();
}
else
{
app.win.show();
}
}
}
app.inject_menu = function(m)
{
Menu.setApplicationMenu(Menu.buildFromTemplate(m));
}
app.path = function()
{
return __dirname
}
app.win = null;
app.on('ready', () =>
{
app.win = new BrowserWindow(
{
webPreferences:
{
nodeIntegration: true,
preload: path.join(__dirname, 'preload.js')
}, width: 950, height: 950, backgroundColor:"#ddd", minWidth: 587, minHeight: 540, frame:true, autoHideMenuBar: true, icon: __dirname + '/icon.ico'
})
app.win.loadURL(`file://${__dirname}/docs/index.html`);
app.win.on('closed', () =>
{
win = null
app.quit()
})
app.win.on('hide', function()
{
is_shown = false;
})
app.win.on('show', function()
{
is_shown = true;
})
app.win.webContents.on('will-navigate', this.handleRedirect)
app.win.webContents.on('new-window', this.handleRedirect)
})
app.on('window-all-closed', () =>
{
app.quit()
})
app.on('activate', () =>
{
if (app.win === null) {
createWindow()
}
})
ipcMain.on('write', (event, arg) =>
{
fs.appendFile(FILELOCATION, arg, function (err)
{
if (err) throw err;
console.log('Saved!');
});
});

View File

@ -1,20 +0,0 @@
{
"name": "Memex",
"productName": "Memex",
"version": "0.1.0",
"main": "main.js",
"scripts": {
"start": "electron .",
"clean": "rm -r builds/Memex-darwin-x64/ ; rm -r builds/Memex-linux-x64/ ; rm -r builds/Memex-win32-x64/ ; rm -r builds/Memex-linux-armv7l ; echo 'cleaned build location'",
"build_osx": "electron-packager . Memex --platform=darwin --arch=x64 --out builds/ --overwrite --icon=icon.icns && echo 'Built for OSX'",
"build_linux": "electron-packager . Memex --platform=linux --arch=x64 --out builds/ --overwrite --icon=icon.ico && echo 'Built for LINUX'",
"build_win": "electron-packager . Memex --platform=win32 --arch=x64 --out builds/ --overwrite --icon=icon.ico && echo 'Built for WIN'",
"build_pi": "electron-packager . Memex --platform=linux --arch=armv7l --out builds/ --overwrite --icon=icon.ico ; echo 'Built for PI'"
},
"devDependencies": {
"electron": "^1.8.1"
},
"dependencies": {
"electron-packager": "^12.0.1"
}
}

View File

@ -1,10 +0,0 @@
// This formats 'require' for use in logic/add.js used for send-ing a method call to the electron app/
window.nodeRequire = require;
delete window.require;
delete window.exports;
delete window.module;
// This preload.js file is included by electron, but not loaded in the web version.
// Defining 'window.showAdd' to true tells the app to include the add entry
// menu button and functionality which is not currently supported in the web version.
window.showAdd = true;