diff --git a/examples/css/stylesheet.css b/examples/css/stylesheet.css index 289a6f54..5a7b1c82 100644 --- a/examples/css/stylesheet.css +++ b/examples/css/stylesheet.css @@ -110,6 +110,10 @@ text-align: left; } +.wysiwyg-text-align-justify { + text-align: justify; +} + .wysiwyg-float-left { float: left; margin: 0 8px 8px 0; @@ -126,4 +130,4 @@ .wysiwyg-clear-left { clear: left; -} \ No newline at end of file +} diff --git a/src/commands/justifyFill.js b/src/commands/justifyFill.js new file mode 100644 index 00000000..994210d3 --- /dev/null +++ b/src/commands/justifyFill.js @@ -0,0 +1,19 @@ +(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-justify", + REG_EXP = /wysiwyg-text-align-[0-9a-z]+/g; + + wysihtml5.commands.justifyFill = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5); diff --git a/test/index.html b/test/index.html index e4933f4c..73cc2947 100644 --- a/test/index.html +++ b/test/index.html @@ -65,6 +65,7 @@ + @@ -122,4 +123,4 @@

wysihtml5 - Test Suite

-
    \ No newline at end of file +