Created
January 31, 2018 02:17
-
-
Save vasilionjea/bd17d8ba4853f944d4325f374b520aa0 to your computer and use it in GitHub Desktop.
New Twiddle
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
import Ember from 'ember'; | |
const TOOLBAR_OPTIONS = [ | |
['bold', 'italic', 'underline'], | |
[ | |
{'list': 'ordered'}, | |
{'list': 'bullet'}, | |
{'script': 'sub'}, | |
{'script': 'super'}, | |
'link', | |
], | |
['clean'] | |
]; | |
export default Ember.Component.extend({ | |
classNames: ['quill-editor'], | |
editor: null, | |
didInsertElement() { | |
Ember.run(() => { | |
const quill = new Quill('.my-editor', { | |
theme: 'snow', | |
modules: { | |
toolbar: TOOLBAR_OPTIONS | |
}, | |
}); | |
this.set('editor', quill); | |
this.get('editor').focus(); | |
console.log( this.get('editor').getText() ); | |
}); | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Quill Editor', | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.message-text-heading { | |
margin: 14px 0; | |
font-size: 15px; | |
color: #333; | |
} | |
.quill-editor .ql-toolbar.ql-snow { | |
border: none; | |
margin-top: 8px; | |
padding: 0; | |
} | |
.ql-toolbar.ql-snow + .ql-container.ql-snow { | |
border: 1px solid #bbb !important; | |
border-radius: 4px; | |
min-height: 200px; | |
} | |
.ql-toolbar.ql-snow { | |
margin-bottom: 8px; | |
} | |
.ql-toolbar.ql-snow .ql-formats { | |
margin-right: 8px !important; | |
} | |
.ql-formats { | |
border: 1px solid #bbb; | |
border-radius: 2px; | |
} | |
.ql-picker-label, | |
.ql-bold, | |
.ql-italic, | |
.ql-underline, | |
.ql-link, | |
.ql-list, | |
.ql-script, | |
.ql-clean { | |
box-sizing: border-box; | |
border-left: 1px solid #bbb !important; | |
width: 32px !important; | |
height: 28px !important; | |
padding: 4px 0px 4px 5px !important; | |
} | |
.ql-bold, | |
.ql-list:first-child, | |
.ql-clean { | |
border-left: none !important; | |
} | |
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
{ | |
"version": "0.13.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"quill": "https://cdn.quilljs.com/1.3.5/quill.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment