2016-07-13 12:44:24 -08:00
|
|
|
import Terms from '../components/terms';
|
2016-09-21 06:27:11 -08:00
|
|
|
import {connect} from '../utils/plugins';
|
2016-07-13 12:44:24 -08:00
|
|
|
import {
|
|
|
|
|
resizeSession,
|
|
|
|
|
sendSessionData,
|
|
|
|
|
exitSessionBrowser,
|
|
|
|
|
setSessionXtermTitle,
|
|
|
|
|
setActiveSession
|
|
|
|
|
} from '../actions/sessions';
|
2016-10-03 18:00:50 -08:00
|
|
|
import {getRootGroups} from '../selectors';
|
2016-07-13 12:44:24 -08:00
|
|
|
|
|
|
|
|
const TermsContainer = connect(
|
2016-09-21 06:27:11 -08:00
|
|
|
state => {
|
2016-10-03 18:00:50 -08:00
|
|
|
const {sessions} = state.sessions;
|
2016-07-13 12:44:24 -08:00
|
|
|
return {
|
2016-10-03 18:00:50 -08:00
|
|
|
sessions,
|
2016-07-13 12:44:24 -08:00
|
|
|
cols: state.ui.cols,
|
|
|
|
|
rows: state.ui.rows,
|
2016-10-03 18:00:50 -08:00
|
|
|
termGroups: getRootGroups(state),
|
|
|
|
|
activeRootGroup: state.termGroups.activeRootGroup,
|
2016-07-13 12:44:24 -08:00
|
|
|
activeSession: state.sessions.activeUid,
|
|
|
|
|
customCSS: state.ui.termCSS,
|
|
|
|
|
write: state.sessions.write,
|
2016-09-21 06:27:11 -08:00
|
|
|
fontSize: state.ui.fontSizeOverride ?
|
|
|
|
|
state.ui.fontSizeOverride :
|
|
|
|
|
state.ui.fontSize,
|
2016-07-13 12:44:24 -08:00
|
|
|
fontFamily: state.ui.fontFamily,
|
2016-07-19 10:30:57 -08:00
|
|
|
fontSmoothing: state.ui.fontSmoothingOverride,
|
2016-07-13 12:44:24 -08:00
|
|
|
padding: state.ui.padding,
|
|
|
|
|
cursorColor: state.ui.cursorColor,
|
2016-07-21 15:15:23 -08:00
|
|
|
cursorShape: state.ui.cursorShape,
|
2016-07-13 12:44:24 -08:00
|
|
|
borderColor: state.ui.borderColor,
|
|
|
|
|
colors: state.ui.colors,
|
|
|
|
|
foregroundColor: state.ui.foregroundColor,
|
2016-08-05 14:30:40 -08:00
|
|
|
backgroundColor: state.ui.backgroundColor,
|
|
|
|
|
bell: state.ui.bell,
|
2016-08-13 13:03:44 -08:00
|
|
|
bellSoundURL: state.ui.bellSoundURL,
|
2016-09-30 04:30:11 -08:00
|
|
|
copyOnSelect: state.ui.copyOnSelect,
|
|
|
|
|
modifierKeys: state.ui.modifierKeys
|
2016-07-13 12:44:24 -08:00
|
|
|
};
|
|
|
|
|
},
|
2016-09-21 06:27:11 -08:00
|
|
|
dispatch => {
|
2016-07-13 12:44:24 -08:00
|
|
|
return {
|
2016-09-21 06:27:11 -08:00
|
|
|
onData(uid, data) {
|
2016-07-13 12:44:24 -08:00
|
|
|
dispatch(sendSessionData(uid, data));
|
|
|
|
|
},
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
onTitle(uid, title) {
|
2016-07-13 12:44:24 -08:00
|
|
|
dispatch(setSessionXtermTitle(uid, title));
|
|
|
|
|
},
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
onResize(uid, cols, rows) {
|
2016-07-13 12:44:24 -08:00
|
|
|
dispatch(resizeSession(uid, cols, rows));
|
|
|
|
|
},
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
onURLAbort(uid) {
|
2016-07-13 12:44:24 -08:00
|
|
|
dispatch(exitSessionBrowser(uid));
|
|
|
|
|
},
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
onActive(uid) {
|
2016-07-13 12:44:24 -08:00
|
|
|
dispatch(setActiveSession(uid));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
null,
|
2016-09-21 06:27:11 -08:00
|
|
|
{withRef: true}
|
2016-07-13 12:44:24 -08:00
|
|
|
)(Terms, 'Terms');
|
|
|
|
|
|
|
|
|
|
export default TermsContainer;
|