mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 18:26:26 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86cc9fb7d8 | ||
|
|
f98efe0b97 | ||
|
|
6c5345df64 | ||
|
|
2d97661d28 | ||
|
|
3efe0c1ce2 | ||
|
|
6099c91216 | ||
|
|
934e4d9607 | ||
|
|
1198f6112e | ||
|
|
777f7f9305 | ||
|
|
43fb37ab1d | ||
|
|
06734ec886 | ||
|
|
0b8ae93727 | ||
|
|
24cea97e08 | ||
|
|
18536e5db0 | ||
|
|
8c236cb5cb | ||
|
|
797c8ad7fa | ||
|
|
ba8d2dcb8b | ||
|
|
78a095d958 | ||
|
|
627172f6df | ||
|
|
a39f25961c | ||
|
|
e738ae5c8c | ||
|
|
749e85e8e6 | ||
|
|
cfa251b158 | ||
|
|
1ca38b8741 | ||
|
|
d7bc5a7088 | ||
|
|
3b9a2c3ee1 | ||
|
|
260ad77d39 | ||
|
|
5c508a0cd9 | ||
|
|
00be41608d | ||
|
|
eda547b868 | ||
|
|
07291d71f2 | ||
|
|
d1ca1ec4d9 | ||
|
|
6a4e8c95ea | ||
|
|
2f90890f50 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,7 @@
|
|||||||
|
.DS_Store
|
||||||
.env
|
.env
|
||||||
|
Desktop.ini
|
||||||
|
Thumbs.db
|
||||||
node_modules/*
|
node_modules/*
|
||||||
!node_modules/boost
|
!node_modules/boost
|
||||||
/dist
|
/dist
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ export default class CodeEditor extends React.Component {
|
|||||||
fontSize: config['editor-font-size'],
|
fontSize: config['editor-font-size'],
|
||||||
fontFamily: config['editor-font-family'],
|
fontFamily: config['editor-font-family'],
|
||||||
indentType: config['editor-indent-type'],
|
indentType: config['editor-indent-type'],
|
||||||
indentSize: config['editor-indent-size']
|
indentSize: config['editor-indent-size'],
|
||||||
|
themeSyntax: config['theme-syntax']
|
||||||
}
|
}
|
||||||
|
|
||||||
this.silentChange = false
|
this.silentChange = false
|
||||||
@@ -114,7 +115,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
var editor = this.editor = ace.edit(el)
|
var editor = this.editor = ace.edit(el)
|
||||||
editor.$blockScrolling = Infinity
|
editor.$blockScrolling = Infinity
|
||||||
editor.renderer.setShowGutter(true)
|
editor.renderer.setShowGutter(true)
|
||||||
editor.setTheme('ace/theme/xcode')
|
editor.setTheme('ace/theme/' + this.state.themeSyntax)
|
||||||
editor.moveCursorTo(0, 0)
|
editor.moveCursorTo(0, 0)
|
||||||
editor.setReadOnly(!!this.props.readOnly)
|
editor.setReadOnly(!!this.props.readOnly)
|
||||||
editor.setFontSize(this.state.fontSize)
|
editor.setFontSize(this.state.fontSize)
|
||||||
@@ -202,9 +203,13 @@ export default class CodeEditor extends React.Component {
|
|||||||
fontSize: config['editor-font-size'],
|
fontSize: config['editor-font-size'],
|
||||||
fontFamily: config['editor-font-family'],
|
fontFamily: config['editor-font-family'],
|
||||||
indentType: config['editor-indent-type'],
|
indentType: config['editor-indent-type'],
|
||||||
indentSize: config['editor-indent-size']
|
indentSize: config['editor-indent-size'],
|
||||||
|
themeSyntax: config['theme-syntax']
|
||||||
}, function () {
|
}, function () {
|
||||||
var session = this.editor.getSession()
|
var editor = this.editor
|
||||||
|
editor.setTheme('ace/theme/' + this.state.themeSyntax)
|
||||||
|
|
||||||
|
var session = editor.getSession()
|
||||||
session.setUseSoftTabs(this.state.indentType === 'space')
|
session.setUseSoftTabs(this.state.indentType === 'space')
|
||||||
session.setTabSize(!isNaN(this.state.indentSize) ? parseInt(this.state.indentSize, 10) : 4)
|
session.setTabSize(!isNaN(this.state.indentSize) ? parseInt(this.state.indentSize, 10) : 4)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const sanitizeOpts = {
|
|||||||
allowedClasses: {
|
allowedClasses: {
|
||||||
'a': ['lineAnchor'],
|
'a': ['lineAnchor'],
|
||||||
'div': ['math'],
|
'div': ['math'],
|
||||||
|
'pre': ['hljs'],
|
||||||
'span': ['math', 'hljs-*'],
|
'span': ['math', 'hljs-*'],
|
||||||
'code': ['language-*']
|
'code': ['language-*']
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,11 +9,27 @@ import FinderDetail from './FinderDetail'
|
|||||||
import actions, { selectArticle, searchArticle } from './actions'
|
import actions, { selectArticle, searchArticle } from './actions'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import dataStore from 'browser/lib/dataStore'
|
import dataStore from 'browser/lib/dataStore'
|
||||||
|
import fetchConfig from '../lib/fetchConfig'
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { clipboard, ipcRenderer, remote } = electron
|
const { clipboard, ipcRenderer, remote } = electron
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
|
let config = fetchConfig()
|
||||||
|
applyConfig(config)
|
||||||
|
|
||||||
|
ipcRenderer.on('config-apply', function (e, newConfig) {
|
||||||
|
config = newConfig
|
||||||
|
applyConfig(config)
|
||||||
|
})
|
||||||
|
|
||||||
|
function applyConfig () {
|
||||||
|
let body = document.body
|
||||||
|
body.setAttribute('data-theme', config['theme-ui'])
|
||||||
|
|
||||||
|
let hljsCss = document.getElementById('hljs-css')
|
||||||
|
hljsCss.setAttribute('href', '../node_modules/highlight.js/styles/' + config['theme-code'] + '.css')
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
window.addEventListener('keydown', function (e) {
|
window.addEventListener('keydown', function (e) {
|
||||||
if (e.keyCode === 73 && e.metaKey && e.altKey) {
|
if (e.keyCode === 73 && e.metaKey && e.altKey) {
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ const defaultConfig = {
|
|||||||
'preview-font-size': '14',
|
'preview-font-size': '14',
|
||||||
'preview-font-family': 'Lato',
|
'preview-font-family': 'Lato',
|
||||||
'switch-preview': 'blur',
|
'switch-preview': 'blur',
|
||||||
'disable-direct-write': false
|
'disable-direct-write': false,
|
||||||
|
'theme-ui': 'light',
|
||||||
|
'theme-code': 'xcode',
|
||||||
|
'theme-syntax': 'xcode'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function fetchConfig () {
|
export default function fetchConfig () {
|
||||||
|
|||||||
78
browser/lib/hljsThemes.js
Normal file
78
browser/lib/hljsThemes.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
const hljsThemeList = [
|
||||||
|
{caption: 'Default', name: 'default'},
|
||||||
|
{caption: 'Agate', name: 'agate'},
|
||||||
|
{caption: 'Androidstudio', name: 'androidstudio'},
|
||||||
|
{caption: 'Arduino Light', name: 'arduino-light'},
|
||||||
|
{caption: 'Arta', name: 'arta'},
|
||||||
|
{caption: 'Ascetic', name: 'ascetic'},
|
||||||
|
{caption: 'Atelier Cave Dark', name: 'atelier-cave-dark'},
|
||||||
|
{caption: 'Atelier Cave Light', name: 'atelier-cave-light'},
|
||||||
|
{caption: 'Atelier Dune Dark', name: 'atelier-dune-dark'},
|
||||||
|
{caption: 'Atelier Dune Light', name: 'atelier-dune-light'},
|
||||||
|
{caption: 'Atelier Estuary Dark', name: 'atelier-estuary-dark'},
|
||||||
|
{caption: 'Atelier Estuary Light', name: 'atelier-estuary-light'},
|
||||||
|
{caption: 'Atelier Forest Dark', name: 'atelier-forest-dark'},
|
||||||
|
{caption: 'Atelier Forest Light', name: 'atelier-forest-light'},
|
||||||
|
{caption: 'Atelier Heath Dark', name: 'atelier-heath-dark'},
|
||||||
|
{caption: 'Atelier Heath Light', name: 'atelier-heath-light'},
|
||||||
|
{caption: 'Atelier Lakeside Dark', name: 'atelier-lakeside-dark'},
|
||||||
|
{caption: 'Atelier Lakeside Light', name: 'atelier-lakeside-light'},
|
||||||
|
{caption: 'Atelier Plateau Dark', name: 'atelier-plateau-dark'},
|
||||||
|
{caption: 'Atelier Plateau Light', name: 'atelier-plateau-light'},
|
||||||
|
{caption: 'Atelier Savanna Dark', name: 'atelier-savanna-dark'},
|
||||||
|
{caption: 'Atelier Savanna Light', name: 'atelier-savanna-light'},
|
||||||
|
{caption: 'Atelier Seaside Dark', name: 'atelier-seaside-dark'},
|
||||||
|
{caption: 'Atelier Seaside Light', name: 'atelier-seaside-light'},
|
||||||
|
{caption: 'Atelier Sulphurpool Dark', name: 'atelier-sulphurpool-dark'},
|
||||||
|
{caption: 'Atelier Sulphurpool Light', name: 'atelier-sulphurpool-light'},
|
||||||
|
{caption: 'Brown Paper', name: 'brown-paper'},
|
||||||
|
{caption: 'Codepen Embed', name: 'codepen-embed'},
|
||||||
|
{caption: 'Color Brewer', name: 'color-brewer'},
|
||||||
|
{caption: 'Dark', name: 'dark'},
|
||||||
|
{caption: 'Darkula', name: 'darkula'},
|
||||||
|
{caption: 'Docco', name: 'docco'},
|
||||||
|
{caption: 'Dracula', name: 'dracula'},
|
||||||
|
{caption: 'Far', name: 'far'},
|
||||||
|
{caption: 'Foundation', name: 'foundation'},
|
||||||
|
{caption: 'Github Gist', name: 'github-gist'},
|
||||||
|
{caption: 'Github', name: 'github'},
|
||||||
|
{caption: 'Googlecode', name: 'googlecode'},
|
||||||
|
{caption: 'Grayscale', name: 'grayscale'},
|
||||||
|
{caption: 'Gruvbox Dark', name: 'gruvbox.dark'},
|
||||||
|
{caption: 'Gruvbox Light', name: 'gruvbox.light'},
|
||||||
|
{caption: 'Hopscotch', name: 'hopscotch'},
|
||||||
|
{caption: 'Hybrid', name: 'hybrid'},
|
||||||
|
{caption: 'Idea', name: 'idea'},
|
||||||
|
{caption: 'Ir Black', name: 'ir-black'},
|
||||||
|
{caption: 'Kimbie Dark', name: 'kimbie.dark'},
|
||||||
|
{caption: 'Kimbie Light', name: 'kimbie.light'},
|
||||||
|
{caption: 'Magula', name: 'magula'},
|
||||||
|
{caption: 'Mono Blue', name: 'mono-blue'},
|
||||||
|
{caption: 'Monokai Sublime', name: 'monokai-sublime'},
|
||||||
|
{caption: 'Monokai', name: 'monokai'},
|
||||||
|
{caption: 'Obsidian', name: 'obsidian'},
|
||||||
|
{caption: 'Paraiso Dark', name: 'paraiso-dark'},
|
||||||
|
{caption: 'Paraiso Light', name: 'paraiso-light'},
|
||||||
|
{caption: 'Pojoaque', name: 'pojoaque'},
|
||||||
|
{caption: 'Qtcreator Dark', name: 'qtcreator_dark'},
|
||||||
|
{caption: 'Qtcreator Light', name: 'qtcreator_light'},
|
||||||
|
{caption: 'Railscasts', name: 'railscasts'},
|
||||||
|
{caption: 'Rainbow', name: 'rainbow'},
|
||||||
|
{caption: 'School Book', name: 'school-book'},
|
||||||
|
{caption: 'Solarized Dark', name: 'solarized-dark'},
|
||||||
|
{caption: 'Solarized Light', name: 'solarized-light'},
|
||||||
|
{caption: 'Sunburst', name: 'sunburst'},
|
||||||
|
{caption: 'Tomorrow Night Blue', name: 'tomorrow-night-blue'},
|
||||||
|
{caption: 'Tomorrow Night Bright', name: 'tomorrow-night-bright'},
|
||||||
|
{caption: 'Tomorrow Night Eighties', name: 'tomorrow-night-eighties'},
|
||||||
|
{caption: 'Tomorrow Night', name: 'tomorrow-night'},
|
||||||
|
{caption: 'Tomorrow', name: 'tomorrow'},
|
||||||
|
{caption: 'Vs', name: 'vs'},
|
||||||
|
{caption: 'Xcode', name: 'xcode'},
|
||||||
|
{caption: 'Xt 256', name: 'xt256'},
|
||||||
|
{caption: 'Zenburn', name: 'zenburn'}
|
||||||
|
]
|
||||||
|
|
||||||
|
export default function hljsTheme () {
|
||||||
|
return hljsThemeList
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import markdownit from 'markdown-it'
|
import markdownit from 'markdown-it'
|
||||||
import emoji from 'markdown-it-emoji'
|
import emoji from 'markdown-it-emoji'
|
||||||
import math from 'markdown-it-math'
|
import math from '@rokt33r/markdown-it-math'
|
||||||
import hljs from 'highlight.js'
|
import hljs from 'highlight.js'
|
||||||
|
|
||||||
var md = markdownit({
|
var md = markdownit({
|
||||||
@@ -11,10 +11,14 @@ var md = markdownit({
|
|||||||
highlight: function (str, lang) {
|
highlight: function (str, lang) {
|
||||||
if (lang && hljs.getLanguage(lang)) {
|
if (lang && hljs.getLanguage(lang)) {
|
||||||
try {
|
try {
|
||||||
return hljs.highlight(lang, str).value
|
return '<pre class="hljs"><code>' +
|
||||||
|
hljs.highlight(lang, str).value +
|
||||||
|
'</code></pre>'
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
return str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"')
|
return '<pre class="hljs"><code>' +
|
||||||
|
str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"') +
|
||||||
|
'</code></pre>'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
md.use(emoji, {
|
md.use(emoji, {
|
||||||
|
|||||||
@@ -7,11 +7,28 @@ require('../styles/main/index.styl')
|
|||||||
import { openModal } from 'browser/lib/modal'
|
import { openModal } from 'browser/lib/modal'
|
||||||
import OSSAnnounceModal from './modal/OSSAnnounceModal'
|
import OSSAnnounceModal from './modal/OSSAnnounceModal'
|
||||||
import activityRecord from 'browser/lib/activityRecord'
|
import activityRecord from 'browser/lib/activityRecord'
|
||||||
|
import fetchConfig from '../lib/fetchConfig'
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const remote = electron.remote
|
const remote = electron.remote
|
||||||
|
|
||||||
|
let config = fetchConfig()
|
||||||
|
applyConfig(config)
|
||||||
|
|
||||||
|
ipc.on('config-apply', function (e, newConfig) {
|
||||||
|
config = newConfig
|
||||||
|
applyConfig(config)
|
||||||
|
})
|
||||||
|
|
||||||
|
function applyConfig (config) {
|
||||||
|
let body = document.body
|
||||||
|
body.setAttribute('data-theme', config['theme-ui'])
|
||||||
|
|
||||||
|
let hljsCss = document.getElementById('hljs-css')
|
||||||
|
hljsCss.setAttribute('href', '../node_modules/highlight.js/styles/' + config['theme-code'] + '.css')
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
window.addEventListener('keydown', function (e) {
|
window.addEventListener('keydown', function (e) {
|
||||||
if (e.keyCode === 73 && e.metaKey && e.altKey) {
|
if (e.keyCode === 73 && e.metaKey && e.altKey) {
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ import React, { PropTypes } from 'react'
|
|||||||
import linkState from 'browser/lib/linkState'
|
import linkState from 'browser/lib/linkState'
|
||||||
import { updateUser } from '../../actions'
|
import { updateUser } from '../../actions'
|
||||||
import fetchConfig from 'browser/lib/fetchConfig'
|
import fetchConfig from 'browser/lib/fetchConfig'
|
||||||
|
import hljsTheme from 'browser/lib/hljsThemes'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
const remote = electron.remote
|
const remote = electron.remote
|
||||||
|
const ace = window.ace
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
|
|
||||||
@@ -114,11 +116,13 @@ export default class AppSettingTab extends React.Component {
|
|||||||
{userAlert.message}
|
{userAlert.message}
|
||||||
</p>
|
</p>
|
||||||
) : null
|
) : null
|
||||||
|
let aceThemeList = ace.require("ace/ext/themelist")
|
||||||
|
let hljsThemeList = hljsTheme()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='AppSettingTab content'>
|
<div className='AppSettingTab content'>
|
||||||
<div className='section'>
|
<div className='section'>
|
||||||
<div className='sectionTitle'>User's info</div>
|
<div className='sectionTitle'>User's info</div>
|
||||||
<div className='sectionInput'>
|
<div className='sectionInput'>
|
||||||
<label>User name</label>
|
<label>User name</label>
|
||||||
<input valueLink={this.linkState('user.name')} type='text'/>
|
<input valueLink={this.linkState('user.name')} type='text'/>
|
||||||
@@ -129,7 +133,7 @@ export default class AppSettingTab extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='section'>
|
<div className='section'>
|
||||||
<div className='sectionTitle'>Text</div>
|
<div className='sectionTitle'>Editor</div>
|
||||||
<div className='sectionInput'>
|
<div className='sectionInput'>
|
||||||
<label>Editor Font Size</label>
|
<label>Editor Font Size</label>
|
||||||
<input valueLink={this.linkState('config.editor-font-size')} onKeyDown={e => this.handleConfigKeyDown(e)} type='text'/>
|
<input valueLink={this.linkState('config.editor-font-size')} onKeyDown={e => this.handleConfigKeyDown(e)} type='text'/>
|
||||||
@@ -154,6 +158,7 @@ export default class AppSettingTab extends React.Component {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className='sectionTitle'>Preview</div>
|
||||||
<div className='sectionInput'>
|
<div className='sectionInput'>
|
||||||
<label>Preview Font Size</label>
|
<label>Preview Font Size</label>
|
||||||
<input valueLink={this.linkState('config.preview-font-size')} onKeyDown={e => this.handleConfigKeyDown(e)} type='text'/>
|
<input valueLink={this.linkState('config.preview-font-size')} onKeyDown={e => this.handleConfigKeyDown(e)} type='text'/>
|
||||||
@@ -178,7 +183,34 @@ export default class AppSettingTab extends React.Component {
|
|||||||
)
|
)
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
<div className='sectionTitle'>Theme</div>
|
||||||
|
<div className='sectionSelect'>
|
||||||
|
<label>UI Theme</label>
|
||||||
|
<select valueLink={this.linkState('config.theme-ui')}>
|
||||||
|
<option value='light'>Light</option>
|
||||||
|
<option value='dark'>Dark</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='sectionSelect'>
|
||||||
|
<label>Code Theme</label>
|
||||||
|
<select valueLink={this.linkState('config.theme-code')}>
|
||||||
|
{
|
||||||
|
hljsThemeList.map(function(v, i){
|
||||||
|
return (<option value={v.name} key={v.name}>{v.caption}</option>)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='sectionSelect'>
|
||||||
|
<label>Syntax Theme</label>
|
||||||
|
<select valueLink={this.linkState('config.theme-syntax')}>
|
||||||
|
{
|
||||||
|
aceThemeList.themes.map(function(v, i){
|
||||||
|
return (<option value={v.name} key={v.name}>{v.caption}</option>)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div className='sectionConfirm'>
|
<div className='sectionConfirm'>
|
||||||
<button onClick={e => this.handleConfigSaveButtonClick(e)}>Save</button>
|
<button onClick={e => this.handleConfigSaveButtonClick(e)}>Save</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default class FolderRow extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleColorButtonClick (index) {
|
handleColorButtonClick (index) {
|
||||||
return e => {
|
return (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
color: index,
|
color: index,
|
||||||
isColorEditing: false
|
isColorEditing: false
|
||||||
@@ -116,7 +116,7 @@ export default class FolderRow extends React.Component {
|
|||||||
? 'active'
|
? 'active'
|
||||||
: null
|
: null
|
||||||
return (
|
return (
|
||||||
<button onClick={e => this.handleColorButtonClick(index)(e)} className={className} key={index}>
|
<button onClick={(e) => this.handleColorButtonClick(index)(e)} className={className} key={index}>
|
||||||
<FolderMark color={index}/>
|
<FolderMark color={index}/>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
@@ -125,7 +125,7 @@ export default class FolderRow extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className='FolderRow edit'>
|
<div className='FolderRow edit'>
|
||||||
<div className='folderColor'>
|
<div className='folderColor'>
|
||||||
<button onClick={e => this.handleColorSelectClick(e)} className='select'>
|
<button onClick={(e) => this.handleColorSelectClick(e)} className='select'>
|
||||||
<FolderMark color={this.state.color}/>
|
<FolderMark color={this.state.color}/>
|
||||||
</button>
|
</button>
|
||||||
{this.state.isColorEditing
|
{this.state.isColorEditing
|
||||||
@@ -139,11 +139,11 @@ export default class FolderRow extends React.Component {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className='folderName'>
|
<div className='folderName'>
|
||||||
<input onKeyDown={e => this.handleNameInputKeyDown(e)} valueLink={this.linkState('name')} type='text'/>
|
<input onKeyDown={(e) => this.handleNameInputKeyDown(e)} valueLink={this.linkState('name')} type='text'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='folderControl'>
|
<div className='folderControl'>
|
||||||
<button onClick={e => this.handleSaveButtonClick(e)} className='primary'>Save</button>
|
<button onClick={(e) => this.handleSaveButtonClick(e)} className='primary'>Save</button>
|
||||||
<button onClick={e => this.handleCancelButtonClick(e)}>Cancel</button>
|
<button onClick={(e) => this.handleCancelButtonClick(e)}>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -152,8 +152,8 @@ export default class FolderRow extends React.Component {
|
|||||||
<div className='FolderRow delete'>
|
<div className='FolderRow delete'>
|
||||||
<div className='folderDeleteLabel'>Are you sure to delete <strong>{folder.name}</strong> folder?</div>
|
<div className='folderDeleteLabel'>Are you sure to delete <strong>{folder.name}</strong> folder?</div>
|
||||||
<div className='folderControl'>
|
<div className='folderControl'>
|
||||||
<button onClick={e => this.handleDeleteConfirmButtonClick(e)} className='primary'>Sure</button>
|
<button onClick={(e) => this.handleDeleteConfirmButtonClick(e)} className='primary'>Sure</button>
|
||||||
<button onClick={e => this.handleCancelButtonClick(e)}>Cancel</button>
|
<button onClick={(e) => this.handleCancelButtonClick(e)}>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -162,14 +162,14 @@ export default class FolderRow extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className='FolderRow'>
|
<div className='FolderRow'>
|
||||||
<div className='sortBtns'>
|
<div className='sortBtns'>
|
||||||
<button onClick={e => this.handleUpClick(e)}><i className='fa fa-sort-up fa-fw'/></button>
|
<button onClick={(e) => this.handleUpClick(e)}><i className='fa fa-sort-up fa-fw'/></button>
|
||||||
<button onClick={e => this.handleDownClick(e)}><i className='fa fa-sort-down fa-fw'/></button>
|
<button onClick={(e) => this.handleDownClick(e)}><i className='fa fa-sort-down fa-fw'/></button>
|
||||||
</div>
|
</div>
|
||||||
<div className='folderColor'><FolderMark color={folder.color}/></div>
|
<div className='folderColor'><FolderMark color={folder.color}/></div>
|
||||||
<div className='folderName'>{folder.name}</div>
|
<div className='folderName'>{folder.name}</div>
|
||||||
<div className='folderControl'>
|
<div className='folderControl'>
|
||||||
<button onClick={e => this.handleEditButtonClick(e)}><i className='fa fa-fw fa-edit'/></button>
|
<button onClick={(e) => this.handleEditButtonClick(e)}><i className='fa fa-fw fa-edit'/></button>
|
||||||
<button onClick={e => this.handleDeleteButtonClick(e)}><i className='fa fa-fw fa-close'/></button>
|
<button onClick={(e) => this.handleDeleteButtonClick(e)}><i className='fa fa-fw fa-close'/></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ export default class FolderSettingTab extends React.Component {
|
|||||||
{folderElements}
|
{folderElements}
|
||||||
<div className='newFolder'>
|
<div className='newFolder'>
|
||||||
<div className='folderName'>
|
<div className='folderName'>
|
||||||
<input onKeyDown={e => this.handleNewFolderNameKeyDown(e)} valueLink={this.linkState('name')} type='text' placeholder='New Folder'/>
|
<input onKeyDown={(e) => this.handleNewFolderNameKeyDown(e)} valueLink={this.linkState('name')} type='text' placeholder='New Folder'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='folderControl'>
|
<div className='folderControl'>
|
||||||
<button onClick={e => this.handleSaveButtonClick(e)} className='primary'>Add</button>
|
<button onClick={(e) => this.handleSaveButtonClick(e)} className='primary'>Add</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{alertElement}
|
{alertElement}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import ContactTab from './Preference/ContactTab'
|
|||||||
import { closeModal } from 'browser/lib/modal'
|
import { closeModal } from 'browser/lib/modal'
|
||||||
|
|
||||||
const APP = 'APP'
|
const APP = 'APP'
|
||||||
const HELP = 'HELP'
|
|
||||||
const FOLDER = 'FOLDER'
|
const FOLDER = 'FOLDER'
|
||||||
const CONTACT = 'CONTACT'
|
const CONTACT = 'CONTACT'
|
||||||
|
|
||||||
@@ -64,8 +63,6 @@ class Preferences extends React.Component {
|
|||||||
let { user, folders, dispatch } = this.props
|
let { user, folders, dispatch } = this.props
|
||||||
|
|
||||||
switch (this.state.currentTab) {
|
switch (this.state.currentTab) {
|
||||||
case HELP:
|
|
||||||
return (<HelpTab/>)
|
|
||||||
case FOLDER:
|
case FOLDER:
|
||||||
return (
|
return (
|
||||||
<FolderSettingTab
|
<FolderSettingTab
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ export default class Tutorial extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='Tutorial modal'>
|
<div className='Tutorial modal'>
|
||||||
<button onClick={e => this.handlePriorSlideClick()} className={'priorBtn' + (this.state.slideIndex === 0 ? ' hide' : '')}>
|
<button onClick={(e) => this.handlePriorSlideClick()} className={'priorBtn' + (this.state.slideIndex === 0 ? ' hide' : '')}>
|
||||||
<i className='fa fa-fw fa-angle-left'/>
|
<i className='fa fa-fw fa-angle-left'/>
|
||||||
</button>
|
</button>
|
||||||
<button onClick={e => this.handleNextSlideClick()} className={'nextBtn' + (this.state.slideIndex === 4 ? ' hide' : '')}>
|
<button onClick={(e) => this.handleNextSlideClick()} className={'nextBtn' + (this.state.slideIndex === 4 ? ' hide' : '')}>
|
||||||
<i className='fa fa-fw fa-angle-right'/>
|
<i className='fa fa-fw fa-angle-right'/>
|
||||||
</button>
|
</button>
|
||||||
{content}
|
{content}
|
||||||
@@ -80,7 +80,7 @@ export default class Tutorial extends React.Component {
|
|||||||
Boost supports code syntax highlighting.<br/>
|
Boost supports code syntax highlighting.<br/>
|
||||||
There are more than 100 different type of language.
|
There are more than 100 different type of language.
|
||||||
<div className='code'>
|
<div className='code'>
|
||||||
<CodeEditor readOnly article={{content:code, mode: 'jsx'}}/>
|
<CodeEditor readOnly article={{content: code, mode: 'jsx'}}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>)
|
</div>)
|
||||||
@@ -101,7 +101,7 @@ export default class Tutorial extends React.Component {
|
|||||||
return (<div className='slide slide4'>
|
return (<div className='slide slide4'>
|
||||||
<div className='title'>Are you ready?</div>
|
<div className='title'>Are you ready?</div>
|
||||||
<div className='content'>
|
<div className='content'>
|
||||||
<button onClick={e => this.startButtonClick(e)}>Start<br/>Boost</button>
|
<button onClick={(e) => this.startButtonClick(e)}>Start<br/>Boost</button>
|
||||||
</div>
|
</div>
|
||||||
</div>)
|
</div>)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ function folders (state = initialFolders, action) {
|
|||||||
if (newFolder.name == null || newFolder.name.length === 0) throw new Error('Folder name is required')
|
if (newFolder.name == null || newFolder.name.length === 0) throw new Error('Folder name is required')
|
||||||
if (newFolder.name.match(/\//)) throw new Error('`/` is not available for folder name')
|
if (newFolder.name.match(/\//)) throw new Error('`/` is not available for folder name')
|
||||||
|
|
||||||
let conflictFolder = _.find(state, folder => folder.name.toLowerCase() === newFolder.name.toLowerCase())
|
let conflictFolder = _.find(state, (folder) => folder.name.toLowerCase() === newFolder.name.toLowerCase())
|
||||||
if (conflictFolder != null) throw new Error(`${conflictFolder.name} already exists!`)
|
if (conflictFolder != null) throw new Error(`${conflictFolder.name} already exists!`)
|
||||||
state.push(newFolder)
|
state.push(newFolder)
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ function folders (state = initialFolders, action) {
|
|||||||
if (targetFolder == null) throw new Error('Folder doesnt exist')
|
if (targetFolder == null) throw new Error('Folder doesnt exist')
|
||||||
// Name conflict check
|
// Name conflict check
|
||||||
if (targetFolder.name !== folder.name) {
|
if (targetFolder.name !== folder.name) {
|
||||||
let conflictFolder = _.find(state, _folder => {
|
let conflictFolder = _.find(state, (_folder) => {
|
||||||
return folder.name.toLowerCase() === _folder.name.toLowerCase() && folder.key !== _folder.key
|
return folder.name.toLowerCase() === _folder.name.toLowerCase() && folder.key !== _folder.key
|
||||||
})
|
})
|
||||||
if (conflictFolder != null) throw new Error('Name conflicted')
|
if (conflictFolder != null) throw new Error('Name conflicted')
|
||||||
@@ -114,7 +114,7 @@ function folders (state = initialFolders, action) {
|
|||||||
if (state.length < 2) throw new Error('Folder must exist more than one')
|
if (state.length < 2) throw new Error('Folder must exist more than one')
|
||||||
|
|
||||||
let targetKey = action.data.key
|
let targetKey = action.data.key
|
||||||
let targetIndex = _.findIndex(state, folder => folder.key === targetKey)
|
let targetIndex = _.findIndex(state, (folder) => folder.key === targetKey)
|
||||||
if (targetIndex >= 0) {
|
if (targetIndex >= 0) {
|
||||||
state.splice(targetIndex, 1)
|
state.splice(targetIndex, 1)
|
||||||
}
|
}
|
||||||
@@ -159,9 +159,9 @@ function articles (state = initialArticles, action) {
|
|||||||
{
|
{
|
||||||
let modified = action.data.article
|
let modified = action.data.article
|
||||||
let targetKey = action.data.key
|
let targetKey = action.data.key
|
||||||
let originalIndex = _.findIndex(state.data, _article => targetKey === _article.key)
|
let originalIndex = _.findIndex(state.data, (_article) => targetKey === _article.key)
|
||||||
if (originalIndex === -1) return state
|
if (originalIndex === -1) return state
|
||||||
let modifiedIndex = _.findIndex(state.modified, _article => targetKey === _article.key)
|
let modifiedIndex = _.findIndex(state.modified, (_article) => targetKey === _article.key)
|
||||||
|
|
||||||
modified = compareArticle(state.data[originalIndex], modified)
|
modified = compareArticle(state.data[originalIndex], modified)
|
||||||
if (modified == null) {
|
if (modified == null) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
@import '../mixins/*'
|
@import '../mixins/*'
|
||||||
global-reset()
|
global-reset()
|
||||||
@import '../shared/*'
|
@import '../shared/*'
|
||||||
|
@import '../theme/*'
|
||||||
|
|
||||||
iptBgColor = #E6E6E6
|
iptBgColor = #E6E6E6
|
||||||
iptFocusBorderColor = #369DCD
|
iptFocusBorderColor = #369DCD
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ infoButton()
|
|||||||
padding 10px
|
padding 10px
|
||||||
background-color #E6E6E6
|
background-color #E6E6E6
|
||||||
border-top 1px solid borderColor
|
border-top 1px solid borderColor
|
||||||
border-left 1px solid borderColor
|
|
||||||
&.empty
|
&.empty
|
||||||
.ArticleDetail-empty-box
|
.ArticleDetail-empty-box
|
||||||
line-height 72px
|
line-height 72px
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ articleCount = #999
|
|||||||
.userInfo
|
.userInfo
|
||||||
height 60px
|
height 60px
|
||||||
display block
|
display block
|
||||||
|
box-sizing content-box
|
||||||
border-bottom 1px solid borderColor
|
border-bottom 1px solid borderColor
|
||||||
.userProfileName
|
.userProfileName
|
||||||
color brandColor
|
color brandColor
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ global-reset()
|
|||||||
@import './ArticleList'
|
@import './ArticleList'
|
||||||
@import './ArticleDetail'
|
@import './ArticleDetail'
|
||||||
@import './modal/*'
|
@import './modal/*'
|
||||||
|
@import '../theme/*'
|
||||||
|
|
||||||
DEFAULT_FONTS = 'Lato', helvetica, arial, sans-serif
|
DEFAULT_FONTS = 'Lato', helvetica, arial, sans-serif
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ iptFocusBorderColor = #369DCD
|
|||||||
.confirmBtn
|
.confirmBtn
|
||||||
display block
|
display block
|
||||||
position absolute
|
position absolute
|
||||||
left 180px
|
left 205px
|
||||||
bottom 44px
|
bottom 44px
|
||||||
width 240px
|
width 240px
|
||||||
font-size 24px
|
font-size 24px
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ iptFocusBorderColor = #369DCD
|
|||||||
border-radius 5px
|
border-radius 5px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
width 720px
|
width 720px
|
||||||
height 450px
|
height 600px
|
||||||
&>.header
|
&>.header
|
||||||
absolute top left right
|
absolute top left right
|
||||||
height 50px
|
height 50px
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ marked()
|
|||||||
background-color alpha(red, 0.1)
|
background-color alpha(red, 0.1)
|
||||||
color darken(red, 15%)
|
color darken(red, 15%)
|
||||||
padding 5px
|
padding 5px
|
||||||
margin -5px
|
margin 5px 0
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
sup
|
sup
|
||||||
position relative
|
position relative
|
||||||
@@ -116,9 +116,7 @@ marked()
|
|||||||
border solid 1px alpha(borderColor, 0.3)
|
border solid 1px alpha(borderColor, 0.3)
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
color black
|
|
||||||
text-decoration none
|
text-decoration none
|
||||||
background-color #F6F6F6
|
|
||||||
margin-right 2px
|
margin-right 2px
|
||||||
*:not(a.lineAnchor) + code
|
*:not(a.lineAnchor) + code
|
||||||
margin-left 2px
|
margin-left 2px
|
||||||
@@ -128,14 +126,15 @@ marked()
|
|||||||
border-radius 5px
|
border-radius 5px
|
||||||
overflow-x auto
|
overflow-x auto
|
||||||
margin 0 0 15px
|
margin 0 0 15px
|
||||||
background-color #F6F6F6
|
|
||||||
line-height 1.35em
|
line-height 1.35em
|
||||||
&>code
|
&>code
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
border-radius 0
|
border-radius 0
|
||||||
color black
|
&>pre
|
||||||
|
border none
|
||||||
|
margin -5px
|
||||||
table
|
table
|
||||||
width 100%
|
width 100%
|
||||||
margin 15px 0 25px
|
margin 15px 0 25px
|
||||||
|
|||||||
397
browser/styles/theme/dark.styl
Normal file
397
browser/styles/theme/dark.styl
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
@import '../vars'
|
||||||
|
|
||||||
|
themeDarkBackground = darken(#21252B, 10%)
|
||||||
|
themeDarkModal = darken(#21252B, 10%)
|
||||||
|
themeDarkList = #282C34
|
||||||
|
themeDarkPreview = #282C34
|
||||||
|
themeDarkSidebar = darken(#21252B, 10%)
|
||||||
|
themeDarkText = #DDDDDD
|
||||||
|
themeDarkBorder = lighten(themeDarkBackground, 20%)
|
||||||
|
themeDarkTopicColor = #369dcd
|
||||||
|
themeDarkTooltip = rgba(0, 0, 0, 0.7)
|
||||||
|
themeDarkFocusText = #FFFFFF
|
||||||
|
themeDarkFocusButton = lighten(themeDarkTopicColor, 30%)
|
||||||
|
themeDarkBoxShadow = alpha(lighten(themeDarkTopicColor, 10%), 0.4);
|
||||||
|
|
||||||
|
body[data-theme="dark"]
|
||||||
|
.Main
|
||||||
|
.ArticleNavigator .userInfo .settingBtn .tooltip,
|
||||||
|
.ArticleNavigator .ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn .tooltip,
|
||||||
|
.ArticleTopBar>.ArticleTopBar-left>.ArticleTopBar-left-search .tooltip,
|
||||||
|
.ArticleTopBar>.ArticleTopBar-left .ArticleTopBar-left-control button.ArticleTopBar-left-control-new-post-button .tooltip
|
||||||
|
.ArticleTopBar>.ArticleTopBar-right>button .tooltip,
|
||||||
|
.ArticleTopBar>.ArticleTopBar-right>.ArticleTopBar-right-links-button-dropdown,
|
||||||
|
.ArticleDetail .ArticleDetail-info .ArticleDetail-info-control>button .tooltip,
|
||||||
|
.ArticleDetail .ArticleDetail-info .ArticleDetail-info-control .ShareButton-open-button .tooltip {
|
||||||
|
background-color themeDarkTooltip
|
||||||
|
}
|
||||||
|
|
||||||
|
.ArticleNavigator
|
||||||
|
border-color lighten(themeDarkBorder, 10%)
|
||||||
|
background-color themeDarkSidebar
|
||||||
|
|
||||||
|
.userInfo
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
.userName
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
.ArticleNavigator-folders
|
||||||
|
border-color lighten(themeDarkBorder, 10%)
|
||||||
|
background-color themeDarkSidebar
|
||||||
|
|
||||||
|
.ArticleNavigator-folders-header
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
.title
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
.folderList,
|
||||||
|
.folderList>button
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
.folderList>button
|
||||||
|
transition 0.1s
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color lighten(themeDarkSidebar, 10%)
|
||||||
|
|
||||||
|
&.active,
|
||||||
|
$:active
|
||||||
|
background-color darken(brandColor, 15%)
|
||||||
|
|
||||||
|
.userInfo .settingBtn,
|
||||||
|
.ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
border none
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
.userInfo .settingBtn:hover,
|
||||||
|
.ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn:hover
|
||||||
|
background-color themeDarkTopicColor
|
||||||
|
|
||||||
|
.userInfo .settingBtn:focus,
|
||||||
|
.ArticleNavigator-folders .ArticleNavigator-folders-header .addBtn:focus
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
.ArticleTopBar
|
||||||
|
color themeDarkText
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
.ArticleTopBar-left
|
||||||
|
.ArticleTopBar-left-search input
|
||||||
|
color themeDarkText
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
.ArticleTopBar-left-control button.ArticleTopBar-left-control-new-post-button
|
||||||
|
color themeDarkText
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color themeDarkText
|
||||||
|
background-color themeDarkTopicColor
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
color themeDarkText
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
.ArticleTopBar-right
|
||||||
|
&>button
|
||||||
|
color themeDarkText
|
||||||
|
border none
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color themeDarkText
|
||||||
|
background-color themeDarkTopicColor
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
color themeDarkText
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
.ArticleList
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkList
|
||||||
|
|
||||||
|
.ArticleList-item
|
||||||
|
color themeDarkText
|
||||||
|
background-color themeDarkList
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color lighten(themeDarkList, 5%)
|
||||||
|
|
||||||
|
.divider
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
.ArticleDetail
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
.ArticleDetail-info
|
||||||
|
.ArticleDetail-info-folder
|
||||||
|
color themeDarkText
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
.ArticleDetail-info-row2 .TagSelect .TagSelect-tags
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
input
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
.ArticleDetail-info-control
|
||||||
|
&>button,
|
||||||
|
& .ShareButton-open-button
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
border none
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&>button:hover,
|
||||||
|
& .ShareButton-open-button:hover
|
||||||
|
background-color themeDarkTopicColor
|
||||||
|
|
||||||
|
&>button:focus,
|
||||||
|
& .ShareButton-open-button:focus
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
& .ShareButton-dropdown
|
||||||
|
color themeDarkText
|
||||||
|
box-shadow 0px 0px 10px 1px themeDarkBoxShadow;
|
||||||
|
border 1px solid themeDarkBorder;
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
& .ShareButton-dropdown>button
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
.ArticleDetail-panel
|
||||||
|
border-color themeDarkBackground
|
||||||
|
|
||||||
|
.ArticleDetail-panel-header,
|
||||||
|
.ArticleDetail-panel-header .ArticleDetail-panel-header-title input
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkPreview
|
||||||
|
|
||||||
|
.ArticleEditor
|
||||||
|
.CodeEditor
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&>.ArticleDetail-panel-header .ArticleDetail-panel-header-mode
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
input
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
&.idle
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkPreview
|
||||||
|
|
||||||
|
&.idle:hover
|
||||||
|
background-color themeDarkTopicColor
|
||||||
|
|
||||||
|
&.edit .ModeSelect-options
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBackground
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
.ModeSelect-options-item
|
||||||
|
&:hover
|
||||||
|
color lighten(themeDarkText, 100%)
|
||||||
|
background-color darken(themeDarkTopicColor, 20%)
|
||||||
|
|
||||||
|
.ModalBase
|
||||||
|
.modal
|
||||||
|
color themeDarkText
|
||||||
|
background-color themeDarkModal
|
||||||
|
box-shadow 0px 0px 10px 1px themeDarkBoxShadow;
|
||||||
|
|
||||||
|
input
|
||||||
|
color themeDarkText
|
||||||
|
border-color lighten(themeDarkBackground, 10%)
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
button
|
||||||
|
&:hover
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
.CreateNewFolder.modal
|
||||||
|
.closeBtn
|
||||||
|
transition 0.1s
|
||||||
|
border-radius 24px
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color darken(#BF360C, 10%)
|
||||||
|
|
||||||
|
.confirmBtn
|
||||||
|
background-color darken(brandColor, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color brandColor
|
||||||
|
|
||||||
|
.Preferences.modal
|
||||||
|
.sectionInput input,
|
||||||
|
.sectionSelect select
|
||||||
|
.sectionMultiSelect .sectionMultiSelect-input select
|
||||||
|
color themeDarkText
|
||||||
|
border-color lighten(themeDarkBackground, 10%)
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
.header
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color darken(themeDarkModal, 40%)
|
||||||
|
|
||||||
|
.nav
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color darken(themeDarkModal, 20%)
|
||||||
|
|
||||||
|
&>button
|
||||||
|
&:hover
|
||||||
|
color themeDarkFocusText
|
||||||
|
background-color lighten(themeDarkModal, 10%)
|
||||||
|
|
||||||
|
&.active,
|
||||||
|
&:active
|
||||||
|
background-color darken(brandColor, 15%)
|
||||||
|
|
||||||
|
.section
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&>.content
|
||||||
|
&.AppSettingTab
|
||||||
|
.description
|
||||||
|
code
|
||||||
|
color themeDarkText
|
||||||
|
border-color darken(themeDarkBorder, 10%)
|
||||||
|
background-color lighten(themeDarkPreview, 5%)
|
||||||
|
|
||||||
|
&.FolderSettingTab
|
||||||
|
.folderTable
|
||||||
|
&>div
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&:last-child
|
||||||
|
border-color transparent
|
||||||
|
|
||||||
|
&>div.FolderRow
|
||||||
|
.sortBtns button
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color themeDarkFocusButton
|
||||||
|
|
||||||
|
.folderColor
|
||||||
|
&>button,
|
||||||
|
.options
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&>button
|
||||||
|
border-color lighten(themeDarkBackground, 10%)
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
.options
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
&>div.FolderRow .folderName input,
|
||||||
|
&>div.newFolder .folderName input
|
||||||
|
color themeDarkText
|
||||||
|
border-color lighten(themeDarkBackground, 10%)
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
.folderControl
|
||||||
|
button
|
||||||
|
transition 0.1s
|
||||||
|
color themeDarkText
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color themeDarkFocusButton
|
||||||
|
|
||||||
|
.Finder
|
||||||
|
.FinderInput
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkBackground
|
||||||
|
|
||||||
|
input
|
||||||
|
color themeDarkText
|
||||||
|
border-color lighten(themeDarkBackground, 10%)
|
||||||
|
background-color lighten(themeDarkBackground, 10%)
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
border-color themeDarkTopicColor
|
||||||
|
|
||||||
|
.FinderList
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkList
|
||||||
|
|
||||||
|
.divider
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
.FinderDetail
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkPreview
|
||||||
|
box-shadow 0px 0px 10px 0 darken(themeDarkBorder, 20%);
|
||||||
|
|
||||||
|
.header
|
||||||
|
border-color themeDarkBorder
|
||||||
|
|
||||||
|
.right
|
||||||
|
.clipboardBtn
|
||||||
|
transition 0.1s
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color themeDarkFocusButton
|
||||||
|
|
||||||
|
.tooltip
|
||||||
|
background-color themeDarkTooltip
|
||||||
|
|
||||||
|
.ArticleDetail-panel
|
||||||
|
border-radius 0
|
||||||
|
|
||||||
|
// Markdown Preview
|
||||||
|
.Finder .FinderDetail .content,
|
||||||
|
.ArticleDetail .ArticleDetail-panel .ArticleEditor
|
||||||
|
.MarkdownPreview
|
||||||
|
color themeDarkText
|
||||||
|
border-color themeDarkBorder
|
||||||
|
background-color themeDarkPreview
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
background-color alpha(lighten(brandColor, 30%), 0.2) !important
|
||||||
70
gruntfile.js
70
gruntfile.js
@@ -2,6 +2,8 @@ const path = require('path')
|
|||||||
const ChildProcess = require('child_process')
|
const ChildProcess = require('child_process')
|
||||||
const packager = require('electron-packager')
|
const packager = require('electron-packager')
|
||||||
|
|
||||||
|
const WIN = process.platform === 'win32'
|
||||||
|
|
||||||
module.exports = function (grunt) {
|
module.exports = function (grunt) {
|
||||||
var auth_code
|
var auth_code
|
||||||
try {
|
try {
|
||||||
@@ -29,10 +31,33 @@ module.exports = function (grunt) {
|
|||||||
certificatePassword: WIN_CERT_PASSWORD,
|
certificatePassword: WIN_CERT_PASSWORD,
|
||||||
noMsi: true
|
noMsi: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'electron-installer-debian': {
|
||||||
|
app: {
|
||||||
|
options: {
|
||||||
|
name: 'boostnote',
|
||||||
|
productName: 'Boostnote',
|
||||||
|
genericName: 'Boostnote',
|
||||||
|
productDescription: 'The opensource note app for developer.',
|
||||||
|
arch: 'amd64',
|
||||||
|
categories: [
|
||||||
|
'Development',
|
||||||
|
'Utility'
|
||||||
|
],
|
||||||
|
icon: path.join(__dirname, 'resources/app.png'),
|
||||||
|
bin: 'Boostnote'
|
||||||
|
},
|
||||||
|
src: path.join(__dirname, 'dist', 'Boostnote-linux-x64'),
|
||||||
|
dest: path.join(__dirname, 'dist')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grunt.initConfig(initConfig)
|
grunt.initConfig(initConfig)
|
||||||
grunt.loadNpmTasks('grunt-electron-installer')
|
grunt.loadNpmTasks('grunt-electron-installer')
|
||||||
|
if (!WIN) {
|
||||||
|
grunt.loadNpmTasks('grunt-electron-installer-debian')
|
||||||
|
}
|
||||||
|
|
||||||
grunt.registerTask('compile', function () {
|
grunt.registerTask('compile', function () {
|
||||||
var done = this.async()
|
var done = this.async()
|
||||||
@@ -69,11 +94,11 @@ module.exports = function (grunt) {
|
|||||||
version: grunt.config.get('pkg.config.electron-version'),
|
version: grunt.config.get('pkg.config.electron-version'),
|
||||||
'app-version': grunt.config.get('pkg.version'),
|
'app-version': grunt.config.get('pkg.version'),
|
||||||
'app-bundle-id': 'com.maisin.boost',
|
'app-bundle-id': 'com.maisin.boost',
|
||||||
asar: true,
|
asar: false,
|
||||||
prune: true,
|
prune: true,
|
||||||
overwrite: true,
|
overwrite: true,
|
||||||
out: path.join(__dirname, 'dist'),
|
out: path.join(__dirname, 'dist'),
|
||||||
ignore: /submodules\/ace\/(?!src-min)|submodules\/ace\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack|^\/appdmg\.json/
|
ignore: /submodules\/ace\/(?!src-min)|submodules\/ace\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack|^\/appdmg\.json|^\/node_modules\/grunt/
|
||||||
}
|
}
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
@@ -115,6 +140,21 @@ module.exports = function (grunt) {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
case 'linux':
|
||||||
|
Object.assign(opts, {
|
||||||
|
platform: 'linux',
|
||||||
|
icon: path.join(__dirname, 'resources/app.icns'),
|
||||||
|
'app-category-type': 'public.app-category.developer-tools'
|
||||||
|
})
|
||||||
|
packager(opts, function (err, appPath) {
|
||||||
|
if (err) {
|
||||||
|
grunt.log.writeln(err)
|
||||||
|
done(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -180,10 +220,22 @@ module.exports = function (grunt) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
grunt.registerTask('build', function (platform) {
|
function getTarget () {
|
||||||
if (!platform) {
|
switch (process.platform) {
|
||||||
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
case 'darwin':
|
||||||
|
return 'osx'
|
||||||
|
case 'win32':
|
||||||
|
return 'win'
|
||||||
|
case 'linux':
|
||||||
|
return 'linux'
|
||||||
|
default:
|
||||||
|
return process.platform
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
grunt.registerTask('build', function (platform) {
|
||||||
|
if (platform == null) platform = getTarget()
|
||||||
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
|
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
|
||||||
@@ -191,13 +243,15 @@ module.exports = function (grunt) {
|
|||||||
case 'osx':
|
case 'osx':
|
||||||
grunt.task.run(['compile', 'pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
|
grunt.task.run(['compile', 'pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
|
||||||
break
|
break
|
||||||
|
case 'linux':
|
||||||
|
grunt.task.run(['compile', 'pack:linux', 'electron-installer-debian'])
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
grunt.registerTask('pre-build', function (platform) {
|
grunt.registerTask('pre-build', function (platform) {
|
||||||
if (!platform) {
|
if (platform == null) platform = getTarget()
|
||||||
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
|
||||||
}
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
grunt.task.run(['compile', 'pack:win'])
|
grunt.task.run(['compile', 'pack:win'])
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ const defaultConfig = {
|
|||||||
'preview-font-size': '14',
|
'preview-font-size': '14',
|
||||||
'preview-font-family': 'Lato',
|
'preview-font-family': 'Lato',
|
||||||
'switch-preview': 'blur',
|
'switch-preview': 'blur',
|
||||||
'disable-direct-write': false
|
'disable-direct-write': false,
|
||||||
|
'theme-ui': 'light',
|
||||||
|
'theme-code': 'xcode',
|
||||||
|
'theme-syntax': 'xcode'
|
||||||
}
|
}
|
||||||
const configFile = 'config.json'
|
const configFile = 'config.json'
|
||||||
|
|
||||||
@@ -76,4 +79,3 @@ app.on('ready', function () {
|
|||||||
applyConfig()
|
applyConfig()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const electron = require('electron')
|
|||||||
const BrowserWindow = electron.BrowserWindow
|
const BrowserWindow = electron.BrowserWindow
|
||||||
|
|
||||||
const OSX = process.platform === 'darwin'
|
const OSX = process.platform === 'darwin'
|
||||||
const WIN = process.platform === 'win32'
|
// const WIN = process.platform === 'win32'
|
||||||
|
|
||||||
var edit = {
|
var edit = {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
|
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
|
||||||
<link rel="stylesheet" href="../node_modules/devicon/devicon.min.css">
|
<link rel="stylesheet" href="../node_modules/devicon/devicon.min.css">
|
||||||
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css">
|
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css" id="hljs-css">
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
<link rel="stylesheet" href="../resources/katex.min.css">
|
<link rel="stylesheet" href="../resources/katex.min.css">
|
||||||
|
|
||||||
|
|||||||
@@ -16,14 +16,11 @@ var finderProcess = null
|
|||||||
var finderWindow = null
|
var finderWindow = null
|
||||||
var update = null
|
var update = null
|
||||||
|
|
||||||
// app.on('window-all-closed', function () {
|
|
||||||
// if (process.platform !== 'darwin') app.quit()
|
|
||||||
// })
|
|
||||||
|
|
||||||
const appRootPath = path.join(process.execPath, '../..')
|
const appRootPath = path.join(process.execPath, '../..')
|
||||||
const updateDotExePath = path.join(appRootPath, 'Update.exe')
|
const updateDotExePath = path.join(appRootPath, 'Update.exe')
|
||||||
const exeName = path.basename(process.execPath)
|
const exeName = path.basename(process.execPath)
|
||||||
|
|
||||||
|
// For windows app
|
||||||
function spawnUpdate (args, cb) {
|
function spawnUpdate (args, cb) {
|
||||||
var stdout = ''
|
var stdout = ''
|
||||||
var updateProcess = null
|
var updateProcess = null
|
||||||
@@ -128,10 +125,13 @@ const updater = new GhReleases(ghReleasesOpts)
|
|||||||
// Check for updates
|
// Check for updates
|
||||||
// `status` returns true if there is a new update available
|
// `status` returns true if there is a new update available
|
||||||
function checkUpdate () {
|
function checkUpdate () {
|
||||||
|
if (process.platform === 'linux') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
updater.check((err, status) => {
|
updater.check((err, status) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err)
|
var isLatest = err.message === 'There is no newer version.'
|
||||||
if (!versionNotified) notify('Updater error!', message)
|
if (!isLatest && !versionNotified) notify('Updater error!', err.message)
|
||||||
}
|
}
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (status) {
|
if (status) {
|
||||||
@@ -159,15 +159,6 @@ nodeIpc.config.id = 'node'
|
|||||||
nodeIpc.config.retry = 1500
|
nodeIpc.config.retry = 1500
|
||||||
nodeIpc.config.silent = true
|
nodeIpc.config.silent = true
|
||||||
|
|
||||||
function spawnFinder() {
|
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
var finderArgv = [path.join(__dirname, 'finder-app.js'), '--finder']
|
|
||||||
if (_.find(process.argv, a => a === '--hot')) finderArgv.push('--hot')
|
|
||||||
finderProcess = ChildProcess
|
|
||||||
.execFile(process.execPath, finderArgv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeIpc.serve(
|
nodeIpc.serve(
|
||||||
path.join(app.getPath('userData'), 'boost.service'),
|
path.join(app.getPath('userData'), 'boost.service'),
|
||||||
function () {
|
function () {
|
||||||
@@ -184,7 +175,7 @@ nodeIpc.serve(
|
|||||||
'message',
|
'message',
|
||||||
function (data, socket) {
|
function (data, socket) {
|
||||||
console.log('>>', data)
|
console.log('>>', data)
|
||||||
format(data)
|
handleIpcEvent(data)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
nodeIpc.server.on(
|
nodeIpc.server.on(
|
||||||
@@ -196,14 +187,18 @@ nodeIpc.serve(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
function format (payload) {
|
function handleIpcEvent (payload) {
|
||||||
switch (payload.type) {
|
switch (payload.type) {
|
||||||
case 'show-main-window':
|
case 'show-main-window':
|
||||||
if (process.platform === 'darwin') {
|
switch (process.platform) {
|
||||||
mainWindow.show()
|
case 'darwin':
|
||||||
} else {
|
mainWindow.show()
|
||||||
mainWindow.minimize()
|
case 'win32':
|
||||||
mainWindow.restore()
|
mainWindow.minimize()
|
||||||
|
mainWindow.restore()
|
||||||
|
case 'linux':
|
||||||
|
// Do nothing
|
||||||
|
// due to bug of `app.focus()` some desktop Env
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'copy-finder':
|
case 'copy-finder':
|
||||||
@@ -215,6 +210,15 @@ function format (payload) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function spawnFinder() {
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
var finderArgv = [path.join(__dirname, 'finder-app.js'), '--finder']
|
||||||
|
if (_.find(process.argv, a => a === '--hot')) finderArgv.push('--hot')
|
||||||
|
finderProcess = ChildProcess
|
||||||
|
.execFile(process.execPath, finderArgv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function quitApp () {
|
function quitApp () {
|
||||||
appQuit = true
|
appQuit = true
|
||||||
if (finderProcess) finderProcess.kill()
|
if (finderProcess) finderProcess.kill()
|
||||||
@@ -223,7 +227,6 @@ function quitApp () {
|
|||||||
|
|
||||||
app.on('ready', function () {
|
app.on('ready', function () {
|
||||||
app.on('before-quit', function () {
|
app.on('before-quit', function () {
|
||||||
console.log('before quite')
|
|
||||||
appQuit = true
|
appQuit = true
|
||||||
if (finderProcess) finderProcess.kill()
|
if (finderProcess) finderProcess.kill()
|
||||||
})
|
})
|
||||||
@@ -244,7 +247,7 @@ app.on('ready', function () {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
var menu = Menu.buildFromTemplate(template)
|
var menu = Menu.buildFromTemplate(template)
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin' || process.platform === 'linux') {
|
||||||
Menu.setApplicationMenu(menu)
|
Menu.setApplicationMenu(menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,25 +269,26 @@ app.on('ready', function () {
|
|||||||
checkUpdate()
|
checkUpdate()
|
||||||
|
|
||||||
mainWindow = require('./main-window')
|
mainWindow = require('./main-window')
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||||
mainWindow.setMenu(menu)
|
mainWindow.setMenu(menu)
|
||||||
}
|
}
|
||||||
mainWindow.on('close', function (e) {
|
mainWindow.on('close', function (e) {
|
||||||
if (appQuit) return true
|
app.quit()
|
||||||
e.preventDefault()
|
|
||||||
mainWindow.hide()
|
|
||||||
})
|
})
|
||||||
|
switch (process.platform) {
|
||||||
if (finderProcess == null && process.platform === 'darwin') {
|
case 'darwin':
|
||||||
spawnFinder()
|
spawnFinder()
|
||||||
} else {
|
break
|
||||||
finderWindow = require('./finder-window')
|
case 'win32':
|
||||||
|
finderWindow = require('./finder-window')
|
||||||
finderWindow.on('close', function (e) {
|
finderWindow.on('close', function (e) {
|
||||||
if (appQuit) return true
|
if (appQuit) return true
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
finderWindow.hide()
|
finderWindow.hide()
|
||||||
})
|
})
|
||||||
|
break
|
||||||
|
case 'linux':
|
||||||
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeIpc.server.start(function (err) {
|
nodeIpc.server.start(function (err) {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ const shell = electron.shell
|
|||||||
const mainWindow = require('./main-window')
|
const mainWindow = require('./main-window')
|
||||||
|
|
||||||
const OSX = process.platform === 'darwin'
|
const OSX = process.platform === 'darwin'
|
||||||
const WIN = process.platform === 'win32'
|
// const WIN = process.platform === 'win32'
|
||||||
|
const LINUX = process.platform === 'linux'
|
||||||
|
|
||||||
var boost = {
|
var boost = {
|
||||||
label: 'Boostnote',
|
label: 'Boostnote',
|
||||||
@@ -58,23 +59,6 @@ var file = {
|
|||||||
mainWindow.webContents.send('nav-new-folder')
|
mainWindow.webContents.send('nav-new-folder')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: 'separator'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'Save Post',
|
|
||||||
// accelerator: OSX ? 'Command + S' : 'Control + S',
|
|
||||||
// click: function () {
|
|
||||||
// mainWindow.webContents.send('detail-save')
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: 'Save All Posts',
|
|
||||||
// accelerator: OSX ? 'Command + Shift + S' : 'Control + Shift + S',
|
|
||||||
// click: function () {
|
|
||||||
// mainWindow.webContents.send('top-save-all')
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
@@ -88,6 +72,19 @@ var file = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LINUX) {
|
||||||
|
file.submenu.push({
|
||||||
|
type: 'separator'
|
||||||
|
})
|
||||||
|
file.submenu.push({
|
||||||
|
label: 'Quit Boostnote',
|
||||||
|
accelerator: 'Control + Q',
|
||||||
|
click: function () {
|
||||||
|
mainWindow.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var edit = {
|
var edit = {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
submenu: [
|
submenu: [
|
||||||
@@ -194,11 +191,13 @@ var help = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Changelog',
|
label: 'Changelog',
|
||||||
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases/blob/master/changelog.md') }
|
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = process.platform === 'darwin'
|
module.exports = process.platform === 'darwin'
|
||||||
? [boost, file, edit, view, window, help]
|
? [boost, file, edit, view, window, help]
|
||||||
|
: process.platform === 'win32'
|
||||||
|
? [file, view, help]
|
||||||
: [file, view, help]
|
: [file, view, help]
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ var mainWindow = new BrowserWindow({
|
|||||||
zoomFactor: 1.0,
|
zoomFactor: 1.0,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
blinkFeatures: 'OverlayScrollbars'
|
blinkFeatures: 'OverlayScrollbars'
|
||||||
},
|
}
|
||||||
standardWindow: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const url = path.resolve(__dirname, './main.html')
|
const url = path.resolve(__dirname, './main.html')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
|
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
|
||||||
<link rel="stylesheet" href="../node_modules/devicon/devicon.min.css">
|
<link rel="stylesheet" href="../node_modules/devicon/devicon.min.css">
|
||||||
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css">
|
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css" id="hljs-css">
|
||||||
<link rel="shortcut icon" href="../resources/favicon.ico">
|
<link rel="shortcut icon" href="../resources/favicon.ico">
|
||||||
<title>Boostnote</title>
|
<title>Boostnote</title>
|
||||||
<link rel="stylesheet" href="../resources/katex.min.css">
|
<link rel="stylesheet" href="../resources/katex.min.css">
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
<div id="content"></div>
|
<div id="content"></div>
|
||||||
|
|
||||||
<script src="../submodules/ace/src-min/ace.js"></script>
|
<script src="../submodules/ace/src-min/ace.js"></script>
|
||||||
|
<script src="../submodules/ace/src-min/ext-themelist.js"></script>
|
||||||
<script src="../resources/katex.min.js"></script>
|
<script src="../resources/katex.min.js"></script>
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
|
|||||||
31
package.json
31
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.5.8",
|
"version": "0.5.10",
|
||||||
"description": "Boostnote",
|
"description": "Boostnote",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Rokt33r/codexen-app.git"
|
"url": "git+https://github.com/BoostIO/Boostnote.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"boostnote",
|
"boostnote",
|
||||||
@@ -24,24 +24,28 @@
|
|||||||
"storage",
|
"storage",
|
||||||
"electron"
|
"electron"
|
||||||
],
|
],
|
||||||
"author": "Dick Choi <fluke8259@gmail.com> (http://kazup.co)",
|
"author": "Dick Choi <fluke8259@gmail.com> (https://github.com/Rokt33r)",
|
||||||
|
"contributors": [
|
||||||
|
"dojineko (https://github.com/dojineko)",
|
||||||
|
"Romain Bazile (https://github.com/gromain)"
|
||||||
|
],
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Rokt33r/codexen-app/issues"
|
"url": "https://github.com/BoostIO/Boostnote/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
"homepage": "https://b00st.io",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@rokt33r/markdown-it-math": "^4.0.1",
|
||||||
"@rokt33r/node-ipc": "^5.0.4",
|
"@rokt33r/node-ipc": "^5.0.4",
|
||||||
"@rokt33r/sanitize-html": "^1.11.2",
|
"@rokt33r/sanitize-html": "^1.11.2",
|
||||||
"devicon": "^2.0.0",
|
"devicon": "^2.0.0",
|
||||||
"electron-gh-releases": "^2.0.2",
|
"electron-gh-releases": "^2.0.2",
|
||||||
"font-awesome": "^4.3.0",
|
"font-awesome": "^4.3.0",
|
||||||
"fs-jetpack": "^0.7.0",
|
"fs-jetpack": "^0.7.0",
|
||||||
"highlight.js": "^8.9.1",
|
"highlight.js": "^9.3.0",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"markdown-it": "^4.4.0",
|
"markdown-it": "^6.0.1",
|
||||||
"markdown-it-checkbox": "^1.1.0",
|
"markdown-it-checkbox": "^1.1.0",
|
||||||
"markdown-it-emoji": "^1.1.0",
|
"markdown-it-emoji": "^1.1.1",
|
||||||
"markdown-it-math": "^3.0.2",
|
|
||||||
"md5": "^2.0.0",
|
"md5": "^2.0.0",
|
||||||
"moment": "^2.10.3",
|
"moment": "^2.10.3",
|
||||||
"superagent": "^1.2.0",
|
"superagent": "^1.2.0",
|
||||||
@@ -66,16 +70,21 @@
|
|||||||
"react-dom": "^0.14.3",
|
"react-dom": "^0.14.3",
|
||||||
"react-redux": "^4.0.6",
|
"react-redux": "^4.0.6",
|
||||||
"redux": "^3.0.5",
|
"redux": "^3.0.5",
|
||||||
"standard": "^5.3.1",
|
"standard": "^6.0.8",
|
||||||
"style-loader": "^0.12.4",
|
"style-loader": "^0.12.4",
|
||||||
"stylus": "^0.52.4",
|
"stylus": "^0.52.4",
|
||||||
"stylus-loader": "^1.3.1",
|
"stylus-loader": "^1.3.1",
|
||||||
"webpack": "^1.12.2",
|
"webpack": "^1.12.2",
|
||||||
"webpack-dev-server": "^1.12.0"
|
"webpack-dev-server": "^1.12.0"
|
||||||
},
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"grunt-electron-installer-debian": "^0.2.0"
|
||||||
|
},
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"standard": {
|
"standard": {
|
||||||
"ignore": [],
|
"ignore": [
|
||||||
|
"submodules"
|
||||||
|
],
|
||||||
"globals": [
|
"globals": [
|
||||||
"localStorage"
|
"localStorage"
|
||||||
]
|
]
|
||||||
|
|||||||
32
readme.md
32
readme.md
@@ -10,12 +10,31 @@ This is a public Kanban board. Also everyone can comment here.
|
|||||||
|
|
||||||
If you want to join us, ask me to add you.
|
If you want to join us, ask me to add you.
|
||||||
|
|
||||||
## Live coding
|
## System requirement
|
||||||
|
|
||||||
I've been broadcasting my work. You can check it from the below links. :smile:
|
This app is built on Electron.
|
||||||
|
|
||||||
- [Live Stream](https://www.livecoding.tv/rokt33r/videos/)
|
You can check it from [here](https://github.com/electron/electron/blob/master/docs/tutorial/supported-platforms.md).
|
||||||
- [Recorded Videos](https://www.livecoding.tv/rokt33r/videos/)
|
|
||||||
|
Currently, I'm testing this app on Windows 10(64bit), OS X El Capitan, Ubuntu Linux, Arch Linux.
|
||||||
|
|
||||||
|
## About note storage
|
||||||
|
|
||||||
|
Currently, Boostnote stores data to a single json file.
|
||||||
|
|
||||||
|
You can find it from the path below.
|
||||||
|
|
||||||
|
OS X
|
||||||
|
```
|
||||||
|
/Users/$USER_NAME$/Library/Application Support/boost/local.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Windows
|
||||||
|
```
|
||||||
|
C:\Users\$USER_NAME$\AppData\Roaming\boost\local.json
|
||||||
|
```
|
||||||
|
|
||||||
|
On v0.6.0, You will be able to select any folder in your file system.
|
||||||
|
|
||||||
## Develop
|
## Develop
|
||||||
|
|
||||||
@@ -106,6 +125,11 @@ grunt zip:osx
|
|||||||
|
|
||||||
[Rokt33r(Dick Choi of MAISIN&CO.)](https://github.com/rokt33r)
|
[Rokt33r(Dick Choi of MAISIN&CO.)](https://github.com/rokt33r)
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
[dojineko](https://github.com/dojineko)
|
||||||
|
[Romain Bazile](https://github.com/gromain)
|
||||||
|
|
||||||
## Copyright & License
|
## Copyright & License
|
||||||
|
|
||||||
Copyright (C) 2016 MAISIN&CO.
|
Copyright (C) 2016 MAISIN&CO.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var config = {
|
|||||||
'highlight.js',
|
'highlight.js',
|
||||||
'markdown-it-emoji',
|
'markdown-it-emoji',
|
||||||
'fs-jetpack',
|
'fs-jetpack',
|
||||||
'markdown-it-math',
|
'@rokt33r/markdown-it-math',
|
||||||
'@rokt33r/sanitize-html',
|
'@rokt33r/sanitize-html',
|
||||||
'markdown-it-checkbox'
|
'markdown-it-checkbox'
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user