@@ -2835,28 +2835,28 @@ protected function loadJavaScript()
28352835 ];
28362836
28372837 if (isset (Config::$ modSettings ['jquery_source ' ]) && array_key_exists (Config::$ modSettings ['jquery_source ' ], $ jQueryUrls )) {
2838- self ::loadJavaScriptFile ($ jQueryUrls [Config::$ modSettings ['jquery_source ' ]], ['external ' => true , 'seed ' => false ], 'smf_jquery ' );
2838+ self ::loadJavaScriptFile ($ jQueryUrls [Config::$ modSettings ['jquery_source ' ]], ['defer ' => true , ' external ' => true , 'seed ' => false ], 'smf_jquery ' );
28392839 } elseif (isset (Config::$ modSettings ['jquery_source ' ]) && Config::$ modSettings ['jquery_source ' ] == 'local ' ) {
2840- self ::loadJavaScriptFile ('jquery- ' . JQUERY_VERSION . '.min.js ' , ['seed ' => false ], 'smf_jquery ' );
2840+ self ::loadJavaScriptFile ('jquery- ' . JQUERY_VERSION . '.min.js ' , ['defer ' => true , ' seed ' => false ], 'smf_jquery ' );
28412841 } elseif (isset (Config::$ modSettings ['jquery_source ' ], Config::$ modSettings ['jquery_custom ' ]) && Config::$ modSettings ['jquery_source ' ] == 'custom ' ) {
2842- self ::loadJavaScriptFile (Config::$ modSettings ['jquery_custom ' ], ['external ' => true , 'seed ' => false ], 'smf_jquery ' );
2842+ self ::loadJavaScriptFile (Config::$ modSettings ['jquery_custom ' ], ['defer ' => true , ' external ' => true , 'seed ' => false ], 'smf_jquery ' );
28432843 }
28442844 // Fall back to the forum default
28452845 else {
2846- self ::loadJavaScriptFile (' https://ajax.googleapis.com/ajax/libs/jquery/ ' . JQUERY_VERSION . ' /jquery.min.js ' , [ 'external ' => true , 'seed ' => false ], 'smf_jquery ' );
2846+ self ::loadJavaScriptFile ($ jQueryUrls [ ' cdn ' ], [ ' defer ' => true , 'external ' => true , 'seed ' => false ], 'smf_jquery ' );
28472847 }
28482848
28492849 // Queue our JQuery plugins!
2850- self ::loadJavaScriptFile ('smf_jquery_plugins.js ' , ['minimize ' => true ], 'smf_jquery_plugins ' );
2850+ self ::loadJavaScriptFile ('smf_jquery_plugins.js ' , ['defer ' => true , ' minimize ' => true ], 'smf_jquery_plugins ' );
28512851
28522852 if (!User::$ me ->is_guest ) {
2853- self ::loadJavaScriptFile ('jquery.custom-scrollbar.js ' , ['minimize ' => true ], 'smf_jquery_scrollbar ' );
2853+ self ::loadJavaScriptFile ('jquery.custom-scrollbar.js ' , ['defer ' => true , ' minimize ' => true ], 'smf_jquery_scrollbar ' );
28542854 self ::loadCSSFile ('jquery.custom-scrollbar.css ' , ['force_current ' => false , 'validate ' => true ], 'smf_scrollbar ' );
28552855 }
28562856
28572857 // script.js and theme.js, always required, so always add them! Makes index.template.php cleaner and all.
28582858 self ::loadJavaScriptFile ('script.js ' , ['defer ' => false , 'minimize ' => true ], 'smf_script ' );
2859- self ::loadJavaScriptFile ('theme.js ' , ['minimize ' => true ], 'smf_theme ' );
2859+ self ::loadJavaScriptFile ('theme.js ' , ['defer ' => true , ' minimize ' => true ], 'smf_theme ' );
28602860
28612861 // And we should probably trigger the cron too.
28622862 if (empty (Config::$ modSettings ['cron_is_real_cron ' ])) {
@@ -3143,4 +3143,4 @@ protected static function templateInclude($filename, $once = false)
31433143 Theme::exportStatic ();
31443144}
31453145
3146- ?>
3146+ ?>
0 commit comments