Skip to content

Instantly share code, notes, and snippets.

@tripitakit
tripitakit / Ti-tableViewsFunctional.js
Last active December 28, 2015 00:49
A functional rewrite of an Appcelerator Titanium iOS tableView test code which displays four tables with combination of moving/moveable/editing/editable properties to test their effects on rows' appearance and behavior.
(function(win) {
["moving editing",
"moving editable",
"moveable editing",
"moveable editable"
].map(function(test){
var table = { headerTitle: test };
test.split(" ").map(function(property){
table[property] = true;
});
@tripitakit
tripitakit / confirmTableViewDelete.js
Last active December 27, 2015 20:48
Appcelerator Titanium example of custom confirm dialog for TableView's delete events. Asks to confirm/cancel a delete operation. On cancel restores the deleted row in its former position in the table data.
/***
* Appcelerator Titanium example of custom confirm dialog for TableView's delete events.
* Asks to confirm/cancel a delete operation. On cancel restores the deleted row in
* its former position in the table data.
*
* @Copyleft 2013 Patrick De Marta
* @License GNU GPL
*/
var win = Titanium.UI.createWindow({
@tripitakit
tripitakit / Ti-touches-kiss.js
Last active July 17, 2016 12:05
Appcelerator Titanium touch events example. Connects the blue box to the red box with touch and finger slide. The windows backgroundColor and the Label will give action feedback to the user. Or how to take advantage of pointInWindowCoords() to keep things simple.
/***
* Connects the blue box to the red box with touch and finger slide.
* The window's backgroundColor and label's text will give action feedback to the user.
* Or how to take advantage of convertPointToView() to keep things simple
*
* @Copyleft 2013 Patrick De Marta
* @License GNU GPL
*/
/**
@tripitakit
tripitakit / Ti-touches.js
Last active March 15, 2017 18:42
Appcelerator Titanium touch events usage example: connecting a blue box to a red box with a touch and finger slide.
/***
* Connects the blue box to the red box with touch and finger slide.
* The window's backgroundColor and the label's text give feedback to the user.
* ... the blue box is not going to move anywhere
*
* @Copyleft 2013 Patrick De Marta
* @License GNU GPL
*/
/**