Last active
August 29, 2015 14:10
-
-
Save easylogic/702b6b01f3154a09d1cc to your computer and use it in GitHub Desktop.
summernote-fullcustom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
summernote 는 현재 bootstrap 기반인데. | |
ui 상관 없이 기존 기능을 쓸려면 어떻게 해야하는가 ? | |
1. button | |
2. icon | |
3. toolbar | |
4. dialog | |
가장 좋은 방법은 기본 소스에서 bootstrap 코드를 빼는 것이다. | |
이렇게 할려면 summernote 가 4가지에 대한 모든 css 를 가지고 있어야 한다. | |
즉 디자인부터 다시 해야한다. | |
하지만 사실상 그건 거의 불가능이다. 이름이 bootstrap 을 위한 에디터라서 ㅡㅡ; | |
자 그럼 다시 생각해보자. | |
bootstrap 의 ui 를 사용하지 않고 나머지 기능을 다 충족시킬려면 어떻게 해야하는가? | |
1. Render 관련된 부분을 처음부터 다시 만든다. | |
- 할려고 보니 이벤트쪽에서도 모조리 bootstrap 관련된 컴포넌트 이벤트를 사용하고 있어서 불가능 할 것 같다. | |
2. Fork 해서 아예 다시 만든다. | |
3. 해당 기능의 스펙을 정의하고 그것을 호출하기 위한 명세를 만든다. | |
즉, summernote 는 기본 에디터형태로만 있고 모든 toolbar 는 없어진다? | |
4. airMode 는 어떻게 처리하지 ? custom 을 따로 지원해야하는것인가? | |
api 정리를 해보자. | |
```javascript | |
// template, editor | |
var tmpl = $.summernote.renderer.getTemplate(); | |
var editor = $.summernote.eventHandler.getEditor(); | |
// core functions: range, dom | |
var range = $.summernote.core.range; | |
var dom = $.summernote.core.dom; | |
``` | |
가장 중요한 기능은 editor 에 다 들어있다. | |
``` | |
editor.restoreRange($editable) | |
editor.storeRange($editable) | |
editor.insertNode | |
editor.insertImage | |
... | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment