Last active
September 19, 2017 13:02
-
-
Save blackmiaool/d721310fa0e1797a67da8b81932c181a to your computer and use it in GitHub Desktop.
hyper plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const hashbow = require('hashbow'); | |
| exports.getTabProps = function (uid, parentProps, props) { | |
| const ret = {}; | |
| Object.assign(ret, props, { | |
| dabColor: hashbow(props.text) | |
| }); | |
| ret.text = ret.text.replace(/blackmiaool@blackmiaool-OptiPlex-9020:/, "") | |
| return ret; | |
| }; | |
| exports.decorateTab = function (Tab, { | |
| React | |
| }) { | |
| return class extends Tab { | |
| render() { | |
| const dab = React.createElement('span', { | |
| className: 'tab_dibdab', | |
| style: { | |
| 'background-color': this.props.dabColor | |
| } | |
| }); | |
| const customChildrenBefore = Array.from(this.props.customChildrenBefore || []).concat(dab); | |
| return React.createElement(Tab, Object.assign({}, this.props, { | |
| customChildrenBefore | |
| })); | |
| } | |
| } | |
| }; | |
| exports.decorateConfig = function (config) { | |
| return Object.assign({}, config, { | |
| termCSS:` | |
| .unicode-node{ | |
| width:12.22px !important; | |
| } | |
| `, | |
| css: ` | |
| ${config.css || ''} | |
| .tab_dibdab { | |
| position: absolute; | |
| left: 13px; | |
| top: 13px; | |
| width: 10px; | |
| height: 10px; | |
| border-radius: 50%; | |
| } | |
| .header_header{ | |
| position:static; | |
| } | |
| .header_windowHeader{ | |
| position:static; | |
| } | |
| .tabs_nav{ | |
| position:static; | |
| height:auto; | |
| } | |
| .tab_tab{ | |
| min-width: 150px; | |
| cursor:pointer; | |
| } | |
| .tab_tab.tab_active{ | |
| background-color: steelblue !important; | |
| cursor:auto; | |
| } | |
| .tabs_list{ | |
| flex-wrap:wrap; | |
| } | |
| .hyper_main{ | |
| display:flex; | |
| flex-direction:column; | |
| } | |
| .terms_terms{ | |
| flex:1; | |
| position:static; | |
| margin-top:0; | |
| } | |
| .tabs_list{ | |
| max-height:none; | |
| } | |
| ` | |
| }); | |
| }; |
Author
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Install hyperterm-dibdabs and replace the index.js with this file