Giter Club home page Giter Club logo

hierarchical-text-input-riot-typescript's Introduction

Introduction

This web app provides a minimal interface for hierarchical text input. The simple hierarchical structure allows the user to organize their unstructured ideas in a natural way.

The app uses RiotJS framework for componentizing the views. The model is written in Typescript.

screenshot

View components (src/components):

  • The top-most view is the app view contained in app.tag. This view contains a collection of items. Each item represents a line in which the user can type. The code in app.tag initializes the first item and handles the keyboard events up, down, tab, shif-tab, and enter. The enter key creates a new item in the next line.
  • The item view in the file item.tag contains a text input. It is associated with one Node object and handles the tab, shift-tab operations when triggered by the app. It also handles the focus event when the text box is clicked or from the up/down keyboard event handlers in the app.tag.

Model (src/store)

  • It contains the class Node. Each object is composed of a title and a list of child Node objects. The class provides methods allowing basic operations to add child, remove child, retrieve siblings, and retrieve the index of a child. The method getOrderedFlatNodeList is called to generate the flat list of nodes used to populate the items list in app.tag.

To run

  1. Run this command in the directory python -m SimpleHTTPServer

  2. Open http://localhost:8000/

  3. Run tsc -w in the src folder to watch for updates on code.

Features

  1. Allows the use of keys: (tab / shift-tab) to modify the indent and up/down to traverse the tree

TODO:

  1. Add Drag/Drop functionality.

hierarchical-text-input-riot-typescript's People

Contributors

gparuthi avatar

Watchers

 avatar

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.