mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Merge pull request #231 from sota1235/master
[Refactor] Use ESLint instead of StandarJS and add settings for TravisCI
This commit is contained in:
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
compiled/
|
||||
dist/
|
||||
6
.eslintrc
Normal file
6
.eslintrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": ["standard", "standard-jsx"],
|
||||
"rules": {
|
||||
"no-useless-escape": 0
|
||||
}
|
||||
}
|
||||
6
.travis.yml
Normal file
6
.travis.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 'stable'
|
||||
- 'lts/*'
|
||||
|
||||
script: npm run lint && npm run test
|
||||
@@ -75,8 +75,8 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
|
||||
: <i styleName='item-title-icon' className='fa fa-fw fa-file-text-o' />
|
||||
}
|
||||
|
||||
{note.isStarred ?
|
||||
<i styleName='item-star' className='fa fa-star' /> : ''
|
||||
{note.isStarred
|
||||
? <i styleName='item-star' className='fa fa-star' /> : ''
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,10 +91,10 @@ NoteItem.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isrequired,
|
||||
tags: PropTypes.array,
|
||||
isStarred: PropTypes.bool.isRequired,
|
||||
isStarred: PropTypes.bool.isRequired
|
||||
}),
|
||||
handleNoteClick: PropTypes.func.isRequired,
|
||||
handleNoteContextMenu: PropTypes.func.isRequired,
|
||||
handleNoteContextMenu: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
export default CSSModules(NoteItem, styles)
|
||||
|
||||
@@ -40,10 +40,10 @@ NoteItemSimple.propTypes = {
|
||||
storage: PropTypes.string.isRequired,
|
||||
key: PropTypes.string.isRequired,
|
||||
type: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isrequired,
|
||||
title: PropTypes.string.isrequired
|
||||
}),
|
||||
handleNoteClick: PropTypes.func.isRequired,
|
||||
handleNoteContextMenu: PropTypes.func.isRequired,
|
||||
handleNoteContextMenu: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
export default CSSModules(NoteItemSimple, styles)
|
||||
|
||||
@@ -12,7 +12,7 @@ export default class ProfileImage extends React.Component {
|
||||
className={className}
|
||||
width={this.props.size}
|
||||
height={this.props.size}
|
||||
src={src}/>
|
||||
src={src} />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@ const SideNavFilter = ({
|
||||
isFolded, isHomeActive, handleAllNotesButtonClick,
|
||||
isStarredActive, handleStarredButtonClick
|
||||
}) => (
|
||||
<div styleName={ isFolded ? 'menu--folded' : 'menu' }>
|
||||
<div styleName={isFolded ? 'menu--folded' : 'menu'}>
|
||||
<button styleName={isHomeActive ? 'menu-button--active' : 'menu-button'}
|
||||
onClick={handleAllNotesButtonClick}
|
||||
>
|
||||
<i className='fa fa-book fa-fw'/>
|
||||
<i className='fa fa-book fa-fw' />
|
||||
<span styleName='menu-button-label'>All Notes</span>
|
||||
</button>
|
||||
<button styleName={isStarredActive ? 'menu-button--active' : 'menu-button'}
|
||||
onClick={handleStarredButtonClick}
|
||||
>
|
||||
<i className='fa fa-star fa-fw'/>
|
||||
<i className='fa fa-star fa-fw' />
|
||||
<span styleName='menu-button-label'>Starred</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@ SideNavFilter.propTypes = {
|
||||
isHomeActive: PropTypes.bool.isRequired,
|
||||
handleAllNotesButtonClick: PropTypes.func.isRequired,
|
||||
isStarredActive: PropTypes.bool.isRequired,
|
||||
handleStarredButtonClick: PropTypes.func.isRequired,
|
||||
handleStarredButtonClick: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
export default CSSModules(SideNavFilter, styles)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './SnippetTab.styl'
|
||||
import context from 'browser/lib/context'
|
||||
@@ -117,7 +117,7 @@ class SnippetTab extends React.Component {
|
||||
<button styleName='deleteButton'
|
||||
onClick={(e) => this.handleDeleteButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-times'/>
|
||||
<i className='fa fa-times' />
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -27,8 +27,8 @@ const StorageItem = ({
|
||||
onClick={handleButtonClick}
|
||||
onContextMenu={handleContextMenu}
|
||||
>
|
||||
<span styleName={isFolded ?
|
||||
'folderList-item-name--folded' : 'folderList-item-name'
|
||||
<span styleName={isFolded
|
||||
? 'folderList-item-name--folded' : 'folderList-item-name'
|
||||
}
|
||||
style={{borderColor: folderColor}}
|
||||
>
|
||||
@@ -52,7 +52,7 @@ StorageItem.propTypes = {
|
||||
folderName: PropTypes.string.isRequired,
|
||||
folderColor: PropTypes.string,
|
||||
isFolded: PropTypes.bool.isRequired,
|
||||
noteCount: PropTypes.number,
|
||||
noteCount: PropTypes.number
|
||||
}
|
||||
|
||||
export default CSSModules(StorageItem, styles)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './NoteDetail.styl'
|
||||
import MarkdownPreview from 'browser/components/MarkdownPreview'
|
||||
@@ -97,9 +97,7 @@ class NoteDetail extends React.Component {
|
||||
let { note, config } = this.props
|
||||
if (note == null) {
|
||||
return (
|
||||
<div styleName='root'>
|
||||
|
||||
</div>
|
||||
<div styleName='root' />
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import NoteItem from 'browser/components/NoteItem'
|
||||
import moment from 'moment'
|
||||
|
||||
@@ -54,12 +54,11 @@ class NoteList extends React.Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
let { storageMap, notes, index } = this.props
|
||||
let { notes, index } = this.props
|
||||
|
||||
let notesList = notes
|
||||
.slice(0, 10 + 10 * this.state.range)
|
||||
.map((note, _index) => {
|
||||
|
||||
const isActive = (index === _index)
|
||||
const key = `${note.storage}-${note.key}`
|
||||
const dateDisplay = moment(note.updatedAt).fromNow()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './StorageSection.styl'
|
||||
import StorageItem from 'browser/components/StorageItem'
|
||||
|
||||
@@ -2,7 +2,6 @@ import React, { PropTypes } from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { connect, Provider } from 'react-redux'
|
||||
import _ from 'lodash'
|
||||
import ipc from './ipcClient'
|
||||
import store from './store'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './FinderMain.styl'
|
||||
@@ -351,7 +350,7 @@ function refreshData () {
|
||||
|
||||
ReactDOM.render((
|
||||
<Provider store={store}>
|
||||
<Finder/>
|
||||
<Finder />
|
||||
</Provider>
|
||||
), document.getElementById('content'), function () {
|
||||
refreshData()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import CodeMirror from 'codemirror'
|
||||
import _ from 'lodash'
|
||||
|
||||
CodeMirror.modeInfo.push({name: 'Stylus', mime: 'text/x-styl', mode: 'stylus', ext: ['styl'], alias: ['styl']})
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @fileoverview Formatting date string.
|
||||
*/
|
||||
import moment from 'moment';
|
||||
import moment from 'moment'
|
||||
|
||||
/**
|
||||
* @description Return date string. For example, 'Sep.9, 2016 12:00'.
|
||||
* @param {mixed}
|
||||
* @return {string}
|
||||
*/
|
||||
export function getLastUpdated(date) {
|
||||
export function getLastUpdated (date) {
|
||||
const m = moment(date)
|
||||
if (!m.isValid()) {
|
||||
throw Error('Invalid argument.');
|
||||
throw Error('Invalid argument.')
|
||||
}
|
||||
|
||||
return m.format('MMM D, gggg H:mm')
|
||||
|
||||
@@ -58,7 +58,7 @@ md.use(math, {
|
||||
})
|
||||
md.use(require('markdown-it-footnote'))
|
||||
// Override task item
|
||||
md.block.ruler.at('paragraph', function (state, startLine/*, endLine*/) {
|
||||
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
||||
let content, terminate, i, l, token
|
||||
let nextLine = startLine + 1
|
||||
let terminatorRules = state.md.block.ruler.getRules('paragraph')
|
||||
|
||||
@@ -128,8 +128,8 @@ class FolderSelect extends React.Component {
|
||||
}
|
||||
|
||||
nextOption () {
|
||||
let { storages } = this.props
|
||||
let { optionIndex } = this.state
|
||||
let { folders } = this.props
|
||||
|
||||
optionIndex++
|
||||
if (optionIndex >= folders.length) optionIndex = 0
|
||||
@@ -268,7 +268,7 @@ class FolderSelect extends React.Component {
|
||||
<span styleName='idle-label-name-surfix'>in {currentOption.storage.name}</span>
|
||||
</span>
|
||||
</div>
|
||||
<i styleName='idle-caret' className='fa fa-fw fa-caret-down'/>
|
||||
<i styleName='idle-caret' className='fa fa-fw fa-caret-down' />
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ const LastUpdatedString = ({ date }) => {
|
||||
}
|
||||
|
||||
LastUpdatedString.propTypes = {
|
||||
date: PropTypes.string,
|
||||
date: PropTypes.string
|
||||
}
|
||||
|
||||
export default CSSModules(LastUpdatedString, styles)
|
||||
|
||||
@@ -205,7 +205,7 @@ class MarkdownNoteDetail extends React.Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
let { data, config } = this.props
|
||||
let { config } = this.props
|
||||
let { note } = this.state
|
||||
|
||||
return (
|
||||
|
||||
@@ -14,6 +14,7 @@ import SnippetTab from 'browser/components/SnippetTab'
|
||||
import StatusBar from '../StatusBar'
|
||||
import context from 'browser/lib/context'
|
||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import _ from 'lodash'
|
||||
|
||||
function pass (name) {
|
||||
switch (name) {
|
||||
@@ -459,7 +460,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
let { data, config } = this.props
|
||||
let { config } = this.props
|
||||
let { note } = this.state
|
||||
|
||||
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
||||
@@ -538,7 +539,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
<button styleName='info-right-button'
|
||||
onClick={(e) => this.handleContextButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-ellipsis-v'/>
|
||||
<i className='fa fa-ellipsis-v' />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -563,7 +564,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
<button styleName='plusButton'
|
||||
onClick={(e) => this.handleTabPlusButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-plus'/>
|
||||
<i className='fa fa-plus' />
|
||||
</button>
|
||||
</div>
|
||||
{viewList}
|
||||
@@ -577,19 +578,19 @@ class SnippetNoteDetail extends React.Component {
|
||||
? 'Select Syntax...'
|
||||
: this.state.note.snippets[this.state.snippetIndex].mode
|
||||
}
|
||||
<i className='fa fa-caret-down'/>
|
||||
<i className='fa fa-caret-down' />
|
||||
</button>
|
||||
<button
|
||||
onClick={(e) => this.handleIndentTypeButtonClick(e)}
|
||||
>
|
||||
Indent: {config.editor.indentType}
|
||||
<i className='fa fa-caret-down'/>
|
||||
<i className='fa fa-caret-down' />
|
||||
</button>
|
||||
<button
|
||||
onClick={(e) => this.handleIndentSizeButtonClick(e)}
|
||||
>
|
||||
size: {config.editor.indentSize}
|
||||
<i className='fa fa-caret-down'/>
|
||||
<i className='fa fa-caret-down' />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class TagSelect extends React.Component {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
newTag: '',
|
||||
newTag: ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class TagSelect extends React.Component {
|
||||
<button styleName='tag-removeButton'
|
||||
onClick={(e) => this.handleTagRemoveButtonClick(tag)(e)}
|
||||
>
|
||||
<i className='fa fa-times fa-fw tag-removeButton-icon'/>
|
||||
<i className='fa fa-times fa-fw tag-removeButton-icon' />
|
||||
</button>
|
||||
</span>
|
||||
)
|
||||
|
||||
@@ -112,7 +112,7 @@ class Main extends React.Component {
|
||||
ConfigManager.set({ navWidth })
|
||||
dispatch({
|
||||
type: 'SET_NAV_WIDTH',
|
||||
navWidth,
|
||||
navWidth
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -169,7 +169,7 @@ class Main extends React.Component {
|
||||
onMouseDown={(e) => this.handleLeftSlideMouseDown(e)}
|
||||
draggable='false'
|
||||
>
|
||||
<div styleName='slider-hitbox'/>
|
||||
<div styleName='slider-hitbox' />
|
||||
</div>
|
||||
}
|
||||
<div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'}
|
||||
|
||||
@@ -324,8 +324,8 @@ class NoteList extends React.Component {
|
||||
const isDefault = config.listStyle === 'DEFAULT'
|
||||
const isActive = location.query.key === note.storage + '-' + note.key
|
||||
const dateDisplay = moment(
|
||||
config.sortBy === 'CREATED_AT' ?
|
||||
note.createdAt : note.updatedAt
|
||||
config.sortBy === 'CREATED_AT'
|
||||
? note.createdAt : note.updatedAt
|
||||
).fromNow()
|
||||
const key = `${note.storage}-${note.key}`
|
||||
|
||||
@@ -376,7 +376,7 @@ class NoteList extends React.Component {
|
||||
}
|
||||
onClick={(e) => this.handleListStyleButtonClick(e, 'DEFAULT')}
|
||||
>
|
||||
<i className='fa fa-th-large'/>
|
||||
<i className='fa fa-th-large' />
|
||||
</button>
|
||||
<button styleName={config.listStyle === 'SMALL'
|
||||
? 'control-button--active'
|
||||
@@ -384,7 +384,7 @@ class NoteList extends React.Component {
|
||||
}
|
||||
onClick={(e) => this.handleListStyleButtonClick(e, 'SMALL')}
|
||||
>
|
||||
<i className='fa fa-list-ul'/>
|
||||
<i className='fa fa-list-ul' />
|
||||
</button>
|
||||
</div>
|
||||
<div styleName='list'
|
||||
|
||||
@@ -181,7 +181,7 @@ class StorageItem extends React.Component {
|
||||
<button styleName='header-addFolderButton'
|
||||
onClick={(e) => this.handleAddFolderButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-plus'/>
|
||||
<i className='fa fa-plus' />
|
||||
</button>
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import StorageItem from './StorageItem'
|
||||
import SideNavFilter from 'browser/components/SideNavFilter'
|
||||
|
||||
const electron = require('electron')
|
||||
const { remote } = electron
|
||||
|
||||
class SideNav extends React.Component {
|
||||
// TODO: should not use electron stuff v0.7
|
||||
handleMenuButtonClick (e) {
|
||||
@@ -65,7 +62,7 @@ class SideNav extends React.Component {
|
||||
<button styleName='top-menu'
|
||||
onClick={(e) => this.handleMenuButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-navicon fa-fw'/>
|
||||
<i className='fa fa-navicon fa-fw' />
|
||||
<span styleName='top-menu-label'>Menu</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -87,8 +84,8 @@ class SideNav extends React.Component {
|
||||
onClick={(e) => this.handleToggleButtonClick(e)}
|
||||
>
|
||||
{isFolded
|
||||
? <i className='fa fa-angle-double-right'/>
|
||||
: <i className='fa fa-angle-double-left'/>
|
||||
? <i className='fa fa-angle-double-right' />
|
||||
: <i className='fa fa-angle-double-left' />
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -59,9 +59,9 @@ class StatusBar extends React.Component {
|
||||
</button>
|
||||
: null
|
||||
}
|
||||
{/*<button styleName='help'>
|
||||
{/* <button styleName='help'>
|
||||
<i className='fa fa-info-circle' />
|
||||
</button>*/}
|
||||
</button> */}
|
||||
<button styleName='zoom'
|
||||
onClick={(e) => this.handleZoomButtonClick(e)}
|
||||
>
|
||||
|
||||
@@ -10,8 +10,6 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import dataApi from 'browser/main/lib/dataApi'
|
||||
|
||||
const OSX = window.process.platform === 'darwin'
|
||||
const { remote } = require('electron')
|
||||
const { Menu, MenuItem } = remote
|
||||
|
||||
class TopBar extends React.Component {
|
||||
constructor (props) {
|
||||
@@ -71,10 +69,10 @@ class TopBar extends React.Component {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (storage == null) alert('No storage to create a note')
|
||||
if (storage == null) window.alert('No storage to create a note')
|
||||
let folder = _.find(storage.folders, {key: params.folderKey})
|
||||
if (folder == null) folder = storage.folders[0]
|
||||
if (folder == null) alert('No folder to create a note')
|
||||
if (folder == null) window.alert('No folder to create a note')
|
||||
|
||||
return {
|
||||
storage,
|
||||
@@ -262,8 +260,8 @@ class TopBar extends React.Component {
|
||||
<span styleName='control-search-optionList-item-folder-surfix'>in {storage.name}</span>
|
||||
</div>
|
||||
{note.type === 'SNIPPET_NOTE'
|
||||
? <i styleName='control-search-optionList-item-type' className='fa fa-code'/>
|
||||
: <i styleName='control-search-optionList-item-type' className='fa fa-file-text-o'/>
|
||||
? <i styleName='control-search-optionList-item-type' className='fa fa-code' />
|
||||
: <i styleName='control-search-optionList-item-type' className='fa fa-file-text-o' />
|
||||
}
|
||||
{note.title}
|
||||
</div>
|
||||
@@ -276,7 +274,7 @@ class TopBar extends React.Component {
|
||||
>
|
||||
<div styleName='control'>
|
||||
<div styleName='control-search'>
|
||||
<i styleName='control-search-icon' className='fa fa-search fa-fw'/>
|
||||
<i styleName='control-search-icon' className='fa fa-search fa-fw' />
|
||||
<div styleName='control-search-input'
|
||||
onFocus={(e) => this.handleSearchFocus(e)}
|
||||
onBlur={(e) => this.handleSearchBlur(e)}
|
||||
@@ -303,14 +301,14 @@ class TopBar extends React.Component {
|
||||
<button styleName='left-search-clearButton'
|
||||
onClick={(e) => this.handleSearchClearButton(e)}
|
||||
>
|
||||
<i className='fa fa-times'/>
|
||||
<i className='fa fa-times' />
|
||||
</button>
|
||||
}
|
||||
|
||||
</div>
|
||||
<button styleName='control-newPostButton'
|
||||
onClick={(e) => this.handleNewPostButtonClick(e)}>
|
||||
<i className='fa fa-plus'/>
|
||||
<i className='fa fa-plus' />
|
||||
<span styleName='control-newPostButton-tooltip'>
|
||||
Make a Note {OSX ? '⌘' : '^'} + n
|
||||
</span>
|
||||
|
||||
@@ -20,10 +20,10 @@ class ModalBase extends React.Component {
|
||||
render () {
|
||||
return (
|
||||
<div className={'ModalBase' + (this.state.isHidden ? ' hide' : '')}>
|
||||
<div onClick={(e) => this.close(e)} className='modalBack'/>
|
||||
<div onClick={(e) => this.close(e)} className='modalBack' />
|
||||
{this.state.component == null ? null : (
|
||||
<Provider store={store}>
|
||||
<this.state.component {...this.state.componentProps} close={this.close}/>
|
||||
<this.state.component {...this.state.componentProps} close={this.close} />
|
||||
</Provider>
|
||||
)}
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@ class ModalBase extends React.Component {
|
||||
|
||||
let el = document.createElement('div')
|
||||
document.body.appendChild(el)
|
||||
let modalBase = ReactDOM.render(<ModalBase/>, el)
|
||||
let modalBase = ReactDOM.render(<ModalBase />, el)
|
||||
|
||||
export function openModal (component, props) {
|
||||
if (modalBase == null) { return }
|
||||
|
||||
@@ -33,13 +33,13 @@ export default class DeleteArticleModal extends React.Component {
|
||||
render () {
|
||||
return (
|
||||
<div className='DeleteArticleModal modal'>
|
||||
<div className='title'><i className='fa fa-fw fa-trash'/> Delete an article.</div>
|
||||
<div className='title'><i className='fa fa-fw fa-trash' /> Delete an article.</div>
|
||||
|
||||
<div className='message'>Do you really want to delete?</div>
|
||||
|
||||
<div className='control'>
|
||||
<button ref='no' onClick={(e) => this.handleNoButtonClick(e)}><i className='fa fa-fw fa-close'/> No</button>
|
||||
<button ref='yes' onClick={(e) => this.handleYesButtonClick(e)} className='danger'><i className='fa fa-fw fa-check'/> Yes</button>
|
||||
<button ref='no' onClick={(e) => this.handleNoButtonClick(e)}><i className='fa fa-fw fa-close' /> No</button>
|
||||
<button ref='yes' onClick={(e) => this.handleYesButtonClick(e)} className='danger'><i className='fa fa-fw fa-check' /> Yes</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './InitModal.styl'
|
||||
import dataApi from 'browser/main/lib/dataApi'
|
||||
import store from 'browser/main/store'
|
||||
import { hashHistory } from 'react-router'
|
||||
import _ from 'lodash'
|
||||
import keygen from 'browser/lib/keygen'
|
||||
|
||||
const CSON = require('@rokt33r/season')
|
||||
const path = require('path')
|
||||
@@ -197,7 +196,7 @@ class InitModal extends React.Component {
|
||||
render () {
|
||||
if (this.state.isLoading) {
|
||||
return <div styleName='root--loading'>
|
||||
<i styleName='spinner' className='fa fa-spin fa-spinner'/>
|
||||
<i styleName='spinner' className='fa fa-spin fa-spinner' />
|
||||
<div styleName='loadingMessage'>Preparing initialization...</div>
|
||||
</div>
|
||||
}
|
||||
@@ -235,7 +234,7 @@ class InitModal extends React.Component {
|
||||
|
||||
{this.state.legacyStorageExists &&
|
||||
<div styleName='body-migration'>
|
||||
<label><input type='checkbox' checked={this.state.migrationRequested} onChange={(e) => this.handleMigrationRequestedChange(e)}/> Migrate old data from the legacy app v0.5</label>
|
||||
<label><input type='checkbox' checked={this.state.migrationRequested} onChange={(e) => this.handleMigrationRequestedChange(e)} /> Migrate old data from the legacy app v0.5</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -247,7 +246,7 @@ class InitModal extends React.Component {
|
||||
>
|
||||
{this.state.isSending
|
||||
? <span>
|
||||
<i className='fa fa-spin fa-spinner'/> Loading...
|
||||
<i className='fa fa-spin fa-spinner' /> Loading...
|
||||
</span>
|
||||
: 'Let\'s Go!'
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './NewNoteModal.styl'
|
||||
import dataApi from 'browser/main/lib/dataApi'
|
||||
@@ -114,8 +114,8 @@ class NewNoteModal extends React.Component {
|
||||
>
|
||||
<i styleName='control-button-icon'
|
||||
className='fa fa-file-text-o'
|
||||
/><br/>
|
||||
<span styleName='control-button-label'>Markdown Note</span><br/>
|
||||
/><br />
|
||||
<span styleName='control-button-label'>Markdown Note</span><br />
|
||||
<span styleName='control-button-description'>It is good for any type of documents. Check List, Code block and Latex block are available.</span>
|
||||
</button>
|
||||
|
||||
@@ -126,14 +126,14 @@ class NewNoteModal extends React.Component {
|
||||
>
|
||||
<i styleName='control-button-icon'
|
||||
className='fa fa-code'
|
||||
/><br/>
|
||||
<span styleName='control-button-label'>Snippet Note</span><br/>
|
||||
/><br />
|
||||
<span styleName='control-button-label'>Snippet Note</span><br />
|
||||
<span styleName='control-button-description'>This format is specialized on managing snippets like Gist. Multiple snippets can be grouped as a note.
|
||||
</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div styleName='description'><i className='fa fa-arrows-h'/> Tab to switch format</div>
|
||||
<div styleName='description'><i className='fa fa-arrows-h' /> Tab to switch format</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -7,8 +7,6 @@ import store from 'browser/main/store'
|
||||
const electron = require('electron')
|
||||
const ipc = electron.ipcRenderer
|
||||
|
||||
const OSX = global.process.platform === 'darwin'
|
||||
|
||||
class HotkeyTab extends React.Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
@@ -150,7 +148,7 @@ class HotkeyTab extends React.Component {
|
||||
}
|
||||
|
||||
HotkeyTab.propTypes = {
|
||||
dispatch: PropTypes.func,
|
||||
dispatch: PropTypes.func
|
||||
}
|
||||
|
||||
export default CSSModules(HotkeyTab, styles)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import React from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './InfoTab.styl'
|
||||
|
||||
@@ -26,7 +26,7 @@ class InfoTab extends React.Component {
|
||||
|
||||
<div styleName='top'>
|
||||
<div styleName='icon-space'>
|
||||
<img styleName='icon' src='../resources/app.png' width='92' height='92'/>
|
||||
<img styleName='icon' src='../resources/app.png' width='92' height='92' />
|
||||
<div styleName='icon-right'>
|
||||
<div styleName='appId'>Boostnote {appVersion}</div>
|
||||
<div styleName='description'>
|
||||
@@ -34,7 +34,7 @@ class InfoTab extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div styleName='clear'></div>
|
||||
<div styleName='clear' />
|
||||
<div styleName='madeBy'>Made by
|
||||
<a href='http://maisin.co/'
|
||||
onClick={(e) => this.handleLinkClick(e)}
|
||||
|
||||
@@ -106,7 +106,10 @@ class UnstyledFolderItem extends React.Component {
|
||||
const popover = { position: 'absolute', zIndex: 2 }
|
||||
const cover = {
|
||||
position: 'fixed',
|
||||
top: 0, right: 0, bottom: 0, left: 0
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
}
|
||||
const pickerStyle = Object.assign({}, {
|
||||
position: 'absolute'
|
||||
@@ -137,7 +140,7 @@ class UnstyledFolderItem extends React.Component {
|
||||
</div>
|
||||
: null
|
||||
}
|
||||
<i className='fa fa-square'/>
|
||||
<i className='fa fa-square' />
|
||||
</button>
|
||||
<input styleName='folderList-item-left-nameInput'
|
||||
value={this.state.folder.name}
|
||||
@@ -368,17 +371,17 @@ class StorageItem extends React.Component {
|
||||
: <div styleName='header-label'
|
||||
onClick={(e) => this.handleLabelClick(e)}
|
||||
>
|
||||
<i className='fa fa-folder-open'/>
|
||||
<i className='fa fa-folder-open' />
|
||||
{storage.name}
|
||||
<span styleName='header-label-path'>({storage.path})</span>
|
||||
<i styleName='header-label-editButton' className='fa fa-pencil'/>
|
||||
<i styleName='header-label-editButton' className='fa fa-pencil' />
|
||||
</div>
|
||||
}
|
||||
<div styleName='header-control'>
|
||||
<button styleName='header-control-button'
|
||||
onClick={(e) => this.handleNewFolderButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-plus'/>
|
||||
<i className='fa fa-plus' />
|
||||
<span styleName='header-control-button-tooltip'
|
||||
style={{left: -20}}
|
||||
>Add Folder</span>
|
||||
@@ -386,7 +389,7 @@ class StorageItem extends React.Component {
|
||||
<button styleName='header-control-button'
|
||||
onClick={(e) => this.handleExternalButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-external-link'/>
|
||||
<i className='fa fa-external-link' />
|
||||
<span styleName='header-control-button-tooltip'
|
||||
style={{left: -50}}
|
||||
>Open Storage folder</span>
|
||||
@@ -394,7 +397,7 @@ class StorageItem extends React.Component {
|
||||
<button styleName='header-control-button'
|
||||
onClick={(e) => this.handleUnlinkButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-unlink'/>
|
||||
<i className='fa fa-unlink' />
|
||||
<span styleName='header-control-button-tooltip'
|
||||
style={{left: -10}}
|
||||
>Unlink</span>
|
||||
|
||||
@@ -72,7 +72,7 @@ class StoragesTab extends React.Component {
|
||||
<button styleName='list-control-addStorageButton'
|
||||
onClick={(e) => this.handleAddStorageButton(e)}
|
||||
>
|
||||
<i className='fa fa-plus'/> Add Storage
|
||||
<i className='fa fa-plus' /> Add Storage
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,9 +5,6 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import store from 'browser/main/store'
|
||||
import consts from 'browser/lib/consts'
|
||||
|
||||
const electron = require('electron')
|
||||
const ipc = electron.ipcRenderer
|
||||
|
||||
const OSX = global.process.platform === 'darwin'
|
||||
|
||||
class UiTab extends React.Component {
|
||||
|
||||
@@ -43,7 +43,7 @@ class Preferences extends React.Component {
|
||||
|
||||
switch (this.state.currentTab) {
|
||||
case 'INFO':
|
||||
return <InfoTab/>
|
||||
return <InfoTab />
|
||||
case 'HOTKEY':
|
||||
return (
|
||||
<HotkeyTab
|
||||
@@ -86,9 +86,9 @@ class Preferences extends React.Component {
|
||||
|
||||
let tabs = [
|
||||
{target: 'STORAGES', label: 'Storages'},
|
||||
{target: 'HOTKEY', label: 'Hotkey'},
|
||||
{target: 'UI', label: 'UI'},
|
||||
{target: 'INFO', label: 'Info'}
|
||||
{target: 'HOTKEY', label: 'Hotkey'},
|
||||
{target: 'UI', label: 'UI'},
|
||||
{target: 'INFO', label: 'Info'}
|
||||
]
|
||||
|
||||
let navButtons = tabs.map((tab) => {
|
||||
|
||||
@@ -5,16 +5,16 @@ const packager = require('electron-packager')
|
||||
const WIN = process.platform === 'win32'
|
||||
|
||||
module.exports = function (grunt) {
|
||||
var auth_code
|
||||
var authCode
|
||||
try {
|
||||
auth_code = grunt.file.readJSON('secret/auth_code.json')
|
||||
authCode = grunt.file.readJSON('secret/auth_code.json')
|
||||
} catch (e) {
|
||||
if (e.origError.code === 'ENOENT') {
|
||||
console.warn('secret/auth_code.json is not found. CodeSigning is not available.')
|
||||
}
|
||||
}
|
||||
const OSX_COMMON_NAME = auth_code != null ? auth_code.OSX_COMMON_NAME : ''
|
||||
const WIN_CERT_PASSWORD = auth_code != null ? auth_code.WIN_CERT_PASSWORD : ''
|
||||
const OSX_COMMON_NAME = authCode != null ? authCode.OSX_COMMON_NAME : ''
|
||||
const WIN_CERT_PASSWORD = authCode != null ? authCode.WIN_CERT_PASSWORD : ''
|
||||
|
||||
var initConfig = {
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
const electron = require('electron')
|
||||
const app = electron.app
|
||||
const Menu = electron.Menu
|
||||
|
||||
var finderWindow = null
|
||||
|
||||
app.on('ready', function () {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.hide()
|
||||
}
|
||||
|
||||
// var template = require('./finder-menu')
|
||||
// var menu = Menu.buildFromTemplate(template)
|
||||
// Menu.setApplicationMenu(menu)
|
||||
|
||||
finderWindow = require('./finder-window')
|
||||
})
|
||||
|
||||
module.exports = app
|
||||
|
||||
@@ -2,7 +2,6 @@ const electron = require('electron')
|
||||
const app = electron.app
|
||||
const Menu = electron.Menu
|
||||
const ipc = electron.ipcMain
|
||||
const autoUpdater = electron.autoUpdater
|
||||
const path = require('path')
|
||||
const ChildProcess = require('child_process')
|
||||
const _ = require('lodash')
|
||||
@@ -11,9 +10,8 @@ const GhReleases = require('electron-gh-releases')
|
||||
var ipcServer = null
|
||||
|
||||
var mainWindow = null
|
||||
var finderWindow = null
|
||||
|
||||
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
||||
var shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
|
||||
if (mainWindow) {
|
||||
if (process.platform === 'win32') {
|
||||
mainWindow.minimize()
|
||||
@@ -26,12 +24,8 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory)
|
||||
|
||||
if (shouldQuit) {
|
||||
app.quit()
|
||||
return
|
||||
}
|
||||
|
||||
var version = app.getVersion()
|
||||
var versionText = (version == null || version.length === 0) ? 'DEV version' : 'v' + version
|
||||
|
||||
var isUpdateReady = false
|
||||
|
||||
var ghReleasesOpts = {
|
||||
@@ -108,14 +102,9 @@ app.on('ready', function () {
|
||||
Menu.setApplicationMenu(menu)
|
||||
break
|
||||
case 'win32':
|
||||
finderWindow = require('./finder-window')
|
||||
mainWindow.setMenu(menu)
|
||||
break
|
||||
case 'linux':
|
||||
// Finder is available on cinnamon only.
|
||||
if (process.env.DESKTOP_SESSION === 'cinnamon') {
|
||||
finderWindow = require('./finder-window')
|
||||
}
|
||||
Menu.setApplicationMenu(menu)
|
||||
mainWindow.setMenu(menu)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
"hot": "electron ./index.js --hot",
|
||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
||||
"compile": "grunt compile",
|
||||
"test": "PWD=$(pwd) NODE_ENV=test ava"
|
||||
"test": "PWD=$(pwd) NODE_ENV=test ava",
|
||||
"fix": "npm run lint --fix",
|
||||
"lint": "eslint ./**/*.js"
|
||||
},
|
||||
"config": {
|
||||
"electron-version": "1.2.8"
|
||||
@@ -87,6 +89,9 @@
|
||||
"dom-storage": "^2.0.2",
|
||||
"electron-packager": "^6.0.0",
|
||||
"electron-prebuilt": "^1.2.8",
|
||||
"eslint": "^3.13.1",
|
||||
"eslint-config-standard": "^6.2.1",
|
||||
"eslint-config-standard-jsx": "^3.2.0",
|
||||
"faker": "^3.1.0",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-electron-installer": "^1.2.0",
|
||||
@@ -119,7 +124,7 @@
|
||||
},
|
||||
"ava": {
|
||||
"files": [
|
||||
"tests/**/*.js"
|
||||
"tests/**/*-test.js"
|
||||
],
|
||||
"require": [
|
||||
"babel-register"
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<h5 align="center">Built with Electron, React + Redux, Webpack and CSSModules</h5>
|
||||
<h1> </h1>
|
||||
|
||||
[](https://travis-ci.org/BoostIO/Boostnote)
|
||||
|
||||
> We launched our [Boostnote store](https://boostnote.paintory.com/)!! :tada: Also, you can support us via [Patreon](https://www.patreon.com/boostnote) and [Open collective](https://opencollective.com/boostnote)!
|
||||
|
||||

|
||||
|
||||
@@ -36,7 +36,7 @@ test.beforeEach((t) => {
|
||||
})
|
||||
|
||||
test.serial('Initialize All Storages', (t) => {
|
||||
const { v1StorageData, legacyStorageData, emptyStorageData } = t.context
|
||||
const { v1StorageData, legacyStorageData } = t.context
|
||||
return Promise.resolve()
|
||||
.then(function test () {
|
||||
return init()
|
||||
|
||||
@@ -12,7 +12,6 @@ const TestDummy = require('../fixtures/TestDummy')
|
||||
const sander = require('sander')
|
||||
const os = require('os')
|
||||
const CSON = require('@rokt33r/season')
|
||||
const faker = require('faker')
|
||||
|
||||
const storagePath = path.join(os.tmpdir(), 'test/move-note')
|
||||
const storagePath2 = path.join(os.tmpdir(), 'test/move-note2')
|
||||
Reference in New Issue
Block a user