<commit_before>var win = Ti.UI.currentWindow;
Ti.include('/includes/lib/json.i18n.js');

var b_close = Ti.UI.createButton({
	title: I('buttons.cancel')
});

b_close.addEventListener('click', function(e) {
	win.close();
});

win.setLeftNavButton(b_close);

var lbl_name = Ti.UI.createLabel({
	text: I('addServer.labels.name.title'),
	color: 'white',
	left: 20,
	top: 20
});

win.add(lbl_name);

var txtfield_name = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: I('addServer.labels.name.placeholder'),
	left: 20,
	right: 20,
	top: 50,
	height: 38,
	returnKeyType: Ti.UI.RETURNKEY_NEXT
});

win.add(txtfield_name);

var lbl_host = Ti.UI.createLabel({
	text: I('addServer.labels.host.title'),
	color: 'white',
	left: 20,
	top: 100
});

win.add(lbl_host);

var txtfield_host = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: I('addServer.labels.host.placeholder'),
	autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
	autocorrect: false,
	keyboardType: Ti.UI.KEYBOARD_URL,
	left: 20,
	right: 130,
	top: 130,
	height: 38,
	returnKeyType: Ti.UI.RETURNKEY_NEXT
});

win.add(txtfield_host);

var lbl_port = Ti.UI.createLabel({
	text: I('addServer.labels.port.title'),
	color: 'white',
	left: 200,
	top: 100
});

win.add(lbl_port);

var txtfield_port = Ti.UI.createTextField({
	keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: '25565',
	right: 20,
	left: 200,
	top: 130,
	height: 38
});

win.add(txtfield_port);

var b_done = Ti.UI.createButton({
	title: I('buttons.done'),
	style: Ti.UI.iPhone.SystemButtonStyle.DONE
});

b_done.addEventListener('click', function(e) {
	if(txtfield_name.getValue() == '' || txtfield_host.getValue() == '') {
		(Ti.UI.createAlertDialog({
				title: I('addServer.confirm.error.title'),
				message: I('addServer.confirm.error.message')<commit_msg>Add default port as text<commit_after>var win = Ti.UI.currentWindow;
Ti.include('/includes/lib/json.i18n.js');

var b_close = Ti.UI.createButton({
	title: I('buttons.cancel')
});

b_close.addEventListener('click', function(e) {
	win.close();
});

win.setLeftNavButton(b_close);

var lbl_name = Ti.UI.createLabel({
	text: I('addServer.labels.name.title'),
	color: 'white',
	left: 20,
	top: 20
});

win.add(lbl_name);

var txtfield_name = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: I('addServer.labels.name.placeholder'),
	left: 20,
	right: 20,
	top: 50,
	height: 38,
	returnKeyType: Ti.UI.RETURNKEY_NEXT
});

win.add(txtfield_name);

var lbl_host = Ti.UI.createLabel({
	text: I('addServer.labels.host.title'),
	color: 'white',
	left: 20,
	top: 100
});

win.add(lbl_host);

var txtfield_host = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: I('addServer.labels.host.placeholder'),
	autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
	autocorrect: false,
	keyboardType: Ti.UI.KEYBOARD_URL,
	left: 20,
	right: 130,
	top: 130,
	height: 38,
	returnKeyType: Ti.UI.RETURNKEY_NEXT
});

win.add(txtfield_host);

var lbl_port = Ti.UI.createLabel({
	text: I('addServer.labels.port.title'),
	color: 'white',
	left: 200,
	top: 100
});

win.add(lbl_port);

var txtfield_port = Ti.UI.createTextField({
	keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: '25565',
	value: '25565',
	right: 20,
	left: 200,
	top: 130,
	height: 38
});

win.add(txtfield_port);

var b_done = Ti.UI.createButton({
	title: I('buttons.done'),
	style: Ti.UI.iPhone.SystemButtonStyle.DONE
});

b_done.addEventListener('click', function(e) {
	if(txtfield_name.getValue() == '' || txtfield_host.getValue() == '') {
		(Ti.UI.createAlertDialog({
				title: I('addServer.confirm.error.title'),
				message: I('addServer.confirm.error.message')
{'fraction_non_alphanumeric': 0.16719077568134172, 'fraction_numerical': 0.027515723270440252, 'mean_word_length': 5.298679867986799, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3687645', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1516, 'n_words': 255}