Code Monkey home page Code Monkey logo

ember-trix-editor's Introduction

ember-trix-editor

Ember Trix Editor is an Ember addon that wraps Basecamp's Trix editor in an Ember component. Visit our demo to see it in action. (Code for our demo is located in tests/dummy/app.)

To use this component in your own Ember project, enter this command: ember install ember-trix-editor.

The component is consistent with Ember's data-down actions-up pattern:

"Data down" to {{trix-editor}}

  • attachmentsDisabled (boolean; if truthy, calls preventDefault() on the trix-file-accept event)
  • autofocus (boolean; if truthy, adds the HTML autofocus attribute to the trix-editor tag)
  • editorClass (string; space-separated list of class names that will be passed to the class attribute of the trix-editor tag)
  • placeholder (string; text that will show up in the editor when it's empty)
  • value (string; text to pre-populate the trix-editor)

"Actions up" from {{trix-editor}}

  • trix-attachment-add
  • trix-attachment-remove
  • trix-blur
  • trix-change
  • trix-file-accept
  • trix-focus
  • trix-initialize
  • trix-selection-change

All actions send up a jQuery event, from which the original event and editor property can be extracted.

actions: {
  handleTrixAttachmentAdd(jqEvent) {
    var attachment = jqEvent.originalEvent.attachment;
    if (attachment.file) {
      // update file to server
      // call attachment.setAttributes();
    }
  }
}

Contributing to Trix

This is the first time Channing Allen and Lynne Tye have contributed to an open-source project! We welcome others to send bug reports, make pull requests, or give us feedback.

Special thanks to Courtland Allen for his help.

Installation

  • git clone this repo
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

ember-trix-editor's People

Contributors

channingallen avatar dandehavilland avatar ember-tomster avatar hernanvicente avatar jpadilla avatar lan0 avatar lynnetye avatar vanetix avatar zkwentz avatar

Watchers

 avatar  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.