Sha256: 803f6c40ea2d36c23ded57832a94dd8b99f2133b45d6942fa657ed9f9b20711a

Contents?: true

Size: 652 Bytes

Versions: 4

Compression:

Stored size: 652 Bytes

Contents

if (!RedactorPlugins) var RedactorPlugins = {};

RedactorPlugins.clips = {
	init: function()
	{
		var callback = $.proxy(function()
		{
			$('#redactor_modal').find('.redactor_clip_link').each($.proxy(function(i, s)
			{
				$(s).click($.proxy(function()
				{
					this.insertClip($(s).next().html());
					return false;

				}, this));
			}, this));

			this.selectionSave();
			this.bufferSet();

		}, this );

		this.buttonAdd('clips', 'Clips', function(e)
		{
			this.modalInit('Clips', '#clipsmodal', 500, callback);
		});
	},
	insertClip: function(html)
	{
		this.selectionRestore();
		this.insertHtml($.trim(html));
		this.modalClose();
	}
};

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redactor-rails-0.4.5 vendor/assets/javascripts/redactor-rails/plugins/clips.js
redactor-rails-0.4.4 vendor/assets/javascripts/redactor-rails/plugins/clips.js
redactor-rails-0.4.3 vendor/assets/javascripts/redactor-rails/plugins/clips.js
redactor-rails-0.4.2 vendor/assets/javascripts/redactor-rails/plugins/clips.js