mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
version 0.2.10
- Hotkeyの設定機能 - Stylus refactor
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
var remote = require('remote')
|
|
||||||
var version = remote.getGlobal('version')
|
|
||||||
|
|
||||||
var React = require('react/addons')
|
var React = require('react/addons')
|
||||||
|
|
||||||
var ExternalLink = require('../Mixins/ExternalLink')
|
var ExternalLink = require('../Mixins/ExternalLink')
|
||||||
@@ -19,8 +16,9 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
|
var version = global.version
|
||||||
return (
|
return (
|
||||||
<div className='AboutModal modal'>
|
<div className='PreferencesModal sideNavModal modal'>
|
||||||
<div className='about1'>
|
<div className='about1'>
|
||||||
<img className='logo' src='resources/favicon-230x230.png'/>
|
<img className='logo' src='resources/favicon-230x230.png'/>
|
||||||
<div className='appInfo'>Boost {version == null || version.length === 0 ? 'DEV version' : 'v' + version}</div>
|
<div className='appInfo'>Boost {version == null || version.length === 0 ? 'DEV version' : 'v' + version}</div>
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ module.exports = React.createClass({
|
|||||||
this.setState({
|
this.setState({
|
||||||
passwordSubmitStatus: 'sending'
|
passwordSubmitStatus: 'sending'
|
||||||
}, function () {
|
}, function () {
|
||||||
console.log(this.state.password)
|
|
||||||
Hq.changePassword(this.state.password)
|
Hq.changePassword(this.state.password)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -103,9 +102,9 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='EditProfileModal modal tabModal'>
|
<div className='EditProfileModal sideNavModal modal'>
|
||||||
<div className='leftPane'>
|
<div className='leftPane'>
|
||||||
<div className='tabLabel'>Edit profile</div>
|
<div className='modalLabel'>Edit profile</div>
|
||||||
<div className='tabList'>
|
<div className='tabList'>
|
||||||
<button className={this.state.currentTab === 'userInfo' ? 'active' : ''} onClick={this.selectTab('userInfo')}><i className='fa fa-user fa-fw'/> User Info</button>
|
<button className={this.state.currentTab === 'userInfo' ? 'active' : ''} onClick={this.selectTab('userInfo')}><i className='fa fa-user fa-fw'/> User Info</button>
|
||||||
<button className={this.state.currentTab === 'password' ? 'active' : ''} onClick={this.selectTab('password')}><i className='fa fa-lock fa-fw'/> Password</button>
|
<button className={this.state.currentTab === 'password' ? 'active' : ''} onClick={this.selectTab('password')}><i className='fa fa-lock fa-fw'/> Password</button>
|
||||||
@@ -119,7 +118,7 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
renderUserInfoTab: function () {
|
renderUserInfoTab: function () {
|
||||||
return (
|
return (
|
||||||
<div className='userInfoTab'>
|
<div className='userInfoTab tab'>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>Profile Name</label>
|
<label>Profile Name</label>
|
||||||
<input valueLink={this.linkState('user.profileName')}/>
|
<input valueLink={this.linkState('user.profileName')}/>
|
||||||
@@ -142,18 +141,18 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
renderPasswordTab: function () {
|
renderPasswordTab: function () {
|
||||||
return (
|
return (
|
||||||
<div className='passwordTab'>
|
<div className='passwordTab tab'>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>Current password</label>
|
<label>Current password</label>
|
||||||
<input valueLink={this.linkState('password.currentPassword')}/>
|
<input type='password' valueLink={this.linkState('password.currentPassword')}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>New password</label>
|
<label>New password</label>
|
||||||
<input valueLink={this.linkState('password.newPassword')}/>
|
<input type='password' valueLink={this.linkState('password.newPassword')}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>Confirmation</label>
|
<label>Confirmation</label>
|
||||||
<input valueLink={this.linkState('password.passwordConfirmation')}/>
|
<input type='password' valueLink={this.linkState('password.passwordConfirmation')}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='formConfirm'>
|
<div className='formConfirm'>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ var Modal = require('../Mixins/Modal')
|
|||||||
|
|
||||||
var UserStore = require('../Stores/UserStore')
|
var UserStore = require('../Stores/UserStore')
|
||||||
|
|
||||||
var AboutModal = require('./AboutModal')
|
var PreferencesModal = require('./PreferencesModal')
|
||||||
var PlanetCreateModal = require('./PlanetCreateModal')
|
var PlanetCreateModal = require('./PlanetCreateModal')
|
||||||
var TeamCreateModal = require('./TeamCreateModal')
|
var TeamCreateModal = require('./TeamCreateModal')
|
||||||
var LogoutModal = require('./LogoutModal')
|
var LogoutModal = require('./LogoutModal')
|
||||||
@@ -65,8 +65,8 @@ module.exports = React.createClass({
|
|||||||
openTeamCreateModal: function () {
|
openTeamCreateModal: function () {
|
||||||
this.openModal(TeamCreateModal, {user: this.state.currentUser, transitionTo: this.transitionTo})
|
this.openModal(TeamCreateModal, {user: this.state.currentUser, transitionTo: this.transitionTo})
|
||||||
},
|
},
|
||||||
openAboutModal: function () {
|
openPreferencesModal: function () {
|
||||||
this.openModal(AboutModal)
|
this.openModal(PreferencesModal)
|
||||||
},
|
},
|
||||||
openPlanetCreateModal: function () {
|
openPlanetCreateModal: function () {
|
||||||
this.openModal(PlanetCreateModal, {transitionTo: this.transitionTo})
|
this.openModal(PlanetCreateModal, {transitionTo: this.transitionTo})
|
||||||
@@ -168,7 +168,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
<ul className='controlGroup'>
|
<ul className='controlGroup'>
|
||||||
<li>
|
<li>
|
||||||
<button onClick={this.openAboutModal}><i className='fa fa-info-circle fa-fw'/> About this app</button>
|
<button onClick={this.openPreferencesModal}><i className='fa fa-gears fa-fw'/> Preferences</button>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button onClick={this.handleLogoutClick}><i className='fa fa-sign-out fa-fw'/> Log out</button>
|
<button onClick={this.handleLogoutClick}><i className='fa fa-sign-out fa-fw'/> Log out</button>
|
||||||
|
|||||||
@@ -125,9 +125,9 @@ module.exports = React.createClass({
|
|||||||
content = this.state.currentTab === 'profile' ? this.renderPlanetProfileTab() : this.renderPlanetDeleteTab()
|
content = this.state.currentTab === 'profile' ? this.renderPlanetProfileTab() : this.renderPlanetDeleteTab()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='PlanetSettingModal modal tabModal'>
|
<div className='PlanetSettingModal sideNavModal modal'>
|
||||||
<div className='leftPane'>
|
<div className='leftPane'>
|
||||||
<h1 className='tabLabel'>Planet setting</h1>
|
<h1 className='modalLabel'>Planet setting</h1>
|
||||||
<nav className='tabList'>
|
<nav className='tabList'>
|
||||||
<button onClick={this.activePlanetProfile} className={this.state.currentTab === 'profile' ? 'active' : ''}><i className='fa fa-globe fa-fw'/> Planet profile</button>
|
<button onClick={this.activePlanetProfile} className={this.state.currentTab === 'profile' ? 'active' : ''}><i className='fa fa-globe fa-fw'/> Planet profile</button>
|
||||||
<button onClick={this.activePlanetDelete} className={this.state.currentTab === 'delete' ? 'active' : ''}><i className='fa fa-trash fa-fw'/> Delete Planet</button>
|
<button onClick={this.activePlanetDelete} className={this.state.currentTab === 'delete' ? 'active' : ''}><i className='fa fa-trash fa-fw'/> Delete Planet</button>
|
||||||
@@ -142,7 +142,7 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
renderPlanetProfileTab: function () {
|
renderPlanetProfileTab: function () {
|
||||||
return (
|
return (
|
||||||
<div className='planetProfileTab'>
|
<div className='planetProfileTab tab'>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>Planet name </label>
|
<label>Planet name </label>
|
||||||
<input valueLink={this.linkState('planet.name')}/>
|
<input valueLink={this.linkState('planet.name')}/>
|
||||||
@@ -169,7 +169,7 @@ module.exports = React.createClass({
|
|||||||
var disabled = !this.state.deleteConfirmation.match(new RegExp('^' + this.props.planet.userName + '/' + this.props.planet.name + '$'))
|
var disabled = !this.state.deleteConfirmation.match(new RegExp('^' + this.props.planet.userName + '/' + this.props.planet.name + '$'))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='planetDeleteTab'>
|
<div className='planetDeleteTab tab'>
|
||||||
<p>Are you sure to destroy <strong>'{this.props.planet.userName + '/' + this.props.planet.name}'</strong>?</p>
|
<p>Are you sure to destroy <strong>'{this.props.planet.userName + '/' + this.props.planet.name}'</strong>?</p>
|
||||||
<p>If you are sure, write <strong>'{this.props.planet.userName + '/' + this.props.planet.name}'</strong> to input below and click <strong>'{this.state.randomDeleteText}'</strong> button.</p>
|
<p>If you are sure, write <strong>'{this.props.planet.userName + '/' + this.props.planet.name}'</strong> to input below and click <strong>'{this.state.randomDeleteText}'</strong> button.</p>
|
||||||
<input valueLink={this.linkState('deleteConfirmation')} placeholder='userName/planetName'/>
|
<input valueLink={this.linkState('deleteConfirmation')} placeholder='userName/planetName'/>
|
||||||
|
|||||||
112
browser/main/Components/PreferencesModal.jsx
Normal file
112
browser/main/Components/PreferencesModal.jsx
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
var ipc = require('ipc')
|
||||||
|
var remote = require('remote')
|
||||||
|
|
||||||
|
var React = require('react/addons')
|
||||||
|
|
||||||
|
var LinkedState = require('../Mixins/LinkedState')
|
||||||
|
var ExternalLink = require('../Mixins/ExternalLink')
|
||||||
|
var KeyCaster = require('../Mixins/KeyCaster')
|
||||||
|
|
||||||
|
module.exports = React.createClass({
|
||||||
|
mixins: [LinkedState, ExternalLink, KeyCaster('aboutModal')],
|
||||||
|
propTypes: {
|
||||||
|
close: React.PropTypes.func
|
||||||
|
},
|
||||||
|
getInitialState: function () {
|
||||||
|
var keymap = remote.getGlobal('keymap')
|
||||||
|
console.log(keymap)
|
||||||
|
return {
|
||||||
|
currentTab: 'settings',
|
||||||
|
keymap: keymap
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onKeyCast: function (e) {
|
||||||
|
switch (e.status) {
|
||||||
|
case 'closeModal':
|
||||||
|
this.props.close()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
activeSettings: function () {
|
||||||
|
this.setState({currentTab: 'settings'})
|
||||||
|
},
|
||||||
|
activeAbout: function () {
|
||||||
|
this.setState({currentTab: 'about'})
|
||||||
|
},
|
||||||
|
saveKeymap: function () {
|
||||||
|
ipc.send('hotkeyUpdated', JSON.stringify(this.state.keymap))
|
||||||
|
},
|
||||||
|
render: function () {
|
||||||
|
var content = this.state.currentTab === 'settings' ? this.renderSettingsTab() : this.renderAboutTab()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='PreferencesModal sideNavModal modal'>
|
||||||
|
<div className='leftPane'>
|
||||||
|
<h1 className='modalLabel'>Preferences</h1>
|
||||||
|
<nav className='tabList'>
|
||||||
|
<button onClick={this.activeSettings} className={this.state.currentTab === 'settings' ? 'active' : ''}><i className='fa fa-gear fa-fw'/> Settings</button>
|
||||||
|
<button onClick={this.activeAbout} className={this.state.currentTab === 'about' ? 'active' : ''}><i className='fa fa-info-circle fa-fw'/> About this app</button>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div className='rightPane'>
|
||||||
|
{content}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
renderSettingsTab: function () {
|
||||||
|
return (
|
||||||
|
<div className='settingsTab tab'>
|
||||||
|
<div className='categoryLabel'>Hotkey</div>
|
||||||
|
<div className='formField'>
|
||||||
|
<label>Toggle finder</label>
|
||||||
|
<input valueLink={this.linkState('keymap.toggleFinder')}/>
|
||||||
|
</div>
|
||||||
|
<div className='formConfirm'>
|
||||||
|
<button onClick={this.saveKeymap}>Save</button>
|
||||||
|
</div>
|
||||||
|
<div className='example'>
|
||||||
|
<h3>Example</h3>
|
||||||
|
<ul>
|
||||||
|
<li><code>0</code> to <code>9</code></li>
|
||||||
|
<li><code>A</code> to <code>Z</code></li>
|
||||||
|
<li><code>F1</code> to <code>F24</code></li>
|
||||||
|
<li>Punctuations like <code>~</code>, <code>!</code>, <code>@</code>, <code>#</code>, <code>$</code>, etc.</li>
|
||||||
|
<li><code>Plus</code></li>
|
||||||
|
<li><code>Space</code></li>
|
||||||
|
<li><code>Backspace</code></li>
|
||||||
|
<li><code>Delete</code></li>
|
||||||
|
<li><code>Insert</code></li>
|
||||||
|
<li><code>Return</code> (or <code>Enter</code> as alias)</li>
|
||||||
|
<li><code>Up</code>, <code>Down</code>, <code>Left</code> and <code>Right</code></li>
|
||||||
|
<li><code>Home</code> and <code>End</code></li>
|
||||||
|
<li><code>PageUp</code> and <code>PageDown</code></li>
|
||||||
|
<li><code>Escape</code> (or <code>Esc</code> for short)</li>
|
||||||
|
<li><code>VolumeUp</code>, <code>VolumeDown</code> and <code>VolumeMute</code></li>
|
||||||
|
<li><code>MediaNextTrack</code>, <code>MediaPreviousTrack</code>, <code>MediaStop</code> and <code>MediaPlayPause</code></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
renderAboutTab: function () {
|
||||||
|
var version = global.version
|
||||||
|
return (
|
||||||
|
<div className='aboutTab tab'>
|
||||||
|
<div className='about1'>
|
||||||
|
<img className='logo' src='resources/favicon-230x230.png'/>
|
||||||
|
<div className='appInfo'>Boost {version == null || version.length === 0 ? 'DEV version' : 'v' + version}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='about2'>
|
||||||
|
<div className='externalLabel'>External links</div>
|
||||||
|
<ul className='externalList'>
|
||||||
|
<li><a onClick={this.openExternal} href='http://b00st.io'>Boost Homepage <i className='fa fa-external-link'/></a></li>
|
||||||
|
<li><a onClick={this.openExternal} href='http://boostio.github.io/regulations.html'>Regulation <i className='fa fa-external-link'/></a></li>
|
||||||
|
<li><a onClick={this.openExternal} href='http://boostio.github.io/privacypolicies.html'>Private policy <i className='fa fa-external-link'/></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -176,9 +176,9 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='TeamSettingsModal modal tabModal'>
|
<div className='TeamSettingsModal sideNavModal modal'>
|
||||||
<div className='leftPane'>
|
<div className='leftPane'>
|
||||||
<div className='tabLabel'>Team settings</div>
|
<div className='modalLabel'>Team settings</div>
|
||||||
<div className='tabList'>
|
<div className='tabList'>
|
||||||
<button className={this.state.currentTab === 'teamInfo' ? 'active' : ''} onClick={this.selectTab('teamInfo')}><i className='fa fa-info-circle fa-fw'/> Team Info</button>
|
<button className={this.state.currentTab === 'teamInfo' ? 'active' : ''} onClick={this.selectTab('teamInfo')}><i className='fa fa-info-circle fa-fw'/> Team Info</button>
|
||||||
<button className={this.state.currentTab === 'members' ? 'active' : ''} onClick={this.selectTab('members')}><i className='fa fa-users fa-fw'/> Members</button>
|
<button className={this.state.currentTab === 'members' ? 'active' : ''} onClick={this.selectTab('members')}><i className='fa fa-users fa-fw'/> Members</button>
|
||||||
@@ -192,7 +192,7 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
renderTeamInfoTab: function () {
|
renderTeamInfoTab: function () {
|
||||||
return (
|
return (
|
||||||
<div className='userInfoTab'>
|
<div className='userInfoTab tab'>
|
||||||
<div className='formField'>
|
<div className='formField'>
|
||||||
<label>Profile Name</label>
|
<label>Profile Name</label>
|
||||||
<input valueLink={this.linkState('team.profileName')}/>
|
<input valueLink={this.linkState('team.profileName')}/>
|
||||||
@@ -239,7 +239,7 @@ module.exports = React.createClass({
|
|||||||
var belowLimit = members.length < 5
|
var belowLimit = members.length < 5
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='membersTab'>
|
<div className='membersTab tab'>
|
||||||
<table className='memberTable'>
|
<table className='memberTable'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ module.exports = React.createClass({
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
this.transitionTo('home')
|
this.transitionTo('home')
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,10 +87,11 @@
|
|||||||
</script>
|
</script>
|
||||||
<script src="../ace/src-min/ace.js"></script>
|
<script src="../ace/src-min/ace.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
var version = require('remote').require('app').getVersion()
|
||||||
var version = require('remote').getGlobal('version')
|
global.version = version
|
||||||
document.title = 'Boost ' + ((version == null || version.length === 0) ? 'DEV version' : 'v' + version)
|
document.title = 'Boost ' + ((version == null || version.length === 0) ? 'DEV version' : 'v' + version)
|
||||||
require('../electron-stylus')(__dirname + '/../styles/main/index.styl', 'mainCss')
|
require('../electron-stylus')(__dirname + '/../styles/main/index.styl', 'mainCss')
|
||||||
|
// 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>
|
||||||
|
|||||||
@@ -32,14 +32,14 @@
|
|||||||
.modal-control
|
.modal-control
|
||||||
float right
|
float right
|
||||||
|
|
||||||
.tabModal
|
.sideNavModal
|
||||||
height 500px
|
height 500px
|
||||||
.leftPane
|
.leftPane
|
||||||
absolute top bottom left
|
absolute top bottom left
|
||||||
width 175px
|
width 175px
|
||||||
padding 20px
|
padding 20px
|
||||||
border-right solid 1px borderColor
|
border-right solid 1px borderColor
|
||||||
.tabLabel
|
.modalLabel
|
||||||
font-size 1.5em
|
font-size 1.5em
|
||||||
margin-top 25px
|
margin-top 25px
|
||||||
margin-bottom 35px
|
margin-bottom 35px
|
||||||
@@ -57,9 +57,7 @@
|
|||||||
left 175px
|
left 175px
|
||||||
padding 15px
|
padding 15px
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
|
.tab
|
||||||
.EditProfileModal, .PlanetSettingModal, .TeamSettingsModal
|
|
||||||
.userInfoTab, .passwordTab, .planetProfileTab, .userInfoTab, .membersTab
|
|
||||||
padding-top 45px
|
padding-top 45px
|
||||||
.formField
|
.formField
|
||||||
position relative
|
position relative
|
||||||
@@ -111,6 +109,33 @@
|
|||||||
alertSuccess()
|
alertSuccess()
|
||||||
.alertError
|
.alertError
|
||||||
alertError()
|
alertError()
|
||||||
|
.PreferencesModal
|
||||||
|
.settingsTab
|
||||||
|
.categoryLabel
|
||||||
|
font-size 1.5em
|
||||||
|
margin-bottom 25px
|
||||||
|
.example
|
||||||
|
marked()
|
||||||
|
.aboutTab
|
||||||
|
padding-top 30px
|
||||||
|
.about1
|
||||||
|
margin-bottom 25px
|
||||||
|
.logo
|
||||||
|
display block
|
||||||
|
margin 0 auto
|
||||||
|
.appInfo
|
||||||
|
font-size 1.5em
|
||||||
|
text-align center
|
||||||
|
.about2
|
||||||
|
width 200px
|
||||||
|
margin 0 auto
|
||||||
|
.externalLabel
|
||||||
|
font-size 1.2em
|
||||||
|
margin-bottom 15px
|
||||||
|
.externalList
|
||||||
|
li
|
||||||
|
margin-bottom 15px
|
||||||
|
.PlanetSettingModal
|
||||||
.planetDeleteTab
|
.planetDeleteTab
|
||||||
padding-top 65px
|
padding-top 65px
|
||||||
p
|
p
|
||||||
@@ -153,6 +178,7 @@
|
|||||||
alertSuccess()
|
alertSuccess()
|
||||||
.alertError
|
.alertError
|
||||||
alertError()
|
alertError()
|
||||||
|
.TeamSettingsModal
|
||||||
.membersTab
|
.membersTab
|
||||||
.memberTable
|
.memberTable
|
||||||
width 100%
|
width 100%
|
||||||
@@ -262,25 +288,6 @@
|
|||||||
border-radius 5px
|
border-radius 5px
|
||||||
marked()
|
marked()
|
||||||
|
|
||||||
.AboutModal
|
|
||||||
width 320px
|
|
||||||
.about1
|
|
||||||
margin-bottom 25px
|
|
||||||
.logo
|
|
||||||
display block
|
|
||||||
margin 0 auto
|
|
||||||
.appInfo
|
|
||||||
font-size 1.5em
|
|
||||||
text-align center
|
|
||||||
.about2
|
|
||||||
width 200px
|
|
||||||
margin 0 auto
|
|
||||||
.externalLabel
|
|
||||||
font-size 1.2em
|
|
||||||
margin-bottom 15px
|
|
||||||
.externalList
|
|
||||||
li
|
|
||||||
margin-bottom 15px
|
|
||||||
|
|
||||||
.PlanetCreateModal.modal, .TeamCreateModal.modal, .AddMemberModal.modal
|
.PlanetCreateModal.modal, .TeamCreateModal.modal, .AddMemberModal.modal
|
||||||
padding 60px 0
|
padding 60px 0
|
||||||
|
|||||||
47
main.js
47
main.js
@@ -4,6 +4,7 @@ var Menu = require('menu')
|
|||||||
var MenuItem = require('menu-item')
|
var MenuItem = require('menu-item')
|
||||||
var Tray = require('tray')
|
var Tray = require('tray')
|
||||||
var ipc = require('ipc')
|
var ipc = require('ipc')
|
||||||
|
var jetpack = require('fs-jetpack')
|
||||||
|
|
||||||
require('crash-reporter').start()
|
require('crash-reporter').start()
|
||||||
|
|
||||||
@@ -19,7 +20,6 @@ var update = null
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
var version = app.getVersion()
|
var version = app.getVersion()
|
||||||
global.version = version
|
|
||||||
var versionText = (version == null || version.length === 0) ? 'DEV version' : 'v' + version
|
var versionText = (version == null || version.length === 0) ? 'DEV version' : 'v' + version
|
||||||
var nn = require('node-notifier')
|
var nn = require('node-notifier')
|
||||||
var autoUpdater = require('auto-updater')
|
var autoUpdater = require('auto-updater')
|
||||||
@@ -143,12 +143,49 @@ app.on('ready', function () {
|
|||||||
popUpWindow.setVisibleOnAllWorkspaces(true)
|
popUpWindow.setVisibleOnAllWorkspaces(true)
|
||||||
|
|
||||||
var globalShortcut = require('global-shortcut')
|
var globalShortcut = require('global-shortcut')
|
||||||
|
console.log('jetpack launch')
|
||||||
|
var userDataPath = app.getPath('userData')
|
||||||
|
if (!jetpack.cwd(userDataPath).exists('keymap.json')) {
|
||||||
|
jetpack.cwd(userDataPath).file('keymap.json', {content: '{}'})
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
global.keymap = JSON.parse(jetpack.cwd(userDataPath).read('keymap.json', 'utf-8'))
|
||||||
|
} catch (err) {
|
||||||
|
jetpack.cwd(userDataPath).file('keymap.json', {content: '{}'})
|
||||||
|
global.keymap = {}
|
||||||
|
}
|
||||||
|
if (global.keymap.toggleFinder == null) global.keymap.toggleFinder = 'ctrl+tab+shift'
|
||||||
|
var toggleFinderKey = global.keymap.toggleFinder
|
||||||
|
|
||||||
globalShortcut.register('ctrl+tab+shift', function () {
|
try {
|
||||||
if (mainWindow != null && !mainWindow.isFocused()) {
|
globalShortcut.register(toggleFinderKey, function () {
|
||||||
mainWindow.hide()
|
if (mainWindow != null && !mainWindow.isFocused()) {
|
||||||
|
mainWindow.hide()
|
||||||
|
}
|
||||||
|
popUpWindow.show()
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
ipc.on('hotkeyUpdated', function (event, newKeymap) {
|
||||||
|
console.log('got new keymap')
|
||||||
|
console.log(newKeymap)
|
||||||
|
globalShortcut.unregisterAll()
|
||||||
|
global.keymap = JSON.parse(newKeymap)
|
||||||
|
jetpack.cwd(userDataPath).file('keymap.json', {content: JSON.stringify(global.keymap)})
|
||||||
|
|
||||||
|
var toggleFinderKey = global.keymap.toggleFinder != null ? global.keymap.toggleFinder : 'ctrl+tab+shift'
|
||||||
|
try {
|
||||||
|
globalShortcut.register(toggleFinderKey, function () {
|
||||||
|
if (mainWindow != null && !mainWindow.isFocused()) {
|
||||||
|
mainWindow.hide()
|
||||||
|
}
|
||||||
|
popUpWindow.show()
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.name)
|
||||||
}
|
}
|
||||||
popUpWindow.show()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
global.hideFinder = function () {
|
global.hideFinder = function () {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = [
|
|||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Hide Electron',
|
label: 'Hide Boost',
|
||||||
accelerator: 'Command+H',
|
accelerator: 'Command+H',
|
||||||
selector: 'hide:'
|
selector: 'hide:'
|
||||||
},
|
},
|
||||||
@@ -89,13 +89,13 @@ module.exports = [
|
|||||||
click: function () {
|
click: function () {
|
||||||
BrowserWindow.getFocusedWindow().reload()
|
BrowserWindow.getFocusedWindow().reload()
|
||||||
}
|
}
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// label: 'Toggle DevTools',
|
label: 'Toggle DevTools',
|
||||||
// accelerator: 'Alt+Command+I',
|
accelerator: 'Alt+Command+I',
|
||||||
// click: function () {
|
click: function () {
|
||||||
// BrowserWindow.getFocusedWindow().toggleDevTools()
|
BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.2.9",
|
"version": "0.2.10",
|
||||||
"description": "Boost App",
|
"description": "Boost App",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"font-awesome": "^4.3.0",
|
"font-awesome": "^4.3.0",
|
||||||
|
"fs-jetpack": "^0.7.0",
|
||||||
"markdown-it": "^4.3.1",
|
"markdown-it": "^4.3.1",
|
||||||
"md5": "^2.0.0",
|
"md5": "^2.0.0",
|
||||||
"moment": "^2.10.3",
|
"moment": "^2.10.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user