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 = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
}); | |
var tf = Ti.UI.createTextField({ | |
top:10, | |
left:10, | |
width:20, | |
content:'', | |
maxLength:'3', |
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 = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
}); | |
var pm = Ti.UI.createTextField({ | |
color: '#336699', | |
top: 10, | |
left: 10, | |
width: 250, | |
height: 60, |
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
// INcluding memory management utils. | |
Ti.include('utils.js'); | |
// root window. | |
var win = Ti.UI.createWindow({ | |
backgroundColor : 'white', | |
exitOnclose : true, | |
}); | |
if (Ti.UI.Android) { |
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
// PEM encryption is possible! I found a JS work by Tom Wu, that you can see here: | |
// http://www-cs-students.stanford.edu/~tjw/jsbn/ | |
// This code attempts to adapt his sample/test code and how to use it in Titanium Appcelerator. | |
Ti.include("jsbn.js"); | |
Ti.include("prng4.js"); | |
Ti.include("rng.js"); | |
Ti.include("rsa.js"); | |
Ti.include("base64.js"); |
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 flip = Ti.UI.create2DMatrix(); | |
flip = flip.rotate(-90); | |
var commonSideTextOne = Ti.UI.createWebView({ | |
html: '<p style="color:#fff;font-size: 10pt; padding-top: 2pt; font-family: futura;">Engine and <br />Drive Train</p>', | |
transform: flip, | |
top: 100, | |
left: 100, | |
width: 180, | |
height: 120, |
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
// We create global variables that will | |
// save the latest geolocation | |
myGeolocation = {}; | |
myGeolocation.lon = 0; | |
myGeolocation.lat = 0; | |
// This is the call function of the getCurrentPosition | |
// Note that you are storing the current lat and long | |
// so you can use it anywhere else in the code. | |
// You can even throw another event within this function |
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 = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
}); | |
var tableData = []; | |
for (var i=1; i<=20; i++){ | |
var row = Ti.UI.createTableViewRow({ | |
className:'forumEvent', // used to improve table performance | |
selectedBackgroundColor:'white', |
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 Cloud = require('ti.cloud'); | |
Cloud.debug = true; | |
// optional; if you add this line, set it to false for production | |
var fb = require('facebook'); | |
// Check for your app id in developers.facebook.com | |
fb.appid = ADD_YOUR_APPID_HERE!; | |
fb.permissions = ['publish_stream']; | |
// Permissions your app needs | |
fb.forceDialogAuth = true; | |
fb.addEventListener('login', function(e) { |
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 = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
}); | |
// *** This is taken from Dawsontoth's https://gist.github.com/dawsontoth/839218 | |
var rotate = Ti.UI.create2DMatrix().rotate(90); | |
var counterRotate = rotate.rotate(-180); | |
// *** end of the code taken from Dawsontoth's | |
function randomInt(min, max) { |
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 = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
}); | |
function randomInt(min, max) { | |
return Math.round(min + Math.random()*(max-min)); | |
} | |
function getView(){ | |
var rnd = randomInt(0,200) % 3; |
NewerOlder