Browse Source

Move spellcheck to the loader

Signed-off-by: Suki <[email protected]>
Suki 10 years ago
parent
commit
e541002c14
2 changed files with 5 additions and 2 deletions
  1. 4 0
      Sources/Display.php
  2. 1 2
      Themes/default/Display.template.php

+ 4 - 0
Sources/Display.php

@@ -1215,6 +1215,10 @@ function Display()
 	// Load the drafts js file
 	if ($context['drafts_autosave'])
 		loadJavascriptFile('drafts.js', array('default_theme' => true, 'defer' => false), 'smf_drafts');
+
+	// Spellcheck
+	if ($context['show_spellchecking'])
+		loadJavascriptFile('spellcheck.js', array('default_theme' => true, 'defer' => false), 'smf_spellcheck');
 }
 
 /**

+ 1 - 2
Themes/default/Display.template.php

@@ -353,8 +353,7 @@ function template_main()
 
 	if ($context['show_spellchecking'])
 		echo '
-			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>
-				<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
+			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>';
 
 	echo '
 				<script src="', $settings['default_theme_url'], '/scripts/topic.js"></script>