mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06a54d451c | ||
|
|
e317075815 | ||
|
|
45541a255b | ||
|
|
3ab423d695 | ||
|
|
345d7b427a | ||
|
|
de6d6b692e | ||
|
|
b2845e2284 | ||
|
|
47383c347c | ||
|
|
4bda84d69c | ||
|
|
b510aa11f5 | ||
|
|
8dab6d5e04 | ||
|
|
85f833c865 | ||
|
|
15133d00c7 | ||
|
|
b93990d10b | ||
|
|
a0bcb8edbe | ||
|
|
bfdf691bed | ||
|
|
f60856b998 | ||
|
|
3308eeaf82 | ||
|
|
19930a2472 | ||
|
|
e75d95b1fc | ||
|
|
4319711dc6 | ||
|
|
9712be909d | ||
|
|
04060ce252 | ||
|
|
da066fe694 | ||
|
|
3b7215b36a | ||
|
|
b88d5cfb06 | ||
|
|
8ab96cf2fb | ||
|
|
63af2fd8b1 | ||
|
|
fcf26f7844 | ||
|
|
657ebc99df | ||
|
|
9500f9a8c9 | ||
|
|
a05bba15e7 | ||
|
|
3b907627f7 | ||
|
|
2284fd41b9 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "browser/ace"]
|
||||
path = browser/ace
|
||||
url = https://github.com/ajaxorg/ace-builds.git
|
||||
[submodule "browser/electron-stylus"]
|
||||
path = browser/electron-stylus
|
||||
url = https://github.com/Rokt33r/electron-stylus.git
|
||||
|
||||
BIN
Lato-Regular.ttf
Normal file
BIN
Lato-Regular.ttf
Normal file
Binary file not shown.
BIN
Lato-Regular.woff
Normal file
BIN
Lato-Regular.woff
Normal file
Binary file not shown.
BIN
Lato-Regular.woff2
Normal file
BIN
Lato-Regular.woff2
Normal file
Binary file not shown.
1
browser/electron-stylus
Submodule
1
browser/electron-stylus
Submodule
Submodule browser/electron-stylus added at 6d86de7c66
@@ -2,10 +2,9 @@ var React = require('react/addons')
|
||||
|
||||
var CodeViewer = require('../../main/Components/CodeViewer')
|
||||
|
||||
var Markdown = require('../../main/Mixins/Markdown')
|
||||
var MarkdownPreview = require('../../main/Components/MarkdownPreview')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [Markdown],
|
||||
propTypes: {
|
||||
currentArticle: React.PropTypes.object
|
||||
},
|
||||
@@ -28,7 +27,7 @@ module.exports = React.createClass({
|
||||
<div className='FinderDetail'>
|
||||
<div className='header'><i className='fa fa-file-text-o fa-fw'/> {article.title}</div>
|
||||
<div className='content'>
|
||||
<div className='marked' dangerouslySetInnerHTML={{__html: ' ' + this.markdown(article.content)}}></div>
|
||||
<MarkdownPreview className='marked' content={article.content}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -8,6 +8,17 @@
|
||||
|
||||
<link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css" media="screen" title="no title" charset="utf-8">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url('../../Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
|
||||
url('../../Lato-Regular.woff') format('woff'), /* Modern Browsers */
|
||||
url('../../Lato-Regular.ttf') format('truetype');
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
document.addEventListener('mousewheel', function(e) {
|
||||
if(e.deltaY % 1 !== 0) {
|
||||
@@ -47,14 +58,13 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
require('electron-stylus')(__dirname + '/../styles/finder/index.styl')
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script src="../ace/src-min/ace.js"></script>
|
||||
<script>
|
||||
require('../electron-stylus')(__dirname + '/../styles/finder/index.styl', 'finderCss')
|
||||
require('node-jsx').install({ harmony: true, extension: '.jsx' })
|
||||
require('./index.jsx')
|
||||
</script>
|
||||
|
||||
@@ -49,6 +49,7 @@ var Finder = React.createClass({
|
||||
document.addEventListener('keydown', this.handleKeyDown)
|
||||
document.addEventListener('click', this.handleClick)
|
||||
window.addEventListener('focus', this.handleFinderFocus)
|
||||
this.handleFinderFocus()
|
||||
},
|
||||
componentWillUnmount: function () {
|
||||
document.removeEventListener('keydown', this.handleKeyDown)
|
||||
|
||||
@@ -4,12 +4,20 @@ var version = remote.getGlobal('version')
|
||||
var React = require('react/addons')
|
||||
|
||||
var ExternalLink = require('../Mixins/ExternalLink')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [ExternalLink],
|
||||
mixins: [ExternalLink, KeyCaster('aboutModal')],
|
||||
propTypes: {
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='AboutModal modal'>
|
||||
|
||||
@@ -5,6 +5,8 @@ var LinkedState = require('../Mixins/LinkedState')
|
||||
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var UserStore = require('../Stores/UserStore')
|
||||
|
||||
var getOptions = function (input, callback) {
|
||||
@@ -26,7 +28,7 @@ var getOptions = function (input, callback) {
|
||||
}
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('addMemberModal')],
|
||||
propTypes: {
|
||||
team: React.PropTypes.object,
|
||||
close: React.PropTypes.func
|
||||
@@ -37,20 +39,35 @@ module.exports = React.createClass({
|
||||
role: 'member'
|
||||
}
|
||||
},
|
||||
handleSubmit: function () {
|
||||
Hq
|
||||
.addMember(this.props.team.name, {
|
||||
userName: this.state.userName,
|
||||
role: this.state.role
|
||||
})
|
||||
.then(function (res) {
|
||||
console.log(res.body)
|
||||
UserStore.Actions.addMember(res.body)
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
break
|
||||
case 'submitAddMemberModal':
|
||||
this.handleSubmit()
|
||||
break
|
||||
}
|
||||
},
|
||||
handleSubmit: function () {
|
||||
this.setState({errorMessage: null}, function () {
|
||||
Hq
|
||||
.addMember(this.props.team.name, {
|
||||
userName: this.state.userName,
|
||||
role: this.state.role
|
||||
})
|
||||
.then(function (res) {
|
||||
console.log(res.body)
|
||||
UserStore.Actions.addMember(res.body)
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
if (err.status === 403) {
|
||||
this.setState({errorMessage: err.response.body.message})
|
||||
}
|
||||
}.bind(this))
|
||||
})
|
||||
},
|
||||
handleChange: function (value) {
|
||||
this.setState({userName: value})
|
||||
@@ -76,6 +93,8 @@ module.exports = React.createClass({
|
||||
role
|
||||
</div>
|
||||
|
||||
{this.state.errorMessage != null ? (<p className='errorAlert'>{this.state.errorMessage}</p>) : null}
|
||||
|
||||
<button onClick={this.handleSubmit} className='submitButton'><i className='fa fa-check'/></button>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -2,19 +2,26 @@ var React = require('react')
|
||||
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [KeyCaster('codeDeleteModal')],
|
||||
propTypes: {
|
||||
planet: React.PropTypes.object,
|
||||
code: React.PropTypes.object,
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this).focus()
|
||||
},
|
||||
stopPropagation: function (e) {
|
||||
e.stopPropagation()
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'submitCodeDeleteModal':
|
||||
this.submit()
|
||||
break
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
submit: function () {
|
||||
var planet = this.props.planet
|
||||
|
||||
@@ -7,13 +7,19 @@ module.exports = React.createClass({
|
||||
code: React.PropTypes.object,
|
||||
planet: React.PropTypes.object
|
||||
},
|
||||
componentDidMount: function () {
|
||||
// TODO: Hacked!! should fix later
|
||||
setTimeout(function () {
|
||||
React.findDOMNode(this.refs.form.refs.description).focus()
|
||||
}.bind(this), 1)
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='CodeEditModal modal'>
|
||||
<div className='modal-header'>
|
||||
<h1>Edit Code</h1>
|
||||
</div>
|
||||
<CodeForm code={this.props.code} planet={this.props.planet} close={this.props.close}/>
|
||||
<CodeForm ref='form' code={this.props.code} planet={this.props.planet} close={this.props.close}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ module.exports = React.createClass({
|
||||
propTypes: {
|
||||
code: React.PropTypes.string,
|
||||
mode: React.PropTypes.string,
|
||||
className: React.PropTypes.string,
|
||||
onChange: React.PropTypes.func
|
||||
},
|
||||
componentDidMount: function () {
|
||||
@@ -52,7 +53,7 @@ module.exports = React.createClass({
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div ref='target'></div>
|
||||
<div ref='target' className={this.props.className}></div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ var Select = require('react-select')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
@@ -29,7 +30,7 @@ var getOptions = function (input, callback) {
|
||||
}
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('codeForm')],
|
||||
propTypes: {
|
||||
planet: React.PropTypes.object,
|
||||
close: React.PropTypes.func,
|
||||
@@ -55,6 +56,16 @@ module.exports = React.createClass({
|
||||
code: code
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'submitCodeForm':
|
||||
this.submit()
|
||||
break
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
handleModeChange: function (selected) {
|
||||
var code = this.state.code
|
||||
code.mode = selected
|
||||
|
||||
@@ -5,7 +5,8 @@ var ace = window.ace
|
||||
module.exports = React.createClass({
|
||||
propTypes: {
|
||||
code: React.PropTypes.string,
|
||||
mode: React.PropTypes.string
|
||||
mode: React.PropTypes.string,
|
||||
className: React.PropTypes.string
|
||||
},
|
||||
componentDidMount: function () {
|
||||
var el = React.findDOMNode(this.refs.target)
|
||||
@@ -46,7 +47,7 @@ module.exports = React.createClass({
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div ref='target'></div>
|
||||
<div ref='target' className={this.props.className}></div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
var React = require('react')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('contactModal')],
|
||||
propTypes: {
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
@@ -18,6 +19,23 @@ module.exports = React.createClass({
|
||||
}
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
case 'submitContactModal':
|
||||
if (this.state.isSent) {
|
||||
this.props.close()
|
||||
return
|
||||
}
|
||||
this.sendEmail()
|
||||
break
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this.refs.title).focus()
|
||||
},
|
||||
sendEmail: function () {
|
||||
Hq.sendEmail(this.state.mail)
|
||||
.then(function (res) {
|
||||
@@ -36,7 +54,7 @@ module.exports = React.createClass({
|
||||
<div className='contactForm'>
|
||||
<div className='modal-body'>
|
||||
<div className='formField'>
|
||||
<input valueLink={this.linkState('mail.title')} placeholder='Title'/>
|
||||
<input ref='title' valueLink={this.linkState('mail.title')} placeholder='Title'/>
|
||||
</div>
|
||||
<div className='formField'>
|
||||
<textarea valueLink={this.linkState('mail.content')} placeholder='Content'/>
|
||||
|
||||
@@ -5,17 +5,19 @@ var React = require('react/addons')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var UserStore = require('../Stores/UserStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('editProfileModal')],
|
||||
propTypes: {
|
||||
user: React.PropTypes.shape({
|
||||
name: React.PropTypes.string,
|
||||
profileName: React.PropTypes.string,
|
||||
email: React.PropTypes.string
|
||||
})
|
||||
}),
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
getInitialState: function () {
|
||||
var user = this.props.user
|
||||
@@ -34,6 +36,13 @@ module.exports = React.createClass({
|
||||
passwordSubmitStatus: null
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
selectTab: function (tabName) {
|
||||
return function () {
|
||||
this.setState({currentTab: tabName})
|
||||
|
||||
@@ -71,16 +71,6 @@ module.exports = React.createClass({
|
||||
openPlanetCreateModal: function () {
|
||||
this.openModal(PlanetCreateModal, {transitionTo: this.transitionTo})
|
||||
},
|
||||
handleKeyDown: function (e) {
|
||||
if (this.state.currentUser == null) return
|
||||
if (e.metaKey && e.keyCode > 48 && e.keyCode < 58) {
|
||||
var planet = this.state.currentUser.Planets[e.keyCode - 49]
|
||||
if (planet != null) {
|
||||
this.transitionTo('planet', {userName: planet.userName, planetName: planet.name})
|
||||
}
|
||||
e.preventDefault()
|
||||
}
|
||||
},
|
||||
toggleProfilePopup: function () {
|
||||
this.openProfilePopup()
|
||||
},
|
||||
@@ -96,6 +86,10 @@ module.exports = React.createClass({
|
||||
handleLogoutClick: function () {
|
||||
this.openModal(LogoutModal, {transitionTo: this.transitionTo})
|
||||
},
|
||||
switchPlanetByIndex: function (index) {
|
||||
var planetProps = this.refs.planets.props.children[index - 1].props
|
||||
this.transitionTo('planet', {userName: planetProps.userName, planetName: planetProps.planetName})
|
||||
},
|
||||
render: function () {
|
||||
var params = this.getParams()
|
||||
|
||||
@@ -110,12 +104,12 @@ module.exports = React.createClass({
|
||||
return team.Planets == null ? planets : planets.concat(team.Planets)
|
||||
}, []))).map(function (planet, index) {
|
||||
return (
|
||||
<li key={planet.id} className={params.userName === planet.userName && params.planetName === planet.name ? 'active' : ''}>
|
||||
<li userName={planet.userName} planetName={planet.name} key={planet.id} className={params.userName === planet.userName && params.planetName === planet.name ? 'active' : ''}>
|
||||
<Link to='planet' params={{userName: planet.userName, planetName: planet.name}}>
|
||||
{planet.name[0]}
|
||||
<div className='planetTooltip'>{planet.userName}/{planet.name}</div>
|
||||
</Link>
|
||||
<div className='shortCut'>⌘{index + 1}</div>
|
||||
{index < 9 ? (<div className='shortCut'>⌘{index + 1}</div>) : null}
|
||||
</li>
|
||||
)
|
||||
})
|
||||
@@ -128,12 +122,12 @@ module.exports = React.createClass({
|
||||
<ProfileImage size='55' email={this.state.currentUser.email}/>
|
||||
</button>
|
||||
{popup}
|
||||
<ul className='planetList'>
|
||||
<ul ref='planets' className='planetList'>
|
||||
{planets}
|
||||
</ul>
|
||||
<button onClick={this.openPlanetCreateModal} className='newPlanet'>
|
||||
<i className='fa fa-plus'/>
|
||||
<div className='newPlanetTooltip'>Create new planet</div>
|
||||
<div className='tooltip'>Create new planet</div>
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
@@ -143,7 +137,6 @@ module.exports = React.createClass({
|
||||
return (
|
||||
<li key={'user-' + team.id}>
|
||||
<Link to='userHome' params={{userName: team.name}} className='userName'>{team.profileName} ({team.name})</Link>
|
||||
<div className='userSetting'><i className='fa fa-gear'/></div>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
@@ -157,7 +150,6 @@ module.exports = React.createClass({
|
||||
<ul className='profileGroupList'>
|
||||
<li>
|
||||
<Link to='userHome' params={{userName: this.state.currentUser.name}} className='userName'>Profile ({this.state.currentUser.name})</Link>
|
||||
<div className='userSetting'><i className='fa fa-gear'/></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -15,34 +15,52 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
|
||||
var codeButton = React.findDOMNode(this.refs.codeButton)
|
||||
codeButton.addEventListener('keydown', this.handleKeyDown)
|
||||
React.findDOMNode(this.refs.noteButton).addEventListener('keydown', this.handleKeyDown)
|
||||
codeButton.focus()
|
||||
},
|
||||
stopPropagation: function (e) {
|
||||
e.stopPropagation()
|
||||
},
|
||||
selectCodeTab: function () {
|
||||
this.setState({currentTab: 'code'})
|
||||
},
|
||||
selectNoteTab: function () {
|
||||
this.setState({currentTab: 'note'})
|
||||
componentWillUnmount: function () {
|
||||
React.findDOMNode(this.refs.codeButton).removeEventListener('keydown', this.handleKeyDown)
|
||||
React.findDOMNode(this.refs.noteButton).removeEventListener('keydown', this.handleKeyDown)
|
||||
},
|
||||
handleKeyDown: function (e) {
|
||||
if (e.keyCode === 37 && e.metaKey) {
|
||||
this.selectCodeTab()
|
||||
e.stopPropagation()
|
||||
return
|
||||
}
|
||||
if (e.keyCode === 39 && e.metaKey) {
|
||||
this.selectNoteTab()
|
||||
e.stopPropagation()
|
||||
return
|
||||
}
|
||||
if (e.keyCode === 9) {
|
||||
if (this.state.currentTab === 'code') React.findDOMNode(this.refs.form.refs.description).focus()
|
||||
else React.findDOMNode(this.refs.form.refs.title).focus()
|
||||
|
||||
e.preventDefault()
|
||||
}
|
||||
},
|
||||
selectCodeTab: function () {
|
||||
this.setState({currentTab: 'code'}, function () {
|
||||
React.findDOMNode(this.refs.codeButton).focus()
|
||||
})
|
||||
},
|
||||
selectNoteTab: function () {
|
||||
this.setState({currentTab: 'note'}, function () {
|
||||
React.findDOMNode(this.refs.noteButton).focus()
|
||||
})
|
||||
},
|
||||
render: function () {
|
||||
var modalBody
|
||||
if (this.state.currentTab === 'code') {
|
||||
modalBody = (
|
||||
<CodeForm planet={this.props.planet} transitionTo={this.props.transitionTo} close={this.props.close}/>
|
||||
<CodeForm ref='form' planet={this.props.planet} transitionTo={this.props.transitionTo} close={this.props.close}/>
|
||||
)
|
||||
} else {
|
||||
modalBody = (
|
||||
<NoteForm planet={this.props.planet} transitionTo={this.props.transitionTo} close={this.props.close}/>
|
||||
<NoteForm ref='form' planet={this.props.planet} transitionTo={this.props.transitionTo} close={this.props.close}/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -50,7 +68,8 @@ module.exports = React.createClass({
|
||||
<div className='LaunchModal modal'>
|
||||
<div className='modal-header'>
|
||||
<div className='modal-tab'>
|
||||
<button className={this.state.currentTab === 'code' ? 'btn-primary active' : 'btn-default'} onClick={this.selectCodeTab}>Code</button><button className={this.state.currentTab === 'note' ? 'btn-primary active' : 'btn-default'} onClick={this.selectNoteTab}>Note</button>
|
||||
<button ref='codeButton' className={this.state.currentTab === 'code' ? 'btn-primary active' : 'btn-default'} onClick={this.selectCodeTab}>Code</button>
|
||||
<button ref='noteButton' className={this.state.currentTab === 'note' ? 'btn-primary active' : 'btn-default'} onClick={this.selectNoteTab}>Note</button>
|
||||
</div>
|
||||
</div>
|
||||
{modalBody}
|
||||
|
||||
@@ -2,11 +2,24 @@
|
||||
|
||||
var React = require('react')
|
||||
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [KeyCaster('logoutModal')],
|
||||
propTypes: {
|
||||
transitionTo: React.PropTypes.func,
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
case 'submitLogoutModal':
|
||||
this.logout()
|
||||
break
|
||||
}
|
||||
},
|
||||
logout: function () {
|
||||
localStorage.removeItem('currentUser')
|
||||
localStorage.removeItem('token')
|
||||
|
||||
@@ -2,16 +2,26 @@ var React = require('react')
|
||||
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [KeyCaster('noteDeleteModal')],
|
||||
propTypes: {
|
||||
planet: React.PropTypes.object,
|
||||
note: React.PropTypes.object,
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this).focus()
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'submitNoteDeleteModal':
|
||||
this.submit()
|
||||
break
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
submit: function () {
|
||||
var planet = this.props.planet
|
||||
|
||||
@@ -8,13 +8,19 @@ module.exports = React.createClass({
|
||||
note: React.PropTypes.object,
|
||||
planet: React.PropTypes.object
|
||||
},
|
||||
componentDidMount: function () {
|
||||
// TODO: Hacked!! should fix later
|
||||
setTimeout(function () {
|
||||
React.findDOMNode(this.refs.form.refs.title).focus()
|
||||
}.bind(this), 1)
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='NoteEditModal modal'>
|
||||
<div className='modal-header'>
|
||||
<h1>Edit Note</h1>
|
||||
</div>
|
||||
<NoteForm note={this.props.note} planet={this.props.planet} close={this.props.close}/>
|
||||
<NoteForm ref='form' note={this.props.note} planet={this.props.planet} close={this.props.close}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
var React = require('react/addons')
|
||||
var ReactRouter = require('react-router')
|
||||
var Select = require('react-select')
|
||||
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var Markdown = require('../Mixins/Markdown')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
@@ -34,7 +34,7 @@ var EDIT_MODE = 0
|
||||
var PREVIEW_MODE = 1
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState, Markdown],
|
||||
mixins: [LinkedState, Markdown, KeyCaster('noteForm')],
|
||||
propTypes: {
|
||||
planet: React.PropTypes.object,
|
||||
close: React.PropTypes.func,
|
||||
@@ -58,8 +58,15 @@ module.exports = React.createClass({
|
||||
mode: EDIT_MODE
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this.refs.title).focus()
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'submitNoteForm':
|
||||
this.submit()
|
||||
break
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
handleTagsChange: function (selected, all) {
|
||||
var note = this.state.note
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
var React = require('react/addons')
|
||||
var moment = require('moment')
|
||||
|
||||
var CodeViewer = require('../Components/CodeViewer')
|
||||
|
||||
var CodeEditModal = require('../Components/CodeEditModal')
|
||||
var CodeDeleteModal = require('../Components/CodeDeleteModal')
|
||||
var NoteEditModal = require('../Components/NoteEditModal')
|
||||
var NoteDeleteModal = require('../Components/NoteDeleteModal')
|
||||
var MarkdownPreview = require('../Components/MarkdownPreview')
|
||||
var CodeViewer = require('./CodeViewer')
|
||||
var CodeEditModal = require('./CodeEditModal')
|
||||
var CodeDeleteModal = require('./CodeDeleteModal')
|
||||
var NoteEditModal = require('./NoteEditModal')
|
||||
var NoteDeleteModal = require('./NoteDeleteModal')
|
||||
var MarkdownPreview = require('./MarkdownPreview')
|
||||
var ProfileImage = require('./ProfileImage')
|
||||
|
||||
var Modal = require('../Mixins/Modal')
|
||||
var ForceUpdate = require('../Mixins/ForceUpdate')
|
||||
@@ -25,6 +25,7 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
openEditModal: function () {
|
||||
if (this.props.article == null) return
|
||||
switch (this.props.article.type) {
|
||||
case 'code' :
|
||||
this.openModal(CodeEditModal, {code: this.props.article, planet: this.props.planet})
|
||||
@@ -34,6 +35,7 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
openDeleteModal: function () {
|
||||
if (this.props.article == null) return
|
||||
switch (this.props.article.type) {
|
||||
case 'code' :
|
||||
this.openModal(CodeDeleteModal, {code: this.props.article, planet: this.props.planet})
|
||||
@@ -61,36 +63,61 @@ module.exports = React.createClass({
|
||||
if (article.type === 'code') {
|
||||
return (
|
||||
<div className='PlanetArticleDetail codeDetail'>
|
||||
<div className='viewer-header'>
|
||||
<i className='fa fa-code fa-fw'></i> {article.callSign} <small className='updatedAt'>{moment(article.updatedAt).fromNow()}</small>
|
||||
<span className='control-group'>
|
||||
<button onClick={this.openEditModal} className='btn-default btn-square btn-sm'><i className='fa fa-edit fa-fw'></i></button>
|
||||
<button onClick={this.openDeleteModal} className='btn-default btn-square btn-sm'><i className='fa fa-trash fa-fw'></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<div className='viewer-body'>
|
||||
<div className='viewer-detail'>
|
||||
<div className='detailHeader'>
|
||||
<div className='itemLeft'>
|
||||
<ProfileImage className='profileImage' size='25' email={article.User.email}/>
|
||||
<i className='fa fa-code fa-fw'></i>
|
||||
</div>
|
||||
|
||||
<div className='itemRight'>
|
||||
<div className='itemInfo'>{moment(article.updatedAt).fromNow()} by <span className='userProfileName'>{article.User.profileName}</span></div>
|
||||
<div className='description'>{article.description}</div>
|
||||
<div className='tags'><i className='fa fa-tags'/>{tags}</div>
|
||||
</div>
|
||||
<div className='content'>
|
||||
<CodeViewer code={article.content} mode={article.mode}/>
|
||||
</div>
|
||||
|
||||
<span className='itemControl'>
|
||||
<button id='articleEditButton' onClick={this.openEditModal} className='editButton'>
|
||||
<i className='fa fa-edit fa-fw'></i>
|
||||
<div className='tooltip'>Edit</div>
|
||||
</button>
|
||||
<button onClick={this.openDeleteModal} className='deleteButton'>
|
||||
<i className='fa fa-trash fa-fw'></i>
|
||||
<div className='tooltip'>Delete</div>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div className='detailBody'>
|
||||
<CodeViewer className='content' code={article.content} mode={article.mode}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className='PlanetArticleDetail noteDetail'>
|
||||
<div className='viewer-header'>
|
||||
<i className='fa fa-file-text-o fa-fw'></i> {article.title} <small className='updatedAt'>{moment(article.updatedAt).fromNow()}</small>
|
||||
<span className='control-group'>
|
||||
<button onClick={this.openEditModal} className='btn-default btn-square btn-sm'><i className='fa fa-edit fa-fw'></i></button>
|
||||
<button onClick={this.openDeleteModal} className='btn-default btn-square btn-sm'><i className='fa fa-trash fa-fw'></i></button>
|
||||
<div className='detailHeader'>
|
||||
<div className='itemLeft'>
|
||||
<ProfileImage className='profileImage' size='25' email={article.User.email}/>
|
||||
<i className='fa fa-file-text-o fa-fw'></i>
|
||||
</div>
|
||||
|
||||
<div className='itemRight'>
|
||||
<div className='itemInfo'>{moment(article.updatedAt).fromNow()} by <span className='userProfileName'>{article.User.profileName}</span></div>
|
||||
<div className='description'>{article.title}</div>
|
||||
<div className='tags'><i className='fa fa-tags'/>{tags}</div>
|
||||
</div>
|
||||
|
||||
<span className='itemControl'>
|
||||
<button id='articleEditButton' onClick={this.openEditModal} className='editButton'>
|
||||
<i className='fa fa-edit fa-fw'></i>
|
||||
<div className='tooltip'>Edit</div>
|
||||
</button>
|
||||
<button onClick={this.openDeleteModal} className='deleteButton'>
|
||||
<i className='fa fa-trash fa-fw'></i>
|
||||
<div className='tooltip'>Delete</div>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div className='viewer-body'>
|
||||
<div className='tags'><i className='fa fa-tags'/>{tags}</div>
|
||||
<div className='detailBody'>
|
||||
<MarkdownPreview className='content' content={article.content}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,33 @@ module.exports = React.createClass({
|
||||
articles: React.PropTypes.array,
|
||||
showOnlyWithTag: React.PropTypes.func
|
||||
},
|
||||
handleArticleClikck: function (article) {
|
||||
if (article.type === 'code') {
|
||||
return function (e) {
|
||||
var params = this.getParams()
|
||||
|
||||
document.getElementById('articleEditButton').focus()
|
||||
this.transitionTo('codes', {
|
||||
userName: params.userName,
|
||||
planetName: params.planetName,
|
||||
localId: article.localId
|
||||
})
|
||||
}.bind(this)
|
||||
}
|
||||
|
||||
if (article.type === 'note') {
|
||||
return function (e) {
|
||||
var params = this.getParams()
|
||||
|
||||
document.getElementById('articleEditButton').focus()
|
||||
this.transitionTo('notes', {
|
||||
userName: params.userName,
|
||||
planetName: params.planetName,
|
||||
localId: article.localId
|
||||
})
|
||||
}.bind(this)
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
var articles = this.props.articles.map(function (article) {
|
||||
var tags = article.Tags.length > 0 ? article.Tags.map(function (tag) {
|
||||
@@ -25,28 +52,17 @@ module.exports = React.createClass({
|
||||
var params = this.getParams()
|
||||
var isActive = article.type === 'code' ? this.isActive('codes') && parseInt(params.localId, 10) === article.localId : this.isActive('notes') && parseInt(params.localId, 10) === article.localId
|
||||
|
||||
var handleClick
|
||||
|
||||
if (article.type === 'code') {
|
||||
|
||||
handleClick = function () {
|
||||
this.transitionTo('codes', {
|
||||
userName: params.userName,
|
||||
planetName: params.planetName,
|
||||
localId: article.localId
|
||||
})
|
||||
}.bind(this)
|
||||
|
||||
return (
|
||||
<li onClick={handleClick} key={'code-' + article.id}>
|
||||
<li onClick={this.handleArticleClikck(article)} key={'code-' + article.id}>
|
||||
<div className={'articleItem' + (isActive ? ' active' : '')}>
|
||||
<div className='itemLeft'>
|
||||
<ProfileImage className='profileImage' size='25' email={article.User.email}/>
|
||||
<i className='fa fa-code fa-fw'></i>
|
||||
</div>
|
||||
<div className='itemRight'>
|
||||
<div className='updatedAt'>{moment(article.updatedAt).fromNow()}</div>
|
||||
<div className='description'>{article.description.length > 50 ? article.description.substring(0, 50) + ' …' : article.description}</div>
|
||||
<div className='itemInfo'>{moment(article.updatedAt).fromNow()} by <span className='userProfileName'>{article.User.profileName}</span></div>
|
||||
<div className='description'>{article.description}</div>
|
||||
<div className='tags'><i className='fa fa-tags'/>{tags}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,16 +71,8 @@ module.exports = React.createClass({
|
||||
)
|
||||
}
|
||||
|
||||
handleClick = function () {
|
||||
this.transitionTo('notes', {
|
||||
userName: params.userName,
|
||||
planetName: params.planetName,
|
||||
localId: article.localId
|
||||
})
|
||||
}.bind(this)
|
||||
|
||||
return (
|
||||
<li onClick={handleClick} key={'note-' + article.id}>
|
||||
<li onClick={this.handleArticleClikck(article)} key={'note-' + article.id}>
|
||||
<div className={'articleItem blueprintItem' + (isActive ? ' active' : '')}>
|
||||
<div className='itemLeft'>
|
||||
<ProfileImage className='profileImage' size='25' email={article.User.email}/>
|
||||
@@ -72,7 +80,7 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
|
||||
<div className='itemRight'>
|
||||
<div className='updatedAt'>{moment(article.updatedAt).fromNow()}</div>
|
||||
<div className='itemInfo'>{moment(article.updatedAt).fromNow()} by <span className='userProfileName'>{article.User.profileName}</span></div>
|
||||
<div className='description'>{article.title}</div>
|
||||
<div className='tags'><i className='fa fa-tags'/>{tags}</div>
|
||||
</div>
|
||||
@@ -85,7 +93,7 @@ module.exports = React.createClass({
|
||||
|
||||
return (
|
||||
<div className='PlanetArticleList'>
|
||||
<ul>
|
||||
<ul ref='articles'>
|
||||
{articles}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,12 @@ var React = require('react/addons')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('planetCreateModal')],
|
||||
propTypes: {
|
||||
ownerName: React.PropTypes.string,
|
||||
transitionTo: React.PropTypes.func,
|
||||
@@ -24,33 +25,57 @@ module.exports = React.createClass({
|
||||
name: '',
|
||||
public: true
|
||||
},
|
||||
ownerName: ownerName
|
||||
ownerName: ownerName,
|
||||
error: null
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this.refs.name).focus()
|
||||
},
|
||||
onListen: function (res) {
|
||||
if (res.status === 'planetCreated') {
|
||||
this.props.close()
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
case 'submitPlanetCreateModal':
|
||||
this.handleSubmit()
|
||||
break
|
||||
}
|
||||
},
|
||||
handleSubmit: function () {
|
||||
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
||||
.then(function (res) {
|
||||
var planet = res.body
|
||||
this.setState({error: null}, function () {
|
||||
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
||||
.then(function (res) {
|
||||
var planet = res.body
|
||||
|
||||
PlanetStore.Actions.update(planet)
|
||||
PlanetStore.Actions.update(planet)
|
||||
|
||||
if (this.props.transitionTo != null) {
|
||||
this.props.transitionTo('planetHome', {userName: planet.userName, planetName: planet.name})
|
||||
}
|
||||
if (this.props.transitionTo != null) {
|
||||
this.props.transitionTo('planetHome', {userName: planet.userName, planetName: planet.name})
|
||||
}
|
||||
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
|
||||
if (err.status == null) return this.setState({error: {message: 'Check your network connection'}})
|
||||
|
||||
switch (err.status) {
|
||||
case 403:
|
||||
this.setState({error: err.response.body})
|
||||
break
|
||||
case 422:
|
||||
this.setState({error: {message: 'Planet name should be Alphanumeric with _, -'}})
|
||||
break
|
||||
case 409:
|
||||
this.setState({error: {message: 'The entered name already in use'}})
|
||||
break
|
||||
default:
|
||||
this.setState({error: {message: 'Unexpected error occured! please try again'}})
|
||||
}
|
||||
}.bind(this))
|
||||
})
|
||||
},
|
||||
render: function () {
|
||||
var teamOptions = this.state.user.Teams.map(function (team) {
|
||||
@@ -75,6 +100,8 @@ module.exports = React.createClass({
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{this.state.error != null ? (<p className='errorAlert'>{this.state.error.message != null ? this.state.error.message : 'Error message undefined'}</p>) : null}
|
||||
|
||||
<button onClick={this.handleSubmit} className='submitButton'>
|
||||
<i className='fa fa-check'/>
|
||||
</button>
|
||||
|
||||
@@ -21,7 +21,22 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this.refs.search).focus()
|
||||
var search = React.findDOMNode(this.refs.search)
|
||||
search.addEventListener('keydown', this.handleSearchKeyDown)
|
||||
},
|
||||
componentWillUnmount: function () {
|
||||
var search = React.findDOMNode(this.refs.search)
|
||||
search.removeEventListener('keydown', this.handleSearchKeyDown)
|
||||
},
|
||||
handleSearchKeyDown: function (e) {
|
||||
if (e.keyCode === 38 || e.keyCode === 40) {
|
||||
var search = React.findDOMNode(this.refs.search)
|
||||
search.blur()
|
||||
e.preventDefault()
|
||||
}
|
||||
if (e.keyCode !== 27 && (e.keyCode !== 13 || !e.metaKey)) {
|
||||
e.stopPropagation()
|
||||
}
|
||||
},
|
||||
openPlanetSettingModal: function () {
|
||||
this.openModal(PlanetSettingModal, {planet: this.props.currentPlanet})
|
||||
@@ -42,12 +57,13 @@ module.exports = React.createClass({
|
||||
{this.props.currentPlanet.public ? null : (
|
||||
<div className='private'>
|
||||
<i className='fa fa-lock'/>
|
||||
<div className='privateTooltip'>Private planet</div>
|
||||
<div className='tooltip'>Private planet</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button onClick={this.openPlanetSettingModal} className='menuBtn'>
|
||||
<button onClick={this.openPlanetSettingModal} className='planetSettingButton'>
|
||||
<i className='fa fa-chevron-down'></i>
|
||||
<div className='tooltip'>Planet setting</div>
|
||||
</button>
|
||||
</div>
|
||||
<div className='headerControl'>
|
||||
@@ -55,9 +71,13 @@ module.exports = React.createClass({
|
||||
<i className='fa fa-search'/>
|
||||
<input onChange={this.props.onSearchChange} value={this.props.search} ref='search' type='text' className='inline-input circleInput' placeholder='Search...'/>
|
||||
</div>
|
||||
<button onClick={this.refresh} className='refreshButton'><i className='fa fa-refresh'/></button>
|
||||
<button onClick={this.refresh} className='refreshButton'>
|
||||
<i className='fa fa-refresh'/>
|
||||
<div className='tooltip'>Refresh planet</div>
|
||||
</button>
|
||||
<a onClick={this.openExternal} href='http://b00st.io' className='logo'>
|
||||
<img width='44' height='44' src='resources/favicon-230x230.png'/>
|
||||
<div className='tooltip'>Boost official page</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,29 +3,47 @@ var ReactRouter = require('react-router')
|
||||
var Navigation = ReactRouter.Navigation
|
||||
|
||||
var Modal = require('../Mixins/Modal')
|
||||
|
||||
var LaunchModal = require('../Components/LaunchModal')
|
||||
|
||||
var PlanetNavigator = React.createClass({
|
||||
module.exports = React.createClass({
|
||||
mixins: [Modal, Navigation],
|
||||
propTypes: {
|
||||
planet: React.PropTypes.shape({
|
||||
name: React.PropTypes.string
|
||||
name: React.PropTypes.string,
|
||||
Owner: React.PropTypes.shape({
|
||||
id: React.PropTypes.number,
|
||||
userType: React.PropTypes.string
|
||||
})
|
||||
}),
|
||||
search: React.PropTypes.string,
|
||||
toggleCodeFilter: React.PropTypes.func,
|
||||
toggleNoteFilter: React.PropTypes.func
|
||||
toggleNoteFilter: React.PropTypes.func,
|
||||
currentUser: React.PropTypes.shape({
|
||||
id: React.PropTypes.number,
|
||||
userType: React.PropTypes.string,
|
||||
Teams: React.PropTypes.array
|
||||
})
|
||||
},
|
||||
getInitialState: function () {
|
||||
return {
|
||||
isLaunchModalOpen: false
|
||||
}
|
||||
},
|
||||
submitLaunchModal: function (ret) {
|
||||
this.setState({isLaunchModalOpen: false})
|
||||
},
|
||||
openLaunchModal: function () {
|
||||
this.openModal(LaunchModal, {planet: this.props.planet, transitionTo: this.transitionTo})
|
||||
},
|
||||
isMyPlanet: function () {
|
||||
if (this.props.currentUser == null) return false
|
||||
if (this.props.planet.Owner.userType === 'person' && this.props.planet.Owner.id !== this.props.currentUser.id) return false
|
||||
if (this.props.planet.Owner.userType === 'team' && !this.props.currentUser.Teams.some(function (team) {
|
||||
if (team.id === this.props.planet.Owner.id) return true
|
||||
return false
|
||||
}.bind(this))) return false
|
||||
|
||||
return true
|
||||
|
||||
},
|
||||
render: function () {
|
||||
var keywords = this.props.search.split(' ')
|
||||
var usingCodeFilter = keywords.some(function (keyword) {
|
||||
@@ -39,9 +57,11 @@ var PlanetNavigator = React.createClass({
|
||||
|
||||
return (
|
||||
<div className='PlanetNavigator'>
|
||||
<button onClick={this.openLaunchModal} className='launchButton btn-primary btn-block'>
|
||||
<i className='fa fa-rocket fa-fw'/> Launch
|
||||
</button>
|
||||
{this.isMyPlanet() ? (
|
||||
<button onClick={this.openLaunchModal} className='launchButton btn-primary btn-block'>
|
||||
<i className='fa fa-rocket fa-fw'/> Launch
|
||||
</button>
|
||||
) : null}
|
||||
<nav className='articleFilters'>
|
||||
<a className={usingCodeFilter && !usingNoteFilter ? 'active' : ''} onClick={this.props.toggleCodeFilter}>
|
||||
<i className='fa fa-code fa-fw'/> Codes
|
||||
@@ -54,5 +74,3 @@ var PlanetNavigator = React.createClass({
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = PlanetNavigator
|
||||
|
||||
@@ -3,11 +3,12 @@ var React = require('react/addons')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('planetSettingModal')],
|
||||
propTypes: {
|
||||
close: React.PropTypes.func,
|
||||
planet: React.PropTypes.shape({
|
||||
@@ -35,6 +36,13 @@ module.exports = React.createClass({
|
||||
deleteConfirmation: ''
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
activePlanetProfile: function () {
|
||||
this.setState({currentTab: 'profile'})
|
||||
},
|
||||
@@ -50,18 +58,44 @@ module.exports = React.createClass({
|
||||
handleSavePlanetProfile: function (e) {
|
||||
var planet = this.props.planet
|
||||
|
||||
this.setState({profileSubmitStatus: 'sending'}, function () {
|
||||
this.setState({profileFormStatus: 'sending', profileFormError: null}, function () {
|
||||
Hq.updatePlanet(planet.userName, planet.name, this.state.planet)
|
||||
.then(function (res) {
|
||||
var planet = res.body
|
||||
|
||||
this.setState({profileSubmitStatus: 'done'})
|
||||
console.log(planet)
|
||||
this.setState({profileFormStatus: 'done'})
|
||||
|
||||
PlanetStore.Actions.update(planet)
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
this.setState({profileSubmitStatus: 'error'})
|
||||
console.error(err)
|
||||
var newState = {
|
||||
profileFormStatus: 'error'
|
||||
}
|
||||
|
||||
if (err.status == null) {
|
||||
newState.profileFormError = {message: 'Check your network connection'}
|
||||
return this.setState(newState)
|
||||
}
|
||||
|
||||
switch (err.status) {
|
||||
case 403:
|
||||
newState.profileFormError = err.response.body
|
||||
this.setState(newState)
|
||||
break
|
||||
case 422:
|
||||
newState.profileFormError = {message: 'Planet name should be Alphanumeric with _, -'}
|
||||
this.setState(newState)
|
||||
break
|
||||
case 409:
|
||||
newState.profileFormError = {message: 'The entered name already in use'}
|
||||
this.setState(newState)
|
||||
break
|
||||
default:
|
||||
newState.profileFormError = {message: 'Undefined error please try again'}
|
||||
this.setState(newState)
|
||||
}
|
||||
}.bind(this))
|
||||
})
|
||||
},
|
||||
@@ -122,11 +156,11 @@ module.exports = React.createClass({
|
||||
<div className='formConfirm'>
|
||||
<button onClick={this.handleSavePlanetProfile} className='saveButton btn-primary'>Save</button>
|
||||
|
||||
<div className={'alertInfo' + (this.state.profileSubmitStatus === 'sending' ? '' : ' hide')}>on Sending...</div>
|
||||
<div className={'alertInfo' + (this.state.profileFormStatus === 'sending' ? '' : ' hide')}>on Sending...</div>
|
||||
|
||||
<div className={'alertError' + (this.state.profileSubmitStatus === 'error' ? '' : ' hide')}>Connection failed.. Try again.</div>
|
||||
<div className={'alertError' + (this.state.profileFormStatus === 'error' ? '' : ' hide')}>{this.state.profileFormError != null ? this.state.profileFormError.message : 'Unexpected error occured! please try again'}</div>
|
||||
|
||||
<div className={'alertSuccess' + (this.state.profileSubmitStatus === 'done' ? '' : ' hide')}>Successfully done!!</div>
|
||||
<div className={'alertSuccess' + (this.state.profileFormStatus === 'done' ? '' : ' hide')}>Successfully done!!</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -5,11 +5,12 @@ var React = require('react/addons')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var UserStore = require('../Stores/UserStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState],
|
||||
mixins: [LinkedState, KeyCaster('teamCreateModal')],
|
||||
propTypes: {
|
||||
user: React.PropTypes.shape({
|
||||
name: React.PropTypes.string
|
||||
@@ -21,33 +22,62 @@ module.exports = React.createClass({
|
||||
return {
|
||||
team: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
error: null
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
React.findDOMNode(this.refs.teamName).focus()
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
case 'submitTeamCreateModal':
|
||||
this.handleSubmit()
|
||||
break
|
||||
}
|
||||
},
|
||||
handleSubmit: function () {
|
||||
Hq.createTeam(this.props.user.name, this.state.team)
|
||||
.then(function (res) {
|
||||
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
||||
var team = res.body
|
||||
this.setState({error: null}, function () {
|
||||
Hq.createTeam(this.props.user.name, this.state.team)
|
||||
.then(function (res) {
|
||||
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
||||
var team = res.body
|
||||
|
||||
currentUser.Teams.push(team)
|
||||
localStorage.setItem('currentUser', JSON.stringify(currentUser))
|
||||
UserStore.Actions.update(currentUser)
|
||||
currentUser.Teams.push(team)
|
||||
localStorage.setItem('currentUser', JSON.stringify(currentUser))
|
||||
UserStore.Actions.update(currentUser)
|
||||
|
||||
if (this.props.transitionTo != null) {
|
||||
this.props.transitionTo('userHome', {userName: team.name})
|
||||
}
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
if (this.props.transitionTo != null) {
|
||||
this.props.transitionTo('userHome', {userName: team.name})
|
||||
}
|
||||
this.props.close()
|
||||
}.bind(this))
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
|
||||
if (err.status == null) return this.setState({error: {message: 'Check your network connection'}})
|
||||
|
||||
switch (err.status) {
|
||||
case 422:
|
||||
this.setState({error: {message: 'Team name should be Alphanumeric with _, -'}})
|
||||
break
|
||||
case 409:
|
||||
this.setState({error: {message: 'The entered name already in use'}})
|
||||
break
|
||||
default:
|
||||
this.setState({error: {message: 'Error message undefined'}})
|
||||
}
|
||||
}.bind(this))
|
||||
})
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='TeamCreateModal modal'>
|
||||
<input valueLink={this.linkState('team.name')} className='nameInput stripInput' placeholder='Create new team'/>
|
||||
|
||||
<input ref='teamName' valueLink={this.linkState('team.name')} className='nameInput stripInput' placeholder='Create new team'/>
|
||||
{this.state.error != null ? (<p className='errorAlert'>{this.state.error.message != null ? this.state.error.message : 'Unintended error occured'}</p>) : null}
|
||||
<button onClick={this.handleSubmit} className='submitButton'>
|
||||
<i className='fa fa-check'/>
|
||||
</button>
|
||||
|
||||
@@ -8,6 +8,7 @@ var Hq = require('../Services/Hq')
|
||||
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var Helper = require('../Mixins/Helper')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var UserStore = require('../Stores/UserStore')
|
||||
|
||||
@@ -30,7 +31,7 @@ var getOptions = function (input, callback) {
|
||||
}
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState, Reflux.listenTo(UserStore, 'onUserChange'), Helper],
|
||||
mixins: [LinkedState, Reflux.listenTo(UserStore, 'onUserChange'), Helper, KeyCaster('teamSettingsModal')],
|
||||
propTypes: {
|
||||
team: React.PropTypes.shape({
|
||||
id: React.PropTypes.number,
|
||||
@@ -38,7 +39,8 @@ module.exports = React.createClass({
|
||||
profileName: React.PropTypes.string,
|
||||
email: React.PropTypes.string,
|
||||
Members: React.PropTypes.array
|
||||
})
|
||||
}),
|
||||
close: React.PropTypes.func
|
||||
},
|
||||
getInitialState: function () {
|
||||
var team = this.props.team
|
||||
@@ -55,6 +57,13 @@ module.exports = React.createClass({
|
||||
updatingMember: false
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'closeModal':
|
||||
this.props.close()
|
||||
break
|
||||
}
|
||||
},
|
||||
onUserChange: function (res) {
|
||||
var member
|
||||
switch (res.status) {
|
||||
@@ -264,7 +273,7 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
Maximum numbr of members is 5 on Beta version. Please contact us if you want futher use.
|
||||
Maximum number of members is 5 on Beta version. Please contact us if you want futher use.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -7,21 +7,33 @@ var State = ReactRouter.State
|
||||
var Navigation = ReactRouter.Navigation
|
||||
|
||||
var AuthFilter = require('../Mixins/AuthFilter')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var HomeNavigator = require('../Components/HomeNavigator')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [AuthFilter.OnlyUser, State, Navigation],
|
||||
mixins: [AuthFilter.OnlyUser, State, Navigation, KeyCaster('homeContainer')],
|
||||
componentDidMount: function () {
|
||||
if (this.isActive('homeEmpty')) {
|
||||
var user = JSON.parse(localStorage.getItem('currentUser'))
|
||||
if (user.Planets != null && user.Planets.length > 0) {
|
||||
this.transitionTo('planet', {userName: user.name, planetName: user.Planets[0].name})
|
||||
return
|
||||
}
|
||||
this.transitionTo('userHome', {userName: user.name})
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'switchPlanet':
|
||||
this.refs.navigator.switchPlanetByIndex(e.data)
|
||||
break
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='HomeContainer'>
|
||||
<HomeNavigator/>
|
||||
<HomeNavigator ref='navigator'/>
|
||||
<RouteHandler/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -96,7 +96,10 @@ module.exports = React.createClass({
|
||||
{this.state.updateAvailable ? (
|
||||
<button onClick={this.updateApp} className='appUpdateButton'><i className='fa fa-cloud-download'/> Update available!</button>
|
||||
) : null}
|
||||
<button onClick={this.openContactModal} className='contactButton'><i className='fa fa-paper-plane-o'/></button>
|
||||
<button onClick={this.openContactModal} className='contactButton'>
|
||||
<i className='fa fa-paper-plane-o'/>
|
||||
<div className='tooltip'>Contact us</div>
|
||||
</button>
|
||||
<RouteHandler/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -14,12 +14,13 @@ var Hq = require('../Services/Hq')
|
||||
var Modal = require('../Mixins/Modal')
|
||||
var ArticleFilter = require('../Mixins/ArticleFilter')
|
||||
var Helper = require('../Mixins/Helper')
|
||||
var KeyCaster = require('../Mixins/KeyCaster')
|
||||
|
||||
var UserStore = require('../Stores/UserStore')
|
||||
var PlanetStore = require('../Stores/PlanetStore')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [ReactRouter.Navigation, ReactRouter.State, Modal, Reflux.listenTo(UserStore, 'onUserChange'), Reflux.listenTo(PlanetStore, 'onPlanetChange'), ArticleFilter, Helper],
|
||||
mixins: [ReactRouter.Navigation, ReactRouter.State, Modal, Reflux.listenTo(UserStore, 'onUserChange'), Reflux.listenTo(PlanetStore, 'onPlanetChange'), ArticleFilter, Helper, KeyCaster('planetContainer')],
|
||||
propTypes: {
|
||||
params: React.PropTypes.object,
|
||||
planetName: React.PropTypes.string
|
||||
@@ -62,6 +63,28 @@ module.exports = React.createClass({
|
||||
})
|
||||
}
|
||||
},
|
||||
onKeyCast: function (e) {
|
||||
switch (e.status) {
|
||||
case 'openLaunchModal':
|
||||
this.refs.navigator.openLaunchModal()
|
||||
break
|
||||
case 'selectNextArticle':
|
||||
this.selectNextArticle()
|
||||
break
|
||||
case 'selectPriorArticle':
|
||||
this.selectPriorArticle()
|
||||
break
|
||||
case 'toggleFocusSearchInput':
|
||||
this.toggleFocusSearchInput()
|
||||
break
|
||||
case 'openEditModal':
|
||||
this.refs.detail.openEditModal()
|
||||
break
|
||||
case 'openDeleteModal':
|
||||
this.refs.detail.openDeleteModal()
|
||||
break
|
||||
}
|
||||
},
|
||||
onPlanetChange: function (res) {
|
||||
if (this.state.planet == null) return
|
||||
|
||||
@@ -207,6 +230,18 @@ module.exports = React.createClass({
|
||||
return
|
||||
}
|
||||
|
||||
var listElement = this.refs.list.refs.articles.getDOMNode()
|
||||
var articleElement = listElement.querySelectorAll('li')[index]
|
||||
|
||||
var overflowBelow = listElement.clientHeight + listElement.scrollTop < articleElement.offsetTop + articleElement.clientHeight
|
||||
if (overflowBelow) {
|
||||
listElement.scrollTop = articleElement.offsetTop + articleElement.clientHeight - listElement.clientHeight
|
||||
}
|
||||
var overflowAbove = listElement.scrollTop > articleElement.offsetTop
|
||||
if (overflowAbove) {
|
||||
listElement.scrollTop = articleElement.offsetTop
|
||||
}
|
||||
|
||||
if (article.type === 'code') {
|
||||
params.localId = article.localId
|
||||
this.transitionTo('codes', params)
|
||||
@@ -237,9 +272,17 @@ module.exports = React.createClass({
|
||||
if (index > 0) {
|
||||
this.selectArticleByListIndex(index - 1)
|
||||
} else {
|
||||
React.findDOMNode(this).querySelector('.PlanetHeader .searchInput input').focus()
|
||||
React.findDOMNode(this.refs.header.refs.search).focus()
|
||||
}
|
||||
},
|
||||
toggleFocusSearchInput: function () {
|
||||
var search = React.findDOMNode(this.refs.header.refs.search)
|
||||
if (document.activeElement === search) {
|
||||
React.findDOMNode(this.refs.header.refs.search).blur()
|
||||
return
|
||||
}
|
||||
React.findDOMNode(this.refs.header.refs.search).focus()
|
||||
},
|
||||
handleSearchChange: function (e) {
|
||||
this.setState({search: e.target.value}, function () {
|
||||
this.selectArticleByListIndex(0)
|
||||
@@ -309,9 +352,6 @@ module.exports = React.createClass({
|
||||
this.setState({search: '#' + tag})
|
||||
}.bind(this)
|
||||
},
|
||||
focus: function () {
|
||||
React.findDOMNode(this).focus()
|
||||
},
|
||||
render: function () {
|
||||
if (this.state.planet == null) return (<div/>)
|
||||
|
||||
@@ -346,6 +386,7 @@ module.exports = React.createClass({
|
||||
return (
|
||||
<div className='PlanetContainer'>
|
||||
<PlanetHeader
|
||||
ref='header'
|
||||
search={this.state.search}
|
||||
fetchPlanet={this.fetchPlanet}
|
||||
onSearchChange={this.handleSearchChange}
|
||||
@@ -358,7 +399,8 @@ module.exports = React.createClass({
|
||||
showAll={this.showAll}
|
||||
toggleCodeFilter={this.toggleCodeFilter}
|
||||
toggleNoteFilter={this.toggleNoteFilter}
|
||||
planet={this.state.planet}/>
|
||||
planet={this.state.planet}
|
||||
currentUser={this.state.currentUser}/>
|
||||
|
||||
<PlanetArticleList showOnlyWithTag={this.applyTagFilter} ref='list' articles={filteredArticles}/>
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@ var Link = ReactRouter.Link
|
||||
|
||||
var AuthFilter = require('../Mixins/AuthFilter')
|
||||
var LinkedState = require('../Mixins/LinkedState')
|
||||
var ExternalLink = require('../Mixins/ExternalLink')
|
||||
var Hq = require('../Services/Hq')
|
||||
|
||||
module.exports = React.createClass({
|
||||
mixins: [LinkedState, ReactRouter.Navigation, AuthFilter.OnlyGuest],
|
||||
mixins: [LinkedState, ReactRouter.Navigation, AuthFilter.OnlyGuest, ExternalLink],
|
||||
getInitialState: function () {
|
||||
return {
|
||||
user: {},
|
||||
@@ -129,7 +130,7 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p className='alert'>会員登録することで、当サイトの利用規約及びCookieの使用を含むデータに関するポリシーに同意するものとします。</p>
|
||||
<p className='alert'>会員登録することで、<a onClick={this.openExternal} href='http://boostio.github.io/regulations.html'>当サイトの利用規約</a>及び<a onClick={this.openExternal} href='http://boostio.github.io/privacypolicies.html'>Cookieの使用を含むデータに関するポリシー</a>に同意するものとします。</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -190,7 +190,6 @@ module.exports = React.createClass({
|
||||
return this.renderUserHome(currentUser)
|
||||
}
|
||||
} else if (this.isActive('planet') && user != null && user.userType === 'team') {
|
||||
console.log(user.Members)
|
||||
var members = user.Members.map(function (member) {
|
||||
return (
|
||||
<li key={'user-' + member.id}><Link to='userHome' params={{userName: member.name}}>
|
||||
@@ -224,7 +223,9 @@ module.exports = React.createClass({
|
||||
renderTeamHome: function (currentUser) {
|
||||
var user = this.state.user
|
||||
|
||||
var isOwner = true
|
||||
var isOwner = user.Members == null ? false : user.Members.some(function (member) {
|
||||
return member.id === currentUser.id && member.TeamMember.role === 'owner'
|
||||
})
|
||||
|
||||
var userPlanets = user.Planets.map(function (planet) {
|
||||
return (
|
||||
@@ -258,7 +259,7 @@ module.exports = React.createClass({
|
||||
<div className='userName'>{user.name}</div>
|
||||
</div>
|
||||
|
||||
<button onClick={this.openTeamSettingsModal} className='editProfileButton'>Team settings</button>
|
||||
{isOwner ? (<button onClick={this.openTeamSettingsModal} className='editProfileButton'>Team settings</button>) : null}
|
||||
</div>
|
||||
<div className='memberList'>
|
||||
<div className='memberLabel'>{members.length} {members.length > 1 ? 'Members' : 'Member'}</div>
|
||||
@@ -317,7 +318,7 @@ module.exports = React.createClass({
|
||||
})
|
||||
return (
|
||||
<div key={'user-' + team.id} className='planetGroup'>
|
||||
<div className='planetGroupLabel'>{team.name}</div>
|
||||
<div className='planetGroupLabel'>{team.profileName} <small>@{team.name}</small></div>
|
||||
<ul className='planets'>
|
||||
{planets}
|
||||
{isOwner ? (<li><button onClick={this.openPlanetCreateModalWithOwnerName(team.name)} className='createPlanetButton'><i className='fa fa-plus-square-o'/> Create new planet</button></li>) : null}
|
||||
@@ -352,7 +353,7 @@ module.exports = React.createClass({
|
||||
<div className='planetList'>
|
||||
<div className='planetLabel'>{planetCount} {planetCount > 1 ? 'Planets' : 'Planet'}</div>
|
||||
<div className='planetGroup'>
|
||||
<div className='planetGroupLabel'>{user.profileName}</div>
|
||||
<div className='planetGroupLabel'>{user.profileName} <small>@{user.name}</small></div>
|
||||
<ul className='planets'>
|
||||
{userPlanets}
|
||||
{isOwner ? (<li><button onClick={this.openPlanetCreateModalWithOwnerName(user.name)} className='createPlanetButton'><i className='fa fa-plus-square-o'/> Create new planet</button></li>) : null}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function deleteItemFromTargetArray (item, targetArray) {
|
||||
if (targetArray == null) targetArray = []
|
||||
targetArray.some(function (_item, index) {
|
||||
if (_item.id === item.id) {
|
||||
targetArray.splice(index, 1)
|
||||
@@ -11,6 +12,8 @@ function deleteItemFromTargetArray (item, targetArray) {
|
||||
}
|
||||
|
||||
function updateItemToTargetArray (item, targetArray) {
|
||||
if (targetArray == null) targetArray = []
|
||||
|
||||
var isNew = !targetArray.some(function (_item, index) {
|
||||
if (_item.id === item.id) {
|
||||
targetArray.splice(index, 1, item)
|
||||
|
||||
100
browser/main/Mixins/KeyCaster.js
Normal file
100
browser/main/Mixins/KeyCaster.js
Normal file
@@ -0,0 +1,100 @@
|
||||
var Reflux = require('reflux')
|
||||
|
||||
var state = {
|
||||
|
||||
}
|
||||
|
||||
var keyDown = Reflux.createAction()
|
||||
|
||||
var KeyStore = Reflux.createStore({
|
||||
init: function () {
|
||||
this.listenTo(keyDown, this.onKeyDown)
|
||||
document.addEventListener('keydown', function (e) {
|
||||
keyDown(e)
|
||||
})
|
||||
},
|
||||
setState: function (newState, cb) {
|
||||
for (var key in newState) {
|
||||
state[key] = newState[key]
|
||||
}
|
||||
if (typeof cb === 'function') cb()
|
||||
},
|
||||
onKeyDown: function (e) {
|
||||
/*
|
||||
Modals
|
||||
*/
|
||||
if (state.codeForm || state.noteForm || state.noteDeleteModal || state.codeDeleteModal || state.addMemberModal || state.aboutModal || state.editProfileModal || state.contactModal || state.teamCreateModal || state.planetCreateModal || state.planetSettingModal || state.teamSettingsModal || state.logoutModal) {
|
||||
// ESC
|
||||
if (e.keyCode === 27) this.cast('closeModal')
|
||||
|
||||
// Cmd + Enter
|
||||
if (e.keyCode === 13 && e.metaKey) {
|
||||
if (state.codeForm) this.cast('submitCodeForm')
|
||||
if (state.noteForm) this.cast('submitNoteForm')
|
||||
if (state.codeDeleteModal) this.cast('submitCodeDeleteModal')
|
||||
if (state.noteDeleteModal) this.cast('submitNoteDeleteModal')
|
||||
if (state.addMemberModal) this.cast('submitAddMemberModal')
|
||||
if (state.contactModal) this.cast('submitContactModal')
|
||||
if (state.teamCreateModal) this.cast('submitTeamCreateModal')
|
||||
if (state.planetCreateModal) this.cast('submitPlanetCreateModal')
|
||||
if (state.logoutModal) this.cast('submitLogoutModal')
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
PlanetContainer
|
||||
*/
|
||||
if (state.planetContainer) {
|
||||
// Cmd + Enter, A
|
||||
if ((e.keyCode === 13 && e.metaKey) || e.keyCode === 65) this.cast('openLaunchModal')
|
||||
|
||||
// Esc
|
||||
if (e.keyCode === 27) this.cast('toggleFocusSearchInput')
|
||||
|
||||
// Up
|
||||
if (e.keyCode === 38) this.cast('selectPriorArticle')
|
||||
|
||||
// Down
|
||||
if (e.keyCode === 40) this.cast('selectNextArticle')
|
||||
|
||||
// E
|
||||
if (e.keyCode === 69) this.cast('openEditModal')
|
||||
|
||||
// D
|
||||
if (e.keyCode === 68) this.cast('openDeleteModal')
|
||||
}
|
||||
|
||||
/*
|
||||
HomeContainer
|
||||
*/
|
||||
if (state.homeContainer) {
|
||||
if (e.keyCode > 48 && e.keyCode < 58 && e.metaKey) {
|
||||
this.cast('switchPlanet', e.keyCode - 48)
|
||||
}
|
||||
}
|
||||
},
|
||||
cast: function (status, data) {
|
||||
this.trigger({
|
||||
status: status,
|
||||
data: data
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = function (stateKey) {
|
||||
return {
|
||||
mixins: [Reflux.listenTo(KeyStore, 'onKeyCast')],
|
||||
componentDidMount: function () {
|
||||
var newState = {}
|
||||
newState[stateKey] = true
|
||||
KeyStore.setState(newState)
|
||||
},
|
||||
componentWillUnmount: function () {
|
||||
var newState = {}
|
||||
newState[stateKey] = false
|
||||
KeyStore.setState(newState)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,9 @@ module.exports = {
|
||||
fetchUser: function (userName) {
|
||||
return request
|
||||
.get(apiUrl + 'resources/' + userName)
|
||||
.set({
|
||||
Authorization: 'Bearer ' + localStorage.getItem('token')
|
||||
})
|
||||
},
|
||||
updateUser: function (userName, input) {
|
||||
return request
|
||||
@@ -79,6 +82,9 @@ module.exports = {
|
||||
fetchPlanet: function (userName, planetName) {
|
||||
return request
|
||||
.get(apiUrl + 'resources/' + userName + '/planets/' + planetName)
|
||||
.set({
|
||||
Authorization: 'Bearer ' + localStorage.getItem('token')
|
||||
})
|
||||
},
|
||||
updatePlanet: function (userName, planetName, input) {
|
||||
return request
|
||||
|
||||
@@ -53,6 +53,14 @@ module.exports = Reflux.createStore({
|
||||
localStorage.setItem('currentUser', JSON.stringify(currentUser))
|
||||
UserStore.Actions.update(currentUser)
|
||||
|
||||
planet.Codes.forEach(function (code) {
|
||||
code.type = 'code'
|
||||
})
|
||||
|
||||
planet.Notes.forEach(function (note) {
|
||||
note.type = 'note'
|
||||
})
|
||||
|
||||
// Update the planet
|
||||
localStorage.setItem('planet-' + planet.id, JSON.stringify(planet))
|
||||
|
||||
|
||||
@@ -1,16 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var version = require('remote').getGlobal('version')
|
||||
document.title = 'Boost ' + ((version == null || version.length === 0) ? 'DEV version' : 'v' + version)
|
||||
</script>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||
|
||||
<link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css" media="screen" title="no title" charset="utf-8">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url('../../Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
|
||||
url('../../Lato-Regular.woff') format('woff'), /* Modern Browsers */
|
||||
url('../../Lato-Regular.ttf') format('truetype');
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
#loadingCover{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 65px 0;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
#loadingCover img{
|
||||
display: block;
|
||||
margin: 75px auto 5px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
#loadingCover .message{
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
font-weight: 100;
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="loadingCover">
|
||||
<img src="resources/favicon-230x230.png">
|
||||
<div class='message'>Loading...</div>
|
||||
</div>
|
||||
|
||||
<div id="content"></div>
|
||||
|
||||
<script>
|
||||
if (!Object.assign) {
|
||||
Object.defineProperty(Object, 'assign', {
|
||||
@@ -45,13 +84,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
require('electron-stylus')(__dirname + '/../styles/main/index.styl')
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script src="../ace/src-min/ace.js"></script>
|
||||
<script>
|
||||
|
||||
var version = require('remote').getGlobal('version')
|
||||
document.title = 'Boost ' + ((version == null || version.length === 0) ? 'DEV version' : 'v' + version)
|
||||
require('../electron-stylus')(__dirname + '/../styles/main/index.styl', 'mainCss')
|
||||
require('node-jsx').install({ harmony: true, extension: '.jsx' })
|
||||
require('./index.jsx')
|
||||
</script>
|
||||
|
||||
@@ -34,7 +34,13 @@ var routes = (
|
||||
</Route>
|
||||
</Route>
|
||||
)
|
||||
var loadingCover = document.getElementById('loadingCover')
|
||||
|
||||
ReactRouter.run(routes, ReactRouter.HashLocation, function (Root) {
|
||||
React.render(<Root/>, document.getElementById('content'))
|
||||
|
||||
if (loadingCover != null) {
|
||||
loadingCover.parentNode.removeChild(loadingCover)
|
||||
loadingCover = null
|
||||
}
|
||||
})
|
||||
|
||||
@@ -46,6 +46,9 @@ body
|
||||
border solid 2px transparent
|
||||
box-sizing border-box
|
||||
cursor pointer
|
||||
white-space nowrap
|
||||
overflow-x hidden
|
||||
text-overflow ellipsis
|
||||
.divider
|
||||
box-sizing border-box
|
||||
border-bottom solid 1px borderColor
|
||||
@@ -65,6 +68,9 @@ body
|
||||
border-bottom solid 1px borderColor
|
||||
line-height 44px
|
||||
font-size 1.3em
|
||||
white-space nowrap
|
||||
text-overflow ellipsis
|
||||
overflow-x hidden
|
||||
.content
|
||||
.ace_editor, .marked
|
||||
position absolute
|
||||
|
||||
@@ -10,7 +10,7 @@ articleListWidth= 275px
|
||||
margin 0 2px
|
||||
text-decoration underline
|
||||
cursor pointer
|
||||
font-size 0.9em
|
||||
font-size 0.95em
|
||||
&.noTag
|
||||
color inactiveTextColor
|
||||
font-size 0.8em
|
||||
@@ -64,40 +64,35 @@ articleListWidth= 275px
|
||||
color inactiveColor
|
||||
&:hover
|
||||
color textColor
|
||||
.privateTooltip
|
||||
position fixed
|
||||
z-index popupZIndex
|
||||
background-color transparentify(invBackgroundColor, 80%)
|
||||
color invTextColor
|
||||
padding 10px
|
||||
font-size 0.9em
|
||||
line-height 0.9em
|
||||
border-radius 5px
|
||||
white-space nowrap
|
||||
opacity 0
|
||||
transition 0.1s
|
||||
pointer-events none
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-left -30px
|
||||
&:hover .privateTooltip
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
|
||||
|
||||
.menuBtn
|
||||
.planetSettingButton
|
||||
position absolute
|
||||
top 12px
|
||||
top 15px
|
||||
right 5px
|
||||
font-size 1em
|
||||
font-size 0.8em
|
||||
btnDefault()
|
||||
box-sizing border-box
|
||||
circle()
|
||||
width 33px
|
||||
height 33px
|
||||
width 26px
|
||||
height 26px
|
||||
text-align center
|
||||
cursor pointer
|
||||
transition 0.1s
|
||||
transform scale(0.8)
|
||||
&:focus, &.focus
|
||||
outline none
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top 11px
|
||||
margin-left -36px
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
|
||||
.headerControl
|
||||
noSelect()
|
||||
absolute top bottom right
|
||||
@@ -118,10 +113,11 @@ articleListWidth= 275px
|
||||
.refreshButton
|
||||
display block
|
||||
position absolute
|
||||
top 12px
|
||||
top 15px
|
||||
right 55px
|
||||
width 28px
|
||||
height 28px
|
||||
width 26px
|
||||
height 26px
|
||||
font-size 0.8em
|
||||
btnDefault()
|
||||
circle()
|
||||
text-align center
|
||||
@@ -129,16 +125,28 @@ articleListWidth= 275px
|
||||
transition 0.1s
|
||||
&:focus, &.focus
|
||||
outline none
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top 11px
|
||||
margin-left -39px
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
.logo
|
||||
display block
|
||||
position absolute
|
||||
top 4px
|
||||
right 10px
|
||||
cursor pointer
|
||||
transition 0.1s
|
||||
opacity 0.9
|
||||
&:hover, &.hover
|
||||
img
|
||||
transition 0.1s
|
||||
opacity 0.9
|
||||
&:hover img, &:hover .tooltip
|
||||
opacity 1
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top -5px
|
||||
margin-left -67px
|
||||
|
||||
|
||||
.PlanetNavigator
|
||||
absolute bottom left
|
||||
@@ -178,33 +186,51 @@ articleListWidth= 275px
|
||||
overflow-y auto
|
||||
li
|
||||
.articleItem
|
||||
user-select none
|
||||
noSelect()
|
||||
border solid 2px transparent
|
||||
padding 10px
|
||||
position relative
|
||||
height 94px
|
||||
width 100%
|
||||
cursor pointer
|
||||
transition 0.1s
|
||||
clearfix()
|
||||
.itemLeft
|
||||
float left
|
||||
width 25px
|
||||
position absolute
|
||||
top 4px
|
||||
bottom 4px
|
||||
width 38px
|
||||
padding 3px 0 3px 3px
|
||||
text-align center
|
||||
.profileImage
|
||||
margin-bottom 5px
|
||||
circle()
|
||||
.fa
|
||||
line-height 25px
|
||||
.itemRight
|
||||
float left
|
||||
width 225px
|
||||
position absolute
|
||||
top 4px
|
||||
bottom 4px
|
||||
right 2px
|
||||
left 40px
|
||||
overflow-x hidden
|
||||
padding-left 10px
|
||||
.updatedAt
|
||||
margin-bottom 10px
|
||||
padding 3px 10px 3px 3px
|
||||
.itemInfo
|
||||
margin 5px 0 13px
|
||||
color lighten(textColor, 25%)
|
||||
font-size 0.7em
|
||||
.userProfileName
|
||||
color brandColor
|
||||
font-size 1.2em
|
||||
.description
|
||||
line-height 120%
|
||||
margin-bottom 15px
|
||||
margin-bottom 10px
|
||||
font-size 1em
|
||||
overflow-x hidden
|
||||
white-space nowrap
|
||||
text-overflow ellipsis
|
||||
.tags
|
||||
position absolute
|
||||
bottom 5px
|
||||
font-size 0.9em
|
||||
&:hover, &.hover
|
||||
background-color hoverBackgroundColor
|
||||
&:active, &.active
|
||||
@@ -218,57 +244,89 @@ articleListWidth= 275px
|
||||
absolute right bottom
|
||||
top 55px
|
||||
left navigationWidth + articleListWidth
|
||||
&>.viewer-header
|
||||
height 44px
|
||||
line-height 44px
|
||||
padding 0 15px
|
||||
box-sizing border-box
|
||||
font-size 1.2em
|
||||
small
|
||||
font-size 0.8em
|
||||
color lighten(textColor, 25%)
|
||||
.control-group
|
||||
float right
|
||||
button
|
||||
margin 10px 3px
|
||||
.viewer-body
|
||||
absolute bottom right
|
||||
left 1px
|
||||
top 44px
|
||||
&.codeDetail>.viewer-body
|
||||
.viewer-detail
|
||||
border-bottom solid 1px borderColor
|
||||
height 150px
|
||||
box-sizing border-box
|
||||
padding 10px
|
||||
.detailHeader
|
||||
border solid 2px transparent
|
||||
position relative
|
||||
height 105px
|
||||
width 100%
|
||||
transition 0.1s
|
||||
.itemLeft
|
||||
position absolute
|
||||
top 7px
|
||||
bottom 4px
|
||||
width 38px
|
||||
padding 3px 0 3px 3px
|
||||
text-align center
|
||||
.profileImage
|
||||
margin-bottom 5px
|
||||
circle()
|
||||
.fa
|
||||
line-height 25px
|
||||
.itemRight
|
||||
position absolute
|
||||
top 7px
|
||||
bottom 4px
|
||||
right 2px
|
||||
left 40px
|
||||
overflow-x hidden
|
||||
padding 3px 10px 3px 3px
|
||||
.itemInfo
|
||||
margin 5px 0 13px
|
||||
color lighten(textColor, 25%)
|
||||
font-size 0.7em
|
||||
.userProfileName
|
||||
color brandColor
|
||||
font-size 1.2em
|
||||
.description
|
||||
height 100px
|
||||
line-height 1.4em
|
||||
overflow-y auto
|
||||
line-height 120%
|
||||
margin-bottom 10px
|
||||
font-size 1em
|
||||
overflow-x auto
|
||||
white-space nowrap
|
||||
.tags
|
||||
position absolute
|
||||
left 15px
|
||||
right 15px
|
||||
top 120px
|
||||
.content
|
||||
.ace_editor
|
||||
absolute left right
|
||||
top 155px
|
||||
bottom 5px
|
||||
&.noteDetail>.viewer-body
|
||||
.tags
|
||||
absolute top
|
||||
left 15px
|
||||
right 15px
|
||||
height 24px
|
||||
line-height 24px
|
||||
font-size 0.9em
|
||||
.itemControl
|
||||
position absolute
|
||||
z-index 1
|
||||
top 2px
|
||||
right 2px
|
||||
.deleteButton, .editButton
|
||||
btnDefault()
|
||||
text-align center
|
||||
width 33px
|
||||
height 33px
|
||||
border-radius 16.5px
|
||||
font-size 15px
|
||||
margin 0 3px
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top 10px
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
.editButton .tooltip
|
||||
margin-left -12px
|
||||
.deleteButton .tooltip
|
||||
margin-left -26px
|
||||
.detailBody
|
||||
absolute left right bottom
|
||||
top 105px
|
||||
.content
|
||||
absolute left right bottom
|
||||
top 30px
|
||||
position absolute
|
||||
top 5px
|
||||
bottom 5px
|
||||
left 2px
|
||||
right 2px
|
||||
box-sizing border-box
|
||||
padding 5px
|
||||
border-top solid 1px borderColor
|
||||
padding 10px
|
||||
&.noteDetail
|
||||
.detailBody .content
|
||||
overflow-x hidden
|
||||
overflow-y auto
|
||||
marked()
|
||||
&.codeDetail
|
||||
.detailBody .content
|
||||
.ace_editor
|
||||
absolute left right top bottom
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.HomeContainer
|
||||
.HomeNavigator
|
||||
noSelect()
|
||||
background-color planetNavBgColor
|
||||
absolute left top bottom
|
||||
width 55px
|
||||
@@ -63,19 +64,12 @@
|
||||
&:hover
|
||||
background-color hoverBackgroundColor
|
||||
.userName
|
||||
float left
|
||||
width 155px
|
||||
padding 10px 15px
|
||||
text-align left
|
||||
display block
|
||||
text-decoration none
|
||||
cursor pointer
|
||||
.userSetting
|
||||
float right
|
||||
display block
|
||||
padding 10px 0
|
||||
width 45px
|
||||
cursor pointer
|
||||
.createNewTeam
|
||||
btnStripDefault()
|
||||
width 100%
|
||||
@@ -166,22 +160,11 @@
|
||||
border-color darken(brandBorderColor, 10%)
|
||||
background-color brandColor
|
||||
color white
|
||||
.newPlanetTooltip
|
||||
position fixed
|
||||
z-index 500
|
||||
background-color transparentify(invBackgroundColor, 80%)
|
||||
color invTextColor
|
||||
padding 10px
|
||||
line-height 1em
|
||||
border-radius 5px
|
||||
margin-top -23px
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top -22px
|
||||
margin-left 33px
|
||||
white-space nowrap
|
||||
font-size 1.1em
|
||||
opacity 0
|
||||
transition 0.1s
|
||||
pointer-events none
|
||||
&:hover .newPlanetTooltip
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
.UserContainer
|
||||
absolute top bottom right
|
||||
@@ -189,7 +172,7 @@
|
||||
.memberPopup
|
||||
absolute left
|
||||
top 235px
|
||||
z-index popupZIndex
|
||||
z-index 1
|
||||
padding 0 15px 10px
|
||||
width 200px
|
||||
.label
|
||||
@@ -205,13 +188,15 @@
|
||||
.memberImage
|
||||
float left
|
||||
margin-right 7px
|
||||
circle()
|
||||
.memberInfo
|
||||
float left
|
||||
.memberProfileName
|
||||
margin-bottom 5px
|
||||
font-size 1.05em
|
||||
.memberName
|
||||
margin-left 5px
|
||||
font-size 0.8em
|
||||
font-size 0.9em
|
||||
color inactiveTextColor
|
||||
a:hover .memberProfileName, a:hover .memberName
|
||||
text-decoration underline
|
||||
@@ -259,9 +244,10 @@
|
||||
float left
|
||||
.teamProfileName
|
||||
margin-bottom 5px
|
||||
font-size 1.05em
|
||||
.teamName
|
||||
margin-left 5px
|
||||
font-size 0.8em
|
||||
font-size 0.9em
|
||||
color inactiveTextColor
|
||||
a:hover .teamProfileName, a:hover .teamName
|
||||
text-decoration underline
|
||||
@@ -277,16 +263,18 @@
|
||||
.memberImage
|
||||
float left
|
||||
margin-right 7px
|
||||
circle()
|
||||
.memberInfo
|
||||
float left
|
||||
.memberProfileName
|
||||
margin-bottom 5px
|
||||
font-size 1.05em
|
||||
.memberRole
|
||||
font-size 0.8em
|
||||
font-size 0.9em
|
||||
color inactiveTextColor
|
||||
.memberName
|
||||
margin-left 5px
|
||||
font-size 0.8em
|
||||
font-size 0.9em
|
||||
color inactiveTextColor
|
||||
.createTeamButton, .addMemberButton
|
||||
btnStripDefault()
|
||||
@@ -306,6 +294,9 @@
|
||||
.planetGroupLabel
|
||||
font-size 1.1em
|
||||
margin-bottom 15px
|
||||
small
|
||||
font-size 0.8em
|
||||
color inactiveTextColor
|
||||
.planets
|
||||
margin-left 15px
|
||||
li
|
||||
|
||||
@@ -7,15 +7,17 @@ global-reset()
|
||||
@import './containers/*'
|
||||
|
||||
html, body
|
||||
width 100%
|
||||
height 100%
|
||||
overflow hidden
|
||||
width 100%
|
||||
height 100%
|
||||
overflow hidden
|
||||
|
||||
body
|
||||
font-family "Lato"
|
||||
color textColor
|
||||
font-size fontSize
|
||||
font-weight 400
|
||||
button
|
||||
font-family "Lato"
|
||||
|
||||
div, span, a, button, input, textarea
|
||||
box-sizing border-box
|
||||
@@ -105,14 +107,22 @@ textarea.block-input
|
||||
z-index 2000
|
||||
bottom 5px
|
||||
right 53px
|
||||
btnDefault()
|
||||
btnPrimary()
|
||||
padding 10px 15px
|
||||
border-radius 5px
|
||||
background-color backgroundColor
|
||||
.contactButton
|
||||
position fixed
|
||||
z-index 2000
|
||||
bottom 5px
|
||||
right 5px
|
||||
btnDefault()
|
||||
btnPrimary()
|
||||
padding 10px 15px
|
||||
border-radius 5px
|
||||
background-color backgroundColor
|
||||
.tooltip
|
||||
tooltip()
|
||||
margin-top -22px
|
||||
margin-left -97px
|
||||
&:hover .tooltip
|
||||
opacity 1
|
||||
|
||||
@@ -22,10 +22,11 @@ marked()
|
||||
font-size 0.67em
|
||||
margin 2.33em auto
|
||||
h1, h2, h3, h4, h5, h6
|
||||
font-weight font-weight 400
|
||||
line-height 1.2em
|
||||
font-weight 400
|
||||
line-height 1.4em
|
||||
p
|
||||
line-height 1.2em
|
||||
line-height 1.4em
|
||||
margin-bottom 15px
|
||||
img
|
||||
max-width 100%
|
||||
strong
|
||||
@@ -36,14 +37,14 @@ marked()
|
||||
text-decoration line-through
|
||||
blockquote
|
||||
border-left solid 4px brandBorderColor
|
||||
margin 1em 0
|
||||
margin 15px 0 15px
|
||||
padding 0 25px
|
||||
ul
|
||||
list-style-type disc
|
||||
padding-left 35px
|
||||
li
|
||||
display list-item
|
||||
margin 0.5em 0
|
||||
margin 15px 0
|
||||
&>li>ul
|
||||
list-style-type circle
|
||||
&>li>ul
|
||||
@@ -53,33 +54,38 @@ marked()
|
||||
padding-left 35px
|
||||
li
|
||||
display list-item
|
||||
margin 0.5em 0
|
||||
margin 15px 0
|
||||
code
|
||||
font-family monospace
|
||||
padding 2px 4px
|
||||
border solid 1px borderColor
|
||||
border-radius 4px
|
||||
font-size 0.9em
|
||||
color black
|
||||
text-decoration none
|
||||
background-color #F6F6F6
|
||||
pre
|
||||
padding 5px
|
||||
border solid 1px borderColor
|
||||
border-radius 5px
|
||||
margin 0.5em 0
|
||||
overflow-x auto
|
||||
margin-bottom 15px
|
||||
background-color #F6F6F6
|
||||
&>code
|
||||
padding 0
|
||||
border none
|
||||
border-radius 0
|
||||
color black
|
||||
table
|
||||
width 100%
|
||||
margin 15px 0
|
||||
margin 15px 0 25px
|
||||
thead
|
||||
tr
|
||||
background-color tableHeadBgColor
|
||||
th
|
||||
border-style: solid;
|
||||
padding: 5px;
|
||||
border-width: 1px 0 2px 1px;
|
||||
border-style solid
|
||||
padding 15px 5px
|
||||
border-width 1px 0 2px 1px
|
||||
border-color borderColor
|
||||
&:last-child
|
||||
border-right solid 1px borderColor
|
||||
@@ -89,9 +95,9 @@ marked()
|
||||
tr:nth-child(2n)
|
||||
background-color tableEvenBgColor
|
||||
td
|
||||
border-style: solid;
|
||||
padding: 5px;
|
||||
border-width: 0 0 1px 1px;
|
||||
border-style solid
|
||||
padding 15px 5px
|
||||
border-width 0 0 1px 1px
|
||||
border-color borderColor
|
||||
&:last-child
|
||||
border-right solid 1px borderColor
|
||||
|
||||
13
browser/styles/mixins/tooltip.styl
Normal file
13
browser/styles/mixins/tooltip.styl
Normal file
@@ -0,0 +1,13 @@
|
||||
tooltip()
|
||||
position fixed
|
||||
z-index popupZIndex
|
||||
background-color transparentify(invBackgroundColor, 80%)
|
||||
color invTextColor
|
||||
padding 10px
|
||||
font-size 12px
|
||||
line-height 12px
|
||||
border-radius 5px
|
||||
white-space nowrap
|
||||
opacity 0
|
||||
transition 0.1s
|
||||
pointer-events none
|
||||
@@ -97,7 +97,7 @@
|
||||
float right
|
||||
padding 12px 10px
|
||||
border-radius 5px
|
||||
width 200px
|
||||
width 320px
|
||||
font-size 1em
|
||||
overflow-x hidden
|
||||
white-space nowrap
|
||||
@@ -139,7 +139,7 @@
|
||||
float right
|
||||
padding 12px 10px
|
||||
border-radius 5px
|
||||
width 200px
|
||||
width 320px
|
||||
font-size 1em
|
||||
overflow-x hidden
|
||||
white-space nowrap
|
||||
@@ -196,7 +196,6 @@
|
||||
border-radius 5px
|
||||
float left
|
||||
|
||||
|
||||
.LaunchModal
|
||||
.modal-tab
|
||||
text-align center
|
||||
@@ -314,6 +313,14 @@
|
||||
height 55px
|
||||
circle()
|
||||
btnPrimary()
|
||||
.errorAlert
|
||||
alertError()
|
||||
padding 12px 10px
|
||||
border-radius 5px
|
||||
text-align center
|
||||
display block
|
||||
width 360px
|
||||
margin 0 auto 15px
|
||||
|
||||
.ContactModal
|
||||
padding 15px
|
||||
@@ -341,6 +348,7 @@
|
||||
padding 0 15px
|
||||
border-radius 5px
|
||||
margin-left 5px
|
||||
font-size 1em
|
||||
button.sendButton
|
||||
btnPrimary()
|
||||
.confirmation
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
apiUrl: 'http://codexen-server-dev2.elasticbeanstalk.com/'
|
||||
apiUrl: 'https://api.b00st.io/'
|
||||
// apiUrl: 'http://localhost:8000/'
|
||||
}
|
||||
|
||||
26
main.js
26
main.js
@@ -27,6 +27,7 @@ var path = require('path')
|
||||
|
||||
autoUpdater
|
||||
.on('error', function (err, message) {
|
||||
console.error(message)
|
||||
nn.notify({
|
||||
title: 'Error! ' + versionText,
|
||||
icon: path.join(__dirname, 'browser/main/resources/favicon-230x230.png'),
|
||||
@@ -34,11 +35,7 @@ autoUpdater
|
||||
})
|
||||
})
|
||||
.on('checking-for-update', function () {
|
||||
nn.notify({
|
||||
title: 'Boost launched!! ' + versionText,
|
||||
icon: path.join(__dirname, 'browser/main/resources/favicon-230x230.png'),
|
||||
message: 'Checking update is available....'
|
||||
})
|
||||
// Connecting
|
||||
})
|
||||
.on('update-available', function () {
|
||||
nn.notify({
|
||||
@@ -85,7 +82,7 @@ app.on('ready', function () {
|
||||
Menu.setApplicationMenu(menu)
|
||||
// menu end
|
||||
appIcon = new Tray(__dirname + '/tray-icon.png')
|
||||
appIcon.setToolTip('Codexen')
|
||||
appIcon.setToolTip('Boost')
|
||||
|
||||
var trayMenu = new Menu()
|
||||
trayMenu.append(new MenuItem({
|
||||
@@ -131,9 +128,10 @@ app.on('ready', function () {
|
||||
'zoom-factor': 1.0,
|
||||
'always-on-top': true,
|
||||
'web-preferences': {
|
||||
'overlay-scrollbars': true,
|
||||
'skip-taskbar': true
|
||||
}
|
||||
'overlay-scrollbars': true,
|
||||
'skip-taskbar': true
|
||||
},
|
||||
'standard-window': false
|
||||
})
|
||||
|
||||
popUpWindow.loadUrl('file://' + __dirname + '/browser/finder/index.electron.html')
|
||||
@@ -141,6 +139,7 @@ app.on('ready', function () {
|
||||
popUpWindow.on('blur', function () {
|
||||
popUpWindow.hide()
|
||||
})
|
||||
|
||||
popUpWindow.setVisibleOnAllWorkspaces(true)
|
||||
|
||||
var globalShortcut = require('global-shortcut')
|
||||
@@ -167,8 +166,9 @@ function makeNewMainWindow () {
|
||||
height: 720,
|
||||
'zoom-factor': 1.0,
|
||||
'web-preferences': {
|
||||
'overlay-scrollbars': true
|
||||
}
|
||||
'overlay-scrollbars': true
|
||||
},
|
||||
'standard-window': false
|
||||
})
|
||||
if (update != null) {
|
||||
mainWindow.webContents.on('did-finish-load', function () {
|
||||
@@ -178,6 +178,10 @@ function makeNewMainWindow () {
|
||||
|
||||
mainWindow.loadUrl('file://' + __dirname + '/browser/main/index.electron.html')
|
||||
|
||||
mainWindow.webContents.on('new-window', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
mainWindow.on('closed', function () {
|
||||
console.log('main closed')
|
||||
mainWindow = null
|
||||
|
||||
@@ -5,7 +5,7 @@ module.exports = [
|
||||
label: 'Electron',
|
||||
submenu: [
|
||||
{
|
||||
label: 'About Electron',
|
||||
label: 'About Boost',
|
||||
selector: 'orderFrontStandardAboutPanel:'
|
||||
},
|
||||
{
|
||||
@@ -89,13 +89,13 @@ module.exports = [
|
||||
click: function () {
|
||||
BrowserWindow.getFocusedWindow().reload()
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Toggle DevTools',
|
||||
accelerator: 'Alt+Command+I',
|
||||
click: function () {
|
||||
BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||
}
|
||||
// },
|
||||
// {
|
||||
// label: 'Toggle DevTools',
|
||||
// accelerator: 'Alt+Command+I',
|
||||
// click: function () {
|
||||
// BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||
// }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "boost",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.9",
|
||||
"description": "Boost App",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
@@ -31,7 +31,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
||||
"dependencies": {
|
||||
"electron-stylus": "^0.1.0",
|
||||
"font-awesome": "^4.3.0",
|
||||
"markdown-it": "^4.3.1",
|
||||
"md5": "^2.0.0",
|
||||
@@ -43,6 +42,7 @@
|
||||
"react-router": "^0.13.3",
|
||||
"react-select": "^0.5.4",
|
||||
"reflux": "^0.2.8",
|
||||
"stylus": "^0.52.0",
|
||||
"superagent": "^1.2.0",
|
||||
"superagent-promise": "^1.0.3"
|
||||
},
|
||||
|
||||
BIN
tray-icon.png
BIN
tray-icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 959 B |
BIN
tray-icon@2x.png
BIN
tray-icon@2x.png
Binary file not shown.
|
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 2.2 KiB |
BIN
tray-icon@4x.png
BIN
tray-icon@4x.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB |
Reference in New Issue
Block a user