Пример #1
0
function initial(args){
	Ti.API.info('image url = ' + args.get('image'));
	$.image.image = args.get('image');
	
	var userId = args.get('userId');
	profileOperations.getProfileByUserId(userId, displayProfile);
	
	$.time.text = prettyDate(args.get('createdAt').toString());
	$.text.text = args.get('content');
	$.row.data = JSON.stringify(args);
	Ti.API.info('tweet row loaded');
}
Пример #2
0
var logger = require('LogOperations');
var profileOperations = require('ProfileOperations');

var args = arguments[0] || {};

function displayProfile(profile){
	$.name.text = profile.username;
	$.header.image = profile.avatar;
}

var tweet = args.content;

var date = new Date(args.createdAt);

Ti.API.info('detail window: ' + tweet + date);
profileOperations.getProfileByUserId(args.userId, displayProfile);

$.image.image = args.image;
$.text.text = tweet;
$.time.text = date.toLocaleDateString();

var data = [];
var comments = Alloy.createCollection('comment');
comments.fetch();

Ti.API.info("comments: " + comments.length);

comments.map(function(comment) {
	// The book argument is an individual model object in the collection
	data.push(Alloy.createWidget('nl.fokkezb.tweetsView', 'row', comment).getView());
});