Merge pull request #1606 from gergo85/master

Add alignment button to Rich editor
This commit is contained in:
Samuel Georges 2015-12-05 10:22:31 +11:00
commit 92e1d1bf13
2 changed files with 6 additions and 6 deletions

View File

@ -2069,7 +2069,7 @@ if(!this.$textarea.attr('id')){this.$textarea.attr('id','element-'+Math.random()
var redactorOptions={imageEditable:true,imageResizable:true,buttonSource:true,removeDataAttr:false,toolbarFixed:false,syncBeforeCallback:this.proxy(this.onSyncBefore),focusCallback:this.proxy(this.onFocus),blurCallback:this.proxy(this.onBlur),keydownCallback:this.proxy(this.onKeydown),enterCallback:this.proxy(this.onEnter),changeCallback:this.proxy(this.onChange),pageLinksHandler:this.options.linksHandler,initCallback:function(){self.build(this)}}
if(this.options.fullpage){redactorOptions.fullpage=true}
redactorOptions.plugins=['fullscreen','figure','table','pagelinks','mediamanager']
redactorOptions.buttons=['html','formatting','bold','italic','unorderedlist','orderedlist','link','horizontalrule'],this.$textarea.redactor(redactorOptions)
redactorOptions.buttons=['html','formatting','bold','italic','alignment','unorderedlist','orderedlist','link','horizontalrule'],this.$textarea.redactor(redactorOptions)
this.redactor=this.$textarea.redactor('core.getObject')
this.$editor=this.redactor.$editor}
RichEditor.prototype.dispose=function(){this.unregisterHandlers()
@ -2203,4 +2203,4 @@ data[option].apply(data,methodArgs)}})}
$.fn.richEditor.Constructor=RichEditor
$.fn.richEditor.noConflict=function(){$.fn.richEditor=old
return this}
$(document).render(function(){$('[data-control="richeditor"]').richEditor()})}(window.jQuery);
$(document).render(function(){$('[data-control="richeditor"]').richEditor()})}(window.jQuery);

View File

@ -43,7 +43,7 @@
fullpage: false
}
RichEditor.prototype.init = function (){
RichEditor.prototype.init = function() {
var self = this;
this.$el.one('dispose-control', this.proxy(this.dispose))
@ -88,7 +88,7 @@
}
redactorOptions.plugins = ['fullscreen', 'figure', 'table', 'pagelinks', 'mediamanager']
redactorOptions.buttons = ['html', 'formatting', 'bold', 'italic', 'unorderedlist', 'orderedlist', 'link', 'horizontalrule'],
redactorOptions.buttons = ['html', 'formatting', 'bold', 'italic', 'alignment', 'unorderedlist', 'orderedlist', 'link', 'horizontalrule'],
this.$textarea.redactor(redactorOptions)
@ -193,7 +193,7 @@
var $domTree = $('<div>'+container.html+'</div>')
// This code removes Redactor-specific attributes and tags from the code.
// It seems to be a known problem with Redactor, try googling for
// It seems to be a known problem with Redactor, try googling for
// "data-redactor-tag" or "redactor-invisible-space" (with quotes)
$('*', $domTree).removeAttr('data-redactor-tag')
@ -217,7 +217,7 @@
}
RichEditor.prototype.onShowFigureToolbar = function($figure, $toolbar) {
// Deal with the case when the toolbar top has negative
// Deal with the case when the toolbar top has negative
// value
var toolbarTop = $figure.position().top - $toolbar.height() - 10