This file contains 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 currentUser lib stores a model representing the logged in user, and other login state information | |
var currentUser = require('currentUser'); | |
// Logger is a Ti.API.info() wrapper with a bit more flexibility | |
var logger = require('logger'); | |
var messageQueue = []; // put this into local storage at some point to retain recent offline events before crashes | |
var messageInTransit = null; | |
var token = Ti.App.Properties.getString('mixpanel.token'); | |
var systemProperties = { | |
mobile_osname: Ti.Platform.osname, |
This file contains 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
/* | |
State. | |
*/ | |
var simplify = Ti.Platform.osname === 'mobileweb'; | |
var currentFlashes = {}; | |
/* | |
Public API. | |
*/ | |
exports.chainAnimateForever = chainAnimateForever; |
This file contains 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
// Copyright Stephen Feather and other contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// |
This file contains 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 UI = require('ui'); | |
UI.Window({ | |
subviews:[ | |
UI.Label({ | |
width: Ti.UI.SIZE, | |
height: Ti.UI.SIZE, | |
color: "#000", | |
text: 'here', | |
onClick: function() { |
This file contains 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
/** | |
* Test #1 | |
* Adding 10,000 Ti.UI.TableViewRows to a Ti.UI.TableView | |
* The rows have the Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE constant in them | |
* | |
* Total time in my Mac: 1228ms | |
*/ | |
var win = Ti.UI.createWindow({ | |
backgroundColor: '#ccc' |
This file contains 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 MIT License | |
Copyright (c) 2010 Roger Chapman | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains 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 user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
This file contains 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
/* | |
Learn the basics of Storekit with this example. | |
Before we can do anything in our app, we need to set up iTunesConnect! This process can be a little painful, but I will | |
guide you through it so you don't have to figure it out on your own. | |
Follow these steps: | |
1) Log in to your Apple Developer account at https://itunesconnect.apple.com/ | |
2) Click "Manage Your Applications". |
This file contains 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 tracer = {}; | |
(function() { | |
tracer.levels = {}; | |
tracer.levels.DEBUG = 1; | |
tracer.levels.INFO = 2; | |
tracer.levels.WARN = 3; | |
tracer.levels.ERROR = 4; | |
tracer.levels.OFF = 5; | |
tracer.allTracers = []; |
This file contains 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
//Public client interface | |
function Client(applicationId, masterKey) { | |
this.applicationId = applicationId; | |
this.masterKey = masterKey; | |
} | |
exports.Client = Client; | |
//Parse API endpoint | |
var ENDPOINT = 'https://api.parse.com/1/classes/'; |
NewerOlder