Skip to content

wecatch/ember-cli-simditor

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Ember-cli-simditor

Build Status Downloads Version

Ember component wrapper for simditor.

Changes

1.0.0

  • Upgrade Ember to 3.85
  • Use native class rewrite addon
  • Lock simditor dependence
  • Change ci to github action

0.0.7

Different from previous version, you must wrap content in object. See issue 6 for why.

Getting Started

Installation

In your ember-cli project, install this addon from npm

ember install ember-cli-simditor

or install the latest version from github

ember install git+https://github.com/wecatch/ember-cli-simditor

Usage

<SimditorEditor
  @value={{get this.model 'one'}}
  @update={{fn (mut this.model.one.content)}}
  @editor={{fn (mut this.editor)}}
  @toolbar={{this.toolbar}}
  @onValuechanged={{this.valuechanged}}
/>

You must wrap content in one object, that means model object must have one property called content for component to render, visit issue 6 for why.

By default the content property name is content, you can custome the property name with name argument

<SimditorEditor 
  @value={{this.model}}
  @update={{fn (mut this.model.html)}}
  @editor={{fn (mut this.editor)}}
  @toolbar={{this.toolbar}}
  @onValuechanged={{this.valuechanged}}
  @name='html'/>

Locale

English by default

<SimditorEditor />

Chinese

<SimditorEditor @locale='zh-CN'/>

API

In this addon , on prefix must be used for all events name. For sample, valuechanged => OnValuechanged.

  • valuechanged => onValuechanged
  • selectionchanged => onSelectionchanged
  • decorate => onDecorate
  • undecorate = > onUndecorate
  • pasting => onPasting
  • blur => onBlur
  • destroy => onDestroy

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server