CoreFiles by mySites.guru
cms.js50 lines, 1,682 bytes, from Joomla_3.2.0-Stable-Full_Package.zip
Raw History Compare with 3.1.6
md5
d6b372e8f78e7684b8de8c27f851e997
sha1
6f60aeff70bd70b0645d7652d6b49834ae7a5160
sha256
4e249da902418c57786ff2606b82d2558e6035f6bf1a83b2f01777eaf859417a
/**
 * @copyright  Copyright (C) 2005 - 2013 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.show();
					else
						i.hide();
				});
			};
		$('[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 5 releases, Joomla 3.1.4 to 3.2.1. See them all, or every version of this file.