<commit_before>//SettingsView Component Constructor
function SettingsView() {
	self = Ti.UI.createView({
		layout : 'vertical'
	});

	//label using localization-ready strings from <app dir>/i18n/en/strings.xml
	var label = Ti.UI.createLabel({
		color : '#000000',
		text : 'Server location',
		height : 'auto',
		width : 'auto',
		left : 5
	});
	self.add(label);

	var textField = Ti.UI.createTextField({
		borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
		color : '#336699',
		right : 5,
		left : 5,
		value : Ti.App.Properties.getString('server_url')
	});
	self.add(textField);

	var saveButton = Ti.UI.createButton({
		title : 'Save',
		height : 30,
		width : 200
	});
	self.add(saveButton);
	saveButton.addEventListener('click', function(e) {
		var server_url = textField.getValue();
		if (server_url.match(/^https?\:\/\/[\w-.]+\.\w{2,4}$/i) == null) {
			alert("Your settings are invalid. Please check them before saving.");
		} else {
			Ti.App.Properties.setString('server_url', server_url);
			Ti.App.fireEvent('settings_saved');
		}
	});

	return self;
}

module.exports = SettingsView;<commit_msg>Update email verification regex to support port numbers.<commit_after>//SettingsView Component Constructor
function SettingsView() {
	self = Ti.UI.createView({
		layout : 'vertical'
	});

	//label using localization-ready strings from <app dir>/i18n/en/strings.xml
	var label = Ti.UI.createLabel({
		color : '#000000',
		text : 'Server location',
		height : 'auto',
		width : 'auto',
		left : 5
	});
	self.add(label);

	var textField = Ti.UI.createTextField({
		borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
		color : '#336699',
		right : 5,
		left : 5,
		value : Ti.App.Properties.getString('server_url')
	});
	self.add(textField);

	var saveButton = Ti.UI.createButton({
		title : 'Save',
		height : 30,
		width : 200
	});
	self.add(saveButton);
	saveButton.addEventListener('click', function(e) {
		var server_url = textField.getValue();
		if (server_url.match(/^https?\:\/\/[\w-.]+(\.\w{2,4}|\:\d{2,5})$/i) == null) {
			alert("Your settings are invalid. Please check them before saving.");
		} else {
			Ti.App.Properties.setString('server_url', server_url);
			Ti.App.fireEvent('settings_saved');
		}
	});

	return self;
}

module.exports = SettingsView;
{'fraction_non_alphanumeric': 0.17026907807675343, 'fraction_numerical': 0.022055580061755623, 'mean_word_length': 3.898488120950324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1539063', 'n_tokens_mistral': 878, 'n_tokens_neox': 778, 'n_words': 166}