diff --git a/app/config.js b/app/config.js deleted file mode 100644 index ab11e637..00000000 --- a/app/config.js +++ /dev/null @@ -1,40 +0,0 @@ -/* global Notification */ -/* eslint no-new:0 */ -import React from 'react'; -import { ipcRenderer, remote } from 'electron'; - -const config = remote.require('./config'); - -export default class Config extends React.Component { - - constructor () { - super(); - this.state = { - config: config.getConfig() - }; - this.onChange = this.onChange.bind(this); - } - - onChange () { - this.setState({ config: config.getConfig() }); - } - - componentDidMount () { - ipcRenderer.on('config change', this.onChange); - ipcRenderer.on('plugins change', this.onChange); - } - - // passes `config` as props to the decorated component - render () { - const child = React.Children.only(this.props.children); - const { config } = this.state; - const decorate = remote.require('./plugins').decorateConfig; - return React.cloneElement(child, { config: decorate(config) }); - } - - componentWillUnmount () { - ipcRenderer.removeListener('config change', this.onChange); - ipcRenderer.removeListener('plugins change', this.onChange); - } - -} diff --git a/app/css/hyperterm.css b/app/css/hyperterm.css deleted file mode 100644 index e86db3fa..00000000 --- a/app/css/hyperterm.css +++ /dev/null @@ -1,105 +0,0 @@ -.main { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - border: 1px solid #333; -} - -.mac.main { - border-radius: 5px; -} - -header { - position: fixed; - top: 1px; - left: 1px; - right: 1px; - background: #000; - z-index: 100; -} - -.mac header { - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} - -.terms { - position: absolute; - margin-top: 28px; - top: 0; - right: 0; - left: 0; - bottom: 0; - color: #fff; -} - -.term { - display: none; -} - -.term.active { - display: block; -} - -.resize-indicator, -.update-indicator { - cursor: default; - -webkit-user-select: none; -} - -.resize-indicator { - color: #fff; - font: 11px Menlo; - position: fixed; - bottom: 20px; - right: 20px; - opacity: 0; - transition: opacity 150ms ease-in; - display: flex; -} - -.resize-indicator > div { - background: rgba(255, 255, 255, .2); - padding: 6px 14px; - margin-left: 10px; -} - -.resize-indicator.showing { - opacity: 1; -} - -.update-indicator { - background: #7ED321; - padding: 6px 14px; - color: #fff; - font: 11px Menlo; - position: fixed; - bottom: 20px; - right: 20px; - opacity: 0; - transition: opacity 150ms ease-in; - pointer-events: none; -} - -.update-indicator a { - color: #fff; -} - -.update-indicator .close { - color: #528D11; - cursor: pointer; -} - -.update-indicator.showing { - opacity: 1; - pointer-events: inherit; -} - -.icon { - vertical-align: middle; - fill: currentColor; - width: 1em; - height: 1em; -} diff --git a/app/css/tabs.css b/app/css/tabs.css deleted file mode 100644 index 3886cbeb..00000000 --- a/app/css/tabs.css +++ /dev/null @@ -1,118 +0,0 @@ -nav { - font-size: 12px; - font-family: -apple-system, BlinkMacSystemFont, - "Segoe UI", "Roboto", "Oxygen", - "Ubuntu", "Cantarell", "Fira Sans", - "Droid Sans", "Helvetica Neue", sans-serif; - height: 34px; - line-height: 34px; - vertical-align: middle; - color: #9B9B9B; - cursor: default; - -webkit-user-select: none; -} - -.single { - text-align: center; - color: #fff; -} - -.tabs { - border-bottom: 1px solid #333; - max-height: 34px; - display: flex; - flex-flow: row; -} - -.tabs li:first-child { - margin-left: 76px; -} - -.tabs li { - list-style-type: none; - flex-grow: 1; - text-align: center; - position: relative; -} - -.tabs li.is_active { - color: #fff; -} - -.tabs li span { - transition: color .2s ease; - display: block; - border-left: 1px solid transparent; - border-right: 1px solid transparent; -} - -.tabs li.is_active span { - border-left-color: #333; - border-right-color: #333; -} - -.tabs li.is_active:last-child span { - border-right-color: transparent; -} - -.tabs li.is_active::before { - position: absolute; - content: ' '; - border-bottom: 1px solid #000; - display: block; - left: 1px; - right: 1px; - bottom: -1px; -} - -.tabs li:not(.is_active):hover span { - color: #ccc; -} - -.tabs li.has_activity, .tabs li.has_activity:hover { - color: #50E3C2; -} - -/* The close button */ - -.tabs li i { - transition: opacity .2s ease, - color .2s ease, - transform .25s ease, - background-color .1s ease; - pointer-events: none; - position: absolute; - right: 7px; - top: 8px; - display: inline-block; - width: 14px; - height: 14px; - border-radius: 100%; - color: #e9e9e9; - opacity: 0; - transform: scale(.95); -} - -.tabs li:hover i { - opacity: 1; - transform: none; - pointer-events: all; -} - -.tabs li i:hover { - background-color: rgba(255,255,255, .13); - color: #fff; -} - -.tabs li i:active { - background-color: rgba(255,255,255, .1); - color: #909090; -} - -.tabs li i .icon { - position: absolute; - left: 4px; - top: 4px; - width: 6px; - height: 6px; -} diff --git a/app/hyperterm.js b/app/hyperterm.js deleted file mode 100644 index 441e1cca..00000000 --- a/app/hyperterm.js +++ /dev/null @@ -1,532 +0,0 @@ -import Tabs_ from './tabs'; -import Term_ from './term'; -import RPC from './rpc'; -import Mousetrap from 'mousetrap'; -import classes from 'classnames'; -import shallowCompare from 'react-addons-shallow-compare'; -import React, { Component } from 'react'; -import decorate from './plugins'; - -// make subcomponents reload siwth plugin changes -const Tabs = decorate(Tabs_); -const Term = decorate(Term_); - -export default class HyperTerm extends Component { - constructor (props) { - super(); - this.state = { - cols: null, - rows: null, - hpadding: 12, - vpadding: 12, - sessions: [], - titles: {}, - urls: {}, - active: null, - activeMarkers: [], - mac: /Mac/.test(navigator.userAgent), - resizeIndicatorShowing: false, - fontSizeIndicatorShowing: false, - dismissedUpdate: false, - updateVersion: null, - fontSize: props.config.fontSize - }; - - // we set this to true when the first tab - // has been initialized and ack'd by the - // node server for the *first time* - this.init = false; - - // we keep track of activity in tabs to avoid - // placing an activity marker right after - // opening - this.tabWasActive = {}; - - this.onResize = this.onResize.bind(this); - this.onChange = this.onChange.bind(this); - this.openExternal = this.openExternal.bind(this); - this.quitAndInstall = this.quitAndInstall.bind(this); - this.focusActive = this.focusActive.bind(this); - this.closeBrowser = this.closeBrowser.bind(this); - this.onHeaderMouseDown = this.onHeaderMouseDown.bind(this); - this.closeTab = this.closeTab.bind(this); - - this.moveLeft = this.moveLeft.bind(this); - this.moveRight = this.moveRight.bind(this); - this.resetFontSize = this.resetFontSize.bind(this); - this.increaseFontSize = this.increaseFontSize.bind(this); - this.decreaseFontSize = this.decreaseFontSize.bind(this); - - this.dismissUpdate = this.dismissUpdate.bind(this); - this.onUpdateAvailable = this.onUpdateAvailable.bind(this); - - document.body.style.backgroundColor = props.config.backgroundColor; - } - - componentWillReceiveProps (props) { - if (props.config.fontSize !== this.props.config.fontSize) { - this.changeFontSize(props.config.fontSize); - } - - if (props.config.backgroundColor !== this.props.config.backgroundColor) { - document.body.style.backgroundColor = props.config.backgroundColor; - } - } - - render () { - const { backgroundColor, borderColor, css } = this.props.config; - return
-
-
- { - const title = this.state.titles[uid]; - return null != title ? title : 'Shell'; - })} - onChange={this.onChange} - onClose={this.closeTab} - /> -
- -
{ - this.state.sessions.map((uid, i) => { - const active = i === this.state.active; - const { config } = this.props; - return
- -
; - }) - }
-
-
- {this.state.fontSizeIndicatorShowing &&
{ this.state.fontSize }px
} -
{ this.state.cols }x{ this.state.rows }
-
-
- Version { this.state.updateVersion } ready. - {this.state.updateNote ? ` ${this.state.updateNote}. ` : ' '} - Restart - to apply [x] -
-