diff --git a/redactorextras/resources/plugins/alignment.css b/redactorextras/resources/plugins/alignment.css index 3c1004d..b12da98 100644 --- a/redactorextras/resources/plugins/alignment.css +++ b/redactorextras/resources/plugins/alignment.css @@ -3,4 +3,7 @@ } .text-right { text-align: right; +} +.text-justify { + text-align: justify; } \ No newline at end of file diff --git a/redactorextras/resources/plugins/alignment.js b/redactorextras/resources/plugins/alignment.js old mode 100755 new mode 100644 index 2ef0d02..a22048d --- a/redactorextras/resources/plugins/alignment.js +++ b/redactorextras/resources/plugins/alignment.js @@ -6,48 +6,61 @@ if (!RedactorPlugins) var RedactorPlugins = {}; RedactorPlugins.alignment = function() { - return { - langs: { - en: { - "align": "Align", - "align-left": "Align Left", - "align-center": "Align Center", - "align-right": "Align Right" - } - }, - init: function() - { - var that = this; - var dropdown = {}; + return { + langs: { + en: { + "align": "Align", + "align-left": "Align Left", + "align-center": "Align Center", + "align-right": "Align Right", + "align-justify": "Align Justify", + } + }, + init: function() + { + var that = this; + var dropdown = {}; - dropdown.left = { title: that.lang.get('align-left'), func: that.alignment.setLeft }; - dropdown.center = { title: that.lang.get('align-center'), func: that.alignment.setCenter }; - dropdown.right = { title: that.lang.get('align-right'), func: that.alignment.setRight }; + dropdown.left = { title: that.lang.get('align-left'), func: that.alignment.setLeft }; + dropdown.center = { title: that.lang.get('align-center'), func: that.alignment.setCenter }; + dropdown.right = { title: that.lang.get('align-right'), func: that.alignment.setRight }; + dropdown.justify = { title: that.lang.get('align-justify'), func: that.alignment.setJustify }; - var button = this.button.add('alignment', this.lang.get('align')); - this.button.addDropdown(button, dropdown); - }, - removeAlign: function() - { - this.block.removeClass('text-center'); - this.block.removeClass('text-right'); - }, - setLeft: function() - { - this.buffer.set(); - this.alignment.removeAlign(); - }, - setCenter: function() - { - this.buffer.set(); - this.alignment.removeAlign(); - this.block.addClass('text-center'); - }, - setRight: function() - { - this.buffer.set(); - this.alignment.removeAlign(); - this.block.addClass('text-right'); - } - }; + var button = this.button.add('alignment', this.lang.get('align')); + this.button.setIcon(button, ''); + this.button.addDropdown(button, dropdown); + }, + removeAlign: function() + { + this.block.removeClass('text-center'); + this.block.removeClass('text-right'); + this.block.removeClass('text-justify'); + }, + setLeft: function() + { + this.buffer.set(); + this.alignment.removeAlign(); + }, + setCenter: function() + { + this.buffer.set(); + this.alignment.removeAlign(); + this.block.addClass('text-center'); + this.core.editor().focus() + }, + setRight: function() + { + this.buffer.set(); + this.alignment.removeAlign(); + this.block.addClass('text-right'); + this.core.editor().focus() + }, + setJustify: function() + { + this.buffer.set(); + this.alignment.removeAlign(); + this.block.addClass('text-justify'); + this.core.editor().focus() + } + }; }; \ No newline at end of file