aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/mod_new_channel.js
blob: 17b354a4b4ca7687bdf7ae168d2d963d24f0a9dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
	$(document).ready(function() {
//		$("#id_permissions_role").sSelect();
		$("#id_name").blur(function() {
			$("#name-spinner").spin('small');
			var zreg_name = $("#id_name").val();
			$.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
				$("#id_nickname").val(data);
				if(data.error) {
					$("#help_name").html("");
					zFormError("#help_name",data.error);
				}
				$("#name-spinner").spin(false);
			});
		});

		$("#id_nickname").blur(function() {
			$("#nick-spinner").spin('small');
			var zreg_nick = $("#id_nickname").val();
			$.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
				$("#id_nickname").val(data);
				if(data.error) {
					$("#help_nickname").html("");
					zFormError("#help_nickname",data.error);
				}
				$("#nick-spinner").spin(false);
			});
		});

	});