This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function percentageToPixels(p,width) { | |
if (width == null) { | |
width = Titanium.Platform.displayCaps.platformWidth-2; | |
} | |
return new Number((width * (p/100))).toFixed(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's make a funky Window | |
var win = Titanium.UI.createWindow({ | |
backgroundColor:'#F00', | |
left: 0, | |
top: 0, | |
zIndex: 0 | |
}); | |
// | |
// Paypal Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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", |
OlderNewer