Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function run() {
var Alloy = require('alloy');
Alloy.CFG.db_name = 'my_db_test';
// remove and create and empty database
var db = Ti.Database.open(Alloy.CFG.db_name);
db.remove();
var tijasmine = require("tijasmine/tijasmine"),
reporter = new (require("tijasmine/tijasmine-console").ConsoleReporter);
tijasmine.addSpecModules(
"specs/lib/counter_spec",
"specs/model/book_spec",
"specs/controller/index_spec",
"specs/controller/detail_spec"
);
tijasmine.addReporter(reporter);
tijasmine.execute();
}
function writeToRemote(level, message, data) {
remoteProvider = Alloy.CFG.logger.remoteProvider;
Ti.API.info('[lLOGGER] :: Writing log to remote provider: ' +
remoteProvider);
switch (remoteProvider) {
case "acs":
//acs(level, message, data);
break;
// This will be where to change to interface with our own backend
case "custom":
break;
default:
alert("You have to edit config.json to supply your remote provider.");
break;
}
}
// Prepare the data (if required)
var url = config.url,
method = config.method || 'GET',
data, query;
if (method == 'GET' || method == 'DELETE') {
query = toQueryString(config.data);
if (query)
url = url + (url.indexOf('?') > 0 ? '&' : '?') + query;
} else
data = config.data || {};
// Add base Url if url does not start with http
if(url.substr(0, 4) !== 'http')
url = Alloy.CFG.baseUrl + url;
Ti.API.debug(method + ': ' + url);
// Ti.API.info(data);
// Open connection
this.httpClient.open(method, url);
// Set headers after opening connection
for (var key in config.headers) {
this.httpClient.setRequestHeader(key, config.headers[key]);
}
if(config.json) {
this.httpClient.setRequestHeader('Content-Type', 'application/json');
if(data)
var _ = require('alloy/underscore')._;
/**
* @property config
* @property {String} [config.driver="http"] The driver to use.
* @property {Boolean} [config.autoReset=true] If true, set the badge count to 0 when you open/resume the application.
* @property {Boolean} [config.fakeDeviceToken=false] A fake device token.
* @property {Object[]} [config.channels] **Android only** A list of channels to create when subscribing to Firebase notifications.
* @property {String[]} [config.dataFields] A list of data fields to check when receiving a data message.
* @type {Object}
*/
exports.config = _.extend({
driver: null,
autoReset: true,
fakeDeviceToken: false
}, (Alloy.CFG.T && Alloy.CFG.T.firebase) ? Alloy.CFG.T.firebase.cloudmessaging : {});
var MODULE_NAME = 'firebase/cloudmessaging';
var Event = require('T/event');
var Q = require('T/ext/q');
require('T/firebase/core');
var FCM = require('firebase.cloudmessaging');
var registered_for_push_notifications = false;
var dataFields = {};
// The listener for all received notification messages
function notificationsCallback(e) {
// Auto-reset the badge when a notification is received
if (exports.config.autoReset === true) {
__processArg(arguments[0], "$model");
}
{
__processArg(arguments[0], "__itemTemplate");
}
}
var $ = this;
var exports = {};
$.__views.index = Ti.UI.createWindow({
backgroundColor: "#ff0",
id: "index"
});
$.__views.index && $.addTopLevelView($.__views.index);
$.__views.label = Ti.UI.createLabel({
backgroundColor: "black",
text: L(Alloy.CFG.someText, Alloy.CFG.someText),
height: Ti.UI.SIZE,
font: {
fontSize: 24,
fontWeight: "bold"
},
width: Ti.UI.SIZE,
color: "red",
top: 10,
textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,
id: "label"
});
$.__views.index.add($.__views.label);
$.__views.__alloyId0 = Alloy.createWidget("com.test.hellobutton", "widget", {
id: "__alloyId0",
__parentSymbol: $.__views.index
});
* @property {Object} config.ios The properties reserved to the Ti.Firebase iOS module.
* @property {String} config.ios.googleAppID Corresponds to the `GOOGLE_APP_ID` key in GoogleService-Info.plist.
* @property {String} [config.ios.bundleID] Corresponds to the `BUNDLE_ID` key in GoogleService-Info.plist.
* @property {String} [config.ios.clientID] Corresponds to the `CLIENT_ID` key in GoogleService-Info.plist.
* @property {String} config.ios.trackingID **Deprecated** Needed to use Google Analytics.
* @property {String} config.ios.androidClientID **Deprecated** Needed to use Firebase Invites.
* @property {String} config.ios.deepLinkURLScheme **Deprecated** Needed to use the Durable Deep Link service.
* @property {String} [config.ios.APIKey] Needed to use Auth. Corresponds to the `API_KEY` key in GoogleService-Info.plist.
* @property {String} [config.ios.logLevel]
* @property {String} config.GCMSenderID Needed to use Cloud Messaging. Corresponds to the `project_info.project_number` key in google-services.json and to the `GCM_SENDER_ID` key in GoogleService-Info.plist.
* @property {String} [config.databaseURL] Needed to use Real Time Database.
* @property {String} [config.storageBucket] Needed to use Storage Bucket.
* @property {String} [config.file] The name of the configuration file to read. If used, all the other parameters are ignored.
* @type {Object}
*/
exports.config = _.extend({}, (Alloy.CFG.T && Alloy.CFG.T.firebase) ? Alloy.CFG.T.firebase.core : {});
var FCore = require('firebase.core');
var mainConfig = _.omit(exports.config, ['android', 'ios']);
FCore.configure(_.extend({}, mainConfig, exports.config[OS_IOS ? 'ios' : 'android']));
module.exports = FCore;
maxDate: "",
value: "",
title: " End Date",
icon: "fa-clock-o",
id: "toDate",
__parentSymbol: __parentSymbol
});
$.__views.__alloyId26 = Ti.UI.createTableViewSection({
id: "__alloyId26"
});
__alloyId25.push($.__views.__alloyId26);
$.__views.__alloyId27 = Ti.UI.createTableViewRow({
height: "70",
backgroundColor: "#fff",
font: {
fontFamily: Alloy.CFG.fontNormal,
fontSize: 16
},
selectionStyle: Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE,
id: "__alloyId27"
});
$.__views.__alloyId26.add($.__views.__alloyId27);
$.__views.__alloyId28 = Ti.UI.createLabel({
font: {
fontFamily: Alloy.CFG.fontItalic,
fontSize: "12dp"
},
color: "#333",
text: "TripLogr can automatically backup your Trip data to the Cloud for free if you wish. Cloud backup is necessary if you want to generate PDF trip reports.",
textAlign: "center",
left: "10",
right: "10",
/**
* @module firebase/analytics
* @author Andrea Jonus
*/
var Alloy = require('alloy');
var _ = require('alloy/underscore')._;
/**
* @property config
* @property {String} [config.log=false] Set to true to display log messages for each call
* @type {Object}
*/
exports.config = _.extend({
log: false,
}, (Alloy.CFG.T && Alloy.CFG.T.firebase) ? Alloy.CFG.T.firebase.analytics : {});
var MODULE_NAME = 'firebase/analytics';
var Util = require('T/util');
var FC = Util.requireOrNull('firebase.core');
var FA = Util.requireOrNull('firebase.analytics');
function checkModules() {
if (FC === null) {
Ti.API.error(MODULE_NAME + ': firebase.core module not initialized.');
return false;
} else if (FA === null) {
Ti.API.error(MODULE_NAME + ': firebase.analytics module not initialized.');
return false;
}
(function () {
var Alloy = require('alloy');
var filterLimit = Alloy.CFG.piwik.filterLimit;
var initialVisitorsToLoad = 15;
function getFixtures()
{
return require('specs/fixtures/piwikLastVisitDetails');
}
function getLast10Visitors()
{
return getFixtures().getLast10Visitors();
}
function getValidAccount()
{
return require('specs/utils/account').getValidAccount();
}