Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fe945ca
Showing
9 changed files
with
1,720 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{.travis.yml,npm-shrinkwrap.json,package.json}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# HackMD Desktop Client | ||
|
||
## Tools | ||
|
||
- electron | ||
|
||
## Development | ||
|
||
```bash | ||
npm install -g yarn | ||
yarn | ||
|
||
npm run dev # if you've started HackMD in localhost:3000 | ||
npm run start # load https://hackmd.io | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const { app, BrowserWindow } = require('electron'); | ||
const os = require('os'); | ||
const fs = require('fs'); | ||
|
||
let mainWin; | ||
|
||
const winOption = { | ||
width: 1024, | ||
height: 768, | ||
webPreferences: { | ||
webSecurity: false, | ||
nodeIntegration: false | ||
} | ||
} | ||
|
||
const isDarwin = os.platform() === 'darwin'; | ||
|
||
function initializeApp () { | ||
mainWin = new BrowserWindow( | ||
(isDarwin | ||
? Object.assign({}, winOption, {titleBarStyle: 'hidden-inset'}) | ||
: winOption) | ||
); | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
mainWin.loadURL('http://localhost:3000'); | ||
} else { | ||
mainWin.loadURL('https://hackmd.io'); | ||
} | ||
|
||
mainWin.webContents.on('did-finish-load', function() { | ||
let cssPath = isDarwin ? '/static/darwin.css' : '/static/app.css'; | ||
|
||
fs.readFile(__dirname + cssPath, 'utf-8', function(error, data) { | ||
if (!error) { | ||
mainWin.webContents.insertCSS(data); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
app.on('ready', () => { | ||
initializeApp(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "hackmd-desktop", | ||
"version": "0.0.1", | ||
"description": "HackMD desktop client", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=development electron .", | ||
"start": "cross-env NODE_ENV=production electron .", | ||
"dist": "build -mwl" | ||
}, | ||
"author": "Yukai Huang <yukaihuangtw@gmail.com> (https://yukaii.tw)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"cross-env": "^3.1.4", | ||
"electron": "^1.4.15", | ||
"electron-builder": "^11.4.4" | ||
}, | ||
"build": { | ||
"appId": "com.hackmd.desktop", | ||
"mac": { | ||
"category": "public.app-category.productivity" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.navbar.navbar-default { | ||
-webkit-app-region: drag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.navbar-header { | ||
margin-left: 70px; | ||
} | ||
|
||
.navbar.navbar-default { | ||
-webkit-app-region: drag; | ||
} |
Oops, something went wrong.