summaryrefslogtreecommitdiffstats
path: root/wp-admin/users.js
blob: 5e4041896db2c12f3e9bf4a9a5a6e1906780ebd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addLoadEvent(function() {
	theListEls = document.getElementsByTagName('tbody');
	theUserLists = new Array();
	for ( var l = 0; l < theListEls.length; l++ ) {
		theUserLists[theListEls[l].id] = new listMan(theListEls[l].id);
	}
	addUserInputs = document.getElementById('adduser').getElementsByTagName('input');
	for ( var i = 0; i < addUserInputs.length; i++ ) {
		addUserInputs[i].onkeypress = function(e) { return killSubmit('addUserSubmit();', e); }
	}
	document.getElementById('addusersub').onclick = function(e) { return killSubmit('addUserSubmit();', e); }
}
);

function addUserSubmit() {
	var roleEl = document.getElementById('role');
	var role = roleEl.options[roleEl.selectedIndex].value;
	if ( !theUserLists['role-' + role] ) return true;
	return theUserLists['role-' + role].ajaxAdder('user', 'adduser');
}