Could we just not use LoadJavascriptFile for jquery at all and then consolidate its options at the start of template_javascript since if its being loaded it needs to go first anyway.
So we then remove all the jquery conditionals in Load.php, Combine.php, and in Subs.php and anywhere else and then just do something like this at the start of template_javascript?
// First up, load jquery
if (isset($modSettings['jquery_source']) && !$do_defered)
{
switch ($modSettings['jquery_source'])
{
case 'cdn':
echo '
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" id="jquery"></script>';
break;
case 'local':
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/jquery-1.7.2.min.js" id="jquery"></script>';
break;
case 'auto':
echo '
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" id="jquery"></script>
<script type="text/javascript"><!-- // --><![CDATA[
window.jQuery || document.write(\'<script src="', $settings['default_theme_url'], '/scripts/jquery-1.7.2.min.js"><\/script>\');
// ]]></script>';
break;
}
}
Of course its late here so who knows what I am thinking