Преглед на файлове

js in register.template

Signed-off-by: Suki <[email protected]>
Suki преди 10 години
родител
ревизия
2f4981ba4b
променени са 3 файла, в които са добавени 8 реда и са изтрити 4 реда
  1. 2 0
      Sources/ManageRegistration.php
  2. 4 0
      Sources/Register.php
  3. 2 4
      Themes/default/Register.template.php

+ 2 - 0
Sources/ManageRegistration.php

@@ -156,10 +156,12 @@ function AdminRegister()
 	}
 	else
 		$context['member_groups'] = array();
+
 	// Basic stuff.
 	$context['sub_template'] = 'admin_register';
 	$context['page_title'] = $txt['registration_center'];
 	createToken('admin-regc');
+	loadJavascriptFile('register.js', array('default_theme' => true, 'defer' => false), 'smf_register');
 }
 
 /**

+ 4 - 0
Sources/Register.php

@@ -89,6 +89,10 @@ function Register($reg_errors = array())
 	$context['sub_template'] = $current_step == 1 ? 'registration_agreement' : 'registration_form';
 	$context['page_title'] = $current_step == 1 ? $txt['registration_agreement'] : $txt['registration_form'];
 
+	// Kinda need this.
+	if ($context['sub_template'] == 'registration_form')
+		loadJavascriptFile('register.js', array('default_theme' => true, 'defer' => false), 'smf_register');
+
 	// Add the register chain to the link tree.
 	$context['linktree'][] = array(
 		'url' => $scripturl . '?action=register',

+ 2 - 4
Themes/default/Register.template.php

@@ -51,7 +51,6 @@ function template_registration_form()
 	global $context, $settings, $scripturl, $txt, $modSettings;
 
 	echo '
-		<script src="', $settings['default_theme_url'], '/scripts/register.js"></script>
 		<script><!-- // --><![CDATA[
 			function verifyAgree()
 			{
@@ -462,7 +461,7 @@ function template_coppa_form()
 // Show a window containing the spoken verification code.
 function template_verification_sound()
 {
-	global $context, $settings, $txt, $scripturl;
+	global $context, $settings, $txt, $scripturl, $modSettings;
 
 	echo '<!DOCTYPE html>
 <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
@@ -470,7 +469,7 @@ function template_verification_sound()
 		<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '">
 		<title>', $txt['visual_verification_sound'], '</title>
 		<meta name="robots" content="noindex">
-		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21">
+		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
 		<style type="text/css">';
 
 	// Just show the help text and a "close window" link.
@@ -506,7 +505,6 @@ function template_admin_register()
 	global $context, $settings, $scripturl, $txt, $modSettings;
 
 	echo '
-	<script src="', $settings['default_theme_url'], '/scripts/register.js"></script>
 	<div id="admincenter">
 		<div id="admin_form_wrapper">
 			<form id="postForm" class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm">