1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

Compare commits

...

8 Commits
0.2.6 ... 0.2.9

Author SHA1 Message Date
Rokt33r
06a54d451c Merge branch 'dev'
* dev:
  0.2.9 API server changed, bump electron version 0.31.0
2015-08-31 01:34:15 +09:00
Rokt33r
e317075815 0.2.9 API server changed, bump electron version 0.31.0 2015-08-31 01:33:32 +09:00
Rokt33r
45541a255b Merge branch 'dev'
* dev:
  - StylusでコンパイルされたCSSをCachingする(ロディングが短くなる) - Planet name changeのときにエラーハンドリング追加 + Bug fix - TeamのMemberを編集する場合、自分を編集することはできない - FinderにMarkdownのリンクがちゃんと外部に飛ぶように - Tray iconがちゃんと表示 - ArticleDetailのCodeアイコンがちゃんと表示されない
2015-08-30 05:31:13 +09:00
Rokt33r
3ab423d695 - StylusでコンパイルされたCSSをCachingする(ロディングが短くなる)
- Planet name changeのときにエラーハンドリング追加 + Bug fix
- TeamのMemberを編集する場合、自分を編集することはできない
- FinderにMarkdownのリンクがちゃんと外部に飛ぶように
- Tray iconがちゃんと表示
- ArticleDetailのCodeアイコンがちゃんと表示されない
2015-08-30 05:30:54 +09:00
Rokt33r
345d7b427a Merge branch 'dev'
* dev:
  Loading font 微調整
2015-08-26 18:27:42 +09:00
Rokt33r
de6d6b692e Loading font 微調整 2015-08-26 18:27:19 +09:00
Rokt33r
b2845e2284 Merge branch 'dev'
* dev:
  version 0.2.7  - Planet, Team作成の時Error message表示  - MarkdownのCode blockの背景を薄い灰色にする  - 権限なしのPlanetには  - SignUpに規約/Privacyの外部リンク追加  - Loading画面追加  - Font 添付(Lato regular)  - UserContainerでのTeam Label変更
2015-08-26 18:23:04 +09:00
Rokt33r
47383c347c version 0.2.7
- Planet, Team作成の時Error message表示
 - MarkdownのCode blockの背景を薄い灰色にする
 - 権限なしのPlanetには
 - SignUpに規約/Privacyの外部リンク追加
 - Loading画面追加
 - Font 添付(Lato regular)
 - UserContainerでのTeam Label変更
2015-08-26 18:22:46 +09:00
29 changed files with 224 additions and 73 deletions

3
.gitmodules vendored
View File

@@ -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

Binary file not shown.

BIN
Lato-Regular.woff Normal file

Binary file not shown.

BIN
Lato-Regular.woff2 Normal file

Binary file not shown.

View File

@@ -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>
)

View File

@@ -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>

View File

@@ -66,7 +66,7 @@ module.exports = React.createClass({
<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>
<i className='fa fa-code fa-fw'></i>
</div>
<div className='itemRight'>

View File

@@ -25,7 +25,8 @@ module.exports = React.createClass({
name: '',
public: true
},
ownerName: ownerName
ownerName: ownerName,
error: null
}
},
componentDidMount: function () {
@@ -42,7 +43,7 @@ module.exports = React.createClass({
}
},
handleSubmit: function () {
this.setState({errorMessage: null}, function () {
this.setState({error: null}, function () {
Hq.createPlanet(this.state.ownerName, this.state.planet)
.then(function (res) {
var planet = res.body
@@ -57,8 +58,21 @@ module.exports = React.createClass({
}.bind(this))
.catch(function (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: 'Unexpected error occured! please try again'}})
}
}.bind(this))
})
@@ -86,7 +100,7 @@ module.exports = React.createClass({
</select>
</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'>
<i className='fa fa-check'/>

View File

@@ -10,11 +10,20 @@ 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 {
@@ -24,6 +33,17 @@ module.exports = React.createClass({
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) {
@@ -37,9 +57,11 @@ module.exports = 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

View File

@@ -58,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))
})
},
@@ -130,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>
)

View File

@@ -22,7 +22,8 @@ module.exports = React.createClass({
return {
team: {
name: ''
}
},
error: null
}
},
componentDidMount: function () {
@@ -39,29 +40,44 @@ module.exports = React.createClass({
}
},
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 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>

View File

@@ -399,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}/>

View File

@@ -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>
)
}

View File

@@ -318,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}
@@ -353,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}

View File

@@ -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))

View File

@@ -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>

View File

@@ -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
}
})

View File

@@ -294,6 +294,9 @@
.planetGroupLabel
font-size 1.1em
margin-bottom 15px
small
font-size 0.8em
color inactiveTextColor
.planets
margin-left 15px
li

View File

@@ -7,9 +7,9 @@ global-reset()
@import './containers/*'
html, body
width 100%
height 100%
overflow hidden
width 100%
height 100%
overflow hidden
body
font-family "Lato"

View File

@@ -63,12 +63,14 @@ marked()
font-size 0.9em
color black
text-decoration none
background-color #F6F6F6
pre
padding 5px
border solid 1px borderColor
border-radius 5px
overflow-x auto
margin-bottom 15px
background-color #F6F6F6
&>code
padding 0
border none

View File

@@ -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

View File

@@ -1,4 +1,4 @@
module.exports = {
apiUrl: 'http://codexen-server-dev2.elasticbeanstalk.com/'
apiUrl: 'https://api.b00st.io/'
// apiUrl: 'http://localhost:8000/'
}

22
main.js
View File

@@ -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 () {

View File

@@ -5,7 +5,7 @@ module.exports = [
label: 'Electron',
submenu: [
{
label: 'About Electron',
label: 'About Boost',
selector: 'orderFrontStandardAboutPanel:'
},
{

View File

@@ -1,6 +1,6 @@
{
"name": "boost",
"version": "0.2.6",
"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"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB