CoreFiles by mySites.guru
color-field-adv-init.js38 lines, 1,131 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
b082f8ccc39851d67c7995f428131975
sha1
5ac4ab4273b68c2843da6a1b5dd945a19943de02
sha256
cff113ce6eeac5db5f167aaad2b3d47eb9d5b4ce64977a77e317d975655a3416
/**
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

!(function(document, $) {
	"use strict";

	function initMinicolorsField (event) {
		$(event.target).find('.minicolors').each(function() {
			$(this).minicolors({
				control: $(this).attr('data-control') || 'hue',
				format: $(this).attr('data-validate') === 'color'
					? 'hex'
					: ($(this).attr('data-format') === 'rgba'
					? 'rgb'
					: $(this).attr('data-format'))
					|| 'hex',
				keywords: $(this).attr('data-keywords') || '',
				opacity:  $(this).attr('data-format') === 'rgba',
				position: $(this).attr('data-position') || 'default',
				swatches: $(this).attr('data-colors') ? $(this).attr('data-colors').split(",") : [],
				theme: 'bootstrap'
			});
		});
	}

	/**
	 * Initialize at an initial page load
	 */
	document.addEventListener("DOMContentLoaded", initMinicolorsField);

	/**
	 * Initialize when a part of the page was updated
	 */
	document.addEventListener("joomla:updated", initMinicolorsField);

})(document, jQuery);

The same content is in 3 releases, Joomla 4.0.0-alpha3 to 4.0.0-alpha6. See them all, or every version of this file.