bower-redactor
Version:
npm package for Imperavi's redactor
31 lines (28 loc) • 684 B
JavaScript
if (!RedactorPlugins) var RedactorPlugins = {};
(function($)
{
RedactorPlugins.textdirection = function()
{
return {
init: function()
{
var that = this;
var dropdown = {};
dropdown.ltr = { title: 'Left to Right', func: that.textdirection.setLtr };
dropdown.rtl = { title: 'Right to Left', func: that.textdirection.setRtl};
var button = this.button.add('textdirection', 'Change Text Direction');
this.button.addDropdown(button, dropdown);
},
setRtl: function()
{
this.buffer.set();
this.block.setAttr('dir', 'rtl');
},
setLtr: function()
{
this.buffer.set();
this.block.removeAttr('dir');
}
};
};
})(jQuery);