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
Titanium.Media.showCamera({ | |
success: function(image,details) { | |
postPic(image); | |
}, | |
error: function(e) { | |
notify(e.message); | |
}, | |
cancel: function() { | |
//no op | |
}, |
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).find("[nodeName=namespace:tag]").text(); |
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
<html> | |
<head> | |
<script type="text/javascript" charset="utf-8"> | |
(function() { | |
var intro = Titanium.Media.createSound("app://audio/FF1prelu.m4a"); | |
intro.setLooping(true); | |
intro.play(); | |
})(); | |
</script> | |
</head> |
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
// #1 - Define the master library | |
var TMA = { | |
ModuleOne: { | |
importantNumber: 2, | |
doSomething: function() { | |
return importantNumber+2; | |
} | |
}, | |
ModuleTwo: { | |
someProperty: true, |
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 c = Titanium.Network.createHTTPClient(); | |
c.onload = function() { | |
var f= Titanium.Filesystem.getFile("xhr.png"); | |
f.write(this.responseData); | |
document.getElementById('html').innerHTML = '<img src="'+f.url+'"/>'; | |
}; | |
// open the client | |
c.open('GET','http://www.appcelerator.com/wp-content/uploads/2009/06/titanium_desk.png'); | |
// send the data | |
c.send(); |
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
<script type="text/javascript" charset="utf-8"> | |
window.location.href="http://www.appcelerator.com/company/partners"; | |
</script> |
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 xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() { | |
try { | |
$(doc).find("rss channel item").each(function() { | |
//do something with news items | |
}); | |
} | |
catch(e) { | |
Titanium.API.debug(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 url = "https://"+un+":"+pw+"@twitter.com/statuses/update.json"; | |
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() { | |
// Handle response | |
}; | |
xhr.open("POST",url); | |
xhr.send({ status:'My awesome tweet!' }); |
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 ta1 = Titanium.UI.createTextArea({ | |
id:'idOfADOMElement', | |
value: 'Here\'s a new #tweet @joeschmoe', | |
keyboardType:Titanium.UI.KEYBOARD_ASCII, | |
autocorrect:false, | |
textAlign:'left', | |
height:100, | |
width:255 | |
}); |
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 info = Titanium.UI.createButton({ | |
image:'/img/info.png' | |
}); | |
var infoWin = Titanium.UI.createWindow({ | |
url:'info.html' | |
}); | |
info.addEventListener('click',function() { | |
infoWin.open( {animated:'true'} ); |