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
//////////////////////push_notifications.js/////////////////////// | |
var apns = function(){ | |
var pref = require('preferences').preferences; | |
Titanium.Network.registerForPushNotifications({ | |
types: [ | |
Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
Titanium.Network.NOTIFICATION_TYPE_ALERT | |
], | |
success:function(e) |
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
// The result of the expression (true && false) is assigned to $g | |
// Acts like: ($g = (true && false)) | |
$g = true && false; | |
// The constant true is assigned to $h and then false is ignored | |
// Acts like: (($h = true) and false) | |
$h = true and 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 Utils = { | |
/* modified version of https://gist.github.com/1243697 | |
* adds detection of file extension rather than hard-coding .jpg as in the original | |
*/ | |
_getExtension: function(fn) { | |
// from http://stackoverflow.com/a/680982/292947 | |
var re = /(?:\.([^.]+))?$/; | |
var tmpext = re.exec(fn)[1]; | |
return (tmpext) ? tmpext : ''; | |
}, |
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({ | |
exitOnClose: true, | |
backgroundColor: '#ccc', | |
fullscreen: false | |
}); | |
win.open(); | |
var activity = win.activity; |
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
function CustomTable(){ | |
var self = {}; | |
var win = Ti.UI.createWindow({ | |
backgroundColor:'#ccc' | |
}); | |
var table = Ti.UI.createTableView({ | |
top:20, | |
bottom:20, | |
left:20, | |
right:20, |
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
$this->data['users'] = $this->ion_auth->users()->result(); | |
foreach ($this->data['users'] as $k => $user) | |
{ | |
$this->data['users'][$k]->groups = $this->ion_auth->get_users_groups($user->id)->result(); | |
} |
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
function GetLocation(callback){ | |
if (!Ti.Network.online) | |
{ | |
callback({success: false}); | |
return; | |
} | |
var PROVIDER = Titanium.Geolocation.PROVIDER_GPS; | |
var timeout; |
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 Utils = { | |
RemoteImage: function(a){ | |
a = a || {}; | |
var md5; | |
var needsToSave = false; | |
var savedFile; | |
if(a.image){ | |
md5 = Ti.Utils.md5HexDigest(a.image)+'.jpg'; | |
savedFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,md5); | |
if(savedFile.exists()){ |
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({}); | |
win.open(); | |
var height = Ti.Platform.displayCaps.platformHeight-40; | |
var width = Ti.Platform.displayCaps.platformWidth; | |
var viewsArray = []; |
NewerOlder