/**
* Fetch the path / URL to the jQuery core library
*
* @param boolean $forceLocal If true, forces the local version of jQuery
*
* @return string
*/
public static function getJquerySource($forceLocal = false)
{
$jQueryVersion = XenForo_Application::$jQueryVersion;
$javaScriptUrl = XenForo_Application::$javaScriptUrl;
$min = '.min';
$options = XenForo_Application::get('options');
// CDN sources from http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery
$source = ($forceLocal ? 'local' : $options->jQuerySource);
switch ($source)
{
case 'jquery':
case 'mt':
return "http://code.jquery.com/jquery-{$jQueryVersion}{$min}.js";
case 'google':
return "//ajax.googleapis.com/ajax/libs/jquery/{$jQueryVersion}/jquery{$min}.js";
case 'microsoft':
return "//ajax.microsoft.com/ajax/jquery/jquery-{$jQueryVersion}{$min}.js";
default:
return "{$javaScriptUrl}/jquery/jquery-{$jQueryVersion}{$min}.js";
}
}