Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5be5b9d
GUI setup
rathod-sahaab Sep 8, 2020
159bf58
Removed dialog from MarkdownDetails page
rathod-sahaab Sep 14, 2020
6e95b90
Added multiple selection dialog to noteList
rathod-sahaab Sep 14, 2020
57436c3
using number of selected notes to determine if MultipleSelectionDialo…
rathod-sahaab Sep 14, 2020
7d19931
toggling only when multiple notes selected, linked N notes selected t…
rathod-sahaab Sep 14, 2020
2dfd5c2
Pin and Unpin made functional
rathod-sahaab Sep 15, 2020
ee182b6
Added starring and unstarring feature
rathod-sahaab Sep 15, 2020
4fdf66e
Added tool tips
rathod-sahaab Sep 15, 2020
33723d0
Added new permanently delete icon
rathod-sahaab Sep 15, 2020
9ee1a77
Added trash feature
rathod-sahaab Sep 15, 2020
859a41f
added permanetly delete feature, splited delete function in this.tras…
rathod-sahaab Sep 15, 2020
7dc9942
made props name grammatically more sensible
rathod-sahaab Sep 15, 2020
72efcdd
Added proper pin and unpin icons
rathod-sahaab Sep 16, 2020
5afe4b8
Added export type icons and updated design
rathod-sahaab Sep 16, 2020
1be02f1
Publish Icon added
rathod-sahaab Sep 16, 2020
5d5d50b
added propTypes description
rathod-sahaab Sep 16, 2020
b3f3633
Added export feature
rathod-sahaab Sep 17, 2020
46aefee
removed un-used variable
rathod-sahaab Sep 17, 2020
257c96e
Publish support
rathod-sahaab Oct 30, 2020
3c8be7a
added adding and removing tags feature
rathod-sahaab Dec 27, 2020
e1009d4
Fixed not starting bug, stylized input fields
rathod-sahaab Dec 27, 2020
9aac92f
Optimized svg icons
rathod-sahaab Dec 27, 2020
5098dc5
Select text on click added placeholder
rathod-sahaab Dec 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions browser/main/NoteList/MultipleSelectionDialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './MultipleSelectionDialog.styl'
import i18n from 'browser/lib/i18n'
/**
* Dialog shown when multiple notes are selected
*/
class MultipleSelectionDialog extends React.Component {
// constructor(props) {
// super(props)
// }
render() {
return (
<div
className='multipleSelectionDialog'
styleName='multipleSelectionDialog'
style={{
display: this.props.nSelectedNotes > 1 ? 'block' : 'none'
}}
>
<h3>{`${this.props.nSelectedNotes} ${i18n.__('notes selected')}`}</h3>
<div styleName='row'>
<div styleName='button-box'>
<button onClick={this.props.onStar}>
<img src='../resources/icon/icon-starred.svg' />
<span styleName='tooltip'>{i18n.__('Star')}</span>
</button>
<button onClick={this.props.onUnStar}>
<img src='../resources/icon/icon-star.svg' />
<span styleName='tooltip'>{i18n.__('Un-star')}</span>
</button>
</div>
<div styleName='button-box'>
<button onClick={this.props.onPin}>
<img src='../resources/icon/icon-pin.svg' />
<span styleName='tooltip'>{i18n.__('Pin')}</span>
</button>
<button onClick={this.props.onUnPin}>
<img src='../resources/icon/icon-unpin.svg' />
<span styleName='tooltip'>{i18n.__('Un-pin')}</span>
</button>
</div>
</div>
<div styleName='row'>
<div styleName='button-box'>
<button onClick={this.props.onTrash}>
<img src='../resources/icon/icon-trash.svg' />
<span styleName='tooltip'>{i18n.__('Trash')}</span>
</button>
<button onClick={this.props.onDelete}>
<img src='../resources/icon/icon-permanent-delete.svg' />
<span styleName='tooltip'>{i18n.__('Permanently Delete')}</span>
</button>
</div>
<div styleName='button-box'>
<button onClick={e => this.props.onExport(e, 'md')}>
<i className='fa fa-file-code-o' />
<span styleName='tooltip'>{i18n.__('Export as .md')}</span>
</button>
<button onClick={e => this.props.onExport(e, 'txt')}>
<i className='fa fa-file-text-o' />
<span styleName='tooltip'>{i18n.__('Export as .txt')}</span>
</button>
<button onClick={e => this.props.onExport(e, 'html')}>
<i className='fa fa-html5' />
<span styleName='tooltip'>{i18n.__('Export as .html')}</span>
</button>
<button onClick={e => this.props.onExport(e, 'pdf')}>
<i className='fa fa-file-pdf-o' />
<span styleName='tooltip'>{i18n.__('Export as .pdf')}</span>
</button>
</div>
<div styleName='button-box'>
<button onClick={this.props.onPublish}>
<img src='../resources/icon/icon-external.svg' />
<span styleName='tooltip'>{i18n.__('Publish')}</span>
</button>
</div>
</div>
<div styleName='row'>
<input
id='addtag-input'
type='text'
onFocus={e => e.target.select()}
placeholder={i18n.__('Add tag...')}
/>
<button
styleName='input-button'
onClick={e =>
this.props.addTag(document.getElementById('addtag-input').value)
}
>
<img src='../resources/icon/addtag.svg' />
<span styleName='tooltip'>{i18n.__('Add tag')}</span>
</button>
</div>
<div styleName='row'>
<input
id='removetag-input'
type='text'
onFocus={e => e.target.select()}
placeholder={i18n.__('Remove tag...')}
/>
<button
styleName='input-button'
onClick={e => {
this.props.removeTag(
document.getElementById('removetag-input').value
)
}}
>
<img src='../resources/icon/removetag.svg' />
<span styleName='tooltip'>{i18n.__('Remove tag')}</span>
</button>
</div>
</div>
)
}
}

