Skip to content

Instantly share code, notes, and snippets.

all:
storage:
class: sfCacheSessionStorage
param:
session_name: mysessionname
session_cookie_domain: .domain.de
session_cookie_lifetime: +30 days
session_cookie_secret: mysecret
cache:
class: sfMemcachedCache
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//
// create root window
var win = Titanium.UI.createWindow({
backgroundColor:'#F00',
left: 0,
top: 0,
zIndex: 0
function percentageToPixels(p,width) {
if (width == null) {
width = Titanium.Platform.displayCaps.platformWidth-2;
}
return new Number((width * (p/100))).toFixed(0);
}
var controlsAffectectedByOrientation = new Array();
Ti.Gesture.addEventListener('orientationchange',function(e){
for ( var i = 0; i < controlsAffectectedByOrientation.length; i++) {
var thisControl = controlsAffectectedByOrientation[i];
var width = thisControl.pWidth;
thisControl.width = percentageToPixels('width',width);
}
var win = Titanium.UI.currentWindow;
// create table view data object
var data = [
{title:'Row 1', hasChild:true},
{title:'Row 2', hasDetail:true},
{title:'Row 3 (no animation)', name:'foo'},
{title:'Row 4 (no animation)', name:'bar'},
{title:'Row 5'}
];
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//
// create root window
var win = Titanium.UI.createWindow({
backgroundColor:'#F00',
left: 0,
top: 0,
zIndex: 0
// Let's make a funky Window
var win = Titanium.UI.createWindow({
backgroundColor:'#F00',
left: 0,
top: 0,
zIndex: 0
});
//
// Paypal Button
var currentData = new Array();
var requestAgain = true;
var xhr = Titanium.Network.createHTTPClient();
var returnedData;
var timeDelay = (2 * 60 * 1000); // 2 mins * 60 seconds * 1000 milliseconds
// Setup our event handlers
xhr.onload = function() {
// This gets first one receipt of the data
returnedData = this.responseText;
// Simple debug output helper
function debug(message) {
Ti.API.info(message);
}
/**
*
* @param thisControl The control you wish to dump
* @param goDeep boolean Do you want deep introspection
* @param incFuncs boolean Do you want to include functions in the output when going deep
// create table view data object
var data = [];
for (var c=0;c<10;c++)
{
data[c] = Ti.UI.createTableViewSection({headerTitle:'Group '+(c+1)});
for (var x=0;x<40;x++)
{
var label = Ti.UI.createLabel({
text:'Group '+(c+1)+', Row '+(x+1)+"\nThis is another line.\nCool",