Sha256: 14dd4016eb0dbe233ce0b819f2af3d7a9ff416f3fbe75011a77c4e34ca0a4933

Contents?: true

Size: 685 Bytes

Versions: 4

Compression:

Stored size: 685 Bytes

Contents

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);

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
redactor-rails-fixes-0.5.0.1 vendor/assets/javascripts/redactor-rails/plugins/textdirection.js
rdrails5-0.5.1 vendor/assets/javascripts/redactor-rails/plugins/textdirection.js
redactor-rails4-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/textdirection.js
redactor-rails-0.5.0 vendor/assets/javascripts/redactor-rails/plugins/textdirection.js