CoreFiles by mySites.guru
helpsite.js32 lines, 1,054 bytes, from Joomla_3.10.1-Stable-Full_Package.zip
Raw History Compare with 3.10.0
md5
0a43479f7966e860b630be5728a5262a
sha1
3f75f2a703faf302245a877c61ad095123f3f8a9
sha256
323e37c7240441791ca9e8157a8b7605c236e6eca4f7fe4bb831aa4c47bebbb0
/**
 * @package		Joomla.JavaScript
 * @copyright	(C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

/**
 * gets the help site with ajax
 */
jQuery(document).ready(function() {
	jQuery('#helpsite-refresh').click(function()
	{
		// Uses global variable helpsite_base for bast uri
		var select_id   = jQuery(this).attr('rel');
		var showDefault = jQuery(this).attr('showDefault');

		jQuery.getJSON('index.php?option=com_users&task=profile.gethelpsites&format=json', function(data){
			// The response contains the options to use in help site select field
			var items = [];

			// Build options
			jQuery.each(data, function(key, val) {
				if (val.value !== '' || showDefault === 'true') {
					items.push('<option value="' + val.value + '">' + val.text + '</option>');
				}
			});

			// Replace current select options. The trigger is needed for Chosen select box enhancer
			jQuery("#" + select_id).empty().append(items).trigger("liszt:updated");
		});
	});
});

The same content is in 25 releases, Joomla 3.10.0-alpha2 to 3.10.12. See them all, or every version of this file.