Skip to content

Instantly share code, notes, and snippets.

View grantges's full-sized avatar

Bert Grantges grantges

  • Austin, Tx - United States
View GitHub Profile
@grantges
grantges / html.js
Created December 1, 2014 15:27
Using Custom Tags to Map HTML to Ti
function htmlToTi(_args){
var json = {};
var keys = _.keys(_args);
_.each(keys, function(key){
switch(key){
case "bgcolor":
@grantges
grantges / index.js
Created October 21, 2014 19:39
ListView with SearchBar Example (pulling from Appcelerator ACS)
var _args = arguments[0] || {};
var Cloud = require('ti.cloud');
$.listView.visible = false;
function getUsers(page){
$.listView.visible = false;
// Default to 1st Page if no page is entered
@grantges
grantges / Index.js
Created October 11, 2014 00:23
object example for ListItem with Searchable Text
var item = {
template: isBookmark ? "favoriteTemplate" : "userTemplate",
properties: {
searchableText: item.name + ' ' + item.company + ' ' + item.email,
user: item,
},
userName: {text: item.firstName+" "+item.lastName},
userCompany: {text: item.company},
userPhoto: {image: item.photo},
userEmail: {text: item.email}
@grantges
grantges / tiapp.xml
Created September 26, 2014 16:35
iOS 8 Map Module plist requirements
<key>NSLocationAlwaysUsageDescription</key>
<string>
YOUR DESCRIPTOIN GOES HERE - EX. This application would like to use your current location.
</string>
@grantges
grantges / index.js
Last active August 29, 2015 14:06
An example of how to create a SplitWindow for iPad using Appcelerator Mobile SDK (with Alloy MVC Framework)
$.index.addEventListener('visible',function(e){
if (e.view == 'detail'){
e.button.title = "Master";
$.index.detailView.getWindow().leftNavButton = e.button;
} else if (e.view == 'master'){
$.index.detailView.getWindow().leftNavButton = null;
}
});
$.index.open();
@grantges
grantges / index.js
Created September 11, 2014 21:09
Create object properties on an Alloy Widget
/** Create your Widget **/
var myWidget = Alloy.createWidget("myWidget");
/*
Now the widget has an icon and title based on the default values as we defined them
in the widget.js file (lines 26/27)
*/
@grantges
grantges / index.js
Created September 4, 2014 17:59
Using DOM calls from Appcelerator MobileWeb
function doClick(e) {
if(OS_MOBILEWEB){
var btn=document.createElement("BUTTON");
btn.style.position='absolute';
var t=document.createTextNode("CLICK ME");
btn.appendChild(t);
document.body.appendChild(btn);
@grantges
grantges / tiapp.xml
Created August 13, 2014 12:25
GoogleMaps v2 Manifest Entries
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application>
<!-- Replace "PASTE YOUR GOOGLE MAPS API KEY HERE" with the Google API key you obtained -->
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="<YOUR KEY HERE>"/>
</application>
<uses-sdk android:minSdkVersion="14" />
<uses-sdk android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
@grantges
grantges / box.js
Created July 30, 2014 15:12
Simple Box Class for Titanium
https://apex.oracle.com/pls/apex/f?p=18868
@grantges
grantges / fb_createUser.js
Created May 1, 2014 01:51
Titanium - Login with Facebook and Create a User In ACS
/**
* Create an instance of the facebook module (need to include this in the tiapp.xml)
*/
var fb = require('facebook');
/*
* Initiate the facebook module with appropriate APP ID and PERMISSIONS ARRAY (developer.facebook.com)
*/
fb.appid = FACEBOOK_APP_ID;