Moved to: https://github.com/FokkeZB/UTiL/tree/master/rate
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({ | |
backgroundColor:"#fafaf9" | |
}); | |
var logo = Ti.UI.createView({ | |
backgroundImage:"info_usat_logo.png", | |
width:157, | |
height:131, | |
top:30, | |
left:30 |
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
Ti.include('overrideTabs.js'); | |
/* | |
This is a typical new project -- a tab group with three tabs. | |
*/ | |
var tabGroup = Ti.UI.createTabGroup(); | |
/* | |
Tab 1. |
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 TiFtp = { | |
config: { | |
host: null, | |
port: 21, | |
path: null, | |
user: null, | |
password: null | |
}, | |
init: function(_host, _path, _user, _password) { | |
if(!_host || !_path || !_user || !_password) { |
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 xmlrpc = require('./lib/xmlrpc'); | |
var client = xmlrpc.createClient({ | |
url: 'https://api.example.com/XML-RPC' | |
, username: 'xxxx' | |
, password: 'xxxx' | |
}); | |
client | |
.call('foo.methodName') |
If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.
Well, you can:
var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;
The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST
will be either TRUE
or FALSE
. The actual expressions in wich they are used will then be evaluated. If FALSE
the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST
will be undefined
, so the code block will be executed.
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 RateMe(ios_url, goog_url, usecount) { | |
if(!Ti.App.Properties.hasProperty('RemindToRate')) { | |
Ti.App.Properties.setString('RemindToRate', 0); | |
} | |
var remindCountAsInt = parseInt(Ti.App.Properties.getString('RemindToRate'), 10); | |
var newRemindCount = remindCountAsInt + 1; | |
if(remindCountAsInt === -1) { | |
// the user has either rated the app already, or has opted to never be | |
// reminded again. |
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
'use strict'; | |
var win = Ti.UI.createWindow({ | |
backgroundColor: 'white', | |
}); | |
//Generate some sample rows | |
var rows = []; | |
for (var iLoop=0;iLoop<100;iLoop++){ | |
rows.push({ title: 'demo row #'+iLoop}); |
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
exports.C = { | |
INSTAGRAM_CLIENT_ID : 'replace this with your public', //replace this with your public | |
INSTAGRAM_CLIENT_SECRET : 'replace this with your private key', //replace this with your private key | |
INSTAGRAM_CALLBACK_URL : 'replace this with your INSTAGRAM_CALLBACK_URL' | |
}; |
OlderNewer