Plugin Structure

Head

Docblock of the pluginName plugin:

/**
 * @tableofcontents
 *
 * 1. plugin name
 * 2. init
 *
 * @since 3.0.0
 *
 * @package Redaxscript
 * @author Author Name
 */

Body

Empty pluginName skeleton with a basic initialisation on document ready:

(function ($)
{
	'use strict';

	/* @section 1. plugin name */

	$.fn.pluginName = function ()
	{
	};

	/* @section 2. init */

	$(function ()
	{
		if (rs.plugins.pluginName.init && rs.plugins.pluginName.dependency)
		{
			$(rs.plugins.pluginName.selector).pluginName(rs.plugins.pluginName.options);
		}
	});
})(window.jQuery);

Init

Empty pluginName initialisation and configuration:

rs.plugins.pluginName =
{
	init: true,
	dependency: true,
	selector: 'div.rs-js-plugin-name',
	options:
	{
		element:
		{
			pluginNameBox: 'div.rs-js-box-plugin-name'
		},
		className:
		{
			pluginNameBox: 'rs-js-box-plugin-name rs-box-plugin-name'
		}
	}
}
Edit on GitHub