<commit_before>var win = Ti.UI.currentWindow;

var global = win.global;
var XHR = require('xhr');
var Resource = require('resource');

var Videos = new Resource('/videos');

win.title = 'Record Video';
win.barColor = null;
win.barImage ='assets/images/bg.jpg';
win.backgroundImage = 'assets/images/bg.jpg';

var media = null;

var uploading = Titanium.UI.createActivityIndicator({
	message:'Uploading Video...',
	width:50,
	height:50,
	color:'#fff'
});

var videoPlayerWin = Ti.UI.createWindow({
	title:'Recorded Video',
	height:210,
	width:280,
	bottom:0
});

var btnRecord = Ti.UI.createButton({
	title:'Record',
	width:150,
	height:40,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2	
});

var btnUpload = Ti.UI.createButton({
	title:'Upload Video',
	width:150,
	height:40,
	top:60,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2,
	enabled:false,
	color:'#343434'
});

var btnCancel = Ti.UI.createButton({
	title:'Cancel',
	width:150,
	height:40,
	top:110,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2	
});

var txtTitle = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: 'please provide title for the video',
	top:10,
	width:300,
	height:40,
	editable:true
});

win.add(btnRecord);
		
txtTitle.addEventListener('change', function(e) {
	if(txtTitle.value.length > 2) {
		btnUpload.enabled = true;
		btnUpload.color = '#fff';
	} else {
		btnUpload.enabled = false;
		btnUpload.color = '#343434';
	}
});

btnUpload.addEventListener('click', function(e) {
	// making sure the app won't auto-lock while uploading..
	Titanium.App.idleTimerDisabled = true;
	
	win.remove(txtTitle);
	win.remove(btnUpload);
	win.remove(btnCancel);
	win.remove(videoPlayerWin);
		
	uploading.show();
	win.add(uploading);<commit_msg>fixing the activity indicator text to reset the percentege from last upload<commit_after>var win = Ti.UI.currentWindow;

var global = win.global;
var XHR = require('xhr');
var Resource = require('resource');

var Videos = new Resource('/videos');

win.title = 'Record Video';
win.barColor = null;
win.barImage ='assets/images/bg.jpg';
win.backgroundImage = 'assets/images/bg.jpg';

var media = null;

var uploading = Titanium.UI.createActivityIndicator({
	message:'Uploading Video...',
	width:50,
	height:50,
	color:'#fff'
});

var videoPlayerWin = Ti.UI.createWindow({
	title:'Recorded Video',
	height:210,
	width:280,
	bottom:0
});

var btnRecord = Ti.UI.createButton({
	title:'Record',
	width:150,
	height:40,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2	
});

var btnUpload = Ti.UI.createButton({
	title:'Upload Video',
	width:150,
	height:40,
	top:60,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2,
	enabled:false,
	color:'#343434'
});

var btnCancel = Ti.UI.createButton({
	title:'Cancel',
	width:150,
	height:40,
	top:110,
	style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,
	borderRadius:10,
	//font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},
	backgroundGradient:{
		type:'linear',
		colors:['#000001','#666666'],
		startPoint:{
			x:0,
			y:0
		},
		endPoint:{
			x:2,
			y:50
		},
		backFillStart:false
	},
	borderWidth:1,
	borderColor:'#666',
	backgroundColor:'#222',
	zIndex:2	
});

var txtTitle = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
	hintText: 'please provide title for the video',
	top:10,
	width:300,
	height:40,
	editable:true
});

win.add(btnRecord);
		
txtTitle.addEventListener('change', function(e) {
	if(txtTitle.value.length > 2) {
		btnUpload.enabled = true;
		btnUpload.color = '#fff';
	} else {
		btnUpload.enabled = false;
		btnUpload.color = '#343434';
	}
});

btnUpload.addEventListener('click', function(e) {
	// making sure the app won't auto-lock while uploading..
	Titanium.App.idleTimerDisabled = true;
	
	win.remove(txtTitle);
	win.remove(btnUpload);
	win.remove(btnCancel);
	win.remove(videoPlayerWin);
		
	uploading.title = 'Upload Video';
	uploading.show();
	win.add(uploading);
{'fraction_non_alphanumeric': 0.16910833785494664, 'fraction_numerical': 0.049918610960390665, 'mean_word_length': 4.984848484848484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '68752', 'n_tokens_mistral': 2366, 'n_tokens_neox': 2075, 'n_words': 345}