Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Dec 26, 2016
0 parents commit 405cdcd
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.DS_Store
/build/
/dist/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Mac:
`electron-packager . "Standard Notes" --platform=mas --icon=icon --overwrite --osx-sign='Mac Developer ID Application: xxx'`
1 change: 1 addition & 0 deletions frontend/errors/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Not Found
Binary file added icon.icns
Binary file not shown.
Binary file added icon.ico
Binary file not shown.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html ng-app="app.frontend" ng-controller="BaseCtrl">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta name="theme-color" content="#ffffff">

<meta ng-bind="title" content="Standard Notes" name="application-name"/>
<base href="/"></base>

<title ng-bind="title">Standard Notes</title>

<script>
window.nodeRequire = require;
delete window.require;
delete window.exports;
delete window.module;
</script>

<script src="https://app.standardnotes.org/assets/compiled.js" debug="false"></script>
<link rel="stylesheet" media="all" href="https://app.standardnotes.org/assets/app.css" debug="false" />

</head>

<body ng-class="bodyClass">
<div ui-view="content"></div>
</body>

</html>
63 changes: 63 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
const {app, BrowserWindow} = require('electron')
const path = require('path')
const server = require("./server");
const url = require('url')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win

function createWindow () {
// Create the browser window.
win = new BrowserWindow({
width: 900, height: 600,
minWidth: 900, minHeight: 600,
icon: __dirname + 'icon.png'
})

// and load the index.html of the app.
// win.loadURL(url.format({
// pathname: path.join(__dirname, 'index.html'),
// protocol: 'file:',
// slashes: true
// }))

//some callback.
win.loadURL('http://localhost:3333');

// Open the DevTools.
// win.webContents.openDevTools()

// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null
})
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
}
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "standard-notes",
"version": "0.1.0",
"main": "main.js",
"dependencies": {
"express": "^4.14.0"
},
"devDependencies": {
"electron": "^1.4.13"
}
}
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var path = require('path');
var express = require('express');
var app = express();

app.use(express.static(__dirname));

app.get('/', function (req, res) {
res.sendfile(__dirname + 'index.html');
});

app.listen(3333);

0 comments on commit 405cdcd

Please sign in to comment.