CoreFiles by mySites.guru
cms.js50 lines, 1,690 bytes, from Joomla_3.4.2-Stable-Full_Package.zip
Raw History Compare with 3.4.1
md5
58b87b2379205bb0b44b7759ba451842
sha1
1466f27031c3a0e3823b28dd3ef82b89b4912b7f
sha256
4594d3576b770bcc9c6110f66e616d542cb57d8165d185b51442fa97534ceb93
/**
 * @copyright  Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

// Only define the Joomla namespace if not defined.
if (typeof(Joomla) === 'undefined') {
	var Joomla = {};
}

/**
 * Sets the HTML of the container-collapse element
 */
Joomla.setcollapse = function(url, name, height) {
    if (!document.getElementById('collapse-' + name)) {
        document.getElementById('container-collapse').innerHTML = '<div class="collapse fade" id="collapse-' + name + '"><iframe class="iframe" src="' + url + '" height="'+ height + '" width="100%"></iframe></div>';
    }
}

if (jQuery) {
	jQuery(document).ready(function($) {
		var elements = {},
			linkedoptions = function(element, target, checkType) {
				var v = element.val(), id = element.attr('id');
				if(checkType && !element.is(':checked'))
					return;
				$('[rel=\"showon_'+target+'\"]').each(function(){
					var i = jQuery(this);
					if (i.hasClass('showon_' + v))
						i.slideDown();
					else
						i.slideUp();
				});
			};
		$('[rel^=\"showon_\"]').each(function(){
			var el = $(this), target = el.attr('rel').replace('showon_', ''), targetEl = $('[name=\"' + target+'\"]');
			if (!elements[target]) {
				var targetType = targetEl.attr('type'), checkType = (targetType == 'checkbox' || targetType == 'radio');
				targetEl.bind('change', function(){
					linkedoptions( $(this), target, checkType);
				}).bind('click', function(){
					linkedoptions( $(this), target, checkType );
				}).each(function(){
					linkedoptions( $(this), target, checkType );
				});
				elements[target] = true;
			}
		});
	});
}

The same content is in 20 releases, Joomla 3.4.0-beta1 to 3.5.0-beta. See them all, or every version of this file.