1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

hide save button

This commit is contained in:
Rokt33r
2016-01-06 20:33:13 +09:00
parent 9632bf5b93
commit 8e70e20f9e
10 changed files with 80 additions and 63 deletions

View File

@@ -35,7 +35,7 @@ export default class CodeEditor extends React.Component {
name: 'Focus title', name: 'Focus title',
bindKey: {win: 'Esc', mac: 'Esc'}, bindKey: {win: 'Esc', mac: 'Esc'},
exec: function (editor, e) { exec: function (editor, e) {
remote.getCurrentWebContents().send('detail-edit') remote.getCurrentWebContents().send('list-focus')
}, },
readOnly: true readOnly: true
}) })

View File

@@ -8,6 +8,8 @@ const path = require('path')
let defaultContent = 'Boost is a brand new note App for programmers.\n\n> 下に日本語版があります。\n\n# \u25CEfeature\n\nBoost has some preponderant functions for efficient engineer\'s task.See some part of it.\n\n1. classify information by\u300CFolders\u300D\n2. deal with great variety of syntax\n3. Finder function\n\n\uFF0A\u3000\uFF0A\u3000\uFF0A\u3000\uFF0A\n\n# 1. classify information by \u300CFolders\u300D- access the information you needed easily.\n\n\u300CFolders\u300D which on the left side bar. Press plus button now. flexible way of classification.\n- Create Folder every language or flamework\n- Make Folder for your own casual memos\n\n# 2. Deal with a great variety of syntax \u2013 instead of your brain\nSave handy all information related with programming\n- Use markdown and gather api specification\n- Well using module and snippet\n\nSave them on Boost, you don\'t need to rewrite or re-search same code again.\n\n# 3. Load Finder function \u2013 now you don\'t need to spell command by hand typing.\n\n**Shift +ctrl+tab** press buttons at same time.\nThen, the window will show up for search Boost contents that instant.\n\nUsing cursor key to chose, press enter, cmd+v to paste and\u2026 please check it out by your own eye.\n\n- Such command spl or linux which programmers often use but troublesome to hand type\n\n- (Phrases commonly used for e-mail or customer support)\n\nWe support preponderant efficiency\n\n\uFF0A\u3000\uFF0A\u3000\uFF0A\u3000\uFF0A\n\n## \u25CEfor more information\nFrequently updated with this blog ( http:\/\/blog-jp.b00st.io )\n\nHave wonderful programmer life!\n\n## Hack your memory**\n\n\n\n# 日本語版\n\n**Boost**は全く新しいエンジニアライクのノートアプリです。\n\n# ◎特徴\nBoostはエンジニアの仕事を圧倒的に効率化するいくつかの機能を備えています。\nその一部をご紹介します。\n1. Folderで情報を分類\n2. 豊富なsyantaxに対応\n3. Finder機能\n\n\n   \n\n# 1. Folderで情報を分類、欲しい情報にすぐアクセス。\n左側のバーに存在する「Folders」。\n今すぐプラスボタンを押しましょう。\n分類の仕方も自由自在です。\n- 言語やフレームワークごとにFolderを作成\n- 自分用のカジュアルなメモをまとめる場としてFolderを作成\n\n\n# 2. 豊富なsyntaxに対応、自分の脳の代わりに。\nプログラミングに関する情報を全て、手軽に保存しましょう。\n- mdで、apiの仕様をまとめる\n- よく使うモジュールやスニペット\n\nBoostに保存しておくことで、何度も同じコードを書いたり調べたりする必要がなくなります。\n\n# 3. Finder機能を搭載、もうコマンドを手打ちする必要はありません。\n**「shift+ctrl+tab」** を同時に押してみてください。\nここでは、一瞬でBoostの中身を検索するウィンドウを表示させることができます。\n\n矢印キーで選択、Enterを押し、cmd+vでペーストすると…続きはご自身の目でお確かめください。\n- sqlやlinux等の、よく使うが手打ちが面倒なコマンド\n- (メールやカスタマーサポート等でよく使うフレーズ)\n\n私たちは、圧倒的な効率性を支援します。\n\   \n\n\n## ◎詳しくは\nこちらのブログ( http://blog-jp.b00st.io )にて随時更新しています。\n\nそれでは素晴らしいエンジニアライフを\n\n## Hack your memory' let defaultContent = 'Boost is a brand new note App for programmers.\n\n> 下に日本語版があります。\n\n# \u25CEfeature\n\nBoost has some preponderant functions for efficient engineer\'s task.See some part of it.\n\n1. classify information by\u300CFolders\u300D\n2. deal with great variety of syntax\n3. Finder function\n\n\uFF0A\u3000\uFF0A\u3000\uFF0A\u3000\uFF0A\n\n# 1. classify information by \u300CFolders\u300D- access the information you needed easily.\n\n\u300CFolders\u300D which on the left side bar. Press plus button now. flexible way of classification.\n- Create Folder every language or flamework\n- Make Folder for your own casual memos\n\n# 2. Deal with a great variety of syntax \u2013 instead of your brain\nSave handy all information related with programming\n- Use markdown and gather api specification\n- Well using module and snippet\n\nSave them on Boost, you don\'t need to rewrite or re-search same code again.\n\n# 3. Load Finder function \u2013 now you don\'t need to spell command by hand typing.\n\n**Shift +ctrl+tab** press buttons at same time.\nThen, the window will show up for search Boost contents that instant.\n\nUsing cursor key to chose, press enter, cmd+v to paste and\u2026 please check it out by your own eye.\n\n- Such command spl or linux which programmers often use but troublesome to hand type\n\n- (Phrases commonly used for e-mail or customer support)\n\nWe support preponderant efficiency\n\n\uFF0A\u3000\uFF0A\u3000\uFF0A\u3000\uFF0A\n\n## \u25CEfor more information\nFrequently updated with this blog ( http:\/\/blog-jp.b00st.io )\n\nHave wonderful programmer life!\n\n## Hack your memory**\n\n\n\n# 日本語版\n\n**Boost**は全く新しいエンジニアライクのノートアプリです。\n\n# ◎特徴\nBoostはエンジニアの仕事を圧倒的に効率化するいくつかの機能を備えています。\nその一部をご紹介します。\n1. Folderで情報を分類\n2. 豊富なsyantaxに対応\n3. Finder機能\n\n\n   \n\n# 1. Folderで情報を分類、欲しい情報にすぐアクセス。\n左側のバーに存在する「Folders」。\n今すぐプラスボタンを押しましょう。\n分類の仕方も自由自在です。\n- 言語やフレームワークごとにFolderを作成\n- 自分用のカジュアルなメモをまとめる場としてFolderを作成\n\n\n# 2. 豊富なsyntaxに対応、自分の脳の代わりに。\nプログラミングに関する情報を全て、手軽に保存しましょう。\n- mdで、apiの仕様をまとめる\n- よく使うモジュールやスニペット\n\nBoostに保存しておくことで、何度も同じコードを書いたり調べたりする必要がなくなります。\n\n# 3. Finder機能を搭載、もうコマンドを手打ちする必要はありません。\n**「shift+ctrl+tab」** を同時に押してみてください。\nここでは、一瞬でBoostの中身を検索するウィンドウを表示させることができます。\n\n矢印キーで選択、Enterを押し、cmd+vでペーストすると…続きはご自身の目でお確かめください。\n- sqlやlinux等の、よく使うが手打ちが面倒なコマンド\n- (メールやカスタマーサポート等でよく使うフレーズ)\n\n私たちは、圧倒的な効率性を支援します。\n\   \n\n\n## ◎詳しくは\nこちらのブログ( http://blog-jp.b00st.io )にて随時更新しています。\n\nそれでは素晴らしいエンジニアライフを\n\n## Hack your memory'
let data = null
function getLocalPath () { function getLocalPath () {
return path.join(remote.app.getPath('userData'), 'local.json') return path.join(remote.app.getPath('userData'), 'local.json')
} }
@@ -108,7 +110,8 @@ export function init () {
} }
export function getData () { export function getData () {
return jetpack.read(getLocalPath(), 'json') if (data == null) data = jetpack.read(getLocalPath(), 'json')
return data
} }
export function setArticles (articles) { export function setArticles (articles) {

View File

@@ -4,9 +4,10 @@ import moment from 'moment'
import _ from 'lodash' import _ from 'lodash'
import { import {
switchFolder, switchFolder,
cacheArticle, updateArticle,
saveArticle, // cacheArticle,
uncacheArticle // saveArticle,
// uncacheArticle
} from '../../actions' } from '../../actions'
import linkState from 'browser/lib/linkState' import linkState from 'browser/lib/linkState'
import TagSelect from 'browser/components/TagSelect' import TagSelect from 'browser/components/TagSelect'
@@ -20,19 +21,19 @@ const ipc = electron.ipcRenderer
const remote = electron.remote const remote = electron.remote
const { Menu, MenuItem } = remote const { Menu, MenuItem } = remote
const othersMenu = new Menu() // const othersMenu = new Menu()
othersMenu.append(new MenuItem({ // othersMenu.append(new MenuItem({
label: 'Delete Post', // label: 'Delete Post',
click: function () { // click: function () {
remote.getCurrentWebContents().send('detail-delete') // remote.getCurrentWebContents().send('detail-delete')
} // }
})) // }))
othersMenu.append(new MenuItem({ // othersMenu.append(new MenuItem({
label: 'Discard Change', // label: 'Discard Change',
click: function (item) { // click: function (item) {
remote.getCurrentWebContents().send('detail-uncache') // remote.getCurrentWebContents().send('detail-uncache')
} // }
})) // }))
const BRAND_COLOR = '#18AF90' const BRAND_COLOR = '#18AF90'
const OSX = global.process.platform === 'darwin' const OSX = global.process.platform === 'darwin'
@@ -116,7 +117,7 @@ export default class ArticleDetail extends React.Component {
} }
this.editHandler = e => { this.editHandler = e => {
if (isModalOpen()) return true if (isModalOpen()) return true
this.editArticle() this.refs.editor.switchEditMode()
} }
this.state = { this.state = {
@@ -134,7 +135,7 @@ export default class ArticleDetail extends React.Component {
e.stopPropagation() e.stopPropagation()
} }
ipc.on('detail-save', this.saveHandler) // ipc.on('detail-save', this.saveHandler)
ipc.on('detail-delete', this.deleteHandler) ipc.on('detail-delete', this.deleteHandler)
ipc.on('detail-uncache', this.uncacheHandler) ipc.on('detail-uncache', this.uncacheHandler)
ipc.on('detail-toggle-preview', this.togglePreviewHandler) ipc.on('detail-toggle-preview', this.togglePreviewHandler)
@@ -144,11 +145,11 @@ export default class ArticleDetail extends React.Component {
componentWillUnmount () { componentWillUnmount () {
clearInterval(this.refreshTimer) clearInterval(this.refreshTimer)
ipc.removeListener('detail-save', this.saveHandler) // ipc.removeListener('detail-save', this.saveHandler)
ipc.removeListener('detail-delete', this.deleteHandler) ipc.removeListener('detail-delete', this.deleteHandler)
ipc.removeListener('detail-uncache', this.uncacheHandler) ipc.removeListener('detail-uncache', this.uncacheHandler)
ipc.removeListener('detail-toggle-preview', this.togglePreviewHandler) ipc.removeListener('detail-toggle-preview', this.togglePreviewHandler)
ipc.removeListener('detail-on', this.editHandler) ipc.removeListener('detail-edit', this.editHandler)
} }
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
@@ -169,9 +170,17 @@ export default class ArticleDetail extends React.Component {
} }
cacheArticle () { cacheArticle () {
let { dispatch } = this.props let { dispatch, status, folders } = this.props
dispatch(cacheArticle(this.props.activeArticle.key, this.state.article)) let input = Object.assign({}, this.props.activeArticle.key, this.state.article, {updatedAt: new Date()})
dispatch(updateArticle(input))
let targetFolderKey = this.state.article.FolderKey
if (status.targetFolders.length > 0) {
let targetFolder = _.findWhere(folders, {key: targetFolderKey})
dispatch(switchFolder(targetFolder.name))
}
} }
renderEmpty () { renderEmpty () {
@@ -185,19 +194,18 @@ export default class ArticleDetail extends React.Component {
} }
handleSaveButtonClick (e) { handleSaveButtonClick (e) {
let { dispatch, folders, status } = this.props // let { dispatch, folders, status } = this.props
let targetFolderKey = this.state.article.FolderKey // let targetFolderKey = this.state.article.FolderKey
dispatch(saveArticle(this.props.activeArticle.key, this.state.article), true) // dispatch(saveArticle(this.props.activeArticle.key, this.state.article), true)
if (status.targetFolders.length > 0) { // if (status.targetFolders.length > 0) {
let targetFolder = _.findWhere(folders, {key: targetFolderKey}) // let targetFolder = _.findWhere(folders, {key: targetFolderKey})
dispatch(switchFolder(targetFolder.name)) // dispatch(switchFolder(targetFolder.name))
} // }
} }
handleOthersButtonClick (e) { handleOthersButtonClick (e) {
let size = remote.getCurrentWindow().getSize() this.deleteHandler()
othersMenu.popup(size[0] - 150, 100)
} }
handleFolderKeyChange (e) { handleFolderKeyChange (e) {
@@ -293,7 +301,7 @@ export default class ArticleDetail extends React.Component {
let isUnsaved = !!_.findWhere(modified, {key: activeArticle.key}) let isUnsaved = !!_.findWhere(modified, {key: activeArticle.key})
return ( return (
<div className='ArticleDetail'> <div tabIndex='4' className='ArticleDetail'>
<div className='ArticleDetail-info'> <div className='ArticleDetail-info'>
<div className='ArticleDetail-info-row'> <div className='ArticleDetail-info-row'>
<select <select
@@ -312,7 +320,7 @@ export default class ArticleDetail extends React.Component {
/> />
<div className='ArticleDetail-info-control'> <div className='ArticleDetail-info-control'>
<div className={'ArticleDetail-info-control-save' + (!isUnsaved ? ' hide' : '')}> {/*<div className={'ArticleDetail-info-control-save' + (!isUnsaved ? ' hide' : '')}>
<button <button
onClick={e => this.handleSaveButtonClick(e)} onClick={e => this.handleSaveButtonClick(e)}
className='ArticleDetail-info-control-save-button' className='ArticleDetail-info-control-save-button'
@@ -321,15 +329,16 @@ export default class ArticleDetail extends React.Component {
<i className='fa fa-fw fa-save'/>&nbsp;Save <i className='fa fa-fw fa-save'/>&nbsp;Save
<span className='tooltip' children={`Save Post (${OSX ? '⌘' : '^'} + S)`}/> <span className='tooltip' children={`Save Post (${OSX ? '⌘' : '^'} + S)`}/>
</button> </button>
</div> </div>*/}
<ShareButton <ShareButton
article={activeArticle} article={activeArticle}
user={user} user={user}
/> />
<button onClick={e => this.handleOthersButtonClick(e)}> <button className='ArticleDetail-info-control-delete-button' onClick={e => this.handleOthersButtonClick(e)}>
<i className='fa fa-fw fa-angle-down'/> <i className='fa fa-fw fa-trash'/>
<span className='tooltip' children={`Delete Post (^ + Del)`}/>
</button> </button>
</div> </div>
</div> </div>

View File

@@ -185,7 +185,7 @@ export default class ArticleList extends React.Component {
}) })
return ( return (
<div tabIndex='1' onKeyDown={e => this.handleArticleListKeyDown(e)} className='ArticleList'> <div tabIndex='3' onKeyDown={e => this.handleArticleListKeyDown(e)} className='ArticleList'>
{articleElements} {articleElements}
</div> </div>
) )

View File

@@ -160,7 +160,7 @@ export default class ArticleNavigator extends React.Component {
}) })
return ( return (
<div className='ArticleNavigator'> <div tabIndex='1' className='ArticleNavigator'>
<div className='userInfo'> <div className='userInfo'>
<div className='userProfileName'>{user.name}</div> <div className='userProfileName'>{user.name}</div>
<div className='userName'>localStorage</div> <div className='userName'>localStorage</div>
@@ -173,7 +173,7 @@ export default class ArticleNavigator extends React.Component {
</div> </div>
<div className={'ArticleNavigator-unsaved' + (hasModified ? '' : ' hide')}> {/*<div className={'ArticleNavigator-unsaved' + (hasModified ? '' : ' hide')}>
<div className='ArticleNavigator-unsaved-header'>Work in progress</div> <div className='ArticleNavigator-unsaved-header'>Work in progress</div>
<div className='ArticleNavigator-unsaved-list'> <div className='ArticleNavigator-unsaved-list'>
{modifiedElements} {modifiedElements}
@@ -181,9 +181,9 @@ export default class ArticleNavigator extends React.Component {
<div className='ArticleNavigator-unsaved-control'> <div className='ArticleNavigator-unsaved-control'>
<button onClick={e => this.handleSaveAllClick()} className='ArticleNavigator-unsaved-control-save-all-button' disabled={modifiedElements.length === 0}>Save all</button> <button onClick={e => this.handleSaveAllClick()} className='ArticleNavigator-unsaved-control-save-all-button' disabled={modifiedElements.length === 0}>Save all</button>
</div> </div>
</div> </div>*/}
<div className={'ArticleNavigator-folders' + (hasModified ? '' : ' expand')}> <div className={'ArticleNavigator-folders expand'}>
<div className='ArticleNavigator-folders-header'> <div className='ArticleNavigator-folders-header'>
<div className='title'>Folders</div> <div className='title'>Folders</div>
<button onClick={e => this.handleNewFolderButton(e)} className='addBtn'> <button onClick={e => this.handleNewFolderButton(e)} className='addBtn'>

View File

@@ -79,7 +79,7 @@ export default class ArticleTopBar extends React.Component {
} }
document.addEventListener('click', this.hideLinksDropdown) document.addEventListener('click', this.hideLinksDropdown)
ipc.on('top-save-all', this.saveAllHandler) // ipc.on('top-save-all', this.saveAllHandler)
ipc.on('top-focus-search', this.focusSearchHandler) ipc.on('top-focus-search', this.focusSearchHandler)
ipc.on('top-new-post', this.newPostHandler) ipc.on('top-new-post', this.newPostHandler)
} }
@@ -88,7 +88,7 @@ export default class ArticleTopBar extends React.Component {
document.removeEventListener('click', this.hideLinksDropdown) document.removeEventListener('click', this.hideLinksDropdown)
this.linksButton.removeEventListener('click', this.showLinksDropdown()) this.linksButton.removeEventListener('click', this.showLinksDropdown())
ipc.removeListener('top-save-all', this.saveAllHandler) // ipc.removeListener('top-save-all', this.saveAllHandler)
ipc.removeListener('top-focus-search', this.focusSearchHandler) ipc.removeListener('top-focus-search', this.focusSearchHandler)
ipc.removeListener('top-new-post', this.newPostHandler) ipc.removeListener('top-new-post', this.newPostHandler)
} }
@@ -168,7 +168,7 @@ export default class ArticleTopBar extends React.Component {
render () { render () {
let { status } = this.props let { status } = this.props
return ( return (
<div className='ArticleTopBar'> <div tabIndex='2' className='ArticleTopBar'>
<div className='ArticleTopBar-left'> <div className='ArticleTopBar-left'>
<div className='ArticleTopBar-left-search'> <div className='ArticleTopBar-left-search'>
<i className='fa fa-search fa-fw' /> <i className='fa fa-search fa-fw' />

View File

@@ -84,6 +84,9 @@ infoButton()
float left float left
&:nth-child(1) .tooltip &:nth-child(1) .tooltip
margin-left -65px margin-left -65px
.ArticleDetail-info-control-delete-button
.tooltip
right 5px
.ArticleDetail-info-control-save .ArticleDetail-info-control-save
float left float left
width 80px width 80px

View File

@@ -92,6 +92,8 @@ articleCount = #999
width 151px width 151px
line-height 33px line-height 33px
overflow ellipsis overflow ellipsis
.ArticleNavigator-unsaved-list-item-label-untitled
color inactiveTextColor
.ArticleNavigator-unsaved-list-item-discard-button .ArticleNavigator-unsaved-list-item-discard-button
float right float right
width 33px width 33px

0
katex.min.css vendored
View File

View File

@@ -58,23 +58,23 @@ var file = {
mainWindow.webContents.send('nav-new-folder') mainWindow.webContents.send('nav-new-folder')
} }
}, },
{ // {
type: 'separator' // type: 'separator'
}, // },
{ // {
label: 'Save Post', // label: 'Save Post',
accelerator: OSX ? 'Command + S' : 'Control + S', // accelerator: OSX ? 'Command + S' : 'Control + S',
click: function () { // click: function () {
mainWindow.webContents.send('detail-save') // mainWindow.webContents.send('detail-save')
} // }
}, // },
{ // {
label: 'Save All Posts', // label: 'Save All Posts',
accelerator: OSX ? 'Command + Shift + S' : 'Control + Shift + S', // accelerator: OSX ? 'Command + Shift + S' : 'Control + Shift + S',
click: function () { // click: function () {
mainWindow.webContents.send('top-save-all') // mainWindow.webContents.send('top-save-all')
} // }
}, // },
{ {
type: 'separator' type: 'separator'
}, },