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 = $.index; | |
Alloy.Globals.ActiveWindow = win; | |
//for dropdown hints | |
Alloy.Globals.CurrentDropDown = null; | |
Alloy.Globals.removeCurrentDropDown = function() { | |
Alloy.Globals.ActiveWindow.remove(Alloy.Globals.CurrentDropDown); | |
Alloy.Globals.CurrentDropDown = null; | |
}; |
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
String.prototype.printf = function (obj) { | |
var useArguments = false; | |
var _arguments = arguments; | |
var i = -1; | |
if (typeof _arguments[0] == "string" || typeof _arguments[0] == "number") { | |
useArguments = true; | |
} | |
if (obj instanceof Array || useArguments) { | |
return this.replace(/\%([s,d])/g, | |
function (placeholder) { |
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
/** | |
* Inside controller : | |
* | |
* var customGUIManager = new CustomGUIManager($); | |
* | |
* customGUIManager.createLabel('sampleUIClassName', 'SampleText', { left : '15dp'}), | |
* | |
*/ | |
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 following snippet will ask the user to rate your app the second time they launch it. | |
* It lets the user rate it now, "Remind Me Later" or never rate the app. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
win.addEventListener('open', checkReminderToRate); | |
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' })); | |
win.open(); | |
function checkReminderToRate() { |
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 version = '2.3'; | |
exports.animate = function (item, paramName, paramCurrentValue, paramTargetValue, duration, timeout) { | |
Ti.API.debug("ZEAnimator[" + version + "]#animate: " + item.apiName + "[" + item.id + "]." + paramName + '(' + item[paramName] + '): ' + paramCurrentValue + ' --> ' + paramTargetValue + " (d:" + duration + ', t:' + timeout + ')'); | |
if ( | |
(item[paramName] === paramTargetValue) | |
|| ( | |
!isNaN(parseInt(item[paramName])) | |
&& !isNaN(parseInt(paramTargetValue)) | |
&& parseInt(item[paramName]) === parseInt(paramTargetValue) |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sync: { | |
main: { | |
files: [{ | |
cwd : 'app', | |
src: [ | |
'**', /* Include everything */ | |
], | |
dest: '/Users/admin/Documents/Appcelerator_Studio_Workspace/gevar/app' |
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 jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type. | |
jQuery.noConflict(); |
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
class PhotoService | |
constructor : ($resource, ACS_API_KEY, Session, $q)-> | |
@instance = $resource 'https://api.cloud.appcelerator.com/v1/photos/:methodName' | |
, | |
key: ACS_API_KEY | |
_session_id: -> | |
Session.sessionId | |
, | |
create: | |
method: 'POST' |
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
args = arguments or [{}] | |
args = args[0] | |
humanizeDuration = (eventDuration)-> | |
eventMDuration = Alloy.Globals.Moment.duration(eventDuration, 'seconds'); | |
eventDurationString = "" | |
if eventMDuration.days() > 0 | |
eventDurationString += " " + Alloy.Globals.Moment.duration(eventMDuration.days(), 'days').humanize() | |
if eventMDuration.hours() > 0 | |
eventDurationString += " " + Alloy.Globals.Moment.duration(eventMDuration.hours(), 'hours').humanize() |
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
class AbstractService | |
constructor: (@cloud)-> | |
defaultSearchCondition: (searchCondition = {})-> | |
searchCondition.response_json_depth or= 3 | |
searchCondition | |
buildArrowQueryString: (methodName)=> "/v1/#{@apiName}/#{methodName}.json" | |
getObjectsFromResponse: (response)=> response?.response?[@apiName] or [] |
OlderNewer