-
-
Save emanuele45/b75ed06e0df2711c4c6f to your computer and use it in GitHub Desktop.
jquery uglyfication...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else | |
{ | |
// load JQuery if needed | |
if (!$do_defered && isset($context['javascript_files']['jquery'])) | |
echo ' | |
<script type="text/javascript" src="', $context['javascript_files']['jquery']['filename'], '" id="jquery"', !empty($context['javascript_files']['jquery']['options']['async']) ? ' async="async"' : '', '></script>'; | |
// and the fallback...if needed | |
if (!$do_defered && isset($context['javascript_files']['jquery']) && (!isset($modSettings['jquery_source']) || $modSettings['jquery_source'] === 'auto')) | |
echo ' | |
<script type="text/javascript"><!-- // --><![CDATA[ | |
window.jQuery || document.write(\'<script src="' . $settings['default_theme_url'] . '/scripts/jquery-1.7.2.min.js"><\/script>\'); | |
// ]]></script>'; | |
// While we have Javascript files to place in the template | |
foreach ($context['javascript_files'] as $id => $js_file) | |
{ | |
if ($id === 'jquery') | |
continue; | |
if ((!$do_defered && empty($js_file['options']['defer'])) || ($do_defered && !empty($js_file['options']['defer']))) | |
echo ' | |
<script type="text/javascript" src="', $js_file['filename'], '" id="', $id, '"', !empty($js_file['options']['async']) ? ' async="async"' : '', '></script>'; | |
// If we are loading JQuery and we are set to 'auto' load, put in our remote success or load local check | |
if ($id === 'jquery' && (!isset($modSettings['jquery_source']) || $modSettings['jquery_source'] === 'auto')) | |
$loadjquery = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment