Skip to content

Instantly share code, notes, and snippets.

View ghae's full-sized avatar

Aeromedicale ghae

View GitHub Profile
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
url:'categories.js',
title:'Categories',
barColor:'#670000',
catid: 0
});
// Using the JavaScript module pattern, create a persistence module for CRUD operations
// One tutorial on the Module Pattern: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
var db = (function() {
//create an object which will be our public API
var api = {};
//maintain a database connection we can use
var conn = Titanium.Database.open('todos');
//Initialize the database
@dawsontoth
dawsontoth / app.js
Created March 4, 2011 00:44
Customize the look of the tab bar in iOS Appcelerator Titanium
Ti.include('overrideTabs.js');
/*
This is a typical new project -- a tab group with three tabs.
*/
var tabGroup = Ti.UI.createTabGroup();
/*
Tab 1.
@kosso
kosso / background_demo.js
Created March 12, 2011 17:55
Background Service notification for Titanium
/* Kosso : March 12th 2011
This the only way I managed to do this without the app crashing on resume.
Done slightly differently to the KS example, since they unregister the service and
do not use a setInterval timer.
*/
//############ in app.js :
// test for iOS 4+
@aaronksaunders
aaronksaunders / app.js
Created April 12, 2011 04:19
here is an iphone app example with a tabGroup with a modal window that contains a navigation group in appcelerator http://www.screenr.com/nUa more cool stuff -> blog.clearlynnovative.com
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title: 'Tab 1',
backgroundColor: '#fff'
});
@rileydutton
rileydutton / collabsablerows.js
Created April 28, 2011 16:03
Collapsable/Expandable Table View Rows in Titanium Mobile
var container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"});
var layout = [
{
title: "Parent 1",
isparent: true,
opened: false,
sub: [
{
@powmedia
powmedia / gist:1081802
Created July 14, 2011 01:58
Backbone.sync for Titanium
//Customise Backbone.sync to work with Titanium rather than jQuery
Backbone.sync = (function() {
var methodMap = {
'create': 'POST',
'read' : 'GET',
'update': 'PUT',
'delete': 'DELETE'
};
var xhr = Ti.Network.createHTTPClient({ timeout: 5000 });
@DHS
DHS / PHP Countries Array
Created November 4, 2011 18:51
PHP array of all country names
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island
@aaronksaunders
aaronksaunders / app.js
Created November 8, 2011 16:56
LinkenIn IOS Javascript Module for Use with Appcelerator
/*
This is a minified javascript module because I have not had a chance to refactor and
clean up the horrible hacks I have done to make this work, and I don't want to expose
the code and then spend alot of time responding to issues and/or questions.
This code is released AS IS and I will clean it up, document it better and eventually
re-release it as a module or open source
*/
Ti.include('linkedin_module-min.js');
@Mode54
Mode54 / Indicator.js
Created February 23, 2012 20:25
Titanium Mobile indicator module (iOS only so far)
var isIndicatorOpen = false,
view = Ti.UI.createView({
backgroundColor : "#000",
borderRadius : 10,
opacity : 0.8
}),
// message
message = Ti.UI.createLabel({
color : "#fff",
width : "auto",