)
TodoListPercentage.propTypes = {
- percentageOfTodo: PropTypes.number.isRequired
+ percentageOfTodo: PropTypes.number.isRequired,
+ onClearCheckboxClick: PropTypes.func.isRequired
}
export default CSSModules(TodoListPercentage, styles)
diff --git a/browser/components/TodoListPercentage.styl b/browser/components/TodoListPercentage.styl
index 94e75599..5a0f3257 100644
--- a/browser/components/TodoListPercentage.styl
+++ b/browser/components/TodoListPercentage.styl
@@ -1,4 +1,5 @@
.percentageBar
+ display: flex
position absolute
top 72px
right 0px
@@ -30,6 +31,20 @@
color #f4f4f4
font-weight 600
+.todoClear
+ display flex
+ justify-content: flex-end
+ position absolute
+ z-index 120
+ width 100%
+ height 100%
+ padding 2px 10px
+
+.todoClearText
+ color #f4f4f4
+ cursor pointer
+ font-weight 500
+
body[data-theme="dark"]
.percentageBar
background-color #444444
@@ -39,6 +54,9 @@ body[data-theme="dark"]
.percentageText
color $ui-dark-text-color
+
+ .todoClearText
+ color $ui-dark-text-color
body[data-theme="solarized-dark"]
.percentageBar
@@ -50,6 +68,9 @@ body[data-theme="solarized-dark"]
.percentageText
color #fdf6e3
+ .todoClearText
+ color #fdf6e3
+
body[data-theme="monokai"]
.percentageBar
background-color: $ui-monokai-borderColor
@@ -58,4 +79,17 @@ body[data-theme="monokai"]
background-color $ui-monokai-active-color
.percentageText
- color $ui-monokai-text-color
\ No newline at end of file
+ color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .percentageBar
+ background-color $ui-dracula-borderColor
+
+ .progressBar
+ background-color: $ui-dracula-active-color
+
+ .percentageText
+ color $ui-dracula-text-color
+
+ .percentageText
+ color $ui-dracula-text-color
diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl
index fb30742d..e091331b 100644
--- a/browser/components/markdown.styl
+++ b/browser/components/markdown.styl
@@ -80,6 +80,9 @@ li
&.checked
text-decoration line-through
opacity 0.5
+ &.taskListItem.checked
+ text-decoration line-through
+ opacity 0.5
div.math-rendered
text-align center
.math-failed
@@ -361,7 +364,7 @@ for name, val in admonition_types
.admonition.{name}
@extend $admonition
border-left-color: val[color]
-
+
.admonition.{name}>.admonition-title
@extend $admonition-title
border-bottom-color: .1rem solid rgba(val[color], 0.2)
@@ -476,5 +479,34 @@ body[data-theme="monokai"]
border-color themeMonokaiTableBorder
&:last-child
border-right solid 1px themeMonokaiTableBorder
+ kbd
+ background-color themeDarkBackground
+
+themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor
+themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%)
+themeDraculaTableHead = themeDraculaTableEven
+themeDraculaTableBorder = themeDarkBorder
+
+body[data-theme="dracula"]
+ color $ui-dracula-text-color
+ border-color themeDarkBorder
+ background-color $ui-dracula-noteDetail-backgroundColor
+ table
+ thead
+ tr
+ background-color themeDraculaTableHead
+ th
+ border-color themeDraculaTableBorder
+ &:last-child
+ border-right solid 1px themeDraculaTableBorder
+ tbody
+ tr:nth-child(2n + 1)
+ background-color themeDraculaTableOdd
+ tr:nth-child(2n)
+ background-color themeDraculaTableEven
+ td
+ border-color themeDraculaTableBorder
+ &:last-child
+ border-right solid 1px themeDraculaTableBorder
kbd
background-color themeDarkBackground
\ No newline at end of file
diff --git a/browser/components/render/MermaidRender.js b/browser/components/render/MermaidRender.js
index 12dce327..e8784d9d 100644
--- a/browser/components/render/MermaidRender.js
+++ b/browser/components/render/MermaidRender.js
@@ -2,8 +2,8 @@ import mermaidAPI from 'mermaid'
// fixes bad styling in the mermaid dark theme
const darkThemeStyling = `
-.loopText tspan {
- fill: white;
+.loopText tspan {
+ fill: white;
}`
function getRandomInt (min, max) {
@@ -21,7 +21,7 @@ function getId () {
function render (element, content, theme) {
try {
- let isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai'
+ let isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula'
mermaidAPI.initialize({
theme: isDarkTheme ? 'dark' : 'default',
themeCSS: isDarkTheme ? darkThemeStyling : ''
diff --git a/browser/lib/findNoteTitle.js b/browser/lib/findNoteTitle.js
index b954f172..912c3bdd 100644
--- a/browser/lib/findNoteTitle.js
+++ b/browser/lib/findNoteTitle.js
@@ -1,4 +1,4 @@
-export function findNoteTitle (value) {
+export function findNoteTitle (value, enableFrontMatterTitle, frontMatterTitleField = 'title') {
const splitted = value.split('\n')
let title = null
let isInsideCodeBlock = false
@@ -6,6 +6,11 @@ export function findNoteTitle (value) {
if (splitted[0] === '---') {
let line = 0
while (++line < splitted.length) {
+ if (enableFrontMatterTitle && splitted[line].startsWith(frontMatterTitleField + ':')) {
+ title = splitted[line].substring(frontMatterTitleField.length + 1).trim()
+
+ break
+ }
if (splitted[line] === '---') {
splitted.splice(0, line + 1)
@@ -14,17 +19,19 @@ export function findNoteTitle (value) {
}
}
- splitted.some((line, index) => {
- const trimmedLine = line.trim()
- const trimmedNextLine = splitted[index + 1] === undefined ? '' : splitted[index + 1].trim()
- if (trimmedLine.match('```')) {
- isInsideCodeBlock = !isInsideCodeBlock
- }
- if (isInsideCodeBlock === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match(/^=+$/))) {
- title = trimmedLine
- return true
- }
- })
+ if (title === null) {
+ splitted.some((line, index) => {
+ const trimmedLine = line.trim()
+ const trimmedNextLine = splitted[index + 1] === undefined ? '' : splitted[index + 1].trim()
+ if (trimmedLine.match('```')) {
+ isInsideCodeBlock = !isInsideCodeBlock
+ }
+ if (isInsideCodeBlock === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match(/^=+$/))) {
+ title = trimmedLine
+ return true
+ }
+ })
+ }
if (title === null) {
title = ''
diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js
index ed4fbca1..49260740 100644
--- a/browser/lib/markdown.js
+++ b/browser/lib/markdown.js
@@ -7,6 +7,7 @@ import _ from 'lodash'
import ConfigManager from 'browser/main/lib/ConfigManager'
import katex from 'katex'
import { lastFindInArray } from './utils'
+import ee from 'browser/main/lib/eventEmitter'
function createGutter (str, firstLineNumber) {
if (Number.isNaN(firstLineNumber)) firstLineNumber = 1
@@ -223,7 +224,11 @@ class Markdown {
if (!liToken.attrs) {
liToken.attrs = []
}
- liToken.attrs.push(['class', 'taskListItem'])
+ if (config.preview.lineThroughCheckbox) {
+ liToken.attrs.push(['class', `taskListItem${match[1] !== ' ' ? ' checked' : ''}`])
+ } else {
+ liToken.attrs.push(['class', 'taskListItem'])
+ }
}
content = ``
}
diff --git a/browser/main/Detail/Detail.styl b/browser/main/Detail/Detail.styl
index 49a634f3..1b7bd606 100644
--- a/browser/main/Detail/Detail.styl
+++ b/browser/main/Detail/Detail.styl
@@ -23,7 +23,7 @@ body[data-theme="dark"]
border-left 1px solid $ui-dark-borderColor
.empty-message
color $ui-dark-inactive-text-color
-
+
body[data-theme="solarized-dark"]
.root
background-color $ui-solarized-dark-noteDetail-backgroundColor
@@ -37,3 +37,10 @@ body[data-theme="monokai"]
border-left 1px solid $ui-monokai-borderColor
.empty-message
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root
+ background-color $ui-dracula-noteDetail-backgroundColor
+ border-left 1px solid $ui-dracula-borderColor
+ .empty-message
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/Detail/FolderSelect.styl b/browser/main/Detail/FolderSelect.styl
index cfdc2734..fe045e3a 100644
--- a/browser/main/Detail/FolderSelect.styl
+++ b/browser/main/Detail/FolderSelect.styl
@@ -36,7 +36,7 @@
height 34px
width 20px
line-height 34px
-
+
.search-input
vertical-align middle
position relative
@@ -71,7 +71,7 @@
overflow ellipsis
cursor pointer
&:hover
- background-color $ui-button--hover-backgroundColor
+ background-color $ui-button--hover-backgroundColor
.search-optionList-item--active
@extend .search-optionList-item
@@ -159,3 +159,29 @@ body[data-theme="monokai"]
color $ui-monokai-button--active-color
.search-optionList-item-name-surfix
color $ui-monokai-inactive-text-color
+
+body[data-theme="dracula"]
+ .root
+ color $ui-dracula-text-color
+ &:hover
+ color #f8f8f2
+ background-color $ui-dark-button--hover-backgroundColor
+ border-color $ui-dracula-borderColor
+
+ .search-optionList
+ color #f8f8f2
+ border-color $ui-dracula-borderColor
+ background-color $ui-dracula-button-backgroundColor
+
+ .search-optionList-item
+ &:hover
+ background-color lighten($ui-dracula-button--hover-backgroundColor, 15%)
+
+ .search-optionList-item--active
+ background-color $ui-dracula-button--active-backgroundColor
+ color $ui-dracula-button--active-color
+ &:hover
+ background-color $ui-dark-button--hover-backgroundColor
+ color $ui-dracula-button--active-color
+ .search-optionList-item-name-surfix
+ color $ui-dracula-inactive-text-color
diff --git a/browser/main/Detail/InfoPanel.styl b/browser/main/Detail/InfoPanel.styl
index 2a73ca7e..1f774174 100644
--- a/browser/main/Detail/InfoPanel.styl
+++ b/browser/main/Detail/InfoPanel.styl
@@ -257,3 +257,43 @@ body[data-theme="monokai"]
color $ui-dark-inactive-text-color
&:hover
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .control-infoButton-panel
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .control-infoButton-panel-trash
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .modification-date
+ color $ui-dracula-text-color
+
+ .modification-date-desc
+ color $ui-inactive-text-color
+
+ .infoPanel-defaul-count
+ color $ui-dracula-text-color
+
+ .infoPanel-sub-count
+ color $ui-inactive-text-color
+
+ .infoPanel-default
+ color $ui-dracula-text-color
+
+ .infoPanel-sub
+ color $ui-inactive-text-color
+
+ .infoPanel-noteLink
+ background-color alpha($ui-dracula-borderColor, 20%)
+ color $ui-dracula-text-color
+
+ [id=export-wrap]
+ button
+ color $ui-dark-inactive-text-color
+ &:hover
+ background-color alpha($ui-dracula-borderColor, 20%)
+ color $ui-dracula-text-color
+ p
+ color $ui-dark-inactive-text-color
+ &:hover
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js
index 0f182636..c35127ba 100755
--- a/browser/main/Detail/MarkdownNoteDetail.js
+++ b/browser/main/Detail/MarkdownNoteDetail.js
@@ -66,7 +66,9 @@ class MarkdownNoteDetail extends React.Component {
}
componentWillReceiveProps (nextProps) {
- if (nextProps.note.key !== this.props.note.key && !this.state.isMovingNote) {
+ const isNewNote = nextProps.note.key !== this.props.note.key
+ const hasDeletedTags = nextProps.note.tags.length < this.props.note.tags.length
+ if (!this.state.isMovingNote && (isNewNote || hasDeletedTags)) {
if (this.saveQueue != null) this.saveNow()
this.setState({
note: Object.assign({}, nextProps.note)
@@ -92,7 +94,7 @@ class MarkdownNoteDetail extends React.Component {
handleUpdateContent () {
const { note } = this.state
note.content = this.refs.content.value
- note.title = markdown.strip(striptags(findNoteTitle(note.content)))
+ note.title = markdown.strip(striptags(findNoteTitle(note.content, this.props.config.editor.enableFrontMatterTitle, this.props.config.editor.frontMatterTitleField)))
this.updateNote(note)
}
@@ -298,9 +300,29 @@ class MarkdownNoteDetail extends React.Component {
this.handleTrashButtonClick()
}
+ handleClearTodo () {
+ const { note } = this.state
+ const splitted = note.content.split('\n')
+
+ const clearTodoContent = splitted.map((line) => {
+ const trimmedLine = line.trim()
+ if (trimmedLine.match(/\[x\]/i)) {
+ return line.replace(/\[x\]/i, '[ ]')
+ } else {
+ return line
+ }
+ }).join('\n')
+
+ note.content = clearTodoContent
+ this.refs.content.setValue(note.content)
+
+ this.updateNote(note)
+ }
+
renderEditor () {
const { config, ignorePreviewPointerEvents } = this.props
const { note } = this.state
+
if (this.state.editorType === 'EDITOR_PREVIEW') {
return
-
+ this.handleClearTodo(e)} percentageOfTodo={getTodoPercentageOfCompleted(note.content)} />
this.handleSwitchMode(e)} editorType={editorType} />
diff --git a/browser/main/Detail/MarkdownNoteDetail.styl b/browser/main/Detail/MarkdownNoteDetail.styl
index b27dc80e..cdfeaf3a 100644
--- a/browser/main/Detail/MarkdownNoteDetail.styl
+++ b/browser/main/Detail/MarkdownNoteDetail.styl
@@ -76,3 +76,8 @@ body[data-theme="monokai"]
.root
border-left 1px solid $ui-monokai-borderColor
background-color $ui-monokai-noteDetail-backgroundColor
+
+body[data-theme="dracula"]
+ .root
+ border-left 1px solid $ui-dracula-borderColor
+ background-color $ui-dracula-noteDetail-backgroundColor
\ No newline at end of file
diff --git a/browser/main/Detail/NoteDetailInfo.styl b/browser/main/Detail/NoteDetailInfo.styl
index 7166a497..1ca46516 100644
--- a/browser/main/Detail/NoteDetailInfo.styl
+++ b/browser/main/Detail/NoteDetailInfo.styl
@@ -98,8 +98,13 @@ body[data-theme="solarized-dark"]
.info
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteDetail-backgroundColor
-
+
body[data-theme="monokai"]
.info
border-color $ui-monokai-borderColor
- background-color $ui-monokai-noteDetail-backgroundColor
\ No newline at end of file
+ background-color $ui-monokai-noteDetail-backgroundColor
+
+body[data-theme="dracula"]
+ .info
+ border-color $ui-dracula-borderColor
+ background-color $ui-dracula-noteDetail-backgroundColor
\ No newline at end of file
diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js
index 9356a02c..65d5dfd3 100644
--- a/browser/main/Detail/SnippetNoteDetail.js
+++ b/browser/main/Detail/SnippetNoteDetail.js
@@ -112,7 +112,7 @@ class SnippetNoteDetail extends React.Component {
if (this.refs.tags) note.tags = this.refs.tags.value
note.description = this.refs.description.value
note.updatedAt = new Date()
- note.title = findNoteTitle(note.description)
+ note.title = findNoteTitle(note.description, false)
this.setState({
note
diff --git a/browser/main/Detail/SnippetNoteDetail.styl b/browser/main/Detail/SnippetNoteDetail.styl
index f8ca48cc..e3bb31c6 100644
--- a/browser/main/Detail/SnippetNoteDetail.styl
+++ b/browser/main/Detail/SnippetNoteDetail.styl
@@ -169,4 +169,21 @@ body[data-theme="monokai"]
.tabList
background-color $ui-monokai-noteDetail-backgroundColor
- color $ui-monokai-text-color
\ No newline at end of file
+ color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root
+ border-left 1px solid $ui-dracula-borderColor
+ background-color $ui-dracula-noteDetail-backgroundColor
+
+ .body
+ background-color $ui-dracula-noteDetail-backgroundColor
+
+ .body .description textarea
+ background-color $ui-dracula-noteDetail-backgroundColor
+ color $ui-dracula-text-color
+ border 1px solid $ui-dracula-borderColor
+
+ .tabList
+ background-color $ui-dracula-noteDetail-backgroundColor
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/Detail/TagSelect.styl b/browser/main/Detail/TagSelect.styl
index 90341de3..c6b13f3c 100644
--- a/browser/main/Detail/TagSelect.styl
+++ b/browser/main/Detail/TagSelect.styl
@@ -76,3 +76,14 @@ body[data-theme="monokai"]
.tag-label
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .tag
+ background-color $ui-dracula-tag-backgroundColor
+
+ .tag-removeButton
+ border-color $ui-dracula-button--focus-borderColor
+ background-color transparent
+
+ .tag-label
+ color $ui-dracula-borderColor
diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl
index 7ede0576..73f5acbd 100644
--- a/browser/main/Detail/ToggleModeButton.styl
+++ b/browser/main/Detail/ToggleModeButton.styl
@@ -63,3 +63,10 @@ body[data-theme="monokai"]
.active
background-color #f92672
box-shadow 2px 0px 7px #222222
+
+body[data-theme="dracula"]
+ .control-toggleModeButton
+ background-color #44475a
+ .active
+ background-color #bd93f9
+ box-shadow 2px 0px 7px #222222
diff --git a/browser/main/Main.js b/browser/main/Main.js
index 65bde538..1ffb2f74 100644
--- a/browser/main/Main.js
+++ b/browser/main/Main.js
@@ -141,7 +141,7 @@ class Main extends React.Component {
componentDidMount () {
const { dispatch, config } = this.props
- const supportedThemes = ['dark', 'white', 'solarized-dark', 'monokai']
+ const supportedThemes = ['dark', 'white', 'solarized-dark', 'monokai', 'dracula']
if (supportedThemes.indexOf(config.ui.theme) !== -1) {
document.body.setAttribute('data-theme', config.ui.theme)
@@ -297,7 +297,7 @@ class Main extends React.Component {
onMouseUp={e => this.handleMouseUp(e)}
>
{!config.isSideNavFolded &&
diff --git a/browser/main/NewNoteButton/NewNoteButton.styl b/browser/main/NewNoteButton/NewNoteButton.styl
index e8e4b5f0..75a9061c 100644
--- a/browser/main/NewNoteButton/NewNoteButton.styl
+++ b/browser/main/NewNoteButton/NewNoteButton.styl
@@ -79,3 +79,7 @@ body[data-theme="solarized-dark"]
body[data-theme="monokai"]
.root, .root--expanded
background-color $ui-monokai-noteList-backgroundColor
+
+body[data-theme="dracula"]
+ .root, .root--expanded
+ background-color $ui-dracula-noteList-backgroundColor
\ No newline at end of file
diff --git a/browser/main/NoteList/NoteList.styl b/browser/main/NoteList/NoteList.styl
index ea261208..73959c9b 100644
--- a/browser/main/NoteList/NoteList.styl
+++ b/browser/main/NoteList/NoteList.styl
@@ -84,7 +84,7 @@ body[data-theme="dark"]
color $ui-dark-inactive-text-color
&:hover
color $ui-dark-text-color
-
+
.control-button--active
color $ui-dark-text-color
&:active
@@ -109,7 +109,7 @@ body[data-theme="solarized-dark"]
color $ui-solarized-dark-inactive-text-color
&:hover
color $ui-solarized-dark-text-color
-
+
.control-button--active
color $ui-solarized-dark-text-color
&:active
@@ -138,3 +138,27 @@ body[data-theme="monokai"]
color $ui-monokai-text-color
&:active
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root
+ border-color $ui-dracula-borderColor
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .control
+ background-color $ui-dracula-noteList-backgroundColor
+ border-color $ui-dracula-borderColor
+
+ .control-sortBy-select
+ &:hover
+ transition 0.2s
+ color $ui-dracula-text-color
+
+ .control-button
+ color $ui-dracula-inactive-text-color
+ &:hover
+ color $ui-dracula-text-color
+
+ .control-button--active
+ color $ui-dracula-text-color
+ &:active
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/SideNav/SideNav.styl b/browser/main/SideNav/SideNav.styl
index ecab70d0..9fa6d4fa 100644
--- a/browser/main/SideNav/SideNav.styl
+++ b/browser/main/SideNav/SideNav.styl
@@ -19,7 +19,7 @@
text-align center
-
+
.top-menu-label
margin-left 5px
overflow ellipsis
@@ -122,3 +122,8 @@ body[data-theme="monokai"]
.root, .root--folded
background-color $ui-monokai-backgroundColor
border-right 1px solid $ui-monokai-borderColor
+
+body[data-theme="dracula"]
+ .root, .root--folded
+ background-color $ui-dracula-backgroundColor
+ border-right 1px solid $ui-dracula-borderColor
\ No newline at end of file
diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js
index 977a8fb5..e78c9c77 100644
--- a/browser/main/SideNav/index.js
+++ b/browser/main/SideNav/index.js
@@ -18,6 +18,7 @@ import TagButton from './TagButton'
import {SortableContainer} from 'react-sortable-hoc'
import i18n from 'browser/lib/i18n'
import context from 'browser/lib/context'
+import { remote } from 'electron'
class SideNav extends React.Component {
// TODO: should not use electron stuff v0.7
@@ -30,6 +31,52 @@ class SideNav extends React.Component {
EventEmitter.off('side:preferences', this.handleMenuButtonClick)
}
+ deleteTag (tag) {
+ const selectedButton = remote.dialog.showMessageBox(remote.getCurrentWindow(), {
+ ype: 'warning',
+ message: i18n.__('Confirm tag deletion'),
+ detail: i18n.__('This will permanently remove this tag.'),
+ buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
+ })
+
+ if (selectedButton === 0) {
+ const { data, dispatch, location, params } = this.props
+
+ const notes = data.noteMap
+ .map(note => note)
+ .filter(note => note.tags.indexOf(tag) !== -1)
+ .map(note => {
+ note = Object.assign({}, note)
+ note.tags = note.tags.slice()
+
+ note.tags.splice(note.tags.indexOf(tag), 1)
+
+ return note
+ })
+
+ Promise
+ .all(notes.map(note => dataApi.updateNote(note.storage, note.key, note)))
+ .then(updatedNotes => {
+ updatedNotes.forEach(note => {
+ dispatch({
+ type: 'UPDATE_NOTE',
+ note
+ })
+ })
+
+ if (location.pathname.match('/tags')) {
+ const tags = params.tagname.split(' ')
+ const index = tags.indexOf(tag)
+ if (index !== -1) {
+ tags.splice(index, 1)
+
+ this.context.router.push(`/tags/${tags.map(tag => encodeURIComponent(tag)).join(' ')}`)
+ }
+ }
+ })
+ }
+ }
+
handleMenuButtonClick (e) {
openModal(PreferencesModal)
}
@@ -44,6 +91,17 @@ class SideNav extends React.Component {
router.push('/starred')
}
+ handleTagContextMenu (e, tag) {
+ const menu = []
+
+ menu.push({
+ label: i18n.__('Delete Tag'),
+ click: this.deleteTag.bind(this, tag)
+ })
+
+ context.popup(menu)
+ }
+
handleToggleButtonClick (e) {
const { dispatch, config } = this.props
@@ -165,6 +223,7 @@ class SideNav extends React.Component {
name={tag.name}
handleClickTagListItem={this.handleClickTagListItem.bind(this)}
handleClickNarrowToTag={this.handleClickNarrowToTag.bind(this)}
+ handleContextMenu={this.handleTagContextMenu.bind(this)}
isActive={this.getTagActive(location.pathname, tag.name)}
isRelated={tag.related}
key={tag.name}
diff --git a/browser/main/StatusBar/StatusBar.styl b/browser/main/StatusBar/StatusBar.styl
index 52cc4b02..83cf2088 100644
--- a/browser/main/StatusBar/StatusBar.styl
+++ b/browser/main/StatusBar/StatusBar.styl
@@ -34,7 +34,7 @@
color $ui-active-color
span
margin-left 5px
-
+
.update
navButtonColor()
height 24px
@@ -80,3 +80,14 @@ body[data-theme="monokai"]
color $ui-monokai-active-color
&:active
color $ui-monokai-active-color
+
+body[data-theme="dracula"]
+ navButtonColor()
+ .zoom
+ border-color $ui-dark-borderColor
+ color $ui-dracula-text-color
+ &:hover
+ transition 0.15s
+ color $ui-dracula-active-color
+ &:active
+ color $ui-dracula-active-color
\ No newline at end of file
diff --git a/browser/main/TopBar/TopBar.styl b/browser/main/TopBar/TopBar.styl
index 7654f66f..61b21fc5 100644
--- a/browser/main/TopBar/TopBar.styl
+++ b/browser/main/TopBar/TopBar.styl
@@ -256,3 +256,25 @@ body[data-theme="monokai"]
input
background-color $ui-monokai-noteList-backgroundColor
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root, .root--expanded
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .control
+ border-color $ui-dracula-borderColor
+ .control-search
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .control-search-icon
+ absolute top bottom left
+ line-height 32px
+ width 35px
+ color $ui-dracula-inactive-text-color
+ background-color $ui-dracula-noteList-backgroundColor
+
+ .control-search-input
+ background-color $ui-dracula-noteList-backgroundColor
+ input
+ background-color $ui-dracula-noteList-backgroundColor
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/global.styl b/browser/main/global.styl
index 815cff4e..e04060c2 100644
--- a/browser/main/global.styl
+++ b/browser/main/global.styl
@@ -18,6 +18,9 @@ body
::-webkit-scrollbar
width 12px
+::-webkit-scrollbar-corner
+ background-color: transparent;
+
::-webkit-scrollbar-thumb
background-color rgba(0, 0, 0, 0.15)
@@ -162,6 +165,15 @@ body[data-theme="monokai"]
.sortableItemHelper
color: $ui-monokai-text-color
+body[data-theme="dracula"]
+ ::-webkit-scrollbar-thumb
+ background-color rgba(0, 0, 0, 0.3)
+ .ModalBase
+ .modalBack
+ background-color $ui-dracula-backgroundColor
+ .sortableItemHelper
+ color: $ui-dracula-text-color
+
body[data-theme="default"]
.SideNav ::-webkit-scrollbar-thumb
background-color rgba(255, 255, 255, 0.3)
diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js
index 7f8ae6fb..2a660ccf 100644
--- a/browser/main/lib/ConfigManager.js
+++ b/browser/main/lib/ConfigManager.js
@@ -48,7 +48,9 @@ export const DEFAULT_CONFIG = {
scrollPastEnd: false,
type: 'SPLIT',
fetchUrlTitle: true,
- enableTableEditor: false
+ enableTableEditor: false,
+ enableFrontMatterTitle: true,
+ frontMatterTitleField: 'title'
},
preview: {
fontSize: '14',
@@ -66,7 +68,8 @@ export const DEFAULT_CONFIG = {
smartArrows: false,
allowCustomCSS: false,
customCSS: '',
- sanitize: 'STRICT' // 'STRICT', 'ALLOW_STYLES', 'NONE'
+ sanitize: 'STRICT', // 'STRICT', 'ALLOW_STYLES', 'NONE'
+ lineThroughCheckbox: true
},
blog: {
type: 'wordpress', // Available value: wordpress, add more types in the future plz
@@ -148,6 +151,8 @@ function set (updates) {
document.body.setAttribute('data-theme', 'solarized-dark')
} else if (newConfig.ui.theme === 'monokai') {
document.body.setAttribute('data-theme', 'monokai')
+ } else if (newConfig.ui.theme === 'dracula') {
+ document.body.setAttribute('data-theme', 'dracula')
} else {
document.body.setAttribute('data-theme', 'default')
}
diff --git a/browser/main/modals/CreateFolderModal.styl b/browser/main/modals/CreateFolderModal.styl
index 1b96e123..93848683 100644
--- a/browser/main/modals/CreateFolderModal.styl
+++ b/browser/main/modals/CreateFolderModal.styl
@@ -128,3 +128,29 @@ body[data-theme="monokai"]
.control-confirmButton
colorMonokaiPrimaryButton()
+
+body[data-theme="dracula"]
+ .root
+ modalDracula()
+ width 500px
+ height 270px
+ overflow hidden
+ position relative
+
+ .header
+ background-color transparent
+ border-color $ui-dark-borderColor
+ color $ui-dracula-text-color
+
+ .control-folder-label
+ color $ui-dracula-text-color
+
+ .control-folder-input
+ border 1px solid $ui-input--create-folder-modal
+ color white
+
+ .description
+ color $ui-inactive-text-color
+
+ .control-confirmButton
+ colorDraculaPrimaryButton()
\ No newline at end of file
diff --git a/browser/main/modals/NewNoteModal.styl b/browser/main/modals/NewNoteModal.styl
index db14133f..c82b9376 100644
--- a/browser/main/modals/NewNoteModal.styl
+++ b/browser/main/modals/NewNoteModal.styl
@@ -97,3 +97,20 @@ body[data-theme="monokai"]
.description
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root
+ background-color transparent
+
+ .header
+ color $ui-dracula-text-color
+
+ .control-button
+ border-color $ui-dracula-borderColor
+ color $ui-dracula-text-color
+ background-color transparent
+ &:focus
+ colorDraculaPrimaryButton()
+
+ .description
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/modals/PreferencesModal/ConfigTab.styl b/browser/main/modals/PreferencesModal/ConfigTab.styl
index b146486d..255165ce 100644
--- a/browser/main/modals/PreferencesModal/ConfigTab.styl
+++ b/browser/main/modals/PreferencesModal/ConfigTab.styl
@@ -138,6 +138,10 @@ colorMonokaiControl()
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
+colorDraculaControl()
+ border none
+ background-color $ui-dracula-button-backgroundColor
+ color $ui-dracula-text-color
body[data-theme="dark"]
.root
@@ -220,3 +224,30 @@ body[data-theme="monokai"]
.group-section-control
select, .group-section-control-input
colorMonokaiControl()
+
+body[data-theme="dracula"]
+ .root
+ color $ui-dracula-text-color
+
+ .group-header
+ color $ui-dracula-text-color
+ border-color $ui-dracula-borderColor
+
+ .group-header2
+ color $ui-dracula-text-color
+
+ .group-section-control-input
+ border-color $ui-dracula-borderColor
+
+ .group-control
+ border-color $ui-dracula-borderColor
+ .group-control-leftButton
+ colorDarkDefaultButton()
+ border-color $ui-dracula-borderColor
+ .group-control-rightButton
+ colorDraculaPrimaryButton()
+ .group-hint
+ colorDraculaControl()
+ .group-section-control
+ select, .group-section-control-input
+ colorDraculaControl()
\ No newline at end of file
diff --git a/browser/main/modals/PreferencesModal/Crowdfunding.js b/browser/main/modals/PreferencesModal/Crowdfunding.js
index f342fb76..f6389cd8 100644
--- a/browser/main/modals/PreferencesModal/Crowdfunding.js
+++ b/browser/main/modals/PreferencesModal/Crowdfunding.js
@@ -23,21 +23,29 @@ class Crowdfunding extends React.Component {
return (
{i18n.__('Crowdfunding')}
-
{i18n.__('Dear Boostnote users,')}
-
{i18n.__('Thank you for using Boostnote!')}
-
{i18n.__('Boostnote is used in about 200 different countries and regions by an awesome community of developers.')}
-
{i18n.__('To support our growing userbase, and satisfy community expectations,')}
-
{i18n.__('we would like to invest more time and resources in this project.')}
+
{i18n.__('We launched IssueHunt which is an issue-based crowdfunding / sourcing platform for open source projects.')}
+
{i18n.__('Anyone can put a bounty on not only a bug but also on OSS feature requests listed on IssueHunt. Collected funds will be distributed to project owners and contributors.')}
-
{i18n.__('If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!')}
+
{i18n.__('### Sustainable Open Source Ecosystem')}
+
{i18n.__('We discussed about open-source ecosystem and IssueHunt concept with the Boostnote team repeatedly. We actually also discussed with Matz who father of Ruby.')}
+
{i18n.__('The original reason why we made IssueHunt was to reward our contributors of Boostnote project. We’ve got tons of Github stars and hundred of contributors in two years.')}
+
{i18n.__('We thought that it will be nice if we can pay reward for our contributors.')}
-
{i18n.__('Thanks,')}
+
{i18n.__('### We believe Meritocracy')}
+
{i18n.__('We think developers who has skill and did great things must be rewarded properly.')}
+
{i18n.__('OSS projects are used in everywhere on the internet, but no matter how they great, most of owners of those projects need to have another job to sustain their living.')}
+
{i18n.__('It sometimes looks like exploitation.')}
+
{i18n.__('We’ve realized IssueHunt could enhance sustainability of open-source ecosystem.')}
+
+
{i18n.__('As same as issues of Boostnote are already funded on IssueHunt, your open-source projects can be also started funding from now.')}
+
+
{i18n.__('Thank you,')}
{i18n.__('The Boostnote Team')}
)
diff --git a/browser/main/modals/PreferencesModal/Crowdfunding.styl b/browser/main/modals/PreferencesModal/Crowdfunding.styl
index 326867d3..6d72290b 100644
--- a/browser/main/modals/PreferencesModal/Crowdfunding.styl
+++ b/browser/main/modals/PreferencesModal/Crowdfunding.styl
@@ -29,7 +29,7 @@ p
body[data-theme="dark"]
p
color $ui-dark-text-color
-
+
body[data-theme="solarized-dark"]
.root
color $ui-solarized-dark-text-color
@@ -41,3 +41,9 @@ body[data-theme="monokai"]
color $ui-monokai-text-color
p
color $ui-monokai-text-color
+
+body[data-theme="dracula"]
+ .root
+ color $ui-dracula-text-color
+ p
+ color $ui-dracula-text-color
\ No newline at end of file
diff --git a/browser/main/modals/PreferencesModal/FolderItem.styl b/browser/main/modals/PreferencesModal/FolderItem.styl
index f4a44675..2ded3ada 100644
--- a/browser/main/modals/PreferencesModal/FolderItem.styl
+++ b/browser/main/modals/PreferencesModal/FolderItem.styl
@@ -154,3 +154,26 @@ body[data-theme="monokai"]
.folderItem-right-dangerButton
colorMonokaiPrimaryButton()
+
+body[data-theme="dracula"]
+ .folderItem
+ &:hover
+ background-color $ui-dracula-button-backgroundColor
+
+ .folderItem-left-danger
+ color $danger-color
+
+ .folderItem-left-key
+ color $ui-dark-inactive-text-color
+
+ .folderItem-left-colorButton
+ colorDraculaPrimaryButton()
+
+ .folderItem-right-button
+ colorDraculaPrimaryButton()
+
+ .folderItem-right-confirmButton
+ colorDraculaPrimaryButton()
+
+ .folderItem-right-dangerButton
+ colorDraculaPrimaryButton()
\ No newline at end of file
diff --git a/browser/main/modals/PreferencesModal/InfoTab.js b/browser/main/modals/PreferencesModal/InfoTab.js
index 1b2d55bb..a6acc963 100644
--- a/browser/main/modals/PreferencesModal/InfoTab.js
+++ b/browser/main/modals/PreferencesModal/InfoTab.js
@@ -84,7 +84,7 @@ class InfoTab extends React.Component {
>{i18n.__('GitHub')}