Skip to content

Instantly share code, notes, and snippets.

View Mindelusions's full-sized avatar

Anthony Decena Mindelusions

View GitHub Profile
Titanium.UI.setBackgroundColor('#fff');
var tibh = {}; //create app namespace
Ti.include('ui.js','db.js');
tibh.tabGroup = tibh.ui.createApplicationTabGroup();
tibh.tabGroup.open();
// Before the closing body tag, either add a script block or create an external js file with the cue point data
var cue_points = [{
time: "21",
copy: "Ensure lips are their most smooth and supple by using a generous layer of Lip Conditioner. Exfoliate them if necessary. Allow Lip Conditioner to \"marinate\" for several minutes. Then thoroughly blot away excess.",
prods: ["CAT960PROD472SKU4920", "CAT960PROD645SKU3165"]
},
{
time: "38",
copy: "Apply lip primer on entire mouth and slightly outside of natural lip line.",
prods: ["CAT960PROD968SKU3830"]
@Mindelusions
Mindelusions / app.js
Created October 7, 2011 15:58
LeatherFace Application Code
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup({
backgroundImage:'/images/tabbar.png'
});
// Component Creation
@Mindelusions
Mindelusions / app.js
Created October 18, 2011 23:01
Sample Titanium App Built Using Sensis Developer API
// Include a small sensis helper library
var mind = {};
Ti.include('sensis.js');
// Custom activity indicator
var indWin = null;
var actInd = null;
function showIndicator()
{
@Mindelusions
Mindelusions / BarWindow.js
Created September 17, 2012 20:10
Simple Titanium Commonjs Example
function BarWindow() {
var self = Ti.UI.createWindow({
backgroundColor:'#f0f0f0',
layout:'vertical'
});
var lbl = Ti.UI.createLabel({
text:'Bar Window',
color:'#000',
top:20
@Mindelusions
Mindelusions / InfoWin.js
Created September 21, 2012 18:53
Titanium - Simple Slide Down Info Window
function InfoWin(_args) {
var self = Ti.UI.createWindow({
backgroundColor:'#000',
height:480,
bottom:436
});
var infolbl = Ti.UI.createLabel({
text:'Info',
color:'#fff',
bottom:0
@Mindelusions
Mindelusions / app.js
Created September 30, 2012 18:15
Titanium - Multi-Column Image View Stack
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var leftView = Ti.UI.createView({
width:'48%',
height:Ti.UI.FILL,
left:0,
backgroundColor:'#dfdfdf',
layout:'vertical'
@Mindelusions
Mindelusions / AddWindow.js
Created October 5, 2012 20:38
TodoListACS - Blog Post Code Samples
/*
* AddWindow.js is the simple modal form for adding new tasks.
*/
function AddWindow() {
var todo = require('todo');
var self = Ti.UI.createWindow({
backgroundColor:'#fff',
layout:'vertical',
modal:true,
title:'Add Item'
@Mindelusions
Mindelusions / lib_collection.js
Created October 16, 2012 17:59
TodoListAlloy - Collection ID Issue
var Alloy = require('alloy');
var todos = Alloy.createCollection('Todo');
todos.on("fetch", function() {
var todorows = [],
donerows = [],
i = 0,
len = todos.length,
model, title;
for ( ; i < len; i++) {
@Mindelusions
Mindelusions / mask.js
Created November 2, 2012 18:49
Titanium - Field Mask
/*
* @ Developed by Nyvra (http://www.nyvra.net)
* @ Last release: 13/10/2011
*/
Mask = {
mask: function(_field, _function) {
_field.value = _function(_field.value)
},