description rtl support

stable
Juanfran 2017-01-23 08:32:12 +01:00
parent ebc70eb330
commit 18eb327345
1 changed files with 19 additions and 0 deletions

View File

@ -56,6 +56,23 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
wysiwygCodeHightlighterService.addCodeLanguageSelectors(elm)
AlignRightButton = MediumEditor.extensions.button.extend({
name: 'rtl',
init: () ->
this.button = this.document.createElement('button')
this.button.classList.add('medium-editor-action')
this.button.innerHTML = '<b>RTL</b>'
this.button.title = 'RTL'
this.on(this.button, 'click', this.handleClick.bind(this))
getButton: () ->
return this.button
handleClick: (event) ->
document.execCommand('justifyRight', false)
})
# MediumEditor extension to add <code>
CodeButton = MediumEditor.extensions.button.extend({
name: 'code',
@ -294,12 +311,14 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
'h3',
'quote',
'removeFormat',
'rtl',
'code'
]
},
extensions: {
code: new CodeButton(),
autolist: new AutoList(),
alignright: new AlignRightButton(),
mediumMention: new MentionExtension({
getItems: (mention, mentionCb) ->
wysiwygMentionService.search(mention).then(mentionCb)