Browse Source

! Few javascript (selectBoards and updateAuthMethod) and a closing tag for a label

emanuele 13 years ago
parent
commit
75c09c4e0a

+ 1 - 1
Themes/default/ManageBans.template.php

@@ -40,7 +40,7 @@ function template_ban_edit()
 							<input type="text" name="ban_name" id="ban_name" value="', $context['ban']['name'], '" size="47" maxlength="60" class="input_text" />
 						</dd>
 						<dt>
-							<strong><label for="reason">', $txt['ban_reason'], ':<label></strong><br />
+							<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br />
 							<span class="smalltext">', $txt['ban_reason_desc'], '</span>
 						</dt>
 						<dd>

+ 3 - 3
Themes/default/ManageMembergroups.template.php

@@ -26,7 +26,7 @@ function template_new_group()
 
 	echo '
 	<div id="admincenter">
-		<form action="', $scripturl, '?action=admin;area=membergroups;sa=add" method="post" accept-charset="', $context['character_set'], '">
+		<form id="new_group" action="', $scripturl, '?action=admin;area=membergroups;sa=add" method="post" accept-charset="', $context['character_set'], '">
 			<div class="cat_bar">
 				<h3 class="catbg">', $txt['membergroups_new_group'], '</h3>
 			</div>
@@ -128,7 +128,7 @@ function template_new_group()
 	{
 		echo '
 									<li class="category">
-										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
+										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;">', $category['name'], '</a>
 									<ul>';
 
 		foreach ($category['boards'] as $board)
@@ -336,7 +336,7 @@ function template_edit_group()
 		{
 			echo '
 									<li class="category">
-										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
+										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'groupForm\'); return false;">', $category['name'], '</a>
 										<ul>';
 
 			foreach ($category['boards'] as $board)

+ 1 - 1
Themes/default/Profile.template.php

@@ -1970,7 +1970,7 @@ function template_ignoreboards()
 
 		echo '
 					<li class="category">
-						<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
+						<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'creator\'); return false;">', $category['name'], '</a>
 						<ul>';
 
 		foreach ($category['boards'] as $board)

+ 1 - 1
Themes/default/Search.template.php

@@ -172,7 +172,7 @@ function template_main()
 	{
 		echo '
 						<li class="category">
-							<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
+							<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'searchform\'); return false;">', $category['name'], '</a>
 							<ul>';
 
 		foreach ($category['boards'] as $board)

+ 18 - 17
Themes/default/scripts/script.js

@@ -1495,15 +1495,16 @@ function initSearch()
 		document.forms.searchform.search.value = unescape(document.forms.searchform.search.value);
 }
 
-function selectBoards(ids)
+function selectBoards(ids, aFormID)
 {
 	var toggle = true;
+	var aForm = document.getElementById(aFormID);
 
 	for (i = 0; i < ids.length; i++)
-		toggle = toggle & document.forms.searchform["brd" + ids[i]].checked;
+		toggle = toggle & aForm["brd" + ids[i]].checked;
 
 	for (i = 0; i < ids.length; i++)
-		document.forms.searchform["brd" + ids[i]].checked = !toggle;
+		aForm["brd" + ids[i]].checked = !toggle;
 }
 
 function expandCollapseBoards()
@@ -1679,34 +1680,34 @@ function previewExternalAvatar(src)
 function updateAuthMethod()
 {
 	// What authentication method is being used?
-	if (!document.getElementById(\'auth_openid\') || !document.getElementById(\'auth_openid\').checked)
-		currentAuthMethod = \'passwd\';
+	if (!document.getElementById('auth_openid') || !document.getElementById('auth_openid').checked)
+		currentAuthMethod = 'passwd';
 	else
-		currentAuthMethod = \'openid\';
+		currentAuthMethod = 'openid';
 
 	// No openID?
-	if (!document.getElementById(\'auth_openid\'))
+	if (!document.getElementById('auth_openid'))
 		return true;
 
-	document.forms.creator.openid_url.disabled = currentAuthMethod == \'openid\' ? false : true;
-	document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == \'passwd\' ? false : true;
-	document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == \'passwd\' ? false : true;
-	document.getElementById(\'smf_autov_pwmain_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
-	document.getElementById(\'smf_autov_pwverify_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
+	document.forms.creator.openid_url.disabled = currentAuthMethod == 'openid' ? false : true;
+	document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == 'passwd' ? false : true;
+	document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == 'passwd' ? false : true;
+	document.getElementById('smf_autov_pwmain_div').style.display = currentAuthMethod == 'passwd' ? '' : 'none';
+	document.getElementById('smf_autov_pwverify_div').style.display = currentAuthMethod == 'passwd' ? '' : 'none';
 
-	if (currentAuthMethod == \'passwd\')
+	if (currentAuthMethod == 'passwd')
 	{
 		verificationHandle.refreshMainPassword();
 		verificationHandle.refreshVerifyPassword();
-		document.forms.creator.openid_url.style.backgroundColor = \'\';
+		document.forms.creator.openid_url.style.backgroundColor = '';
 		document.getElementById("auth_openid_div").style.display = "none";
 		document.getElementById("auth_pass_div").style.display = "";
 	}
 	else
 	{
-		document.forms.creator.smf_autov_pwmain.style.backgroundColor = \'\';
-		document.forms.creator.smf_autov_pwverify.style.backgroundColor = \'\';
-		document.forms.creator.openid_url.style.backgroundColor = \'#FCE184\';
+		document.forms.creator.smf_autov_pwmain.style.backgroundColor = '';
+		document.forms.creator.smf_autov_pwverify.style.backgroundColor = '';
+		document.forms.creator.openid_url.style.backgroundColor = '#FCE184';
 		document.getElementById("auth_openid_div").style.display = "";
 		document.getElementById("auth_pass_div").style.display = "none";
 	}