Skip to content

wecatch/ember-cli-simditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

28dfe73 · Jul 1, 2022

History

56 Commits
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
Mar 23, 2016
May 15, 2022
Mar 23, 2016
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
Mar 23, 2016
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
May 15, 2022
Jul 1, 2022
Jul 1, 2022
May 15, 2022

Repository files navigation

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