mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
version 0.2.7
- Planet, Team作成の時Error message表示 - MarkdownのCode blockの背景を薄い灰色にする - 権限なしのPlanetには - SignUpに規約/Privacyの外部リンク追加 - Loading画面追加 - Font 添付(Lato regular) - UserContainerでのTeam Label変更
This commit is contained in:
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.
@@ -25,7 +25,8 @@ module.exports = React.createClass({
|
|||||||
name: '',
|
name: '',
|
||||||
public: true
|
public: true
|
||||||
},
|
},
|
||||||
ownerName: ownerName
|
ownerName: ownerName,
|
||||||
|
error: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentDidMount: function () {
|
componentDidMount: function () {
|
||||||
@@ -42,7 +43,7 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmit: function () {
|
handleSubmit: function () {
|
||||||
this.setState({errorMessage: null}, function () {
|
this.setState({error: null}, function () {
|
||||||
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
var planet = res.body
|
var planet = res.body
|
||||||
@@ -57,8 +58,21 @@ module.exports = React.createClass({
|
|||||||
}.bind(this))
|
}.bind(this))
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
if (err.status === 403) {
|
|
||||||
this.setState({errorMessage: err.response.body.message})
|
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: 'Undefined error please try again'}})
|
||||||
}
|
}
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
})
|
})
|
||||||
@@ -86,7 +100,7 @@ module.exports = React.createClass({
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{this.state.errorMessage != null ? (<p className='errorAlert'>{this.state.errorMessage}</p>) : null}
|
{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'>
|
<button onClick={this.handleSubmit} className='submitButton'>
|
||||||
<i className='fa fa-check'/>
|
<i className='fa fa-check'/>
|
||||||
|
|||||||
@@ -10,11 +10,20 @@ module.exports = React.createClass({
|
|||||||
mixins: [Modal, Navigation],
|
mixins: [Modal, Navigation],
|
||||||
propTypes: {
|
propTypes: {
|
||||||
planet: React.PropTypes.shape({
|
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,
|
search: React.PropTypes.string,
|
||||||
toggleCodeFilter: React.PropTypes.func,
|
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 () {
|
getInitialState: function () {
|
||||||
return {
|
return {
|
||||||
@@ -24,6 +33,17 @@ module.exports = React.createClass({
|
|||||||
openLaunchModal: function () {
|
openLaunchModal: function () {
|
||||||
this.openModal(LaunchModal, {planet: this.props.planet, transitionTo: this.transitionTo})
|
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 () {
|
render: function () {
|
||||||
var keywords = this.props.search.split(' ')
|
var keywords = this.props.search.split(' ')
|
||||||
var usingCodeFilter = keywords.some(function (keyword) {
|
var usingCodeFilter = keywords.some(function (keyword) {
|
||||||
@@ -37,9 +57,11 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='PlanetNavigator'>
|
<div className='PlanetNavigator'>
|
||||||
<button onClick={this.openLaunchModal} className='launchButton btn-primary btn-block'>
|
{this.isMyPlanet() ? (
|
||||||
<i className='fa fa-rocket fa-fw'/> Launch
|
<button onClick={this.openLaunchModal} className='launchButton btn-primary btn-block'>
|
||||||
</button>
|
<i className='fa fa-rocket fa-fw'/> Launch
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
<nav className='articleFilters'>
|
<nav className='articleFilters'>
|
||||||
<a className={usingCodeFilter && !usingNoteFilter ? 'active' : ''} onClick={this.props.toggleCodeFilter}>
|
<a className={usingCodeFilter && !usingNoteFilter ? 'active' : ''} onClick={this.props.toggleCodeFilter}>
|
||||||
<i className='fa fa-code fa-fw'/> Codes
|
<i className='fa fa-code fa-fw'/> Codes
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ module.exports = React.createClass({
|
|||||||
return {
|
return {
|
||||||
team: {
|
team: {
|
||||||
name: ''
|
name: ''
|
||||||
}
|
},
|
||||||
|
error: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentDidMount: function () {
|
componentDidMount: function () {
|
||||||
@@ -39,29 +40,44 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmit: function () {
|
handleSubmit: function () {
|
||||||
Hq.createTeam(this.props.user.name, this.state.team)
|
this.setState({error: null}, function () {
|
||||||
.then(function (res) {
|
Hq.createTeam(this.props.user.name, this.state.team)
|
||||||
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
.then(function (res) {
|
||||||
var team = res.body
|
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
||||||
|
var team = res.body
|
||||||
|
|
||||||
currentUser.Teams.push(team)
|
currentUser.Teams.push(team)
|
||||||
localStorage.setItem('currentUser', JSON.stringify(currentUser))
|
localStorage.setItem('currentUser', JSON.stringify(currentUser))
|
||||||
UserStore.Actions.update(currentUser)
|
UserStore.Actions.update(currentUser)
|
||||||
|
|
||||||
if (this.props.transitionTo != null) {
|
if (this.props.transitionTo != null) {
|
||||||
this.props.transitionTo('userHome', {userName: team.name})
|
this.props.transitionTo('userHome', {userName: team.name})
|
||||||
}
|
}
|
||||||
this.props.close()
|
this.props.close()
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
console.error(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 () {
|
render: function () {
|
||||||
return (
|
return (
|
||||||
<div className='TeamCreateModal modal'>
|
<div className='TeamCreateModal modal'>
|
||||||
<input ref='teamName' 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'>
|
<button onClick={this.handleSubmit} className='submitButton'>
|
||||||
<i className='fa fa-check'/>
|
<i className='fa fa-check'/>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -399,7 +399,8 @@ module.exports = React.createClass({
|
|||||||
showAll={this.showAll}
|
showAll={this.showAll}
|
||||||
toggleCodeFilter={this.toggleCodeFilter}
|
toggleCodeFilter={this.toggleCodeFilter}
|
||||||
toggleNoteFilter={this.toggleNoteFilter}
|
toggleNoteFilter={this.toggleNoteFilter}
|
||||||
planet={this.state.planet}/>
|
planet={this.state.planet}
|
||||||
|
currentUser={this.state.currentUser}/>
|
||||||
|
|
||||||
<PlanetArticleList showOnlyWithTag={this.applyTagFilter} ref='list' articles={filteredArticles}/>
|
<PlanetArticleList showOnlyWithTag={this.applyTagFilter} ref='list' articles={filteredArticles}/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ var Link = ReactRouter.Link
|
|||||||
|
|
||||||
var AuthFilter = require('../Mixins/AuthFilter')
|
var AuthFilter = require('../Mixins/AuthFilter')
|
||||||
var LinkedState = require('../Mixins/LinkedState')
|
var LinkedState = require('../Mixins/LinkedState')
|
||||||
|
var ExternalLink = require('../Mixins/ExternalLink')
|
||||||
var Hq = require('../Services/Hq')
|
var Hq = require('../Services/Hq')
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
mixins: [LinkedState, ReactRouter.Navigation, AuthFilter.OnlyGuest],
|
mixins: [LinkedState, ReactRouter.Navigation, AuthFilter.OnlyGuest, ExternalLink],
|
||||||
getInitialState: function () {
|
getInitialState: function () {
|
||||||
return {
|
return {
|
||||||
user: {},
|
user: {},
|
||||||
@@ -129,7 +130,7 @@ module.exports = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ module.exports = React.createClass({
|
|||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<div key={'user-' + team.id} className='planetGroup'>
|
<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'>
|
<ul className='planets'>
|
||||||
{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}
|
{isOwner ? (<li><button onClick={this.openPlanetCreateModalWithOwnerName(team.name)} className='createPlanetButton'><i className='fa fa-plus-square-o'/> Create new planet</button></li>) : null}
|
||||||
@@ -353,7 +353,7 @@ module.exports = React.createClass({
|
|||||||
<div className='planetList'>
|
<div className='planetList'>
|
||||||
<div className='planetLabel'>{planetCount} {planetCount > 1 ? 'Planets' : 'Planet'}</div>
|
<div className='planetLabel'>{planetCount} {planetCount > 1 ? 'Planets' : 'Planet'}</div>
|
||||||
<div className='planetGroup'>
|
<div className='planetGroup'>
|
||||||
<div className='planetGroupLabel'>{user.profileName}</div>
|
<div className='planetGroupLabel'>{user.profileName} <small>@{user.name}</small></div>
|
||||||
<ul className='planets'>
|
<ul className='planets'>
|
||||||
{userPlanets}
|
{userPlanets}
|
||||||
{isOwner ? (<li><button onClick={this.openPlanetCreateModalWithOwnerName(user.name)} className='createPlanetButton'><i className='fa fa-plus-square-o'/> Create new planet</button></li>) : null}
|
{isOwner ? (<li><button onClick={this.openPlanetCreateModalWithOwnerName(user.name)} className='createPlanetButton'><i className='fa fa-plus-square-o'/> Create new planet</button></li>) : null}
|
||||||
|
|||||||
@@ -1,16 +1,52 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<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 charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
<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="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">
|
<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: 400;
|
||||||
|
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: 0 auto;
|
||||||
|
}
|
||||||
|
#loadingCover .message{
|
||||||
|
font-size: 2.5em;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 200;
|
||||||
|
color: #404849;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="loadingCover">
|
||||||
|
<img src="resources/favicon-230x230.png">
|
||||||
|
<div class='message'>Loading...</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="content"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
if (!Object.assign) {
|
if (!Object.assign) {
|
||||||
Object.defineProperty(Object, 'assign', {
|
Object.defineProperty(Object, 'assign', {
|
||||||
@@ -45,13 +81,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
require('electron-stylus')(__dirname + '/../styles/main/index.styl')
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="content"></div>
|
|
||||||
<script src="../ace/src-min/ace.js"></script>
|
<script src="../ace/src-min/ace.js"></script>
|
||||||
<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')
|
||||||
require('node-jsx').install({ harmony: true, extension: '.jsx' })
|
require('node-jsx').install({ harmony: true, extension: '.jsx' })
|
||||||
require('./index.jsx')
|
require('./index.jsx')
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -34,7 +34,13 @@ var routes = (
|
|||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
)
|
)
|
||||||
|
var loadingCover = document.getElementById('loadingCover')
|
||||||
|
|
||||||
ReactRouter.run(routes, ReactRouter.HashLocation, function (Root) {
|
ReactRouter.run(routes, ReactRouter.HashLocation, function (Root) {
|
||||||
React.render(<Root/>, document.getElementById('content'))
|
React.render(<Root/>, document.getElementById('content'))
|
||||||
|
|
||||||
|
if (loadingCover != null) {
|
||||||
|
loadingCover.parentNode.removeChild(loadingCover)
|
||||||
|
loadingCover = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -294,6 +294,9 @@
|
|||||||
.planetGroupLabel
|
.planetGroupLabel
|
||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
margin-bottom 15px
|
margin-bottom 15px
|
||||||
|
small
|
||||||
|
font-size 0.8em
|
||||||
|
color inactiveTextColor
|
||||||
.planets
|
.planets
|
||||||
margin-left 15px
|
margin-left 15px
|
||||||
li
|
li
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ global-reset()
|
|||||||
@import './containers/*'
|
@import './containers/*'
|
||||||
|
|
||||||
html, body
|
html, body
|
||||||
width 100%
|
width 100%
|
||||||
height 100%
|
height 100%
|
||||||
overflow hidden
|
overflow hidden
|
||||||
|
|
||||||
body
|
body
|
||||||
font-family "Lato"
|
font-family "Lato"
|
||||||
|
|||||||
@@ -63,12 +63,14 @@ marked()
|
|||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
color black
|
color black
|
||||||
text-decoration none
|
text-decoration none
|
||||||
|
background-color #F6F6F6
|
||||||
pre
|
pre
|
||||||
padding 5px
|
padding 5px
|
||||||
border solid 1px borderColor
|
border solid 1px borderColor
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
overflow-x auto
|
overflow-x auto
|
||||||
margin-bottom 15px
|
margin-bottom 15px
|
||||||
|
background-color #F6F6F6
|
||||||
&>code
|
&>code
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
|
|||||||
2
main.js
2
main.js
@@ -85,7 +85,7 @@ app.on('ready', function () {
|
|||||||
Menu.setApplicationMenu(menu)
|
Menu.setApplicationMenu(menu)
|
||||||
// menu end
|
// menu end
|
||||||
appIcon = new Tray(__dirname + '/tray-icon.png')
|
appIcon = new Tray(__dirname + '/tray-icon.png')
|
||||||
appIcon.setToolTip('Codexen')
|
appIcon.setToolTip('Boost')
|
||||||
|
|
||||||
var trayMenu = new Menu()
|
var trayMenu = new Menu()
|
||||||
trayMenu.append(new MenuItem({
|
trayMenu.append(new MenuItem({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.2.6",
|
"version": "0.2.7",
|
||||||
"description": "Boost App",
|
"description": "Boost App",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
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