Coder Social home page Coder Social logo

hyperterm-window's Introduction

hyperterm-window

Window component for hyperterm

hyperwindow

Example usage:

const HyperWindow = require('hyperterm-window');

exports.decorateTerm = (Term, { React, notify }) => {

  return class extends React.Component {
    render () {
      const children = [React.createElement(Term, Object.assign({}, this.props, { key: 'term' }))];

      // Add a custom component to be displayed in the window
      const myComponent = ...;
        
      const windowProps = Object.assign({}, this.props, {key: 'window', onClose: this.props.clearChart});
      const hyperwindow = React.createElement(HyperWindow, windowProps, myComponent);
      children.push(hyperwindow);
      return React.createElement('div', {style: {width: '100%', height: '100%', position: 'relative'}}, children);
    }
  }
};

See the example for how to integrate the window with the hyperterm redux store.

props

  • width - the width of the window in pixels. optional.
  • height - the height of the window in pixels. optional.
  • onClose - function to call when the user clicks the close button
  • foregroundColor, backgroundColor - these should be the colors specified in the user's .hyperterm.js, used to make the window integrate well into the terminal. If you just pass all of this.props from a terminal decorator these will get set automatically (see example above).

TODO

  • add position prop - e.g. 'UPPER_LEFT', 'BOTTOM_RIGHT', etc
  • add ability to drag
  • add ability to resize

Pull requests welcome!

hyperterm-window's People

Contributors

mathisonian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kandros jonaustin

hyperterm-window's Issues

Could you share the `test.sh` script used in the demo?

Hi there,

I would like to build some things based on hyperterm-window, and I was wondering whether you could share, either in some docs somewhere/a gist/the repo, whether you could share the test.sh script that you call, so that I could get an idea of how that demo works please?

Fantastic project! Really great โœจ ๐Ÿ’– โœจ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.