瀏覽代碼

Merge pull request #1 from emanuele45/yoshi_release-2.1

A couple of minor things
Rick Kerkhof 11 年之前
父節點
當前提交
2d0c00b3a1

+ 2 - 3
Sources/ManageMembergroups.php

@@ -1109,10 +1109,9 @@ function EditMembergroup()
 		}
 	}
 	
-	// Insert our JS, if we have possible stars.
+	// Insert our JS, if we have possible icons.
 	if (!empty($context['possible_icons']))
-		$context['html_headers'] .= '
-	<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/stardropdown.js"></script>';
+		loadJavascriptFile('icondropdown.js', array('validate' => true));
 
 	// Finally, get all the groups this could be inherited off.
 	$request = $smcFunc['db_query']('', '

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

@@ -272,7 +272,7 @@ function template_edit_group()
 							<input type="text" name="icon_count" id="icon_count_input" value="', $context['group']['icon_count'], '" size="4" class="input_text" />
 						</dd>';
         
-        // Do we have any possible stars to select from?
+        // Do we have any possible icons to select from?
        	if (!empty($context['possible_icons']))
        	{
        		echo '
@@ -284,7 +284,7 @@ function template_edit_group()
 							', $txt['membergroups_images_url'], '
 							<select name="icon_image" id="icon_image_input">';
 
-		// For every possible star, create an option.
+		// For every possible icon, create an option.
 		foreach ($context['possible_icons'] as $icon)
 		{
 			echo '
@@ -293,7 +293,7 @@ function template_edit_group()
 	
 		echo '
 							</select>
-							<img id="star_preview" src="" alt="*" />
+							<img id="icon_preview" src="" alt="*" />
 						</dd>';
 	}
 	

+ 1 - 1
Themes/default/languages/ManageMembers.english.php

@@ -74,7 +74,7 @@ $txt['membergroups_postgroups'] = 'Post groups';
 $txt['membergroups_settings'] = 'Membergroup Settings';
 $txt['groups_manage_membergroups'] = 'Groups allowed to change membergroups';
 $txt['membergroups_select_permission_type'] = 'Select permission profile';
-$txt['membergroups_images_url'] = 'Themes/{theme}/images/stars/';
+$txt['membergroups_images_url'] = 'Themes/{theme}/images/membericons/';
 $txt['membergroups_select_visible_boards'] = 'Show boards';
 $txt['membergroups_members_top'] = 'Members';
 $txt['membergroups_name'] = 'Name';

+ 34 - 0
Themes/default/scripts/icondropdown.js

@@ -0,0 +1,34 @@
+$(document).ready(function()
+{	
+	$('#icon_count_input').change(function ()
+	{
+		var select_box = $('select#icon_image_input option:selected').val();
+		var icon_count = $('#icon_count_input');
+		if (icon_count.val() == 0 && select_box != 'blank.png')
+			icon_count.val(1);
+			
+		if (icon_count.val().length > 2)
+			icon_count.val(99);
+	});
+	
+	$('#icon_image_input').change(function ()
+	{
+		refreshIconPreview();
+	});
+
+	refreshIconPreview();
+});
+
+function refreshIconPreview()
+{
+	// Get the icon count element.
+	var icon_count = $('#icon_count_input');
+	var select_box = $('select#icon_image_input').val();
+
+	// If it's empty, set it to 1.
+	if (icon_count.val() == 0 && select_box != 'blank.png')
+		icon_count.val(1);
+
+	// Update the icon preview.
+	$('#icon_preview').attr('src', smf_default_theme_url + '/images/membericons/' + select_box);
+}

+ 0 - 34
Themes/default/scripts/stardropdown.js

@@ -1,34 +0,0 @@
-$(document).ready(function()
-{	
-	$('#icon_count_input').change(function ()
-	{
-		var select_box = $('select#icon_image_input option:selected').val();
-		var icon_count = $('#icon_count_input');
-		if (icon_count.val() == 0 && select_box != 'blank.png')
-			icon_count.val(1);
-			
-		if (icon_count.val().length > 2)
-			icon_count.val(99);
-	});
-	
-	$('#icon_image_input').change(function ()
-	{
-		refreshPreview();
-	});
-	
-	function refreshPreview()
-	{
-		// Get the star count element.
-		var icon_count = $('#icon_count_input');
-		var select_box = $('select#icon_image_input').val();
-	
-		// If it's empty, set it to 1.
-		if (icon_count.val() == 0 && select_box != 'blank.png')
-			icon_count.val(1);
-	
-		// Update the star preview.
-		$('#star_preview').attr('src', smf_default_theme_url + '/images/membericons/' + select_box);
-	}
-	
-	refreshPreview();
-});