mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Merge pull request #1458 from cyalins/cyalins-patch-1
Improved overall wording and grammar of preferences
This commit is contained in:
@@ -2,7 +2,7 @@ const { remote } = require('electron')
|
|||||||
const { Menu, MenuItem } = remote
|
const { Menu, MenuItem } = remote
|
||||||
|
|
||||||
function popup (templates) {
|
function popup (templates) {
|
||||||
let menu = new Menu()
|
const menu = new Menu()
|
||||||
templates.forEach((item) => {
|
templates.forEach((item) => {
|
||||||
menu.append(new MenuItem(item))
|
menu.append(new MenuItem(item))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -169,9 +169,8 @@ class NoteList extends React.Component {
|
|||||||
if (this.notes == null || this.notes.length === 0) {
|
if (this.notes == null || this.notes.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let { router } = this.context
|
let { selectedNoteKeys } = this.state
|
||||||
let { location } = this.props
|
const { shiftKeyDown } = this.state
|
||||||
let { selectedNoteKeys, shiftKeyDown } = this.state
|
|
||||||
|
|
||||||
let targetIndex = this.getTargetIndex()
|
let targetIndex = this.getTargetIndex()
|
||||||
|
|
||||||
@@ -197,9 +196,8 @@ class NoteList extends React.Component {
|
|||||||
if (this.notes == null || this.notes.length === 0) {
|
if (this.notes == null || this.notes.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let { router } = this.context
|
let { selectedNoteKeys } = this.state
|
||||||
let { location } = this.props
|
const { shiftKeyDown } = this.state
|
||||||
let { selectedNoteKeys, shiftKeyDown } = this.state
|
|
||||||
|
|
||||||
let targetIndex = this.getTargetIndex()
|
let targetIndex = this.getTargetIndex()
|
||||||
const isTargetLastNote = targetIndex === this.notes.length - 1
|
const isTargetLastNote = targetIndex === this.notes.length - 1
|
||||||
@@ -240,7 +238,6 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleNoteListKeyDown (e) {
|
handleNoteListKeyDown (e) {
|
||||||
const { shiftKeyDown } = this.state
|
|
||||||
if (e.metaKey || e.ctrlKey) return true
|
if (e.metaKey || e.ctrlKey) return true
|
||||||
|
|
||||||
if (e.keyCode === 65 && !e.shiftKey) {
|
if (e.keyCode === 65 && !e.shiftKey) {
|
||||||
@@ -282,7 +279,7 @@ class NoteList extends React.Component {
|
|||||||
getNotes () {
|
getNotes () {
|
||||||
const { data, params, location } = this.props
|
const { data, params, location } = this.props
|
||||||
|
|
||||||
if (location.pathname.match(/\/home/) || location.pathname.match(/\alltags/)) {
|
if (location.pathname.match(/\/home/) || location.pathname.match(/alltags/)) {
|
||||||
const allNotes = data.noteMap.map((note) => note)
|
const allNotes = data.noteMap.map((note) => note)
|
||||||
this.contextNotes = allNotes
|
this.contextNotes = allNotes
|
||||||
return allNotes
|
return allNotes
|
||||||
@@ -353,9 +350,10 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleNoteClick (e, uniqueKey) {
|
handleNoteClick (e, uniqueKey) {
|
||||||
let { router } = this.context
|
const { router } = this.context
|
||||||
let { location } = this.props
|
const { location } = this.props
|
||||||
let { shiftKeyDown, selectedNoteKeys } = this.state
|
let { selectedNoteKeys } = this.state
|
||||||
|
const { shiftKeyDown } = this.state
|
||||||
|
|
||||||
if (shiftKeyDown && selectedNoteKeys.includes(uniqueKey)) {
|
if (shiftKeyDown && selectedNoteKeys.includes(uniqueKey)) {
|
||||||
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
|
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
|
||||||
@@ -681,9 +679,10 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { location, notes, config, dispatch } = this.props
|
const { location, config } = this.props
|
||||||
let { selectedNoteKeys } = this.state
|
let { notes } = this.props
|
||||||
let sortFunc = config.sortBy === 'CREATED_AT'
|
const { selectedNoteKeys } = this.state
|
||||||
|
const sortFunc = config.sortBy === 'CREATED_AT'
|
||||||
? sortByCreatedAt
|
? sortByCreatedAt
|
||||||
: config.sortBy === 'ALPHABETICAL'
|
: config.sortBy === 'ALPHABETICAL'
|
||||||
? sortByAlphabetical
|
? sortByAlphabetical
|
||||||
@@ -728,7 +727,6 @@ class NoteList extends React.Component {
|
|||||||
config.sortBy === 'CREATED_AT'
|
config.sortBy === 'CREATED_AT'
|
||||||
? note.createdAt : note.updatedAt
|
? note.createdAt : note.updatedAt
|
||||||
).fromNow('D')
|
).fromNow('D')
|
||||||
const key = `${note.storage}-${note.key}`
|
|
||||||
|
|
||||||
if (isDefault) {
|
if (isDefault) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -8,12 +8,10 @@ import CreateFolderModal from 'browser/main/modals/CreateFolderModal'
|
|||||||
import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
|
import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import StorageItemChild from 'browser/components/StorageItem'
|
import StorageItemChild from 'browser/components/StorageItem'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import * as path from 'path'
|
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, MenuItem, dialog } = remote
|
const { Menu, dialog } = remote
|
||||||
|
|
||||||
class StorageItem extends React.Component {
|
class StorageItem extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
|||||||
@@ -22,18 +22,18 @@ class Crowdfunding extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='header'>Crowdfunding</div>
|
<div styleName='header'>Crowdfunding</div>
|
||||||
<p>Dear all,</p>
|
<p>Dear everyone,</p>
|
||||||
<br />
|
<br />
|
||||||
<p>Thanks for your using!</p>
|
<p>Thank you for using Boostnote!</p>
|
||||||
<p>Boostnote is used in about 200 countries and regions, it is a awesome developer community.</p>
|
<p>Boostnote is used in about 200 different countries and regions by an awesome community of developers.</p>
|
||||||
<br />
|
<br />
|
||||||
<p>To continue supporting this growth, and to satisfy community expectations,</p>
|
<p>To continue supporting this growth, and to satisfy community expectations,</p>
|
||||||
<p>we would like to invest more time in this project.</p>
|
<p>we would like to invest more time and resources in this project.</p>
|
||||||
<br />
|
<br />
|
||||||
<p>If you like this project and see its potential, you can help!</p>
|
<p>If you like this project and see its potential, you can help by supporting us on OpenCollective!</p>
|
||||||
<br />
|
<br />
|
||||||
<p>Thanks,</p>
|
<p>Thanks,</p>
|
||||||
<p>Boostnote maintainers.</p>
|
<p>Boostnote maintainers</p>
|
||||||
<br />
|
<br />
|
||||||
<button styleName='cf-link'>
|
<button styleName='cf-link'>
|
||||||
<a href='https://opencollective.com/boostnoteio' onClick={(e) => this.handleLinkClick(e)}>Support via OpenCollective</a>
|
<a href='https://opencollective.com/boostnoteio' onClick={(e) => this.handleLinkClick(e)}>Support via OpenCollective</a>
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ class HotkeyTab extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='group'>
|
<div styleName='group'>
|
||||||
<div styleName='group-header'>Hotkey</div>
|
<div styleName='group-header'>Hotkeys</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
<div styleName='group-section-label'>Toggle Main</div>
|
<div styleName='group-section-label'>Show/Hide Boostnote</div>
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<input styleName='group-section-control-input'
|
<input styleName='group-section-control-input'
|
||||||
onChange={(e) => this.handleHotkeyChange(e)}
|
onChange={(e) => this.handleHotkeyChange(e)}
|
||||||
@@ -131,8 +131,8 @@ class HotkeyTab extends React.Component {
|
|||||||
onClick={(e) => this.handleHintToggleButtonClick(e)}
|
onClick={(e) => this.handleHintToggleButtonClick(e)}
|
||||||
>
|
>
|
||||||
{this.state.isHotkeyHintOpen
|
{this.state.isHotkeyHintOpen
|
||||||
? 'Hide Hint'
|
? 'Hide Help'
|
||||||
: 'Hint?'
|
: 'Help'
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
<button styleName='group-control-rightButton'
|
<button styleName='group-control-rightButton'
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class InfoTab extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSaveButtonClick (e) {
|
handleSaveButtonClick (e) {
|
||||||
let newConfig = {
|
const newConfig = {
|
||||||
amaEnabled: this.state.config.amaEnabled
|
amaEnabled: this.state.config.amaEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class InfoTab extends React.Component {
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div styleName='header--sub'>Info</div>
|
<div styleName='header--sub'>About</div>
|
||||||
|
|
||||||
<div styleName='top'>
|
<div styleName='top'>
|
||||||
<div styleName='icon-space'>
|
<div styleName='icon-space'>
|
||||||
@@ -137,17 +137,19 @@ class InfoTab extends React.Component {
|
|||||||
|
|
||||||
<hr styleName='separate-line' />
|
<hr styleName='separate-line' />
|
||||||
|
|
||||||
<div styleName='policy'>Data collection policy</div>
|
<div styleName='policy'>Analytics</div>
|
||||||
<div>We collect only the number of DAU for Boostnote and **DO NOT collect** any detail information such as your note content.</div>
|
<div>Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.</div>
|
||||||
<div>You can see how it works on <a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
|
<div>You can see how it works on <a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
|
||||||
<div>This data is only used for Boostnote improvements.</div>
|
<br />
|
||||||
|
<div>You can choose to enable or disable this option.</div>
|
||||||
<input onChange={(e) => this.handleConfigChange(e)}
|
<input onChange={(e) => this.handleConfigChange(e)}
|
||||||
checked={this.state.config.amaEnabled}
|
checked={this.state.config.amaEnabled}
|
||||||
ref='amaEnabled'
|
ref='amaEnabled'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
/>
|
/>
|
||||||
Enable to send analytics to our servers<br />
|
Enable analytics to help improve Boostnote<br />
|
||||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
||||||
|
<br />
|
||||||
{this.infoMessage()}
|
{this.infoMessage()}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class StoragesTab extends React.Component {
|
|||||||
<button styleName='list-control-addStorageButton'
|
<button styleName='list-control-addStorageButton'
|
||||||
onClick={(e) => this.handleAddStorageButton(e)}
|
onClick={(e) => this.handleAddStorageButton(e)}
|
||||||
>
|
>
|
||||||
<i className='fa fa-plus' /> Add Storage
|
<i className='fa fa-plus' /> Add Storage Location
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -167,7 +167,7 @@ class StoragesTab extends React.Component {
|
|||||||
<option value='FILESYSTEM'>File System</option>
|
<option value='FILESYSTEM'>File System</option>
|
||||||
</select>
|
</select>
|
||||||
<div styleName='addStorage-body-section-type-description'>
|
<div styleName='addStorage-body-section-type-description'>
|
||||||
3rd party cloud integration:
|
Setting up 3rd-party cloud storage integration:{' '}
|
||||||
<a href='https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup'
|
<a href='https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup'
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
>Cloud-Syncing-and-Backup</a>
|
>Cloud-Syncing-and-Backup</a>
|
||||||
@@ -196,7 +196,7 @@ class StoragesTab extends React.Component {
|
|||||||
<div styleName='addStorage-body-control'>
|
<div styleName='addStorage-body-control'>
|
||||||
<button styleName='addStorage-body-control-createButton'
|
<button styleName='addStorage-body-control-createButton'
|
||||||
onClick={(e) => this.handleAddStorageCreateButton(e)}
|
onClick={(e) => this.handleAddStorageCreateButton(e)}
|
||||||
>Create</button>
|
>Add</button>
|
||||||
<button styleName='addStorage-body-control-cancelButton'
|
<button styleName='addStorage-body-control-cancelButton'
|
||||||
onClick={(e) => this.handleAddStorageCancelButton(e)}
|
onClick={(e) => this.handleAddStorageCancelButton(e)}
|
||||||
>Cancel</button>
|
>Cancel</button>
|
||||||
|
|||||||
@@ -150,10 +150,10 @@ class UiTab extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='group'>
|
<div styleName='group'>
|
||||||
<div styleName='group-header'>UI</div>
|
<div styleName='group-header'>Interface</div>
|
||||||
|
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
Color Theme
|
Interface Theme
|
||||||
<div styleName='group-section-control'>
|
<div styleName='group-section-control'>
|
||||||
<select value={config.ui.theme}
|
<select value={config.ui.theme}
|
||||||
onChange={(e) => this.handleUIChange(e)}
|
onChange={(e) => this.handleUIChange(e)}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
import HotkeyTab from './HotkeyTab'
|
import HotkeyTab from './HotkeyTab'
|
||||||
import UiTab from './UiTab'
|
import UiTab from './UiTab'
|
||||||
@@ -11,6 +10,7 @@ import ModalEscButton from 'browser/components/ModalEscButton'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './PreferencesModal.styl'
|
import styles from './PreferencesModal.styl'
|
||||||
import RealtimeNotification from 'browser/components/RealtimeNotification'
|
import RealtimeNotification from 'browser/components/RealtimeNotification'
|
||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
class Preferences extends React.Component {
|
class Preferences extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -94,8 +94,8 @@ class Preferences extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getContentBoundingBox () {
|
getContentBoundingBox () {
|
||||||
const node = ReactDOM.findDOMNode(this.refs.content)
|
console.log(this.refs.content.getBoundingClientRect())
|
||||||
return node.getBoundingClientRect()
|
return this.refs.content.getBoundingClientRect()
|
||||||
}
|
}
|
||||||
|
|
||||||
haveToSaveNotif (type, message) {
|
haveToSaveNotif (type, message) {
|
||||||
@@ -108,10 +108,10 @@ class Preferences extends React.Component {
|
|||||||
const content = this.renderContent()
|
const content = this.renderContent()
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{target: 'STORAGES', label: 'Storages'},
|
{target: 'STORAGES', label: 'Storage'},
|
||||||
{target: 'HOTKEY', label: 'Hotkey', Hotkey: this.state.HotkeyAlert},
|
{target: 'HOTKEY', label: 'Hotkeys', Hotkey: this.state.HotkeyAlert},
|
||||||
{target: 'UI', label: 'UI', UI: this.state.UIAlert},
|
{target: 'UI', label: 'Interface', UI: this.state.UIAlert},
|
||||||
{target: 'INFO', label: 'Community / Info'},
|
{target: 'INFO', label: 'About'},
|
||||||
{target: 'CROWDFUNDING', label: 'Crowdfunding'}
|
{target: 'CROWDFUNDING', label: 'Crowdfunding'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -355,11 +355,9 @@ function data (state = defaultDataMap(), action) {
|
|||||||
state.storageMap.set(action.storage.key, action.storage)
|
state.storageMap.set(action.storage.key, action.storage)
|
||||||
return state
|
return state
|
||||||
case 'EXPORT_FOLDER':
|
case 'EXPORT_FOLDER':
|
||||||
{
|
state = Object.assign({}, state)
|
||||||
state = Object.assign({}, state)
|
state.storageMap = new Map(state.storageMap)
|
||||||
state.storageMap = new Map(state.storageMap)
|
state.storageMap.set(action.storage.key, action.storage)
|
||||||
state.storageMap.set(action.storage.key, action.storage)
|
|
||||||
}
|
|
||||||
return state
|
return state
|
||||||
case 'DELETE_FOLDER':
|
case 'DELETE_FOLDER':
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user