This file contains hidden or 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.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = .25; | |
| Ti.Geolocation.purpose = "Callbacks Are Your Friend"; | |
| // PUBLIC FUNCTION | |
| /** | |
| * @param {Object} _callback call on completion of location query | |
| */ | |
| exports.currentLocation = function(_callback) { |
This file contains hidden or 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
| // private vars | |
| var mainWindow, callback_label_coords; | |
| var styles = require('styles'); | |
| var maps = require('lib/maps'); | |
| /** | |
| * @param {Object} args properties for the window | |
| */ | |
| exports.AppWindow = function(args) { | |
| var instance, event_label, callback_label; |
This file contains hidden or 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 sendTwitterImage = function(postParams, pSuccessCallback, pErrorCallback) { | |
| var finalUrl = ''; | |
| // authorize user if not authorized, and call this in the callback | |
| if(!authorized && ( typeof (auth) == 'undefined' || auth === true)) { | |
| authorize(function(retval) { | |
| if(!retval) { | |
| // execute the callback function | |
| if( typeof (callback) == 'function') { | |
| callback(false); |
This file contains hidden or 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 win1 = Titanium.UI.createWindow({ | |
| title : 'Tab 1', | |
| backgroundColor : '#fff', | |
| layout : "vertical" | |
| }); | |
| // | |
| var view5 = Titanium.UI.createView({ |
This file contains hidden or 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 nativehttpqueue = require('com.clearlyinnovative.nativeHttpQueue'); | |
| /** | |
| additional paramater(s) supported per request | |
| Paramaters | |
| ---------- | |
| "username" : "<username>" | |
| "password" : "<password>" | |
| "domain" : "<domain>" domain for NTLM |
This file contains hidden or 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 win1 = Titanium.UI.createWindow({ | |
| title:'Tab 1', | |
| backgroundColor:'#fff' | |
| }); | |
| win1.open(); | |
| var alphaonly = Titanium.UI.createTextField({ | |
| color:'#336699', | |
| height:35, | |
| width:300, |
This file contains hidden or 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 win = Ti.UI.createWindow({}); | |
| var tableView = Ti.UI.createTableView({}); | |
| for(var i = 0; i < 5; i++) { | |
| var checkBox = Ti.UI.createView({ | |
| width : 20, | |
| height : 20, | |
| done : false, | |
| item_type : "CHECKBOX", // us this to know we clicked a checkbox |
This file contains hidden or 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 win = Ti.UI.createWindow({}); | |
| var tableView = Ti.UI.createTableView({}); | |
| for(var i = 0; i < 5; i++) { | |
| var checkBox = Ti.UI.createView({ | |
| width : 20, | |
| height : 20, | |
| done : false, | |
| item_type : "CHECKBOX", // us this to know we clicked a checkbox |
This file contains hidden or 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
| /** | |
| * helper to find an element, can be used when there are | |
| * multiple elements in a row and you need to find one | |
| * | |
| * @param _o {Object} parent object to find elements in | |
| * @param _i {String} id of the element you are looking for | |
| */ | |
| function findElement(_o, _i) { | |
| for(var x in _o.children) { | |
| if(_o.children[x].id === _i) { |
This file contains hidden or 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
| /** | |
| * simple method to get the list of items selected | |
| */ | |
| function checkedRowsAre() { | |
| // get the rows; there is a default section in all tables so that | |
| // is why we need to get the rows this way | |
| var selected = []; | |
| var rows = tableView.data[0].rows; | |
| // iterate through the rows to find out which ones are selected, |