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
//single calls over bridge | |
var osname = Ti.Platform.osname, | |
version = parseInt(Ti.Platform.version); | |
//simple boolean checks | |
var isandroid = function() { | |
return osname === 'android'; | |
}; | |
var isios = 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
// Prototype version: | |
// Ti.include('prototype.js'); | |
// Module version: | |
// Ti.include('module.js'); | |
// Factory version: | |
Ti.include('factory.js'); | |
var win = Ti.UI.createWindow({ |
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 _ = require('/lib/underscore'); | |
/* | |
*This is the lightweight version I use based on Kevin Whinnery's one: https://gist.github.com/kwhinnery/1595307 | |
* Wrapper for Titanium UI components. This wrapper provides a few pieces of critical | |
* functionality, currently missing from Titanium UI objects: | |
* - The ability to safely extend components with new members | |
* - Rudimentary resource management and object lifecycle handling | |
* |
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
/* | |
* Mixin properties of n objects into the given object - pass in as many objects to mix in as you like. | |
* Can perform a shallow or deep copy (shallow is default for performance reasons). | |
* | |
* Usage: | |
* mixin([Boolean deepCopy,] objectToExtend, objectToMixIn [, as many other objects as needed]) | |
* | |
* Examples: | |
* | |
* var o1 = { |
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
/* Put this file in <product dir>/plugins/appid/hooks/ | |
* then add this to your tiapp.xml: | |
* <plugins> | |
* <plugin>appid</plugin> | |
* </plugins> | |
*/ | |
exports.cliVersion = '>=3.2.1'; | |
exports.init = function (logger, config, cli, appc) { |
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
function compile(TypeScript, logger, sourcefilename){ | |
var _this = this; | |
var ByteOrderMark = {}; | |
ByteOrderMark[ByteOrderMark["None"] = 0] = "None"; | |
ByteOrderMark[ByteOrderMark["Utf8"] = 1] = "Utf8"; | |
ByteOrderMark[ByteOrderMark["Utf16BigEndian"] = 2] = "Utf16BigEndian"; | |
ByteOrderMark[ByteOrderMark["Utf16LittleEndian"] = 3] = "Utf16LittleEndian"; | |
var FileInformation = (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
/** | |
* Caching functions class | |
* @class Cache | |
*/ | |
var Moment = require("alloy/moment"); | |
var directory; | |
exports.valid = function (_url) { | |
var fileName = _url.replace(/[^\w\d]/g, ""); |
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 Win = Ti.UI.createWindow({ | |
title: "My Message", | |
}); | |
var ScrollView = Ti.UI.createScrollView({ | |
height: Ti.UI.FILL, | |
width: Ti.UI.FILL, | |
contentHeight: "100%", | |
contentWidth: "100%", | |
}); |
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
/** | |
* Global singleton | |
*/ | |
var APP = { | |
/** | |
* This sets up global events, persistant things | |
* throughout the app, etc. Only should be called | |
* when the app is booted. | |
*/ |
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
// Custom swipe detection for table rows (since technically the "swipe" | |
// event doesn't apply to individual rows but rather the table. This way we | |
// don't have to assign a swipe event for each row. One event to manage | |
// them all is more performant. | |
var TOUCH_X = 0; | |
$.list.addEventListener("touchstart", function(e) { | |
TOUCH_X = e.x; | |
}); | |
$.list.addEventListener("touchend", function(e) { | |
if(e.x > (TOUCH_X + 44)) { |