Skip to content

Instantly share code, notes, and snippets.

View bob-sims's full-sized avatar

Bob Sims bob-sims

View GitHub Profile
@pec1985
pec1985 / app.js
Created June 13, 2011 17:43
Simple Single-Context app
// namespace for the windows
var W = {};
// namespace for custom UI
var UI = {};
// store the tabs in this array for later use
var tabs = [];
// include the necessary files to run the app
Ti.include('ui.js');
Ti.include('other.js');
Ti.include('window1.js');
@zeuxisoo
zeuxisoo / app.js
Created June 9, 2011 04:15
Titanium mobile parse html
Ti.include('lib/htmlparser.js');
Ti.include('lib/soupselect.js');
var select = soupselect.select;
var body = '<html><head><title>Test</title></head>'
+ '<body>'
+ '<img src="http://l.yimg.com/mq/i/home/HKGallery.gif" />'
+ '<div id="block">'
+ ' <div class="row">Row 1</div>'
@dawsontoth
dawsontoth / app.js
Created June 6, 2011 20:40
Rate my app in Appcelerator Titanium Mobile
/**
* The following snippet will ask the user to rate your app the second time they launch it.
* It lets the user rate it now, "Remind Me Later" or never rate the app.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.addEventListener('open', checkReminderToRate);
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' }));
win.open();
function checkReminderToRate() {
@donayama
donayama / app.js
Created June 5, 2011 13:09
FlickrShow
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK;
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
@atsusy
atsusy / gist:998503
Created May 30, 2011 05:50
Titanium Mobile sample code(podcast player)
/*
* ユーザーインタフェース
*/
var window = Titanium.UI.createWindow({});
var feedsTable = Titanium.UI.createTableView({});
var playingPanel = Titanium.UI.createView({
bottom:-65,
var container = Ti.UI.createView({
layout:'vertical',
top:5, left:5, right:5
});
var bar = Ti.UI.createView({
top:5,
left:0,
width:'75%',
height:40,
@dawsontoth
dawsontoth / app.js
Created May 10, 2011 14:05
Loading images in @appcelerator #Titanium
/* The images for this example can be downloaded from http://j.mp/loadingimagesforti */
var win = Ti.UI.createWindow({ backgroundColor: '#f00'});
var loading = Ti.UI.createImageView({
images: [
'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png',
'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png',
'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png',
'images/loading/10.png', 'images/loading/11.png'
],
width: 33, height: 33
@codeboxed
codeboxed / youtube_videos_example.js
Created May 4, 2011 16:33
Show YouTube videos with Titanium mobile
var win = Ti.UI.currentWindow;
// Set the window orientation modes for the video to rotate with the device
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT,
Ti.UI.LANDSCAPE_RIGHT ];
// Build the movie URL. 'fs' and 'autoplay' parameters are optional.
var movieId = "d0llSyfgwEE";
var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=1";
@TheBrousse
TheBrousse / image_list.js
Created May 4, 2011 16:27
Titanium Image List View
var win = Ti.UI.currentWindow;
// Images to display (this list can be dynamically generated)
var images = [ 'image1.png', 'image2.png', 'image3.png', 'image4.png',
'image5.png',' image6.png', 'image7.png', 'image8.png' ];
// Empty table data (will be populated at runtime)
var data = [];
var table = Ti.UI.createTableView();
@pec1985
pec1985 / uploadImage.js
Created April 27, 2011 02:56
Upload Image
Titanium.Media.openPhotoGallery({
success:function(event){
var myImage = event.media;
var xhr = Titanium.Network.createHTTPClient();
xhr.open('POST','http:// ------ /uploads.php');
xhr.onerror = function(e){alert(e.error);};
xhr.setTimeout(200000);