MultipleSelectionDialog.propTypes = {
nSelectedNotes: PropTypes.number.isRequired,
addTag: PropTypes.func.isRequired,
removeTag: PropTypes.func.isRequired,
onStar: PropTypes.func.isRequired,
onUnStar: PropTypes.func.isRequired,
onPin: PropTypes.func.isRequired,
onUnPin: PropTypes.func.isRequired,
onTrash: PropTypes.func.isRequired,
onDelete: PropTypes.func.isRequired,
onExport: PropTypes.func.isRequired,
onPublish: PropTypes.func.isRequired
}

export default CSSModules(MultipleSelectionDialog, styles)
83 changes: 83 additions & 0 deletions browser/main/NoteList/MultipleSelectionDialog.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.multipleSelectionDialog
position absolute
top 50vh
left 100%
z-index 9
transform translateY(-50%)
color $ui-text-color
background-color $ui-noteList-backgroundColor
padding 1em

box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1)
h3
font-size 1.5em
text-align center
.row
display flex
justify-content space-between
.button-box
display flex
margin 0.5em
margin-bottom 0
button
position relative
&:hover .tooltip
opacity 1

color $ui-text-color
background-color inherit
border none

font-size 24px
padding 0.5em
img
height 1em
input
background-color inherit
border 2px solid $ui-text-color
color inherit
margin 0.5em
padding 0 0.5em
width 100%
border-radius 5px
.input-button
border 2px solid $ui-text-color

.tooltip
tooltip()
position absolute
pointer-events none
white-space nowrap
top 100%
left 50%
transform translateX(-50%)
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s

.tooltip:lang(ja)
@extend .tooltip
right 46px

apply-theme(theme)
body[data-theme={theme}]
.multipleSelectionDialog
color get-theme-var(theme, 'text-color')
background-color get-theme-var(theme, 'noteList-backgroundColor')
.row
button
color get-theme-var(theme, 'text-color')
background-color get-theme-var(theme, 'noteList-backgroundColor')
input
border-color get-theme-var(theme, 'text-color')
.input-button
border-color get-theme-var(theme, 'text-color')

for theme in 'dark' 'solarized-dark' 'dracula'
apply-theme(theme)

for theme in $themes
apply-theme(theme)
Loading