Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$.__views.testLabel = Ti.UI.createLabel(function() {
var o = {};
Alloy.deepExtend(true, o, {
font: {
fontSize: "22dp"
},
color: "purple",
text: "Simple class label applied"
});
(Alloy.Globals.custom1 || Alloy.Globals.custom2) && Alloy.deepExtend(true, o, {
text: "iOS or Android! Styles conditionals correctly applied"
});
Alloy.deepExtend(true, o, {
id: "testLabel"
});
return o;
}());
$.__views.index.add($.__views.testLabel);
!function() {
Alloy.Globals.drawer = void 0;
Alloy.Globals.contentView = void 0;
var currentCtrl;
Alloy.Globals.getCurrentView = function() {
return currentCtrl.getView();
};
Alloy.Globals.optionsMenu = function(e) {
currentCtrl.trigger("createOptionsMenu", e);
};
Alloy.Globals.open = function(_ctrl) {
if (currentCtrl) {
Alloy.Globals.contentView.remove(currentCtrl.getView());
_.isFunction(currentCtrl.destroy) && currentCtrl.destroy();
currentView = null;
}
currentCtrl = _ctrl;
Alloy.Globals.contentView.add(currentCtrl.getView());
currentCtrl.init();
};
}();
_.defer(function() {
Alloy.Globals.parsePushC || (Alloy.Globals.parsePushC = Alloy.createController("parsePush"));
_.defer(function() {
Alloy.Globals.loginC.trigger("login:after", Alloy.Globals.user);
_.defer(function() {
Alloy.Globals.parsePushC.trigger("parsePush:ready");
_.defer(function() {
_.defer(function() {
var now = new Date();
Parse.Cloud.run("userModify", {
timezoneOffset: now.getTimezoneOffset(),
currentLanguage: Alloy.Globals.currentLanguage
});
_.defer(function() {
appVersionCheck();
_.defer(function() {
Alloy.Globals.appStartProcess = false;
Alloy.Globals.chatListC.startComplete = true;
function loadDriver(name) {
return Alloy.Globals.Trimethyl.loadDriver(MODULE_NAME, name, {
subscribe: function (opt) { },
unsubscribe: function (opt) { }
});
};
}).catch(function(error) {
var message = error.message ? error.message : error;
Ti.API.debug(message);
Alloy.Globals.toast("cr_failSendPhotoMessage");
});
}
$.__views.mainC = Alloy.createController("blank", {
id: "mainC",
__parentSymbol: $.__views.centerWindow
});
$.__views.mainC.setParent($.__views.centerWindow);
$.__views.index = Alloy.createWidget("kr.yostudio.drawer", "widget", {
id: "index",
children: [ $.__views.__alloyId107, $.__views.centerWindow ]
});
$.__views.index && $.addTopLevelView($.__views.index);
onDrawerOpen ? $.__views.index.on("draweropen", onDrawerOpen) : __defers["$.__views.index!draweropen!onDrawerOpen"] = true;
onDrawerClose ? $.__views.index.on("drawerclose", onDrawerClose) : __defers["$.__views.index!drawerclose!onDrawerClose"] = true;
exports.destroy = function() {};
_.extend($, $.__views);
Alloy.Globals.navigation = $.index;
Alloy.Globals.menuC = $.menuC;
Alloy.Globals.loginC = Alloy.createController("login");
Alloy.Globals.loginC.requiredLogin();
var appVersionCheck = function() {
function fetchAppInfo(retryCount) {
Ti.API.debug("retryCount Remain : ", retryCount, "/3", "name :", Titanium.App.name);
Alloy.Globals.appInfoM.fetch({
query: {
where: {
name: Titanium.App.name
}
},
success: successCallbackAfterFetch,
error: function(err) {
Ti.API.debug("fetchAppInfo error :", err);
if (0 >= retryCount) {
var dialog = Ti.UI.createAlertDialog({
function successCallbackAfterFetch(res) {
var results = res.attributes.results || [ null ];
var appInfoData = results[0];
if (appInfoData) {
Alloy.Globals.appInfoM = Alloy.createModel("appInfo", appInfoData);
verifyAndRunByAppVersion(currentVersion);
} else {
var msg = L("c_odizzo") + "의 버전 정보가 없습니다.";
Alloy.Globals.alert(msg);
}
}
function verifyAndRunByAppVersion(currentVersion) {
right: 20
}));
headerRow.add();
headerRow.add(Ti.UI.createLabel({
text: "TripLogr Report",
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
top: 20,
left: 20,
font: {
fontSize: 25,
fontWeight: "bold"
}
}));
headerRow.add(Ti.UI.createLabel({
text: Alloy.Globals.username,
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
top: 50,
left: 20,
font: {
fontSize: 20
}
}));
rows.push(headerRow);
var row = Ti.UI.createTableViewRow({
className: "reportRow",
height: 50,
top: 50
});
row.add(Ti.UI.createView({
height: 2,
error: function() {
banContactsCol.add(contactM, {
add: false
});
drawBanFriend();
Alloy.Globals.alert("c_alertMsgDefault");
}
});
function finalizeTrip(obj) {
var odometer, purpose = "";
var distanceKM = obj.distanceKM;
var endLat = obj.endLat;
var endLng = obj.endLng;
var distanceMeasured = 0;
Ti.API.info("Total distance travelled in KM: " + distanceKM);
var measure = "miles" == Alloy.Globals.TripLogr.distanceMeasurement.toLowerCase() ? "mi" : "km";
distanceMeasured = "mi" == measure ? (.62137 * distanceKM).toFixed(2) : distanceKM.toFixed(2);
var dialog = Ti.UI.createAlertDialog({
buttonNames: [ "OK" ],
title: "The total distance travelled was " + distanceMeasured + measure + ". What was the purpose of this trip?",
style: Ti.UI.iPhone.AlertDialogStyle.PLAIN_TEXT_INPUT
});
var dialogOdometer = Ti.UI.createAlertDialog({
buttonNames: [ "OK" ],
title: "What is your current odometer reading?",
style: Ti.UI.iPhone.AlertDialogStyle.PLAIN_TEXT_INPUT
});
dialog.addEventListener("click", function(dialogEvt) {
Ti.API.info("dialog text: " + dialogEvt.text);
purpose = dialogEvt.text;
dialogOdometer.show();
});